1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        wx/gtk1/checkbox.h
3 // Purpose:
4 // Author:      Robert Roebling
5 // Copyright:   (c) 1998 Robert Roebling
6 // Licence:     wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
8 
9 #ifndef __GTKCHECKBOXH__
10 #define __GTKCHECKBOXH__
11 
12 // ----------------------------------------------------------------------------
13 // wxCheckBox
14 // ----------------------------------------------------------------------------
15 
16 class WXDLLIMPEXP_CORE wxCheckBox : public wxCheckBoxBase
17 {
18 public:
19     wxCheckBox();
20     wxCheckBox( wxWindow *parent, wxWindowID id, const wxString& label,
21             const wxPoint& pos = wxDefaultPosition,
22             const wxSize& size = wxDefaultSize, long style = 0,
23             const wxValidator& validator = wxDefaultValidator,
24             const wxString& name = wxCheckBoxNameStr)
25     {
26         Create(parent, id, label, pos, size, style, validator, name);
27     }
28     bool Create(wxWindow *parent,
29                 wxWindowID id,
30                 const wxString& label,
31                 const wxPoint& pos = wxDefaultPosition,
32                 const wxSize& size = wxDefaultSize,
33                 long style = 0,
34                 const wxValidator& validator = wxDefaultValidator,
35                 const wxString& name = wxCheckBoxNameStr );
36 
37     void SetValue( bool state );
38     bool GetValue() const;
39 
40     virtual void SetLabel( const wxString& label );
41     virtual bool Enable( bool enable = TRUE );
42 
43     static wxVisualAttributes
44     GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
45 
46     // implementation
47     // --------------
48 
49     void DoApplyWidgetStyle(GtkRcStyle *style);
50     bool IsOwnGtkWindow( GdkWindow *window );
51     void OnInternalIdle();
52 
53     GtkWidget *m_widgetCheckbox;
54     GtkWidget *m_widgetLabel;
55 
56     bool       m_blockEvent;
57 
58 protected:
59     virtual wxSize DoGetBestSize() const;
60 
61 private:
62     DECLARE_DYNAMIC_CLASS(wxCheckBox)
63 };
64 
65 #endif // __GTKCHECKBOXH__
66