Include wx/panel.h according to precompiled headers of wx/wx.h (with other minor...
[wxWidgets.git] / src / xrc / xh_panel.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/xrc/xh_panel.cpp
3 // Purpose: XRC resource for panels
4 // Author: Vaclav Slavik
5 // Created: 2000/03/05
6 // RCS-ID: $Id$
7 // Copyright: (c) 2000 Vaclav Slavik
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
19
20 #include "wx/xrc/xh_panel.h"
21
22 #ifndef WX_PRECOMP
23 #include "wx/panel.h"
24 #endif
25
26 #include "wx/frame.h"
27
28 IMPLEMENT_DYNAMIC_CLASS(wxPanelXmlHandler, wxXmlResourceHandler)
29
30 wxPanelXmlHandler::wxPanelXmlHandler() : wxXmlResourceHandler()
31 {
32 #if WXWIN_COMPATIBILITY_2_6
33 XRC_ADD_STYLE(wxNO_3D);
34 #endif // WXWIN_COMPATIBILITY_2_6
35 XRC_ADD_STYLE(wxTAB_TRAVERSAL);
36 XRC_ADD_STYLE(wxWS_EX_VALIDATE_RECURSIVELY);
37
38 AddWindowStyles();
39 }
40
41 wxObject *wxPanelXmlHandler::DoCreateResource()
42 {
43 XRC_MAKE_INSTANCE(panel, wxPanel)
44
45 panel->Create(m_parentAsWindow,
46 GetID(),
47 GetPosition(), GetSize(),
48 GetStyle(wxT("style"), wxTAB_TRAVERSAL),
49 GetName());
50
51 SetupWindow(panel);
52 CreateChildren(panel);
53
54 return panel;
55 }
56
57 bool wxPanelXmlHandler::CanHandle(wxXmlNode *node)
58 {
59 return IsOfClass(node, wxT("wxPanel"));
60 }
61
62 #endif // wxUSE_XRC