]>
Commit | Line | Data |
---|---|---|
ec376c8f | 1 | ///////////////////////////////////////////////////////////////////////////// |
42c09d20 VS |
2 | // Name: src/xrc/xh_dirpicker.cpp |
3 | // Purpose: XML resource handler for wxDirPickerCtrl | |
ec376c8f VZ |
4 | // Author: Francesco Montorsi |
5 | // Created: 2006-04-17 | |
ec376c8f VZ |
6 | // Copyright: (c) 2006 Francesco Montorsi |
7 | // Licence: wxWindows licence | |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | // For compilers that support precompilation, includes "wx.h". | |
11 | #include "wx/wxprec.h" | |
12 | ||
13 | #ifdef __BORLANDC__ | |
14 | #pragma hdrstop | |
15 | #endif | |
16 | ||
17 | #if wxUSE_XRC && wxUSE_DIRPICKERCTRL | |
18 | ||
19 | #include "wx/xrc/xh_dirpicker.h" | |
20 | #include "wx/filepicker.h" | |
21 | ||
22 | IMPLEMENT_DYNAMIC_CLASS(wxDirPickerCtrlXmlHandler, wxXmlResourceHandler) | |
23 | ||
24 | wxDirPickerCtrlXmlHandler::wxDirPickerCtrlXmlHandler() : wxXmlResourceHandler() | |
25 | { | |
26 | XRC_ADD_STYLE(wxDIRP_USE_TEXTCTRL); | |
27 | XRC_ADD_STYLE(wxDIRP_DIR_MUST_EXIST); | |
28 | XRC_ADD_STYLE(wxDIRP_CHANGE_DIR); | |
75bc8b34 | 29 | XRC_ADD_STYLE(wxDIRP_SMALL); |
ec376c8f VZ |
30 | XRC_ADD_STYLE(wxDIRP_DEFAULT_STYLE); |
31 | AddWindowStyles(); | |
32 | } | |
33 | ||
34 | wxObject *wxDirPickerCtrlXmlHandler::DoCreateResource() | |
35 | { | |
36 | XRC_MAKE_INSTANCE(picker, wxDirPickerCtrl) | |
37 | ||
38 | picker->Create(m_parentAsWindow, | |
39 | GetID(), | |
374caf23 | 40 | GetParamValue(wxT("value")), |
bfb78201 | 41 | GetText(wxT("message")), |
ec376c8f | 42 | GetPosition(), GetSize(), |
9a83f860 | 43 | GetStyle(wxT("style"), wxDIRP_DEFAULT_STYLE), |
ec376c8f VZ |
44 | wxDefaultValidator, |
45 | GetName()); | |
46 | ||
47 | SetupWindow(picker); | |
48 | ||
49 | return picker; | |
50 | } | |
51 | ||
52 | bool wxDirPickerCtrlXmlHandler::CanHandle(wxXmlNode *node) | |
53 | { | |
54 | return IsOfClass(node, wxT("wxDirPickerCtrl")); | |
55 | } | |
56 | ||
57 | #endif // wxUSE_XRC && wxUSE_DIRPICKERCTRL |