button.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/osx/button.h
  3. // Purpose: wxButton class
  4. // Author: Stefan Csomor
  5. // Modified by:
  6. // Created: 1998-01-01
  7. // Copyright: (c) Stefan Csomor
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_OSX_BUTTON_H_
  11. #define _WX_OSX_BUTTON_H_
  12. #include "wx/control.h"
  13. #include "wx/gdicmn.h"
  14. // Pushbutton
  15. class WXDLLIMPEXP_CORE wxButton : public wxButtonBase
  16. {
  17. public:
  18. wxButton() {}
  19. wxButton(wxWindow *parent,
  20. wxWindowID id,
  21. const wxString& label = wxEmptyString,
  22. const wxPoint& pos = wxDefaultPosition,
  23. const wxSize& size = wxDefaultSize,
  24. 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. bool Create(wxWindow *parent,
  31. wxWindowID id,
  32. const wxString& label = wxEmptyString,
  33. const wxPoint& pos = wxDefaultPosition,
  34. const wxSize& size = wxDefaultSize,
  35. long style = 0,
  36. const wxValidator& validator = wxDefaultValidator,
  37. const wxString& name = wxButtonNameStr);
  38. virtual void SetLabel(const wxString& label);
  39. virtual wxWindow *SetDefault();
  40. virtual void Command(wxCommandEvent& event);
  41. // osx specific event handling common for all osx-ports
  42. virtual bool OSXHandleClicked( double timestampsec );
  43. #if wxOSX_USE_COCOA
  44. void OSXUpdateAfterLabelChange(const wxString& label);
  45. #endif
  46. protected:
  47. DECLARE_DYNAMIC_CLASS(wxButton)
  48. };
  49. // OS X specific class, not part of public wx API
  50. class WXDLLIMPEXP_CORE wxDisclosureTriangle : public wxControl
  51. {
  52. public:
  53. wxDisclosureTriangle(wxWindow *parent,
  54. wxWindowID id,
  55. const wxString& label = wxEmptyString,
  56. const wxPoint& pos = wxDefaultPosition,
  57. const wxSize& size = wxDefaultSize,
  58. long style = wxBORDER_NONE,
  59. const wxValidator& validator = wxDefaultValidator,
  60. const wxString& name = wxButtonNameStr)
  61. {
  62. Create(parent, id, label, pos, size, style, validator, name);
  63. }
  64. bool Create(wxWindow *parent,
  65. wxWindowID id,
  66. const wxString& label = wxEmptyString,
  67. const wxPoint& pos = wxDefaultPosition,
  68. const wxSize& size = wxDefaultSize,
  69. long style = wxBORDER_NONE,
  70. const wxValidator& validator = wxDefaultValidator,
  71. const wxString& name = wxButtonNameStr);
  72. void SetOpen( bool open );
  73. bool IsOpen() const;
  74. // osx specific event handling common for all osx-ports
  75. virtual bool OSXHandleClicked( double timestampsec );
  76. protected:
  77. virtual wxSize DoGetBestSize() const ;
  78. };
  79. #endif // _WX_OSX_BUTTON_H_