clrpicker.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk/clrpicker.h
  3. // Purpose: wxColourButton header
  4. // Author: Francesco Montorsi
  5. // Modified by:
  6. // Created: 14/4/2006
  7. // Copyright: (c) Francesco Montorsi
  8. // Licence: wxWindows Licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_GTK_CLRPICKER_H_
  11. #define _WX_GTK_CLRPICKER_H_
  12. #include "wx/button.h"
  13. //-----------------------------------------------------------------------------
  14. // wxColourButton
  15. //-----------------------------------------------------------------------------
  16. class WXDLLIMPEXP_CORE wxColourButton : public wxButton,
  17. public wxColourPickerWidgetBase
  18. {
  19. public:
  20. wxColourButton() : m_topParent(NULL) {}
  21. wxColourButton(wxWindow *parent,
  22. wxWindowID id,
  23. const wxColour& initial = *wxBLACK,
  24. const wxPoint& pos = wxDefaultPosition,
  25. const wxSize& size = wxDefaultSize,
  26. long style = wxCLRBTN_DEFAULT_STYLE,
  27. const wxValidator& validator = wxDefaultValidator,
  28. const wxString& name = wxColourPickerWidgetNameStr)
  29. : m_topParent(NULL)
  30. {
  31. Create(parent, id, initial, pos, size, style, validator, name);
  32. }
  33. bool Create(wxWindow *parent,
  34. wxWindowID id,
  35. const wxColour& initial = *wxBLACK,
  36. const wxPoint& pos = wxDefaultPosition,
  37. const wxSize& size = wxDefaultSize,
  38. long style = wxCLRBTN_DEFAULT_STYLE,
  39. const wxValidator& validator = wxDefaultValidator,
  40. const wxString& name = wxColourPickerWidgetNameStr);
  41. virtual ~wxColourButton();
  42. protected:
  43. void UpdateColour();
  44. public: // used by the GTK callback only
  45. void GTKSetColour(const wxColour& colour)
  46. { m_colour = colour; }
  47. wxWindow *m_topParent;
  48. private:
  49. DECLARE_DYNAMIC_CLASS(wxColourButton)
  50. };
  51. #endif // _WX_GTK_CLRPICKER_H_