]> git.saurik.com Git - wxWidgets.git/commitdiff
Initial checkin of the wxFrame support added by Aleks G.
authorGeorge Tasker <gtasker@allenbrook.com>
Sat, 3 Feb 2001 21:44:28 +0000 (21:44 +0000)
committerGeorge Tasker <gtasker@allenbrook.com>
Sat, 3 Feb 2001 21:44:28 +0000 (21:44 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9279 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

contrib/include/wx/xml/xh_frame.h [new file with mode: 0644]
contrib/src/xml/xh_frame.cpp [new file with mode: 0644]

diff --git a/contrib/include/wx/xml/xh_frame.h b/contrib/include/wx/xml/xh_frame.h
new file mode 100644 (file)
index 0000000..d70579c
--- /dev/null
@@ -0,0 +1,29 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        xh_frame.h
+// Purpose:     XML resource handler for dialogs
+// Author:      Vaclav Slavik & Aleks.
+// Created:     2000/03/05
+// RCS-ID:      $Id$
+// Copyright:   (c) 2000 Vaclav Slavik
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_XH_FRAME_H_
+#define _WX_XH_FRAME_H_
+
+#ifdef __GNUG__
+#pragma interface "xh_frame.h"
+#endif
+
+#include "wx/xml/xmlres.h"
+
+class WXDLLEXPORT wxFrameXmlHandler : public wxXmlResourceHandler
+{
+    public:
+        wxFrameXmlHandler();
+        virtual wxObject *DoCreateResource();
+        virtual bool CanHandle(wxXmlNode *node);
+};
+
+
+#endif // _WX_XH_FRAME_H_
diff --git a/contrib/src/xml/xh_frame.cpp b/contrib/src/xml/xh_frame.cpp
new file mode 100644 (file)
index 0000000..dd56ad7
--- /dev/null
@@ -0,0 +1,84 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        xh_frame.cpp
+// Purpose:     XML resource for dialogs
+// Author:      Vaclav Slavik & Aleks.
+// Created:     2000/03/05
+// RCS-ID:      $Id$
+// Copyright:   (c) 2000 Vaclav Slavik
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+#ifdef __GNUG__
+#pragma implementation "xh_frame.h"
+#endif
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#include "wx/xml/xh_frame.h"
+#include "wx/frame.h"
+#include "wx/log.h"
+#include "wx/intl.h"
+
+
+wxFrameXmlHandler::wxFrameXmlHandler() : wxXmlResourceHandler()
+{
+    ADD_STYLE(wxSTAY_ON_TOP);
+    ADD_STYLE(wxCAPTION);
+    ADD_STYLE(wxDEFAULT_DIALOG_STYLE);
+    ADD_STYLE(wxTHICK_FRAME);
+    ADD_STYLE(wxSYSTEM_MENU);
+    ADD_STYLE(wxRESIZE_BORDER);
+    ADD_STYLE(wxRESIZE_BOX);
+
+    ADD_STYLE(wxFRAME_TOOL_WINDOW);
+    ADD_STYLE(wxFRAME_FLOAT_ON_PARENT);
+    ADD_STYLE(wxMAXIMIZE_BOX);
+    ADD_STYLE(wxMINIMIZE_BOX);
+    ADD_STYLE(wxSTAY_ON_TOP);
+
+    ADD_STYLE(wxNO_3D);
+    ADD_STYLE(wxTAB_TRAVERSAL);
+    ADD_STYLE(wxWS_EX_VALIDATE_RECURSIVELY);
+    ADD_STYLE(wxCLIP_CHILDREN);
+    AddWindowStyles();
+}
+
+
+
+wxObject *wxFrameXmlHandler::DoCreateResource()
+{ 
+    wxFrame *frame = wxDynamicCast(m_Instance, wxFrame);
+    
+    wxASSERT_MSG(frame, _("XML resource: Cannot create dialog without instance."));
+    
+    frame->Create(m_ParentAsWindow,
+                GetID(),
+                GetText(_T("title")),
+                wxDefaultPosition, wxDefaultSize,
+                GetStyle(_T("style"), wxDEFAULT_FRAME_STYLE),
+                GetName());
+    frame->SetClientSize(GetSize());
+    frame->Move(GetPosition());
+    SetupWindow(frame);
+
+    CreateChildren(frame);
+    
+    if (GetBool(_("centered"), FALSE))
+        frame->Centre();
+    
+    return frame;
+}
+
+
+
+bool wxFrameXmlHandler::CanHandle(wxXmlNode *node)
+{
+    return IsOfClass(node, _T("wxFrame"));
+}
+
+