1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: XRC resource for dialogs
4 // Author: Vaclav Slavik & Aleks.
7 // Copyright: (c) 2000 Vaclav Slavik
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "xh_frame.h"
15 // For compilers that support precompilation, includes "wx.h".
16 #include "wx/wxprec.h"
22 #include "wx/xrc/xh_frame.h"
28 wxFrameXmlHandler::wxFrameXmlHandler() : wxXmlResourceHandler()
30 ADD_STYLE(wxSTAY_ON_TOP
);
32 ADD_STYLE(wxDEFAULT_DIALOG_STYLE
);
33 ADD_STYLE(wxDEFAULT_FRAME_STYLE
);
34 ADD_STYLE(wxTHICK_FRAME
);
35 ADD_STYLE(wxSYSTEM_MENU
);
36 ADD_STYLE(wxRESIZE_BORDER
);
37 ADD_STYLE(wxRESIZE_BOX
);
39 ADD_STYLE(wxFRAME_TOOL_WINDOW
);
40 ADD_STYLE(wxFRAME_FLOAT_ON_PARENT
);
41 ADD_STYLE(wxMAXIMIZE_BOX
);
42 ADD_STYLE(wxMINIMIZE_BOX
);
43 ADD_STYLE(wxSTAY_ON_TOP
);
46 ADD_STYLE(wxTAB_TRAVERSAL
);
47 ADD_STYLE(wxWS_EX_VALIDATE_RECURSIVELY
);
48 ADD_STYLE(wxCLIP_CHILDREN
);
54 wxObject
*wxFrameXmlHandler::DoCreateResource()
56 wxFrame
*frame
= wxDynamicCast(m_instance
, wxFrame
);
58 wxASSERT_MSG(frame
, _("XRC resource: Cannot create dialog without instance."));
60 frame
->Create(m_parentAsWindow
,
62 GetText(wxT("title")),
63 wxDefaultPosition
, wxDefaultSize
,
64 GetStyle(wxT("style"), wxDEFAULT_FRAME_STYLE
),
66 if (HasParam(wxT("size")))
67 frame
->SetClientSize(GetSize());
68 if (HasParam(wxT("pos")))
69 frame
->Move(GetPosition());
72 CreateChildren(frame
);
74 if (GetBool(wxT("centered"), FALSE
))
82 bool wxFrameXmlHandler::CanHandle(wxXmlNode
*node
)
84 return IsOfClass(node
, wxT("wxFrame"));