button.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk1/button.h
  3. // Purpose:
  4. // Author: Robert Roebling
  5. // Copyright: (c) 1998 Robert Roebling
  6. // Licence: wxWindows licence
  7. /////////////////////////////////////////////////////////////////////////////
  8. #ifndef __GTKBUTTONH__
  9. #define __GTKBUTTONH__
  10. #include "wx/defs.h"
  11. #include "wx/object.h"
  12. #include "wx/list.h"
  13. //-----------------------------------------------------------------------------
  14. // wxButton
  15. //-----------------------------------------------------------------------------
  16. class WXDLLIMPEXP_CORE wxButton: public wxButtonBase
  17. {
  18. public:
  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. virtual ~wxButton();
  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. virtual wxWindow *SetDefault();
  37. virtual void SetLabel( const wxString &label );
  38. virtual bool Enable( bool enable = TRUE );
  39. // implementation
  40. // --------------
  41. void DoApplyWidgetStyle(GtkRcStyle *style);
  42. bool IsOwnGtkWindow( GdkWindow *window );
  43. // Since this wxButton doesn't derive from wxButtonBase (why?) we need
  44. // to override this here too...
  45. virtual bool ShouldInheritColours() const { return false; }
  46. static wxVisualAttributes
  47. GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
  48. protected:
  49. virtual wxSize DoGetBestSize() const;
  50. private:
  51. DECLARE_DYNAMIC_CLASS(wxButton)
  52. };
  53. #endif // __GTKBUTTONH__