1 ///////////////////////////////////////////////////////////////////////////// 
   2 // Name:        src/palmos/tglbtn.cpp 
   3 // Purpose:     Definition of the wxToggleButton class, which implements a 
   5 // Author:      William Osborne - minimal working wxPalmOS port 
   6 // Modified by: Wlodzimierz ABX Skiba - native implementation 
   9 // Copyright:   (c) William Osborne, Wlodzimierz Skiba 
  10 // Licence:     wxWindows licence 
  11 ///////////////////////////////////////////////////////////////////////////// 
  13 // ============================================================================ 
  15 // ============================================================================ 
  17 // ---------------------------------------------------------------------------- 
  19 // ---------------------------------------------------------------------------- 
  21 #include "wx/wxprec.h" 
  29 #include "wx/tglbtn.h" 
  32     #include "wx/button.h" 
  34     #include "wx/dcscreen.h" 
  35     #include "wx/settings.h" 
  42 // ---------------------------------------------------------------------------- 
  44 // ---------------------------------------------------------------------------- 
  46 IMPLEMENT_DYNAMIC_CLASS(wxToggleButton
, wxControl
) 
  47 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED
) 
  49 // ============================================================================ 
  51 // ============================================================================ 
  53 // ---------------------------------------------------------------------------- 
  55 // ---------------------------------------------------------------------------- 
  57 // Single check box item 
  58 bool wxToggleButton::Create(wxWindow 
*parent
, wxWindowID id
, 
  59                             const wxString
& label
, 
  61                             const wxSize
& size
, long style
, 
  62                             const wxValidator
& validator
, 
  65     if(!wxControl::Create(parent
, id
, pos
, size
, style
, validator
, name
)) 
  68     return wxControl::PalmCreateControl(pushButtonCtl
, label
, pos
, size
); 
  71 wxBorder 
wxToggleButton::GetDefaultBorder() const 
  76 wxSize 
wxToggleButton::DoGetBestSize() const 
  81 void wxToggleButton::SetValue(bool val
) 
  86 bool wxToggleButton::GetValue() const 
  88     return GetBoolValue(); 
  91 bool wxToggleButton::SendClickEvent() 
  93     wxCommandEvent 
event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED
, GetId()); 
  94     event
.SetInt(GetValue()); 
  95     event
.SetEventObject(this); 
  96     return ProcessCommand(event
); 
  99 void wxToggleButton::Command(wxCommandEvent 
& event
) 
 103 #endif // wxUSE_TOGGLEBTN