anybutton.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: anybutton.h
  3. // Purpose: wxAnyButton class
  4. // Author: Stefan Csomor
  5. // Created: 1998-01-01 (extracted from button.h)
  6. // Copyright: (c) Stefan Csomor
  7. // Licence: wxWindows licence
  8. /////////////////////////////////////////////////////////////////////////////
  9. #ifndef _WX_OSX_ANYBUTTON_H_
  10. #define _WX_OSX_ANYBUTTON_H_
  11. // Any button
  12. class WXDLLIMPEXP_CORE wxAnyButton : public wxAnyButtonBase
  13. {
  14. public:
  15. wxAnyButton() {}
  16. static wxSize GetDefaultSize();
  17. virtual void SetLabel(const wxString& label);
  18. protected:
  19. virtual wxSize DoGetBestSize() const ;
  20. void OnEnterWindow( wxMouseEvent& event);
  21. void OnLeaveWindow( wxMouseEvent& event);
  22. virtual wxBitmap DoGetBitmap(State which) const;
  23. virtual void DoSetBitmap(const wxBitmap& bitmap, State which);
  24. virtual void DoSetBitmapPosition(wxDirection dir);
  25. virtual void DoSetBitmapMargins(int x, int y)
  26. {
  27. m_marginX = x;
  28. m_marginY = y;
  29. InvalidateBestSize();
  30. }
  31. #if wxUSE_MARKUP && wxOSX_USE_COCOA
  32. virtual bool DoSetLabelMarkup(const wxString& markup);
  33. #endif // wxUSE_MARKUP && wxOSX_USE_COCOA
  34. // the margins around the bitmap
  35. int m_marginX;
  36. int m_marginY;
  37. // the bitmaps for the different state of the buttons, all of them may be
  38. // invalid and the button only shows a bitmap at all if State_Normal bitmap
  39. // is valid
  40. wxBitmap m_bitmaps[State_Max];
  41. wxDECLARE_NO_COPY_CLASS(wxAnyButton);
  42. DECLARE_EVENT_TABLE()
  43. };
  44. #endif // _WX_OSX_ANYBUTTON_H_