1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/xrc/xh_fontpicker.cpp
3 // Purpose: XML resource handler for wxFontPickerCtrl
4 // Author: Francesco Montorsi
6 // Copyright: (c) 2006 Francesco Montorsi
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
17 #if wxUSE_XRC && wxUSE_FONTPICKERCTRL
19 #include "wx/xrc/xh_fontpicker.h"
20 #include "wx/fontpicker.h"
22 IMPLEMENT_DYNAMIC_CLASS(wxFontPickerCtrlXmlHandler
, wxXmlResourceHandler
)
24 wxFontPickerCtrlXmlHandler::wxFontPickerCtrlXmlHandler() : wxXmlResourceHandler()
26 XRC_ADD_STYLE(wxFNTP_USE_TEXTCTRL
);
27 XRC_ADD_STYLE(wxFNTP_FONTDESC_AS_LABEL
);
28 XRC_ADD_STYLE(wxFNTP_USEFONT_FOR_LABEL
);
29 XRC_ADD_STYLE(wxFNTP_DEFAULT_STYLE
);
33 wxObject
*wxFontPickerCtrlXmlHandler::DoCreateResource()
35 XRC_MAKE_INSTANCE(picker
, wxFontPickerCtrl
)
37 wxFont f
= *wxNORMAL_FONT
;
38 if (HasParam(wxT("value")))
39 f
= GetFont(wxT("value"));
41 picker
->Create(m_parentAsWindow
,
44 GetPosition(), GetSize(),
45 GetStyle(wxT("style"), wxFNTP_DEFAULT_STYLE
),
54 bool wxFontPickerCtrlXmlHandler::CanHandle(wxXmlNode
*node
)
56 return IsOfClass(node
, wxT("wxFontPickerCtrl"));
59 #endif // wxUSE_XRC && wxUSE_FONTPICKERCTRL