src/xrc/xh_notbk.cpp
src/xrc/xh_odcombo.cpp
src/xrc/xh_panel.cpp
+ src/xrc/xh_propdlg.cpp
src/xrc/xh_radbt.cpp
src/xrc/xh_radbx.cpp
<!-- disabled until linking problems are fixed -->
wx/xrc/xh_notbk.h
wx/xrc/xh_odcombo.h
wx/xrc/xh_panel.h
+ wx/xrc/xh_propdlg.h
wx/xrc/xh_radbt.h
wx/xrc/xh_radbx.h
<!-- wx/xrc/xh_richtext.h -->
$(OBJS)\xrcdll_xh_notbk.obj \
$(OBJS)\xrcdll_xh_odcombo.obj \
$(OBJS)\xrcdll_xh_panel.obj \
+ $(OBJS)\xrcdll_xh_propdlg.obj \
$(OBJS)\xrcdll_xh_radbt.obj \
$(OBJS)\xrcdll_xh_radbx.obj \
$(OBJS)\xrcdll_xh_scrol.obj \
$(OBJS)\xrclib_xh_notbk.obj \
$(OBJS)\xrclib_xh_odcombo.obj \
$(OBJS)\xrclib_xh_panel.obj \
+ $(OBJS)\xrclib_xh_propdlg.obj \
$(OBJS)\xrclib_xh_radbt.obj \
$(OBJS)\xrclib_xh_radbx.obj \
$(OBJS)\xrclib_xh_scrol.obj \
$(OBJS)\monodll_xh_notbk.obj \
$(OBJS)\monodll_xh_odcombo.obj \
$(OBJS)\monodll_xh_panel.obj \
+ $(OBJS)\monodll_xh_propdlg.obj \
$(OBJS)\monodll_xh_radbt.obj \
$(OBJS)\monodll_xh_radbx.obj \
$(OBJS)\monodll_xh_scrol.obj \
$(OBJS)\monolib_xh_notbk.obj \
$(OBJS)\monolib_xh_odcombo.obj \
$(OBJS)\monolib_xh_panel.obj \
+ $(OBJS)\monolib_xh_propdlg.obj \
$(OBJS)\monolib_xh_radbt.obj \
$(OBJS)\monolib_xh_radbx.obj \
$(OBJS)\monolib_xh_scrol.obj \
$(OBJS)\monodll_xh_panel.obj: ..\..\src\xrc\xh_panel.cpp
$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) $**
+$(OBJS)\monodll_xh_propdlg.obj: ..\..\src\xrc\xh_propdlg.cpp
+ $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) $**
+
$(OBJS)\monodll_xh_radbt.obj: ..\..\src\xrc\xh_radbt.cpp
$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) $**
$(OBJS)\monolib_xh_panel.obj: ..\..\src\xrc\xh_panel.cpp
$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) $**
+$(OBJS)\monolib_xh_propdlg.obj: ..\..\src\xrc\xh_propdlg.cpp
+ $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) $**
+
$(OBJS)\monolib_xh_radbt.obj: ..\..\src\xrc\xh_radbt.cpp
$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) $**
$(OBJS)\xrcdll_xh_panel.obj: ..\..\src\xrc\xh_panel.cpp
$(CXX) /c /nologo /TP /Fo$@ $(XRCDLL_CXXFLAGS) $**
+$(OBJS)\xrcdll_xh_propdlg.obj: ..\..\src\xrc\xh_propdlg.cpp
+ $(CXX) /c /nologo /TP /Fo$@ $(XRCDLL_CXXFLAGS) $**
+
$(OBJS)\xrcdll_xh_radbt.obj: ..\..\src\xrc\xh_radbt.cpp
$(CXX) /c /nologo /TP /Fo$@ $(XRCDLL_CXXFLAGS) $**
$(OBJS)\xrclib_xh_panel.obj: ..\..\src\xrc\xh_panel.cpp
$(CXX) /c /nologo /TP /Fo$@ $(XRCLIB_CXXFLAGS) $**
+$(OBJS)\xrclib_xh_propdlg.obj: ..\..\src\xrc\xh_propdlg.cpp
+ $(CXX) /c /nologo /TP /Fo$@ $(XRCLIB_CXXFLAGS) $**
+
$(OBJS)\xrclib_xh_radbt.obj: ..\..\src\xrc\xh_radbt.cpp
$(CXX) /c /nologo /TP /Fo$@ $(XRCLIB_CXXFLAGS) $**
// Existing handlers:
-#include "wx/xrc/xh_menu.h"
-#include "wx/xrc/xh_panel.h"
-#include "wx/xrc/xh_dlg.h"
+#include "wx/xrc/xh_animatctrl.h"
+#include "wx/xrc/xh_bmp.h"
+#include "wx/xrc/xh_bmpbt.h"
+#include "wx/xrc/xh_bmpcbox.h"
#include "wx/xrc/xh_bttn.h"
+#include "wx/xrc/xh_cald.h"
#include "wx/xrc/xh_chckb.h"
-#include "wx/xrc/xh_tglbtn.h"
+#include "wx/xrc/xh_chckl.h"
+#include "wx/xrc/xh_choic.h"
+#include "wx/xrc/xh_choicbk.h"
+#include "wx/xrc/xh_clrpicker.h"
+#include "wx/xrc/xh_collpane.h"
+#include "wx/xrc/xh_combo.h"
+#include "wx/xrc/xh_datectrl.h"
+#include "wx/xrc/xh_dirpicker.h"
+#include "wx/xrc/xh_dlg.h"
+#include "wx/xrc/xh_filepicker.h"
+#include "wx/xrc/xh_fontpicker.h"
+#include "wx/xrc/xh_frame.h"
#include "wx/xrc/xh_gauge.h"
+#include "wx/xrc/xh_gdctl.h"
+#include "wx/xrc/xh_grid.h"
#include "wx/xrc/xh_html.h"
-#include "wx/xrc/xh_spin.h"
-#include "wx/xrc/xh_sttxt.h"
-#include "wx/xrc/xh_slidr.h"
+#include "wx/xrc/xh_htmllbox.h"
+#include "wx/xrc/xh_hyperlink.h"
+#include "wx/xrc/xh_listb.h"
+#include "wx/xrc/xh_listc.h"
+#include "wx/xrc/xh_listbk.h"
+#include "wx/xrc/xh_mdi.h"
+#include "wx/xrc/xh_menu.h"
+#include "wx/xrc/xh_notbk.h"
+#include "wx/xrc/xh_odcombo.h"
+#include "wx/xrc/xh_panel.h"
+#include "wx/xrc/xh_propdlg.h"
#include "wx/xrc/xh_radbt.h"
#include "wx/xrc/xh_radbx.h"
-#include "wx/xrc/xh_combo.h"
-#include "wx/xrc/xh_chckl.h"
-#include "wx/xrc/xh_choic.h"
-#include "wx/xrc/xh_datectrl.h"
+#include "wx/xrc/xh_scrol.h"
+#include "wx/xrc/xh_scwin.h"
#include "wx/xrc/xh_sizer.h"
+#include "wx/xrc/xh_slidr.h"
+#include "wx/xrc/xh_spin.h"
+#include "wx/xrc/xh_split.h"
+#include "wx/xrc/xh_statbar.h"
+#include "wx/xrc/xh_stbox.h"
#include "wx/xrc/xh_stbmp.h"
-#include "wx/xrc/xh_notbk.h"
-#include "wx/xrc/xh_odcombo.h"
-#include "wx/xrc/xh_listbk.h"
-#include "wx/xrc/xh_choicbk.h"
-#include "wx/xrc/xh_treebk.h"
+#include "wx/xrc/xh_sttxt.h"
+#include "wx/xrc/xh_stlin.h"
#include "wx/xrc/xh_text.h"
-#include "wx/xrc/xh_listb.h"
+#include "wx/xrc/xh_tglbtn.h"
#include "wx/xrc/xh_toolb.h"
-#include "wx/xrc/xh_bmpbt.h"
-#include "wx/xrc/xh_stbox.h"
-#include "wx/xrc/xh_scrol.h"
#include "wx/xrc/xh_tree.h"
-#include "wx/xrc/xh_cald.h"
-#include "wx/xrc/xh_listc.h"
-#include "wx/xrc/xh_stlin.h"
-#include "wx/xrc/xh_bmp.h"
+#include "wx/xrc/xh_treebk.h"
#include "wx/xrc/xh_unkwn.h"
-#include "wx/xrc/xh_gdctl.h"
-#include "wx/xrc/xh_frame.h"
-#include "wx/xrc/xh_scwin.h"
-#include "wx/xrc/xh_htmllbox.h"
-#include "wx/xrc/xh_split.h"
#include "wx/xrc/xh_wizrd.h"
-#include "wx/xrc/xh_statbar.h"
-#include "wx/xrc/xh_mdi.h"
-#include "wx/xrc/xh_grid.h"
-#include "wx/xrc/xh_clrpicker.h"
-#include "wx/xrc/xh_filepicker.h"
-#include "wx/xrc/xh_fontpicker.h"
-#include "wx/xrc/xh_dirpicker.h"
-#include "wx/xrc/xh_hyperlink.h"
-#include "wx/xrc/xh_bmpcbox.h"
-#include "wx/xrc/xh_animatctrl.h"
-#include "wx/xrc/xh_collpane.h"
#endif // _WX_XH_ALL_H_
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////\r
+// Name: wx/xrc/xh_propdlg.h\r
+// Purpose: XML resource handler for wxPropertySheetDialog\r
+// Author: Sander Berents\r
+// Created: 2007/07/12\r
+// RCS-ID: $Id$\r
+// Copyright: (c) 2007 Sander Berents\r
+// Licence: wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef _WX_XH_PROPDLG_H_\r
+#define _WX_XH_PROPDLG_H_\r
+\r
+#include "wx/xrc/xmlres.h"\r
+\r
+#if wxUSE_XRC\r
+\r
+class WXDLLEXPORT wxPropertySheetDialog;\r
+\r
+class WXDLLIMPEXP_XRC wxPropertySheetDialogXmlHandler : public wxXmlResourceHandler\r
+{\r
+ DECLARE_DYNAMIC_CLASS(wxPropertySheetDialogXmlHandler)\r
+\r
+public:\r
+ wxPropertySheetDialogXmlHandler();\r
+ virtual wxObject *DoCreateResource();\r
+ virtual bool CanHandle(wxXmlNode *node);\r
+\r
+private:\r
+ bool m_isInside;\r
+ wxPropertySheetDialog *m_dialog;\r
+};\r
+\r
+#endif // wxUSE_XRC\r
+\r
+#endif // _WX_XH_PROPDLG_H_\r
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////\r
+// Name: src/xrc/xh_propdlg.cpp\r
+// Purpose: XRC resource handler for wxPropertySheetDialog\r
+// Author: Sander Berents\r
+// Created: 2007/07/12\r
+// RCS-ID: $Id$\r
+// Copyright: (c) 2007 Sander Berents\r
+// Licence: wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+// For compilers that support precompilation, includes "wx.h".\r
+#include "wx/wxprec.h"\r
+\r
+#ifdef __BORLANDC__\r
+ #pragma hdrstop\r
+#endif\r
+\r
+#if wxUSE_XRC && wxUSE_BOOKCTRL\r
+\r
+#include "wx/xrc/xh_propdlg.h"\r
+\r
+#ifndef WX_PRECOMP\r
+ #include "wx/log.h"\r
+ #include "wx/sizer.h"\r
+#endif\r
+\r
+#include "wx/bookctrl.h"\r
+#include "wx/propdlg.h"\r
+\r
+IMPLEMENT_DYNAMIC_CLASS(wxPropertySheetDialogXmlHandler, wxXmlResourceHandler)\r
+\r
+wxPropertySheetDialogXmlHandler::wxPropertySheetDialogXmlHandler()\r
+ :wxXmlResourceHandler(),\r
+ m_isInside(false),\r
+ m_dialog(NULL)\r
+{\r
+ XRC_ADD_STYLE(wxSTAY_ON_TOP);\r
+ XRC_ADD_STYLE(wxCAPTION);\r
+ XRC_ADD_STYLE(wxDEFAULT_DIALOG_STYLE);\r
+ XRC_ADD_STYLE(wxSYSTEM_MENU);\r
+ XRC_ADD_STYLE(wxRESIZE_BORDER);\r
+ XRC_ADD_STYLE(wxCLOSE_BOX);\r
+ XRC_ADD_STYLE(wxDIALOG_NO_PARENT);\r
+\r
+ XRC_ADD_STYLE(wxTAB_TRAVERSAL);\r
+ XRC_ADD_STYLE(wxWS_EX_VALIDATE_RECURSIVELY);\r
+ XRC_ADD_STYLE(wxDIALOG_EX_METAL);\r
+ XRC_ADD_STYLE(wxMAXIMIZE_BOX);\r
+ XRC_ADD_STYLE(wxMINIMIZE_BOX);\r
+ XRC_ADD_STYLE(wxFRAME_SHAPED);\r
+ XRC_ADD_STYLE(wxDIALOG_EX_CONTEXTHELP);\r
+\r
+ AddWindowStyles();\r
+}\r
+\r
+wxObject *wxPropertySheetDialogXmlHandler::DoCreateResource()\r
+{\r
+ if (m_class == wxT("propertysheetpage"))\r
+ {\r
+ wxXmlNode *n = GetParamNode(wxT("object"));\r
+\r
+ if (!n) n = GetParamNode(wxT("object_ref"));\r
+\r
+ if (n)\r
+ {\r
+ wxBookCtrlBase *bookctrl = m_dialog->GetBookCtrl();\r
+ bool old_ins = m_isInside;\r
+ m_isInside = false;\r
+ wxObject *item = CreateResFromNode(n, bookctrl, NULL);\r
+ m_isInside = old_ins;\r
+ wxWindow *wnd = wxDynamicCast(item, wxWindow);\r
+\r
+ if (wnd)\r
+ {\r
+ bookctrl->AddPage(wnd, GetText(wxT("label")), GetBool(wxT("selected")));\r
+ if (HasParam(wxT("bitmap")))\r
+ {\r
+ wxBitmap bmp = GetBitmap(wxT("bitmap"), wxART_OTHER);\r
+ wxImageList *imgList = bookctrl->GetImageList();\r
+ if (imgList == NULL)\r
+ {\r
+ imgList = new wxImageList(bmp.GetWidth(), bmp.GetHeight());\r
+ bookctrl->AssignImageList(imgList);\r
+ }\r
+ int imgIndex = imgList->Add(bmp);\r
+ bookctrl->SetPageImage(bookctrl->GetPageCount()-1, imgIndex);\r
+ }\r
+ }\r
+ else\r
+ wxLogError(wxT("Error in resource."));\r
+ return wnd;\r
+ }\r
+ else\r
+ {\r
+ wxLogError(wxT("Error in resource: no control within wxPropertySheetDialog's <page> tag."));\r
+ return NULL;\r
+ }\r
+ }\r
+\r
+ else\r
+ {\r
+ XRC_MAKE_INSTANCE(dlg, wxPropertySheetDialog)\r
+\r
+ dlg->Create(m_parentAsWindow,\r
+ GetID(),\r
+ GetText(wxT("title")),\r
+ GetPosition(),\r
+ GetSize(),\r
+ GetStyle(),\r
+ GetName());\r
+\r
+ if (HasParam(wxT("icon"))) dlg->SetIcon(GetIcon(wxT("icon"), wxART_FRAME_ICON));\r
+\r
+ SetupWindow(dlg);\r
+\r
+ wxPropertySheetDialog *old_par = m_dialog;\r
+ m_dialog = dlg;\r
+ bool old_ins = m_isInside;\r
+ m_isInside = true;\r
+ CreateChildren(m_dialog, true/*only this handler*/);\r
+ m_isInside = old_ins;\r
+ m_dialog = old_par;\r
+\r
+ if (GetBool(wxT("centered"), false)) dlg->Centre();\r
+ wxString buttons = GetText(wxT("buttons"));\r
+ if (!buttons.IsEmpty())\r
+ {\r
+ int flags = 0;\r
+ if (buttons.Find(wxT("wxOK")) != wxNOT_FOUND) flags |= wxOK;\r
+ if (buttons.Find(wxT("wxCANCEL")) != wxNOT_FOUND) flags |= wxCANCEL;\r
+ if (buttons.Find(wxT("wxYES")) != wxNOT_FOUND) flags |= wxYES;\r
+ if (buttons.Find(wxT("wxNO")) != wxNOT_FOUND) flags |= wxNO;\r
+ if (buttons.Find(wxT("wxHELP")) != wxNOT_FOUND) flags |= wxHELP;\r
+ if (buttons.Find(wxT("wxNO_DEFAULT")) != wxNOT_FOUND) flags |= wxNO_DEFAULT;\r
+ dlg->CreateButtons(flags);\r
+ }\r
+\r
+ return dlg;\r
+ }\r
+}\r
+\r
+bool wxPropertySheetDialogXmlHandler::CanHandle(wxXmlNode *node)\r
+{\r
+ return ((!m_isInside && IsOfClass(node, wxT("wxPropertySheetDialog"))) ||\r
+ (m_isInside && IsOfClass(node, wxT("propertysheetpage"))));\r
+}\r
+\r
+#endif // wxUSE_XRC && wxUSE_BOOKCTRL\r
#if wxUSE_BMPBUTTON
AddHandler(new wxBitmapButtonXmlHandler);
#endif
+#if wxUSE_BOOKCTRL
+ AddHandler(new wxPropertySheetDialogXmlHandler);
+#endif
#if wxUSE_BUTTON
AddHandler(new wxStdDialogButtonSizerXmlHandler);
AddHandler(new wxButtonXmlHandler);