]> git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_filectrl.cpp
Remove all lines containing cvs/svn "$Id$" keyword.
[wxWidgets.git] / src / xrc / xh_filectrl.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/xrc/xh_filectrl.cpp
3 // Purpose: XML resource handler for wxFileCtrl
4 // Author: Kinaou Hervé
5 // Created: 2009-05-11
6 // Copyright: (c) 2009 wxWidgets development team
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_FILECTRL
18
19 #include "wx/xrc/xh_filectrl.h"
20 #include "wx/filectrl.h"
21
22 IMPLEMENT_DYNAMIC_CLASS(wxFileCtrlXmlHandler, wxXmlResourceHandler)
23
24 wxFileCtrlXmlHandler::wxFileCtrlXmlHandler() : wxXmlResourceHandler()
25 {
26 XRC_ADD_STYLE(wxFC_DEFAULT_STYLE);
27 XRC_ADD_STYLE(wxFC_OPEN);
28 XRC_ADD_STYLE(wxFC_SAVE);
29 XRC_ADD_STYLE(wxFC_MULTIPLE);
30 XRC_ADD_STYLE(wxFC_NOSHOWHIDDEN);
31
32 AddWindowStyles();
33 }
34
35 wxObject *wxFileCtrlXmlHandler::DoCreateResource()
36 {
37 XRC_MAKE_INSTANCE(filectrl, wxFileCtrl)
38
39 filectrl->Create(m_parentAsWindow,
40 GetID(),
41 GetText(wxT("defaultdirectory")),
42 GetText(wxT("defaultfilename")),
43 GetParamValue(wxT("wildcard")),
44 GetStyle(wxT("style"), wxFC_DEFAULT_STYLE),
45 GetPosition(),
46 GetSize(),
47 GetName());
48
49 SetupWindow(filectrl);
50 return filectrl;
51 }
52
53 bool wxFileCtrlXmlHandler::CanHandle(wxXmlNode *node)
54 {
55 return IsOfClass(node, wxT("wxFileCtrl"));
56 }
57
58 #endif // wxUSE_XRC && wxUSE_FILECTRL