1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/fontpickerg.h
3 // Purpose: wxGenericFontButton header
4 // Author: Francesco Montorsi
7 // Copyright: (c) Francesco Montorsi
8 // Licence: wxWindows Licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_FONTPICKER_H_
12 #define _WX_FONTPICKER_H_
14 #include "wx/button.h"
15 #include "wx/fontdata.h"
17 //-----------------------------------------------------------------------------
18 // wxGenericFontButton: a button which brings up a wxFontDialog
19 //-----------------------------------------------------------------------------
21 class WXDLLIMPEXP_CORE wxGenericFontButton
: public wxButton
,
22 public wxFontPickerWidgetBase
25 wxGenericFontButton() {}
26 wxGenericFontButton(wxWindow
*parent
,
28 const wxFont
&initial
= wxNullFont
,
29 const wxPoint
& pos
= wxDefaultPosition
,
30 const wxSize
& size
= wxDefaultSize
,
31 long style
= wxFONTBTN_DEFAULT_STYLE
,
32 const wxValidator
& validator
= wxDefaultValidator
,
33 const wxString
& name
= wxFontPickerWidgetNameStr
)
35 Create(parent
, id
, initial
, pos
, size
, style
, validator
, name
);
38 virtual ~wxGenericFontButton() {}
41 public: // API extensions specific for wxGenericFontButton
43 // user can override this to init font data in a different way
44 virtual void InitFontData();
46 // returns the font data shown in wxFontDialog
47 wxFontData
*GetFontData() { return &m_data
; }
52 bool Create(wxWindow
*parent
,
54 const wxFont
&initial
= *wxNORMAL_FONT
,
55 const wxPoint
& pos
= wxDefaultPosition
,
56 const wxSize
& size
= wxDefaultSize
,
57 long style
= wxFONTBTN_DEFAULT_STYLE
,
58 const wxValidator
& validator
= wxDefaultValidator
,
59 const wxString
& name
= wxFontPickerWidgetNameStr
);
61 void OnButtonClick(wxCommandEvent
&);
71 DECLARE_DYNAMIC_CLASS(wxGenericFontButton
)
75 #endif // _WX_FONTPICKER_H_