1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/xrc/xh_fontpicker.cpp
3 // Purpose: XML resource handler for wxFontPickerCtrl
4 // Author: Francesco Montorsi
7 // Copyright: (c) 2006 Francesco Montorsi
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
18 #if wxUSE_XRC && wxUSE_FONTPICKERCTRL
20 #include "wx/xrc/xh_fontpicker.h"
21 #include "wx/fontpicker.h"
23 IMPLEMENT_DYNAMIC_CLASS(wxFontPickerCtrlXmlHandler
, wxXmlResourceHandler
)
25 wxFontPickerCtrlXmlHandler::wxFontPickerCtrlXmlHandler() : wxXmlResourceHandler()
27 XRC_ADD_STYLE(wxFNTP_USE_TEXTCTRL
);
28 XRC_ADD_STYLE(wxFNTP_FONTDESC_AS_LABEL
);
29 XRC_ADD_STYLE(wxFNTP_USEFONT_FOR_LABEL
);
30 XRC_ADD_STYLE(wxFNTP_DEFAULT_STYLE
);
34 wxObject
*wxFontPickerCtrlXmlHandler::DoCreateResource()
36 XRC_MAKE_INSTANCE(picker
, wxFontPickerCtrl
)
38 wxFont f
= *wxNORMAL_FONT
;
39 if (HasParam(wxT("value")))
40 f
= GetFont(wxT("value"));
42 picker
->Create(m_parentAsWindow
,
45 GetPosition(), GetSize(),
46 GetStyle(wxT("style"), wxFNTP_DEFAULT_STYLE
),
55 bool wxFontPickerCtrlXmlHandler::CanHandle(wxXmlNode
*node
)
57 return IsOfClass(node
, wxT("wxFontPickerCtrl"));
60 #endif // wxUSE_XRC && wxUSE_FONTPICKERCTRL