bmpbuttn.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/motif/bmpbuttn.h
  3. // Purpose: wxBitmapButton class
  4. // Author: Julian Smart
  5. // Modified by:
  6. // Created: 17/09/98
  7. // Copyright: (c) Julian Smart
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_BMPBUTTN_H_
  11. #define _WX_BMPBUTTN_H_
  12. #include "wx/motif/bmpmotif.h"
  13. #define wxDEFAULT_BUTTON_MARGIN 4
  14. class WXDLLIMPEXP_CORE wxBitmapButton: public wxBitmapButtonBase
  15. {
  16. public:
  17. wxBitmapButton();
  18. virtual ~wxBitmapButton();
  19. wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
  20. const wxPoint& pos = wxDefaultPosition,
  21. const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
  22. const wxValidator& validator = wxDefaultValidator,
  23. const wxString& name = wxButtonNameStr)
  24. {
  25. Create(parent, id, bitmap, pos, size, style, validator, name);
  26. }
  27. bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
  28. const wxPoint& pos = wxDefaultPosition,
  29. const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
  30. const wxValidator& validator = wxDefaultValidator,
  31. const wxString& name = wxButtonNameStr);
  32. // Implementation
  33. virtual void ChangeBackgroundColour();
  34. protected:
  35. virtual wxSize DoGetBestSize() const;
  36. virtual void DoSetBitmap(const wxBitmap& bitmap, State which);
  37. virtual void OnSetBitmap();
  38. // original bitmaps may be different from the ones we were initialized with
  39. // if they were changed to reflect button background colour
  40. wxBitmap m_bitmapsOriginal[State_Max];
  41. wxBitmapCache m_bitmapCache;
  42. WXPixmap m_insensPixmap;
  43. DECLARE_DYNAMIC_CLASS(wxBitmapButton)
  44. };
  45. #endif // _WX_BMPBUTTN_H_