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"
17 class WXDLLIMPEXP_CORE wxFontData
;
19 //-----------------------------------------------------------------------------
20 // wxGenericFontButton: a button which brings up a wxColourDialog
21 //-----------------------------------------------------------------------------
23 #define wxFONTBTN_DEFAULT_STYLE \
24 (wxFNTP_FONTDESC_AS_LABEL | wxFNTP_USEFONT_FOR_LABEL)
26 class WXDLLIMPEXP_CORE wxGenericFontButton
: public wxButton
,
27 public wxFontPickerWidgetBase
30 wxGenericFontButton() {}
31 wxGenericFontButton(wxWindow
*parent
,
33 const wxFont
&initial
= *wxNORMAL_FONT
,
34 const wxPoint
& pos
= wxDefaultPosition
,
35 const wxSize
& size
= wxDefaultSize
,
36 long style
= wxFONTBTN_DEFAULT_STYLE
,
37 const wxValidator
& validator
= wxDefaultValidator
,
38 const wxString
& name
= wxFontPickerWidgetNameStr
)
40 Create(parent
, id
, initial
, pos
, size
, style
, validator
, name
);
43 virtual ~wxGenericFontButton() {}
46 public: // API extensions specific for wxGenericFontButton
48 // user can override this to init font data in a different way
49 virtual void InitFontData();
51 // returns the font data shown in wxColourDialog
52 wxFontData
*GetFontData() { return &ms_data
; }
57 bool Create(wxWindow
*parent
,
59 const wxFont
&initial
= *wxNORMAL_FONT
,
60 const wxPoint
& pos
= wxDefaultPosition
,
61 const wxSize
& size
= wxDefaultSize
,
62 long style
= wxFONTBTN_DEFAULT_STYLE
,
63 const wxValidator
& validator
= wxDefaultValidator
,
64 const wxString
& name
= wxFontPickerWidgetNameStr
);
66 void OnButtonClick(wxCommandEvent
&);
73 // the colour data shown in wxColourPickerCtrlGeneric
74 // controls. This member is static so that all colour pickers
75 // in the program share the same set of custom colours.
76 static wxFontData ms_data
;
79 DECLARE_DYNAMIC_CLASS(wxGenericFontButton
)
83 #endif // _WX_FONTPICKER_H_