bmpbuttn.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/cocoa/bmpbuttn.h
  3. // Purpose: wxBitmapButton class
  4. // Author: David Elliott
  5. // Modified by:
  6. // Created: 2003/03/16
  7. // Copyright: (c) 2003 David Elliott
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef __WX_COCOA_BMPBUTTN_H__
  11. #define __WX_COCOA_BMPBUTTN_H__
  12. #include "wx/cocoa/NSButton.h"
  13. // ========================================================================
  14. // wxBitmapButton
  15. // ========================================================================
  16. class WXDLLIMPEXP_CORE wxBitmapButton : public wxBitmapButtonBase
  17. {
  18. DECLARE_DYNAMIC_CLASS(wxBitmapButton)
  19. DECLARE_EVENT_TABLE()
  20. WX_DECLARE_COCOA_OWNER(NSButton,NSControl,NSView)
  21. // ------------------------------------------------------------------------
  22. // initialization
  23. // ------------------------------------------------------------------------
  24. public:
  25. wxBitmapButton() { }
  26. wxBitmapButton(wxWindow *parent, wxWindowID winid,
  27. const wxBitmap& bitmap,
  28. const wxPoint& pos = wxDefaultPosition,
  29. const wxSize& size = wxDefaultSize, long style = 0,
  30. const wxValidator& validator = wxDefaultValidator,
  31. const wxString& name = wxButtonNameStr)
  32. {
  33. Create(parent, winid, bitmap, pos, size, style, validator, name);
  34. }
  35. bool Create(wxWindow *parent, wxWindowID winid,
  36. const wxBitmap& bitmap,
  37. const wxPoint& pos = wxDefaultPosition,
  38. const wxSize& size = wxDefaultSize, long style = 0,
  39. const wxValidator& validator = wxDefaultValidator,
  40. const wxString& name = wxButtonNameStr);
  41. virtual ~wxBitmapButton();
  42. // ------------------------------------------------------------------------
  43. // Cocoa callbacks
  44. // ------------------------------------------------------------------------
  45. protected:
  46. virtual void Cocoa_wxNSButtonAction(void);
  47. // ------------------------------------------------------------------------
  48. // Implementation
  49. // ------------------------------------------------------------------------
  50. public:
  51. // The wxButton::DoGetBestSize is not correct for bitmap buttons
  52. wxSize DoGetBestSize() const
  53. { return wxButtonBase::DoGetBestSize(); }
  54. };
  55. #endif // __WX_COCOA_BMPBUTTN_H__