added wxGenericDirCtrl handler to XRC
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13759 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
6302ab2fa9
commit
995c1788f5
@ -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_
|
||||
|
32
contrib/include/wx/xrc/xh_gdctl.h
Normal file
32
contrib/include/wx/xrc/xh_gdctl.h
Normal file
@ -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_
|
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
62
contrib/src/xrc/xh_gdctl.cpp
Normal file
62
contrib/src/xrc/xh_gdctl.cpp
Normal file
@ -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
|
@ -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);
|
||||
}
|
||||
|
6
contrib/utils/wxrcedit/df/wxGenericDirCtrl.df
Normal file
6
contrib/utils/wxrcedit/df/wxGenericDirCtrl.df
Normal file
@ -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
|
@ -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_
|
||||
|
32
include/wx/xrc/xh_gdctl.h
Normal file
32
include/wx/xrc/xh_gdctl.h
Normal file
@ -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_
|
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
62
src/xrc/xh_gdctl.cpp
Normal file
62
src/xrc/xh_gdctl.cpp
Normal file
@ -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
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user