1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/xrc/xh_frame.cpp
3 // Purpose: XRC resource for dialogs
4 // Author: Vaclav Slavik & Aleks.
7 // Copyright: (c) 2000 Vaclav Slavik
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
20 #include "wx/xrc/xh_frame.h"
22 #include "wx/dialog.h" // to get wxDEFAULT_DIALOG_STYLE
26 IMPLEMENT_DYNAMIC_CLASS(wxFrameXmlHandler
, wxXmlResourceHandler
)
28 wxFrameXmlHandler::wxFrameXmlHandler() : wxXmlResourceHandler()
30 XRC_ADD_STYLE(wxSTAY_ON_TOP
);
31 XRC_ADD_STYLE(wxCAPTION
);
32 XRC_ADD_STYLE(wxDEFAULT_DIALOG_STYLE
);
33 XRC_ADD_STYLE(wxDEFAULT_FRAME_STYLE
);
34 #if WXWIN_COMPATIBILITY_2_6
35 XRC_ADD_STYLE(wxTHICK_FRAME
);
36 #endif // WXWIN_COMPATIBILITY_2_6
37 XRC_ADD_STYLE(wxSYSTEM_MENU
);
38 XRC_ADD_STYLE(wxRESIZE_BORDER
);
39 #if WXWIN_COMPATIBILITY_2_6
40 XRC_ADD_STYLE(wxRESIZE_BOX
);
41 #endif // WXWIN_COMPATIBILITY_2_6
42 XRC_ADD_STYLE(wxCLOSE_BOX
);
44 XRC_ADD_STYLE(wxFRAME_NO_TASKBAR
);
45 XRC_ADD_STYLE(wxFRAME_SHAPED
);
46 XRC_ADD_STYLE(wxFRAME_TOOL_WINDOW
);
47 XRC_ADD_STYLE(wxFRAME_FLOAT_ON_PARENT
);
48 XRC_ADD_STYLE(wxMAXIMIZE_BOX
);
49 XRC_ADD_STYLE(wxMINIMIZE_BOX
);
50 XRC_ADD_STYLE(wxSTAY_ON_TOP
);
52 #if WXWIN_COMPATIBILITY_2_6
53 XRC_ADD_STYLE(wxNO_3D
);
54 #endif // WXWIN_COMPATIBILITY_2_6
55 XRC_ADD_STYLE(wxTAB_TRAVERSAL
);
56 XRC_ADD_STYLE(wxWS_EX_VALIDATE_RECURSIVELY
);
57 XRC_ADD_STYLE(wxFRAME_EX_METAL
);
58 XRC_ADD_STYLE(wxFRAME_EX_CONTEXTHELP
);
63 wxObject
*wxFrameXmlHandler::DoCreateResource()
65 XRC_MAKE_INSTANCE(frame
, wxFrame
);
67 frame
->Create(m_parentAsWindow
,
69 GetText(wxT("title")),
70 wxDefaultPosition
, wxDefaultSize
,
71 GetStyle(wxT("style"), wxDEFAULT_FRAME_STYLE
),
74 if (HasParam(wxT("size")))
75 frame
->SetClientSize(GetSize(wxT("size"), frame
));
76 if (HasParam(wxT("pos")))
77 frame
->Move(GetPosition());
78 if (HasParam(wxT("icon")))
79 frame
->SetIcon(GetIcon(wxT("icon"), wxART_FRAME_ICON
));
83 CreateChildren(frame
);
85 if (GetBool(wxT("centered"), false))
91 bool wxFrameXmlHandler::CanHandle(wxXmlNode
*node
)
93 return IsOfClass(node
, wxT("wxFrame"));