]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/button.h
2c0779aefffbc3a4c1ec6912f2768d0a49dbc5c3
[wxWidgets.git] / include / wx / gtk / button.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/button.h
3 // Purpose: wxGTK wxButton class declaration
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #ifndef _WX_GTK_BUTTON_H_
11 #define _WX_GTK_BUTTON_H_
12
13 //-----------------------------------------------------------------------------
14 // wxButton
15 //-----------------------------------------------------------------------------
16
17 class WXDLLIMPEXP_CORE wxButton : public wxButtonBase
18 {
19 public:
20 wxButton() {}
21 wxButton(wxWindow *parent, wxWindowID id,
22 const wxString& label = wxEmptyString,
23 const wxPoint& pos = wxDefaultPosition,
24 const wxSize& size = wxDefaultSize, long style = 0,
25 const wxValidator& validator = wxDefaultValidator,
26 const wxString& name = wxButtonNameStr)
27 {
28 Create(parent, id, label, pos, size, style, validator, name);
29 }
30
31 bool Create(wxWindow *parent, wxWindowID id,
32 const wxString& label = wxEmptyString,
33 const wxPoint& pos = wxDefaultPosition,
34 const wxSize& size = wxDefaultSize, long style = 0,
35 const wxValidator& validator = wxDefaultValidator,
36 const wxString& name = wxButtonNameStr);
37
38 virtual wxWindow *SetDefault();
39 virtual void SetLabel( const wxString &label );
40
41 // implementation
42 // --------------
43
44 static wxVisualAttributes
45 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
46
47 // helper to allow access to protected member from GTK callback
48 void MoveWindow(int x, int y, int width, int height) { DoMoveWindow(x, y, width, height); }
49
50 // called from GTK callbacks: they update the button state and call
51 // GTKUpdateBitmap()
52 void GTKMouseEnters();
53 void GTKMouseLeaves();
54 void GTKPressed();
55 void GTKReleased();
56
57 protected:
58 virtual wxSize DoGetBestSize() const;
59 virtual void DoApplyWidgetStyle(GtkRcStyle *style);
60
61 #if wxUSE_MARKUP
62 virtual bool DoSetLabelMarkup(const wxString& markup);
63 #endif // wxUSE_MARKUP
64
65 private:
66 typedef wxButtonBase base_type;
67
68 // Return the GtkLabel used by this button.
69 GtkLabel *GTKGetLabel() const;
70
71 DECLARE_DYNAMIC_CLASS(wxButton)
72 };
73
74 #endif // _WX_GTK_BUTTON_H_