From b008b592cce934305dfa2eaaae0cd824b0d1e1cb Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 14 Sep 2000 21:32:23 +0000 Subject: [PATCH] added new controls: wxBitmapButton, wxCalendarCtrl, wxListCtrl, wxScrollBar, wxStaticBox, wxTreeCtrl git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8363 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/xml/xh_all.h | 7 +++- contrib/include/wx/xml/xh_bmpbt.h | 30 ++++++++++++++ contrib/include/wx/xml/xh_cald.h | 29 +++++++++++++ contrib/include/wx/xml/xh_listc.h | 29 +++++++++++++ contrib/include/wx/xml/xh_scrol.h | 39 ++++++++++++++++++ contrib/include/wx/xml/xh_stbox.h | 30 ++++++++++++++ contrib/include/wx/xml/xh_tree.h | 29 +++++++++++++ contrib/src/xml/Makefile.in | 4 +- contrib/src/xml/makefile.b32 | 3 +- contrib/src/xml/makefile.g95 | 3 +- contrib/src/xml/makefile.vc | 4 +- contrib/src/xml/makefile.wat | 3 +- contrib/src/xml/wxXMLVC.dsp | 24 +++++++++++ contrib/src/xml/xh_bmpbt.cpp | 60 +++++++++++++++++++++++++++ contrib/src/xml/xh_cald.cpp | 60 +++++++++++++++++++++++++++ contrib/src/xml/xh_listc.cpp | 67 +++++++++++++++++++++++++++++++ contrib/src/xml/xh_scrol.cpp | 63 +++++++++++++++++++++++++++++ contrib/src/xml/xh_stbox.cpp | 52 ++++++++++++++++++++++++ contrib/src/xml/xh_tree.cpp | 57 ++++++++++++++++++++++++++ contrib/src/xml/xmlrsall.cpp | 32 ++++++++++++--- 20 files changed, 613 insertions(+), 12 deletions(-) create mode 100644 contrib/include/wx/xml/xh_bmpbt.h create mode 100644 contrib/include/wx/xml/xh_cald.h create mode 100644 contrib/include/wx/xml/xh_listc.h create mode 100644 contrib/include/wx/xml/xh_scrol.h create mode 100644 contrib/include/wx/xml/xh_stbox.h create mode 100644 contrib/include/wx/xml/xh_tree.h create mode 100644 contrib/src/xml/xh_bmpbt.cpp create mode 100644 contrib/src/xml/xh_cald.cpp create mode 100644 contrib/src/xml/xh_listc.cpp create mode 100644 contrib/src/xml/xh_scrol.cpp create mode 100644 contrib/src/xml/xh_stbox.cpp create mode 100644 contrib/src/xml/xh_tree.cpp diff --git a/contrib/include/wx/xml/xh_all.h b/contrib/include/wx/xml/xh_all.h index a46213b434..5f5d75442a 100644 --- a/contrib/include/wx/xml/xh_all.h +++ b/contrib/include/wx/xml/xh_all.h @@ -35,5 +35,10 @@ #include "wx/xml/xh_text.h" #include "wx/xml/xh_listb.h" #include "wx/xml/xh_toolb.h" - +#include "wx/xml/xh_bmpbt.h" +#include "wx/xml/xh_stbox.h" +#include "wx/xml/xh_scrol.h" +#include "wx/xml/xh_tree.h" +#include "wx/xml/xh_cald.h" +#include "wx/xml/xh_listc.h" #endif // _WX_XMLRES_H_ diff --git a/contrib/include/wx/xml/xh_bmpbt.h b/contrib/include/wx/xml/xh_bmpbt.h new file mode 100644 index 0000000000..7b12cc9719 --- /dev/null +++ b/contrib/include/wx/xml/xh_bmpbt.h @@ -0,0 +1,30 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: xh_bmpbt.h +// Purpose: XML resource handler for bitmap buttons +// Author: Brian Gavin +// Created: 2000/03/05 +// RCS-ID: $Id$ +// Copyright: (c) 2000 Brian Gavin +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_XH_BMPBT_H_ +#define _WX_XH_BMPBT_H_ + +#ifdef __GNUG__ +#pragma interface "xh_bmpbt.h" +#endif + +#include "wx/xml/xmlres.h" + + +class WXDLLEXPORT wxBitmapButtonXmlHandler : public wxXmlResourceHandler +{ + public: + wxBitmapButtonXmlHandler(); + virtual wxObject *DoCreateResource(); + virtual bool CanHandle(wxXmlNode *node); +}; + + +#endif // _WX_XH_BMPBT_H_ diff --git a/contrib/include/wx/xml/xh_cald.h b/contrib/include/wx/xml/xh_cald.h new file mode 100644 index 0000000000..adf0ecc7e3 --- /dev/null +++ b/contrib/include/wx/xml/xh_cald.h @@ -0,0 +1,29 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: xh_cald.h +// Purpose: XML resource handler for wxCalendarCtrl +// Author: Brian Gavin +// Created: 2000/09/09 +// RCS-ID: $Id$ +// Copyright: (c) 2000 Brian Gavin +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_XH_CALD_H_ +#define _WX_XH_CALD_H_ + +#ifdef __GNUG__ +#pragma interface "xh_cald.h" +#endif + +#include "wx/xml/xmlres.h" + +class WXDLLEXPORT wxCalendarCtrlXmlHandler : public wxXmlResourceHandler +{ + public: + wxCalendarCtrlXmlHandler(); + virtual wxObject *DoCreateResource(); + virtual bool CanHandle(wxXmlNode *node); +}; + + +#endif // _WX_XH_CALD_H_ diff --git a/contrib/include/wx/xml/xh_listc.h b/contrib/include/wx/xml/xh_listc.h new file mode 100644 index 0000000000..27de314e58 --- /dev/null +++ b/contrib/include/wx/xml/xh_listc.h @@ -0,0 +1,29 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: xh_listc.h +// Purpose: XML resource handler for wxCalendarCtrl +// Author: Brian Gavin +// Created: 2000/09/09 +// RCS-ID: $Id$ +// Copyright: (c) 2000 Brian Gavin +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_XH_LISTC_H_ +#define _WX_XH_LISTC_H_ + +#ifdef __GNUG__ +#pragma interface "xh_listc.h" +#endif + +#include "wx/xml/xmlres.h" + +class WXDLLEXPORT wxListCtrlXmlHandler : public wxXmlResourceHandler +{ + public: + wxListCtrlXmlHandler(); + virtual wxObject *DoCreateResource(); + virtual bool CanHandle(wxXmlNode *node); +}; + + +#endif // _WX_XH_LISTC_H_ diff --git a/contrib/include/wx/xml/xh_scrol.h b/contrib/include/wx/xml/xh_scrol.h new file mode 100644 index 0000000000..f5d2aec0b1 --- /dev/null +++ b/contrib/include/wx/xml/xh_scrol.h @@ -0,0 +1,39 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: xh_scrol.h +// Purpose: XML resource handler for wxScrollBar +// Author: Brian Gavin +// Created: 2000/09/09 +// RCS-ID: $Id$ +// Copyright: (c) 2000 Brian Gavin +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_XH_SCROL_H_ +#define _WX_XH_SCROL_H_ + +#ifdef __GNUG__ +#pragma interface "xh_scrol.h" +#endif + +#include "wx/xml/xmlres.h" +#include "wx/defs.h" + + + +class WXDLLEXPORT wxScrollBarXmlHandler : public wxXmlResourceHandler +{ + enum + { + wxSL_DEFAULT_VALUE = 0, + wxSL_DEFAULT_MIN = 0, + wxSL_DEFAULT_MAX = 100 + }; + + public: + wxScrollBarXmlHandler(); + virtual wxObject *DoCreateResource(); + virtual bool CanHandle(wxXmlNode *node); +}; + + +#endif // _WX_XH_SCROL_H_ diff --git a/contrib/include/wx/xml/xh_stbox.h b/contrib/include/wx/xml/xh_stbox.h new file mode 100644 index 0000000000..aae851cfc7 --- /dev/null +++ b/contrib/include/wx/xml/xh_stbox.h @@ -0,0 +1,30 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: xh_stbox.h +// Purpose: XML resource handler for wxStaticBox +// Author: Brian Gavin +// Created: 2000/09/00 +// RCS-ID: $Id$ +// Copyright: (c) 2000 Brian Gavin +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_XH_STBOX_H_ +#define _WX_XH_STBOX_H_ + +#ifdef __GNUG__ +#pragma interface "xh_stbox.h" +#endif + +#include "wx/xml/xmlres.h" + + +class WXDLLEXPORT wxStaticBoxXmlHandler : public wxXmlResourceHandler +{ + public: + wxStaticBoxXmlHandler(); + virtual wxObject *DoCreateResource(); + virtual bool CanHandle(wxXmlNode *node); +}; + + +#endif // _WX_XH_STBOX_H_ diff --git a/contrib/include/wx/xml/xh_tree.h b/contrib/include/wx/xml/xh_tree.h new file mode 100644 index 0000000000..e743380a15 --- /dev/null +++ b/contrib/include/wx/xml/xh_tree.h @@ -0,0 +1,29 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: xh_tree.h +// Purpose: XML resource handler for wxTreeCtrl +// Author: Brian Gavin +// Created: 2000/09/09 +// RCS-ID: $Id$ +// Copyright: (c) 2000 Brian Gavin +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_XH_TREE_H_ +#define _WX_XH_TREE_H_ + +#ifdef __GNUG__ +#pragma interface "xh_tree.h" +#endif + +#include "wx/xml/xmlres.h" + +class WXDLLEXPORT wxTreeCtrlXmlHandler : public wxXmlResourceHandler +{ + public: + wxTreeCtrlXmlHandler(); + virtual wxObject *DoCreateResource(); + virtual bool CanHandle(wxXmlNode *node); +}; + + +#endif // _WX_XH_TREE_H_ diff --git a/contrib/src/xml/Makefile.in b/contrib/src/xml/Makefile.in index 5ce54915cf..8c2286b7eb 100644 --- a/contrib/src/xml/Makefile.in +++ b/contrib/src/xml/Makefile.in @@ -16,7 +16,8 @@ HEADER_SUBDIR=xml HEADERS=xh_all.h xh_bttn.h xh_chckb.h xh_chckl.h xh_choic.h xh_combo.h \ xh_dlg.h xh_gauge.h xh_html.h xh_menu.h xh_notbk.h xh_panel.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_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 OBJECTS=xml.o xmlbin.o xmlbinz.o xmlpars.o xmlres.o xmlrsall.o \ @@ -24,6 +25,7 @@ OBJECTS=xml.o xmlbin.o xmlbinz.o xmlpars.o xmlres.o xmlrsall.o \ xh_gauge.o xh_html.o xh_menu.o xh_notbk.o xh_panel.o xh_radbt.o \ 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_bmpbt.o xh_cald.o xh_listc.o xh_scrol.o xh_stbox.o xh_tree.o APPEXTRADEFS=-I$(top_srcdir)/contrib/include diff --git a/contrib/src/xml/makefile.b32 b/contrib/src/xml/makefile.b32 index 2da7a27428..70ed81e963 100644 --- a/contrib/src/xml/makefile.b32 +++ b/contrib/src/xml/makefile.b32 @@ -17,7 +17,8 @@ OBJECTS=xml.obj xmlbin.obj xmlbinz.obj xmlpars.obj xmlres.obj xmlrsall.obj \ xh_bttn.obj xh_chckb.obj xh_chckl.obj xh_choic.obj xh_combo.obj xh_dlg.obj \ xh_gauge.obj xh_html.obj xh_menu.obj xh_notbk.obj xh_panel.obj xh_radbt.obj \ 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_text.obj xh_listb.obj xh_toolb.obj \ + xh_bmpbt.obj xh_cald.obj xh_listc.obj xh_scrol.obj xh_stbox.obj xh_tree.obj !include $(WXDIR)\src\makelib.b32 diff --git a/contrib/src/xml/makefile.g95 b/contrib/src/xml/makefile.g95 index 4b1e1a64d7..75d4bca0bf 100644 --- a/contrib/src/xml/makefile.g95 +++ b/contrib/src/xml/makefile.g95 @@ -16,7 +16,8 @@ OBJECTS=xml.o xmlbin.o xmlbinz.o xmlpars.o xmlres.o xmlrsall.o \ xh_bttn.o xh_chckb.o xh_chckl.o xh_choic.o xh_combo.o xh_dlg.o \ xh_gauge.o xh_html.o xh_menu.o xh_notbk.o xh_panel.o xh_radbt.o \ 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_text.o xh_listb.o xh_toolb.o \ + xh_bmpbt.o xh_cald.o xh_listc.o xh_scrol.o xh_stbox.o xh_tree.o include $(WXDIR)/src/makelib.g95 diff --git a/contrib/src/xml/makefile.vc b/contrib/src/xml/makefile.vc index bc8b3e3eb5..58baf13425 100644 --- a/contrib/src/xml/makefile.vc +++ b/contrib/src/xml/makefile.vc @@ -37,7 +37,9 @@ OBJECTS=$(D)\xml.obj $(D)\xmlbin.obj $(D)\xmlbinz.obj $(D)\xmlpars.obj $(D)\xmlr $(D)\xh_bttn.obj $(D)\xh_chckb.obj $(D)\xh_chckl.obj $(D)\xh_choic.obj $(D)\xh_combo.obj $(D)\xh_dlg.obj \ $(D)\xh_gauge.obj $(D)\xh_html.obj $(D)\xh_menu.obj $(D)\xh_notbk.obj $(D)\xh_panel.obj $(D)\xh_radbt.obj \ $(D)\xh_radbx.obj $(D)\xh_sizer.obj $(D)\xh_slidr.obj $(D)\xh_spin.obj $(D)\xh_stbmp.obj $(D)\xh_sttxt.obj \ - $(D)\xh_text.obj $(D)\xh_listb.obj $(D)\xh_toolb.obj + $(D)\xh_text.obj $(D)\xh_listb.obj $(D)\xh_toolb.obj \ + $(D)\xh_bmpbt.obj $(D)\xh_cald.obj $(D)\xh_listc.obj $(D)\xh_scrol.obj \ + $(D)\xh_stbox.obj $(D)\xh_tree.obj !include $(WXDIR)\src\makelib.vc diff --git a/contrib/src/xml/makefile.wat b/contrib/src/xml/makefile.wat index 883e948eec..545aa04728 100644 --- a/contrib/src/xml/makefile.wat +++ b/contrib/src/xml/makefile.wat @@ -16,7 +16,8 @@ OBJECTS=xml.obj xmlbin.obj xmlbinz.obj xmlpars.obj xmlres.obj xmlrsall.obj & xh_bttn.obj xh_chckb.obj xh_chckl.obj xh_choic.obj xh_combo.obj xh_dlg.obj & xh_gauge.obj xh_html.obj xh_menu.obj xh_notbk.obj xh_panel.obj xh_radbt.obj & 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_text.obj xh_listb.obj xh_toolb.obj & + xh_bmpbt.obj xh_cald.obj xh_listc.obj xh_scrol.obj xh_stbox.obj xh_tree.obj all: $(WXXMLLIB) diff --git a/contrib/src/xml/wxXMLVC.dsp b/contrib/src/xml/wxXMLVC.dsp index ac16ed5c16..64008fe50a 100644 --- a/contrib/src/xml/wxXMLVC.dsp +++ b/contrib/src/xml/wxXMLVC.dsp @@ -188,6 +188,30 @@ SOURCE=.\xmlres.cpp # End Source File # Begin Source File +SOURCE=.\xh_bmpbt.cpp +# End Source File +# Begin Source File + +SOURCE=.\xh_cald.cpp +# End Source File +# Begin Source File + +SOURCE=.\xh_listc.cpp +# End Source File +# Begin Source File + +SOURCE=.\xh_scrol.cpp +# End Source File +# Begin Source File + +SOURCE=.\xh_stbox.cpp +# End Source File +# Begin Source File + +SOURCE=.\xh_tree.cpp +# End Source File +# Begin Source File + SOURCE=.\xmlrsall.cpp # End Source File # End Target diff --git a/contrib/src/xml/xh_bmpbt.cpp b/contrib/src/xml/xh_bmpbt.cpp new file mode 100644 index 0000000000..cfc3fe5891 --- /dev/null +++ b/contrib/src/xml/xh_bmpbt.cpp @@ -0,0 +1,60 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: xh_bmpbt.cpp +// Purpose: XML resource for bitmap buttons +// Author: Brian Gavin +// Created: 2000/09/09 +// RCS-ID: $Id$ +// Copyright: (c) 2000 Brian Gavin +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifdef __GNUG__ +#pragma implementation "xh_bmpbt.h" +#endif + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/xml/xh_bmpbt.h" +#include + +wxBitmapButtonXmlHandler::wxBitmapButtonXmlHandler() +: wxXmlResourceHandler() +{ + ADD_STYLE(wxBU_AUTODRAW); + ADD_STYLE(wxBU_LEFT); + ADD_STYLE(wxBU_RIGHT); + ADD_STYLE(wxBU_TOP); + ADD_STYLE(wxBU_BOTTOM); + AddWindowStyles(); +} + + +wxObject *wxBitmapButtonXmlHandler::DoCreateResource() +{ + wxBitmapButton *button = new wxBitmapButton(m_ParentAsWindow, + GetID(), + GetBitmap(_T("bitmap"), GetSize()), + //GetBitmap(_T("bitmap")), + GetPosition(), GetSize(), + GetStyle(_T("style"), wxBU_AUTODRAW), + wxDefaultValidator, + GetName()); + if (GetBool(_T("default"), 0) == 1) button->SetDefault(); + SetupWindow(button); + + return button; +} + + + +bool wxBitmapButtonXmlHandler::CanHandle(wxXmlNode *node) +{ + return node->GetName() == _T("bitmapbutton"); +} + + diff --git a/contrib/src/xml/xh_cald.cpp b/contrib/src/xml/xh_cald.cpp new file mode 100644 index 0000000000..a17453184d --- /dev/null +++ b/contrib/src/xml/xh_cald.cpp @@ -0,0 +1,60 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: xh_cald.cpp +// Purpose: XML resource for wxCalendarCtrl +// Author: Brian Gavin +// Created: 2000/09/09 +// RCS-ID: $Id$ +// Copyright: (c) 2000 Brian Gavin +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifdef __GNUG__ +#pragma implementation "xh_cald.h" +#endif + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/xml/xh_cald.h" +#include "wx/calctrl.h" + + +wxCalendarCtrlXmlHandler::wxCalendarCtrlXmlHandler() +: wxXmlResourceHandler() +{ + ADD_STYLE(wxCAL_SUNDAY_FIRST); + ADD_STYLE(wxCAL_MONDAY_FIRST); + ADD_STYLE(wxCAL_SHOW_HOLIDAYS); + ADD_STYLE(wxCAL_NO_YEAR_CHANGE); + ADD_STYLE(wxCAL_NO_MONTH_CHANGE); + AddWindowStyles(); +} + + +wxObject *wxCalendarCtrlXmlHandler::DoCreateResource() +{ + wxCalendarCtrl *calendar = new wxCalendarCtrl(m_ParentAsWindow, + GetID(), + wxDefaultDateTime, + /*TODO: take it from resource*/ + GetPosition(), GetSize(), + GetStyle(), + GetName()); + + SetupWindow(calendar); + + return calendar; +} + + + +bool wxCalendarCtrlXmlHandler::CanHandle(wxXmlNode *node) +{ + return node->GetName() == _T("calendarctrl"); +} + + diff --git a/contrib/src/xml/xh_listc.cpp b/contrib/src/xml/xh_listc.cpp new file mode 100644 index 0000000000..332d9655f4 --- /dev/null +++ b/contrib/src/xml/xh_listc.cpp @@ -0,0 +1,67 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: xh_listc.cpp +// Purpose: XML resource for wxListCtrl +// Author: Brian Gavin +// Created: 2000/09/09 +// RCS-ID: $Id$ +// Copyright: (c) 2000 Brian Gavin +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifdef __GNUG__ +#pragma implementation "xh_listc.h" +#endif + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/xml/xh_listc.h" +#include "wx/listctrl.h" + + +wxListCtrlXmlHandler::wxListCtrlXmlHandler() +: wxXmlResourceHandler() +{ + ADD_STYLE(wxLC_LIST); + ADD_STYLE(wxLC_REPORT); + ADD_STYLE(wxLC_REPORT); + ADD_STYLE(wxLC_ICON); + ADD_STYLE(wxLC_SMALL_ICON); + ADD_STYLE(wxLC_ALIGN_TOP); + ADD_STYLE(wxLC_ALIGN_LEFT); + ADD_STYLE(wxLC_AUTOARRANGE); + ADD_STYLE(wxLC_USER_TEXT); + ADD_STYLE(wxLC_EDIT_LABELS); + ADD_STYLE(wxLC_NO_HEADER); + ADD_STYLE(wxLC_SINGLE_SEL); + ADD_STYLE(wxLC_SORT_ASCENDING); + ADD_STYLE(wxLC_SORT_DESCENDING); + AddWindowStyles(); +} + + +wxObject *wxListCtrlXmlHandler::DoCreateResource() +{ + wxListCtrl *list = new wxListCtrl(m_ParentAsWindow, + GetID(), + GetPosition(), GetSize(), + GetStyle(), + wxDefaultValidator, + GetName()); + /* TODO: columns definition */ + + SetupWindow(list); + + return list; +} + + + +bool wxListCtrlXmlHandler::CanHandle(wxXmlNode *node) +{ + return node->GetName() == _T("listctrl"); +} diff --git a/contrib/src/xml/xh_scrol.cpp b/contrib/src/xml/xh_scrol.cpp new file mode 100644 index 0000000000..6e7e2b19dc --- /dev/null +++ b/contrib/src/xml/xh_scrol.cpp @@ -0,0 +1,63 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: xh_scrol.cpp +// Purpose: XML resource for wxScrollBar +// Author: Brian Gavin +// Created: 2000/09/09 +// RCS-ID: $Id$ +// Copyright: (c) 2000 Brian Gavin +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifdef __GNUG__ +#pragma implementation "xh_scrol.h" +#endif + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/xml/xh_scrol.h" +#include "wx/scrolbar.h" + + +wxScrollBarXmlHandler::wxScrollBarXmlHandler() +: wxXmlResourceHandler() +{ + ADD_STYLE( wxSB_HORIZONTAL ); + ADD_STYLE( wxSB_VERTICAL ); + AddWindowStyles(); +} + +wxObject *wxScrollBarXmlHandler::DoCreateResource() +{ + wxScrollBar *control = new wxScrollBar(m_ParentAsWindow, + GetID(), + GetPosition(), GetSize(), + GetStyle(), + wxDefaultValidator, + GetName() + ); + control->SetScrollbar(GetLong( _T("value"), 0), + GetLong( _T("thumbsize"),1), + GetLong( _T("range"), 10), + GetLong( _T("pagesize"),1) + ); + + + SetupWindow(control); + + return control; +} + + + +bool wxScrollBarXmlHandler::CanHandle(wxXmlNode *node) +{ + return node->GetName() == _T("scrollbar"); +} + + + diff --git a/contrib/src/xml/xh_stbox.cpp b/contrib/src/xml/xh_stbox.cpp new file mode 100644 index 0000000000..3613fbc671 --- /dev/null +++ b/contrib/src/xml/xh_stbox.cpp @@ -0,0 +1,52 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: xh_stbox.cpp +// Purpose: XML resource for wxStaticBox +// Author: Brian Gavin +// Created: 2000/09/09 +// RCS-ID: $Id$ +// Copyright: (c) 2000 Brian Gavin +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifdef __GNUG__ +#pragma implementation "xh_stbox.h" +#endif + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/xml/xh_stbox.h" +#include "wx/statbox.h" + +wxStaticBoxXmlHandler::wxStaticBoxXmlHandler() +: wxXmlResourceHandler() +{ + AddWindowStyles(); +} + +wxObject *wxStaticBoxXmlHandler::DoCreateResource() +{ + wxStaticBox *box = new wxStaticBox(m_ParentAsWindow, + GetID(), + GetText(_T("label")), + GetPosition(), GetSize(), + GetStyle(), + GetName() + ); + SetupWindow(box); + + return box; +} + + + +bool wxStaticBoxXmlHandler::CanHandle(wxXmlNode *node) +{ + return node->GetName() == _T("staticbox"); +} + + diff --git a/contrib/src/xml/xh_tree.cpp b/contrib/src/xml/xh_tree.cpp new file mode 100644 index 0000000000..b10dc6ce94 --- /dev/null +++ b/contrib/src/xml/xh_tree.cpp @@ -0,0 +1,57 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: xh_tree.cpp +// Purpose: XML resource for wxTreeCtrl +// Author: Brian Gavin +// Created: 2000/09/09 +// RCS-ID: $Id$ +// Copyright: (c) 2000 Brian Gavin +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifdef __GNUG__ +#pragma implementation "xh_tree.h" +#endif + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/xml/xh_tree.h" +#include "wx/treectrl.h" + + +wxTreeCtrlXmlHandler::wxTreeCtrlXmlHandler() +: wxXmlResourceHandler() +{ + ADD_STYLE(wxTR_HAS_BUTTONS); + ADD_STYLE(wxTR_EDIT_LABELS); + ADD_STYLE(wxTR_MULTIPLE); + AddWindowStyles(); +} + + +wxObject *wxTreeCtrlXmlHandler::DoCreateResource() +{ + wxTreeCtrl *tree = new wxTreeCtrl(m_ParentAsWindow, + GetID(), + GetPosition(), GetSize(), + GetStyle(), + wxDefaultValidator, + GetName()); + + SetupWindow(tree); + + return tree; +} + + + +bool wxTreeCtrlXmlHandler::CanHandle(wxXmlNode *node) +{ + return node->GetName() == _T("treectrl"); +} + + diff --git a/contrib/src/xml/xmlrsall.cpp b/contrib/src/xml/xmlrsall.cpp index 19312097e9..584dc04ed4 100644 --- a/contrib/src/xml/xmlrsall.cpp +++ b/contrib/src/xml/xmlrsall.cpp @@ -30,7 +30,26 @@ void wxXmlResource::InitAllHandlers() AddHandler(new wxDialogXmlHandler); AddHandler(new wxPanelXmlHandler); + + AddHandler(new wxSizerXmlHandler); +//Controls AddHandler(new wxButtonXmlHandler); + AddHandler(new wxBitmapButtonXmlHandler); + AddHandler(new wxStaticTextXmlHandler); + AddHandler(new wxStaticBoxXmlHandler); + AddHandler(new wxStaticBitmapXmlHandler); + AddHandler(new wxTreeCtrlXmlHandler); + AddHandler(new wxCalendarCtrlXmlHandler); + AddHandler(new wxListCtrlXmlHandler); +#if CHECKLISTBOX + AddHandler(new wxCheckListXmlHandler); +#endif +#if wxUSE_CHOICE + AddHandler(new wxChoiceXmlHandler); +#endif +#if wxUSE_SLIDER + AddHandler(new wxSliderXmlHandler); +#endif #if wxUSE_GAUGE AddHandler(new wxGaugeXmlHandler); #endif @@ -46,9 +65,10 @@ void wxXmlResource::InitAllHandlers() #if wxUSE_SPINCTRL AddHandler(new wxSpinCtrlXmlHandler); #endif - AddHandler(new wxStaticTextXmlHandler); - AddHandler(new wxStaticBitmapXmlHandler); - AddHandler(new wxSliderXmlHandler); +#if wxUSE_SCROLLBAR + AddHandler(new wxScrollBarXmlHandler); +#endif + #if wxUSE_RADIOBOX AddHandler(new wxRadioBoxXmlHandler); AddHandler(new wxRadioButtonXmlHandler); @@ -56,9 +76,6 @@ void wxXmlResource::InitAllHandlers() #if wxUSE_COMBOBOX AddHandler(new wxComboBoxXmlHandler); #endif - AddHandler(new wxChoiceXmlHandler); - AddHandler(new wxCheckListXmlHandler); - AddHandler(new wxSizerXmlHandler); #if wxUSE_NOTEBOOK AddHandler(new wxNotebookXmlHandler); #endif @@ -69,4 +86,7 @@ void wxXmlResource::InitAllHandlers() #if wxUSE_TOOLBAR AddHandler(new wxToolBarXmlHandler); #endif + + + } -- 2.45.2