]> git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_filepicker.cpp
Don't set cell value in wxDataViewEvent in one place only.
[wxWidgets.git] / src / xrc / xh_filepicker.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/xrc/xh_filepicker.cpp
3 // Purpose: XML resource handler for wxFilePickerCtrl
4 // Author: Francesco Montorsi
5 // Created: 2006-04-17
6 // RCS-ID: $Id$
7 // Copyright: (c) 2006 Francesco Montorsi
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
13
14 #ifdef __BORLANDC__
15 #pragma hdrstop
16 #endif
17
18 #if wxUSE_XRC && wxUSE_FILEPICKERCTRL
19
20 #include "wx/xrc/xh_filepicker.h"
21 #include "wx/filepicker.h"
22
23 IMPLEMENT_DYNAMIC_CLASS(wxFilePickerCtrlXmlHandler, wxXmlResourceHandler)
24
25 wxFilePickerCtrlXmlHandler::wxFilePickerCtrlXmlHandler() : wxXmlResourceHandler()
26 {
27 XRC_ADD_STYLE(wxFLP_OPEN);
28 XRC_ADD_STYLE(wxFLP_SAVE);
29 XRC_ADD_STYLE(wxFLP_OVERWRITE_PROMPT);
30 XRC_ADD_STYLE(wxFLP_FILE_MUST_EXIST);
31 XRC_ADD_STYLE(wxFLP_CHANGE_DIR);
32 XRC_ADD_STYLE(wxFLP_SMALL);
33 XRC_ADD_STYLE(wxFLP_DEFAULT_STYLE);
34 XRC_ADD_STYLE(wxFLP_USE_TEXTCTRL);
35 AddWindowStyles();
36 }
37
38 wxObject *wxFilePickerCtrlXmlHandler::DoCreateResource()
39 {
40 XRC_MAKE_INSTANCE(picker, wxFilePickerCtrl)
41
42 picker->Create(m_parentAsWindow,
43 GetID(),
44 GetParamValue(wxT("value")),
45 GetText(wxT("message")),
46 GetParamValue(wxT("wildcard")),
47 GetPosition(), GetSize(),
48 GetStyle(wxT("style"), wxFLP_DEFAULT_STYLE),
49 wxDefaultValidator,
50 GetName());
51
52 SetupWindow(picker);
53 return picker;
54 }
55
56 bool wxFilePickerCtrlXmlHandler::CanHandle(wxXmlNode *node)
57 {
58 return IsOfClass(node, wxT("wxFilePickerCtrl"));
59 }
60
61 #endif // wxUSE_XRC && wxUSE_FILEPICKERCTRL