1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: This dummy header includes the proper header file for the
4 // system we're compiling under.
5 // Author: John Norris, minor changes by Axel Schlueter
9 // Copyright: (c) 2000 Johnny C. Norris II
10 // License: wxWindows Licence
11 /////////////////////////////////////////////////////////////////////////////
13 #ifndef _WX_TOGGLEBUTTON_H_BASE_
14 #define _WX_TOGGLEBUTTON_H_BASE_
21 #include "wx/control.h" // base class
23 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE
, wxEVT_COMMAND_TOGGLEBUTTON_CLICKED
, wxCommandEvent
);
25 // ----------------------------------------------------------------------------
27 // ----------------------------------------------------------------------------
29 class WXDLLIMPEXP_CORE wxToggleButtonBase
: public wxControl
32 wxToggleButtonBase() { }
35 virtual void SetValue(bool state
) = 0;
36 virtual bool GetValue() const = 0;
38 void UpdateWindowUI(long flags
)
40 wxControl::UpdateWindowUI(flags
);
45 wxWindow
*tlw
= wxGetTopLevelParent( this );
46 if (tlw
&& wxPendingDelete
.Member( tlw
))
49 wxUpdateUIEvent
event( GetId() );
50 event
.SetEventObject(this);
52 if (GetEventHandler()->ProcessEvent(event
) )
54 if ( event
.GetSetChecked() )
55 SetValue( event
.GetChecked() );
59 // Buttons on MSW can look bad if they are not native colours, because
60 // then they become owner-drawn and not theme-drawn. Disable it here
61 // in wxToggleButtonBase to make it consistent.
62 virtual bool ShouldInheritColours() const { return false; }
65 // choose the default border for this window
66 virtual wxBorder
GetDefaultBorder() const { return wxBORDER_NONE
; }
68 wxDECLARE_NO_COPY_CLASS(wxToggleButtonBase
);
72 #define EVT_TOGGLEBUTTON(id, fn) \
73 wx__DECLARE_EVT1(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, id, wxCommandEventHandler(fn))
75 #if defined(__WXUNIVERSAL__)
76 #include "wx/univ/tglbtn.h"
77 #elif defined(__WXMSW__)
78 #include "wx/msw/tglbtn.h"
79 #elif defined(__WXGTK20__)
80 #include "wx/gtk/tglbtn.h"
81 #elif defined(__WXGTK__)
82 #include "wx/gtk1/tglbtn.h"
83 # elif defined(__WXMOTIF__)
84 #include "wx/motif/tglbtn.h"
85 #elif defined(__WXMAC__)
86 #include "wx/osx/tglbtn.h"
87 #elif defined(__WXPALMOS__)
88 #include "wx/palmos/tglbtn.h"
89 #elif defined(__WXPM__)
90 #include "wx/os2/tglbtn.h"
93 #endif // wxUSE_TOGGLEBTN
95 #endif // _WX_TOGGLEBUTTON_H_BASE_