1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: XML 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/xml/xh_frame.h"
28 wxFrameXmlHandler::wxFrameXmlHandler() : wxXmlResourceHandler()
30 ADD_STYLE(wxSTAY_ON_TOP
);
32 ADD_STYLE(wxDEFAULT_DIALOG_STYLE
);
33 ADD_STYLE(wxTHICK_FRAME
);
34 ADD_STYLE(wxSYSTEM_MENU
);
35 ADD_STYLE(wxRESIZE_BORDER
);
36 ADD_STYLE(wxRESIZE_BOX
);
38 ADD_STYLE(wxFRAME_TOOL_WINDOW
);
39 ADD_STYLE(wxFRAME_FLOAT_ON_PARENT
);
40 ADD_STYLE(wxMAXIMIZE_BOX
);
41 ADD_STYLE(wxMINIMIZE_BOX
);
42 ADD_STYLE(wxSTAY_ON_TOP
);
45 ADD_STYLE(wxTAB_TRAVERSAL
);
46 ADD_STYLE(wxWS_EX_VALIDATE_RECURSIVELY
);
47 ADD_STYLE(wxCLIP_CHILDREN
);
53 wxObject
*wxFrameXmlHandler::DoCreateResource()
55 wxFrame
*frame
= wxDynamicCast(m_instance
, wxFrame
);
57 wxASSERT_MSG(frame
, _("XML resource: Cannot create dialog without instance."));
59 frame
->Create(m_parentAsWindow
,
62 wxDefaultPosition
, wxDefaultSize
,
63 GetStyle(_T("style"), wxDEFAULT_FRAME_STYLE
),
65 frame
->SetClientSize(GetSize());
66 frame
->Move(GetPosition());
69 CreateChildren(frame
);
71 if (GetBool(_("centered"), FALSE
))
79 bool wxFrameXmlHandler::CanHandle(wxXmlNode
*node
)
81 return IsOfClass(node
, _T("wxFrame"));