1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/fontpickerg.h
3 // Purpose: wxGenericFontButton header
4 // Author: Francesco Montorsi
7 // Copyright: (c) Francesco Montorsi
9 // Licence: wxWindows Licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_FONTPICKER_H_
13 #define _WX_FONTPICKER_H_
15 #include "wx/button.h"
16 #include "wx/cmndata.h"
18 //-----------------------------------------------------------------------------
19 // wxGenericFontButton: a button which brings up a wxColourDialog
20 //-----------------------------------------------------------------------------
22 class WXDLLIMPEXP_CORE wxGenericFontButton
: public wxButton
,
23 public wxFontPickerWidgetBase
26 wxGenericFontButton() {}
27 wxGenericFontButton(wxWindow
*parent
,
29 const wxFont
&initial
= wxNullFont
,
30 const wxPoint
& pos
= wxDefaultPosition
,
31 const wxSize
& size
= wxDefaultSize
,
32 long style
= wxFONTBTN_DEFAULT_STYLE
,
33 const wxValidator
& validator
= wxDefaultValidator
,
34 const wxString
& name
= wxFontPickerWidgetNameStr
)
36 Create(parent
, id
, initial
, pos
, size
, style
, validator
, name
);
39 virtual ~wxGenericFontButton() {}
42 public: // API extensions specific for wxGenericFontButton
44 // user can override this to init font data in a different way
45 virtual void InitFontData();
47 // returns the font data shown in wxColourDialog
48 wxFontData
*GetFontData() { return &ms_data
; }
53 bool Create(wxWindow
*parent
,
55 const wxFont
&initial
= *wxNORMAL_FONT
,
56 const wxPoint
& pos
= wxDefaultPosition
,
57 const wxSize
& size
= wxDefaultSize
,
58 long style
= wxFONTBTN_DEFAULT_STYLE
,
59 const wxValidator
& validator
= wxDefaultValidator
,
60 const wxString
& name
= wxFontPickerWidgetNameStr
);
62 void OnButtonClick(wxCommandEvent
&);
69 // the colour data shown in wxColourPickerCtrlGeneric
70 // controls. This member is static so that all colour pickers
71 // in the program share the same set of custom colours.
72 static wxFontData ms_data
;
75 DECLARE_DYNAMIC_CLASS(wxGenericFontButton
)
79 #endif // _WX_FONTPICKER_H_