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