]>
Commit | Line | Data |
---|---|---|
ec376c8f | 1 | ///////////////////////////////////////////////////////////////////////////// |
42c09d20 VS |
2 | // Name: src/xrc/xh_filepicker.cpp |
3 | // Purpose: XML resource handler for wxFilePickerCtrl | |
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_FILEPICKERCTRL | |
18 | ||
19 | #include "wx/xrc/xh_filepicker.h" | |
20 | #include "wx/filepicker.h" | |
21 | ||
22 | IMPLEMENT_DYNAMIC_CLASS(wxFilePickerCtrlXmlHandler, wxXmlResourceHandler) | |
23 | ||
24 | wxFilePickerCtrlXmlHandler::wxFilePickerCtrlXmlHandler() : wxXmlResourceHandler() | |
25 | { | |
26 | XRC_ADD_STYLE(wxFLP_OPEN); | |
27 | XRC_ADD_STYLE(wxFLP_SAVE); | |
28 | XRC_ADD_STYLE(wxFLP_OVERWRITE_PROMPT); | |
29 | XRC_ADD_STYLE(wxFLP_FILE_MUST_EXIST); | |
30 | XRC_ADD_STYLE(wxFLP_CHANGE_DIR); | |
75bc8b34 | 31 | XRC_ADD_STYLE(wxFLP_SMALL); |
ec376c8f | 32 | XRC_ADD_STYLE(wxFLP_DEFAULT_STYLE); |
ee90e264 | 33 | XRC_ADD_STYLE(wxFLP_USE_TEXTCTRL); |
ec376c8f VZ |
34 | AddWindowStyles(); |
35 | } | |
36 | ||
37 | wxObject *wxFilePickerCtrlXmlHandler::DoCreateResource() | |
38 | { | |
39 | XRC_MAKE_INSTANCE(picker, wxFilePickerCtrl) | |
40 | ||
41 | picker->Create(m_parentAsWindow, | |
42 | GetID(), | |
374caf23 | 43 | GetParamValue(wxT("value")), |
bfb78201 | 44 | GetText(wxT("message")), |
ec376c8f VZ |
45 | GetParamValue(wxT("wildcard")), |
46 | GetPosition(), GetSize(), | |
9a83f860 | 47 | GetStyle(wxT("style"), wxFLP_DEFAULT_STYLE), |
ec376c8f VZ |
48 | wxDefaultValidator, |
49 | GetName()); | |
50 | ||
51 | SetupWindow(picker); | |
52 | return picker; | |
53 | } | |
54 | ||
55 | bool wxFilePickerCtrlXmlHandler::CanHandle(wxXmlNode *node) | |
56 | { | |
57 | return IsOfClass(node, wxT("wxFilePickerCtrl")); | |
58 | } | |
59 | ||
60 | #endif // wxUSE_XRC && wxUSE_FILEPICKERCTRL |