fontpicker.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk/fontpicker.h
  3. // Purpose: wxFontButton 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_FONTPICKER_H_
  11. #define _WX_GTK_FONTPICKER_H_
  12. #include "wx/button.h"
  13. //-----------------------------------------------------------------------------
  14. // wxFontButton
  15. //-----------------------------------------------------------------------------
  16. class WXDLLIMPEXP_CORE wxFontButton : public wxButton,
  17. public wxFontPickerWidgetBase
  18. {
  19. public:
  20. wxFontButton() {}
  21. wxFontButton(wxWindow *parent,
  22. wxWindowID id,
  23. const wxFont& initial = wxNullFont,
  24. const wxPoint& pos = wxDefaultPosition,
  25. const wxSize& size = wxDefaultSize,
  26. long style = wxFONTBTN_DEFAULT_STYLE,
  27. const wxValidator& validator = wxDefaultValidator,
  28. const wxString& name = wxFontPickerWidgetNameStr)
  29. {
  30. Create(parent, id, initial, pos, size, style, validator, name);
  31. }
  32. bool Create(wxWindow *parent,
  33. wxWindowID id,
  34. const wxFont& initial = wxNullFont,
  35. const wxPoint& pos = wxDefaultPosition,
  36. const wxSize& size = wxDefaultSize,
  37. long style = wxFONTBTN_DEFAULT_STYLE,
  38. const wxValidator& validator = wxDefaultValidator,
  39. const wxString& name = wxFontPickerWidgetNameStr);
  40. virtual ~wxFontButton();
  41. protected:
  42. void UpdateFont();
  43. public: // used by the GTK callback only
  44. void SetNativeFontInfo(const char *gtkdescription)
  45. { m_selectedFont.SetNativeFontInfo(wxString::FromAscii(gtkdescription)); }
  46. private:
  47. DECLARE_DYNAMIC_CLASS(wxFontButton)
  48. };
  49. #endif // _WX_GTK_FONTPICKER_H_