]> git.saurik.com Git - wxWidgets.git/commitdiff
added wxGenericDirCtrl handler to XRC
authorVáclav Slavík <vslavik@fastmail.fm>
Wed, 23 Jan 2002 00:15:13 +0000 (00:15 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Wed, 23 Jan 2002 00:15:13 +0000 (00:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13759 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

15 files changed:
contrib/include/wx/xrc/xh_all.h
contrib/include/wx/xrc/xh_gdctl.h [new file with mode: 0644]
contrib/src/xrc/Makefile.in
contrib/src/xrc/makefile.b32
contrib/src/xrc/makefile.g95
contrib/src/xrc/xh_gdctl.cpp [new file with mode: 0644]
contrib/src/xrc/xmlrsall.cpp
contrib/utils/wxrcedit/df/wxGenericDirCtrl.df [new file with mode: 0644]
include/wx/xrc/xh_all.h
include/wx/xrc/xh_gdctl.h [new file with mode: 0644]
src/xrc/Makefile.in
src/xrc/makefile.b32
src/xrc/makefile.g95
src/xrc/xh_gdctl.cpp [new file with mode: 0644]
src/xrc/xmlrsall.cpp

index 3abb40c2c6dc2a93de9c9d5eb55926a8c2754811..5382b6ffb0808dad57eb979edbaba641efcadfdb 100644 (file)
@@ -44,6 +44,7 @@
 #include "wx/xrc/xh_stlin.h"
 #include "wx/xrc/xh_bmp.h"
 #include "wx/xrc/xh_unkwn.h"
+#include "wx/xrc/xh_gdctl.h"
 #include "wx/xrc/xh_frame.h"
 
 #endif // _WX_XMLRES_H_
diff --git a/contrib/include/wx/xrc/xh_gdctl.h b/contrib/include/wx/xrc/xh_gdctl.h
new file mode 100644 (file)
index 0000000..548ecaf
--- /dev/null
@@ -0,0 +1,32 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        xh_gdctl.h
+// Purpose:     XML resource handler for wxGenericDirCtrl
+// Author:      Markus Greither
+// Created:     2002/01/20
+// RCS-ID:      $Id$
+// Copyright:   (c) 2002 Markus Greither
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_XH_GDCTL_H_
+#define _WX_XH_GDCTL_H_
+
+#ifdef __GNUG__
+#pragma interface "xh_gdctl.h"
+#endif
+
+#include "wx/xrc/xmlres.h"
+
+#if wxUSE_DIRDLG
+
+class WXXMLDLLEXPORT wxGenericDirCtrlXmlHandler : public wxXmlResourceHandler
+{
+public:
+    wxGenericDirCtrlXmlHandler();
+    virtual wxObject *DoCreateResource();
+    virtual bool CanHandle(wxXmlNode *node);
+};
+
+#endif
+
+#endif // _WX_XH_GDCTL_H_
index 4f92c3d6ceb18f2244d9bef7e663c9f9b96890df..729c6f1574fb722aad84e91cabdbc463aabe4f44 100644 (file)
@@ -24,7 +24,7 @@ HEADERS=xh_all.h xh_bttn.h xh_chckb.h xh_chckl.h xh_choic.h xh_combo.h \
         xh_radbt.h xh_radbx.h xh_sizer.h xh_slidr.h xh_spin.h xh_stbmp.h \
         xh_sttxt.h xh_text.h xh_listb.h xml.h xmlio.h xmlres.h xh_toolb.h \
         xh_bmpbt.h xh_cald.h xh_listc.h xh_scrol.h xh_stbox.h xh_tree.h \
-        xh_stlin.h xh_bmp.h xh_unkwn.h xh_frame.h
+        xh_stlin.h xh_bmp.h xh_unkwn.h xh_frame.h xh_gdctl.h
 
 OBJECTS=$(EXPAT_OBJECTS) \
         xml.o xmlbin.o xmlbinz.o xmlexpat.o xmlwrite.o xmlres.o xmlrsall.o \
@@ -33,7 +33,7 @@ OBJECTS=$(EXPAT_OBJECTS) \
         xh_radbx.o xh_sizer.o xh_slidr.o xh_spin.o xh_stbmp.o xh_sttxt.o \
         xh_text.o xh_listb.o xh_toolb.o xh_stlin.o xh_bmp.o xh_unkwn.o \
         xh_bmpbt.o xh_cald.o xh_listc.o xh_scrol.o xh_stbox.o xh_tree.o \
-        xh_frame.o
+        xh_frame.o xh_gdctl.o
 DEPFILES=$(OBJECTS:.o=.d)
 
 APPEXTRADEFS=-I$(top_srcdir)/contrib/include $(EXPAT_DEFS)
index 258e43c36868fd855ff30c343d0efdfafb3b1236..ba854f74e65c854addfa43612ebb1fd56c20da5f 100644 (file)
@@ -27,7 +27,7 @@ OBJECTS=$(EXPAT_OBJECTS) \
         xh_radbx.obj xh_sizer.obj xh_slidr.obj xh_spin.obj xh_stbmp.obj xh_sttxt.obj \
         xh_text.obj xh_listb.obj xh_toolb.obj xh_stlin.obj xh_bmp.obj \
         xh_bmpbt.obj xh_cald.obj xh_listc.obj xh_scrol.obj xh_stbox.obj \
-        xh_tree.obj xh_unkwn.obj xh_frame.obj
+        xh_tree.obj xh_unkwn.obj xh_frame.obj xh_gdctl.obj
 
 !include $(WXDIR)\src\makelib.b32
 
index 3a11d890ec28293f00385bee3aff4b2c45c9e20d..2fb8b309a5b2b0041974099f1631cfefc41945e5 100644 (file)
@@ -28,7 +28,7 @@ OBJECTS= $(XMLPARSEDIR_OBJECTS) $(XMLTOKDIR_OBJECTS) \
         xh_radbx.o xh_sizer.o xh_slidr.o xh_spin.o xh_stbmp.o xh_sttxt.o \
         xh_text.o xh_listb.o xh_toolb.o xh_stlin.o xh_bmp.o xh_unkwn.o \
         xh_bmpbt.o xh_cald.o xh_listc.o xh_scrol.o xh_stbox.o xh_tree.o \
-        xh_frame.o
+        xh_frame.o xh_gdctl.o
 
 include $(WXDIR)/src/makelib.g95
 
diff --git a/contrib/src/xrc/xh_gdctl.cpp b/contrib/src/xrc/xh_gdctl.cpp
new file mode 100644 (file)
index 0000000..9252d60
--- /dev/null
@@ -0,0 +1,62 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        xh_gdctl.cpp
+// Purpose:     XRC resource for wxGenericDirCtrl
+// Author:      Markus Greither
+// Created:     2002/01/20
+// RCS-ID:
+// Copyright:   (c) 2002 Markus Greither
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifdef __GNUG__
+#pragma implementation "xh_gdctl.h"
+#endif
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#include "wx/defs.h"
+#if wxUSE_DIRDLG
+
+#include "wx/textctrl.h"
+#include "wx/xrc/xh_gdctl.h"
+#include "wx/dirctrl.h"
+
+wxGenericDirCtrlXmlHandler::wxGenericDirCtrlXmlHandler()
+: wxXmlResourceHandler()
+{
+    ADD_STYLE(wxDIRCTRL_DIR_ONLY);
+    ADD_STYLE(wxDIRCTRL_3D_INTERNAL);
+    ADD_STYLE(wxDIRCTRL_SELECT_FIRST);
+    ADD_STYLE(wxDIRCTRL_SHOW_FILTERS);
+    AddWindowStyles();
+}
+
+wxObject *wxGenericDirCtrlXmlHandler::DoCreateResource()
+{
+    XRC_MAKE_INSTANCE(ctrl, wxGenericDirCtrl)
+    ctrl->Create(m_parentAsWindow,
+                 GetID(),
+                 GetText(wxT("defaultfolder")),
+                 GetPosition(), GetSize(),
+                 GetStyle(),
+                 GetText(wxT("filter")),
+                 (int)GetLong(wxT("defaultfilter")),
+                 GetName());
+
+    SetupWindow(ctrl);
+
+    return ctrl;
+}
+
+bool wxGenericDirCtrlXmlHandler::CanHandle(wxXmlNode *node)
+{
+    return IsOfClass(node, wxT("wxGenericDirCtrl"));
+}
+
+#endif
index 29deb1c4cad8cb0ea72ad5ea75dd0bdd570901ae..2e956f6ee824252c06b01fe5f8d85783ef4f4901 100644 (file)
@@ -29,12 +29,9 @@ void wxXmlResource::InitAllHandlers()
     AddHandler(new wxIconXmlHandler);
     AddHandler(new wxMenuXmlHandler);
     AddHandler(new wxMenuBarXmlHandler);
-
     AddHandler(new wxDialogXmlHandler);
     AddHandler(new wxPanelXmlHandler);
-
     AddHandler(new wxSizerXmlHandler);
-//Controls
     AddHandler(new wxButtonXmlHandler);
     AddHandler(new wxBitmapButtonXmlHandler);
     AddHandler(new wxStaticTextXmlHandler);
@@ -70,7 +67,6 @@ void wxXmlResource::InitAllHandlers()
 #if wxUSE_SCROLLBAR
     AddHandler(new wxScrollBarXmlHandler);
 #endif
-    
 #if wxUSE_RADIOBOX
     AddHandler(new wxRadioBoxXmlHandler);
     AddHandler(new wxRadioButtonXmlHandler);
@@ -92,6 +88,8 @@ void wxXmlResource::InitAllHandlers()
     AddHandler(new wxStaticLineXmlHandler);
 #endif
     AddHandler(new wxUnknownWidgetXmlHandler);
-
+#if wxUSE_DIRDLG
+    AddHandler(new wxGenericDirCtrlXmlHandler);
+#endif
     AddHandler(new wxFrameXmlHandler);
 }
diff --git a/contrib/utils/wxrcedit/df/wxGenericDirCtrl.df b/contrib/utils/wxrcedit/df/wxGenericDirCtrl.df
new file mode 100644 (file)
index 0000000..4def310
--- /dev/null
@@ -0,0 +1,6 @@
+node wxGenericDirCtrl
+var defaultfolder of text
+var filter of text
+var defaultfilter of integer
+var style of flags wxDIRCTRL_DIR_ONLY,wxDIRCTRL_3D_INTERNAL,wxDIRCTRL_SELECT_FIRST,wxDIRCTRL_SHOW_FILTERS
+derived from control
index 3abb40c2c6dc2a93de9c9d5eb55926a8c2754811..5382b6ffb0808dad57eb979edbaba641efcadfdb 100644 (file)
@@ -44,6 +44,7 @@
 #include "wx/xrc/xh_stlin.h"
 #include "wx/xrc/xh_bmp.h"
 #include "wx/xrc/xh_unkwn.h"
+#include "wx/xrc/xh_gdctl.h"
 #include "wx/xrc/xh_frame.h"
 
 #endif // _WX_XMLRES_H_
diff --git a/include/wx/xrc/xh_gdctl.h b/include/wx/xrc/xh_gdctl.h
new file mode 100644 (file)
index 0000000..548ecaf
--- /dev/null
@@ -0,0 +1,32 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        xh_gdctl.h
+// Purpose:     XML resource handler for wxGenericDirCtrl
+// Author:      Markus Greither
+// Created:     2002/01/20
+// RCS-ID:      $Id$
+// Copyright:   (c) 2002 Markus Greither
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_XH_GDCTL_H_
+#define _WX_XH_GDCTL_H_
+
+#ifdef __GNUG__
+#pragma interface "xh_gdctl.h"
+#endif
+
+#include "wx/xrc/xmlres.h"
+
+#if wxUSE_DIRDLG
+
+class WXXMLDLLEXPORT wxGenericDirCtrlXmlHandler : public wxXmlResourceHandler
+{
+public:
+    wxGenericDirCtrlXmlHandler();
+    virtual wxObject *DoCreateResource();
+    virtual bool CanHandle(wxXmlNode *node);
+};
+
+#endif
+
+#endif // _WX_XH_GDCTL_H_
index 4f92c3d6ceb18f2244d9bef7e663c9f9b96890df..729c6f1574fb722aad84e91cabdbc463aabe4f44 100644 (file)
@@ -24,7 +24,7 @@ HEADERS=xh_all.h xh_bttn.h xh_chckb.h xh_chckl.h xh_choic.h xh_combo.h \
         xh_radbt.h xh_radbx.h xh_sizer.h xh_slidr.h xh_spin.h xh_stbmp.h \
         xh_sttxt.h xh_text.h xh_listb.h xml.h xmlio.h xmlres.h xh_toolb.h \
         xh_bmpbt.h xh_cald.h xh_listc.h xh_scrol.h xh_stbox.h xh_tree.h \
-        xh_stlin.h xh_bmp.h xh_unkwn.h xh_frame.h
+        xh_stlin.h xh_bmp.h xh_unkwn.h xh_frame.h xh_gdctl.h
 
 OBJECTS=$(EXPAT_OBJECTS) \
         xml.o xmlbin.o xmlbinz.o xmlexpat.o xmlwrite.o xmlres.o xmlrsall.o \
@@ -33,7 +33,7 @@ OBJECTS=$(EXPAT_OBJECTS) \
         xh_radbx.o xh_sizer.o xh_slidr.o xh_spin.o xh_stbmp.o xh_sttxt.o \
         xh_text.o xh_listb.o xh_toolb.o xh_stlin.o xh_bmp.o xh_unkwn.o \
         xh_bmpbt.o xh_cald.o xh_listc.o xh_scrol.o xh_stbox.o xh_tree.o \
-        xh_frame.o
+        xh_frame.o xh_gdctl.o
 DEPFILES=$(OBJECTS:.o=.d)
 
 APPEXTRADEFS=-I$(top_srcdir)/contrib/include $(EXPAT_DEFS)
index 258e43c36868fd855ff30c343d0efdfafb3b1236..ba854f74e65c854addfa43612ebb1fd56c20da5f 100644 (file)
@@ -27,7 +27,7 @@ OBJECTS=$(EXPAT_OBJECTS) \
         xh_radbx.obj xh_sizer.obj xh_slidr.obj xh_spin.obj xh_stbmp.obj xh_sttxt.obj \
         xh_text.obj xh_listb.obj xh_toolb.obj xh_stlin.obj xh_bmp.obj \
         xh_bmpbt.obj xh_cald.obj xh_listc.obj xh_scrol.obj xh_stbox.obj \
-        xh_tree.obj xh_unkwn.obj xh_frame.obj
+        xh_tree.obj xh_unkwn.obj xh_frame.obj xh_gdctl.obj
 
 !include $(WXDIR)\src\makelib.b32
 
index 3a11d890ec28293f00385bee3aff4b2c45c9e20d..2fb8b309a5b2b0041974099f1631cfefc41945e5 100644 (file)
@@ -28,7 +28,7 @@ OBJECTS= $(XMLPARSEDIR_OBJECTS) $(XMLTOKDIR_OBJECTS) \
         xh_radbx.o xh_sizer.o xh_slidr.o xh_spin.o xh_stbmp.o xh_sttxt.o \
         xh_text.o xh_listb.o xh_toolb.o xh_stlin.o xh_bmp.o xh_unkwn.o \
         xh_bmpbt.o xh_cald.o xh_listc.o xh_scrol.o xh_stbox.o xh_tree.o \
-        xh_frame.o
+        xh_frame.o xh_gdctl.o
 
 include $(WXDIR)/src/makelib.g95
 
diff --git a/src/xrc/xh_gdctl.cpp b/src/xrc/xh_gdctl.cpp
new file mode 100644 (file)
index 0000000..9252d60
--- /dev/null
@@ -0,0 +1,62 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        xh_gdctl.cpp
+// Purpose:     XRC resource for wxGenericDirCtrl
+// Author:      Markus Greither
+// Created:     2002/01/20
+// RCS-ID:
+// Copyright:   (c) 2002 Markus Greither
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifdef __GNUG__
+#pragma implementation "xh_gdctl.h"
+#endif
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#include "wx/defs.h"
+#if wxUSE_DIRDLG
+
+#include "wx/textctrl.h"
+#include "wx/xrc/xh_gdctl.h"
+#include "wx/dirctrl.h"
+
+wxGenericDirCtrlXmlHandler::wxGenericDirCtrlXmlHandler()
+: wxXmlResourceHandler()
+{
+    ADD_STYLE(wxDIRCTRL_DIR_ONLY);
+    ADD_STYLE(wxDIRCTRL_3D_INTERNAL);
+    ADD_STYLE(wxDIRCTRL_SELECT_FIRST);
+    ADD_STYLE(wxDIRCTRL_SHOW_FILTERS);
+    AddWindowStyles();
+}
+
+wxObject *wxGenericDirCtrlXmlHandler::DoCreateResource()
+{
+    XRC_MAKE_INSTANCE(ctrl, wxGenericDirCtrl)
+    ctrl->Create(m_parentAsWindow,
+                 GetID(),
+                 GetText(wxT("defaultfolder")),
+                 GetPosition(), GetSize(),
+                 GetStyle(),
+                 GetText(wxT("filter")),
+                 (int)GetLong(wxT("defaultfilter")),
+                 GetName());
+
+    SetupWindow(ctrl);
+
+    return ctrl;
+}
+
+bool wxGenericDirCtrlXmlHandler::CanHandle(wxXmlNode *node)
+{
+    return IsOfClass(node, wxT("wxGenericDirCtrl"));
+}
+
+#endif
index 29deb1c4cad8cb0ea72ad5ea75dd0bdd570901ae..2e956f6ee824252c06b01fe5f8d85783ef4f4901 100644 (file)
@@ -29,12 +29,9 @@ void wxXmlResource::InitAllHandlers()
     AddHandler(new wxIconXmlHandler);
     AddHandler(new wxMenuXmlHandler);
     AddHandler(new wxMenuBarXmlHandler);
-
     AddHandler(new wxDialogXmlHandler);
     AddHandler(new wxPanelXmlHandler);
-
     AddHandler(new wxSizerXmlHandler);
-//Controls
     AddHandler(new wxButtonXmlHandler);
     AddHandler(new wxBitmapButtonXmlHandler);
     AddHandler(new wxStaticTextXmlHandler);
@@ -70,7 +67,6 @@ void wxXmlResource::InitAllHandlers()
 #if wxUSE_SCROLLBAR
     AddHandler(new wxScrollBarXmlHandler);
 #endif
-    
 #if wxUSE_RADIOBOX
     AddHandler(new wxRadioBoxXmlHandler);
     AddHandler(new wxRadioButtonXmlHandler);
@@ -92,6 +88,8 @@ void wxXmlResource::InitAllHandlers()
     AddHandler(new wxStaticLineXmlHandler);
 #endif
     AddHandler(new wxUnknownWidgetXmlHandler);
-
+#if wxUSE_DIRDLG
+    AddHandler(new wxGenericDirCtrlXmlHandler);
+#endif
     AddHandler(new wxFrameXmlHandler);
 }