From f2fdc4d56e41711ce7c547484bf97aa0c2bd997a Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Wed, 17 May 2006 19:49:09 +0000 Subject: [PATCH] Rearranged widgets sample to show more and categorized widgets. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39190 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- autoconf_inc.m4 | 2 +- samples/widgets/Makefile.in | 19 +- samples/widgets/button.cpp | 8 +- samples/widgets/checkbox.cpp | 8 +- samples/widgets/combobox.cpp | 9 +- samples/widgets/datepick.cpp | 220 ++++++++++++++++ samples/widgets/gauge.cpp | 8 +- samples/widgets/icons/choicebk.xpm | 54 ++++ samples/widgets/icons/datepick.xpm | 54 ++++ samples/widgets/icons/listbook.xpm | 54 ++++ samples/widgets/icons/notebook.xpm | 44 ++-- samples/widgets/listbox.cpp | 9 +- samples/widgets/makefile.bcc | 18 +- samples/widgets/makefile.gcc | 20 +- samples/widgets/makefile.vc | 20 +- samples/widgets/makefile.wat | 22 +- samples/widgets/notebook.cpp | 408 ++++++++++++++++++++--------- samples/widgets/radiobox.cpp | 9 +- samples/widgets/slider.cpp | 8 +- samples/widgets/spinbtn.cpp | 9 +- samples/widgets/static.cpp | 8 +- samples/widgets/textctrl.cpp | 9 +- samples/widgets/widgets.bkl | 6 +- samples/widgets/widgets.cpp | 189 +++++++++---- samples/widgets/widgets.dsp | 76 +++--- samples/widgets/widgets.h | 68 ++++- samples/widgets/widgets.rc | 1 - 27 files changed, 1060 insertions(+), 300 deletions(-) create mode 100644 samples/widgets/datepick.cpp create mode 100644 samples/widgets/icons/choicebk.xpm create mode 100644 samples/widgets/icons/datepick.xpm create mode 100644 samples/widgets/icons/listbook.xpm delete mode 100644 samples/widgets/widgets.rc diff --git a/autoconf_inc.m4 b/autoconf_inc.m4 index 5010828eba..8e2b22efb2 100644 --- a/autoconf_inc.m4 +++ b/autoconf_inc.m4 @@ -206,7 +206,7 @@ dnl ### begin block 20_COND_MONOLITHIC_0_SHARED_1_USE_XRC_1[wx.bkl] ### COND_MONOLITHIC_0_SHARED_1_USE_XRC_1="" fi AC_SUBST(COND_MONOLITHIC_0_SHARED_1_USE_XRC_1) -dnl ### begin block 20_COND_MONOLITHIC_0_USE_MEDIA_1[../../samples/dialup/dialup.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/splash/splash.bkl,../../tests/test.bkl,wx.bkl] ### +dnl ### begin block 20_COND_MONOLITHIC_0_USE_MEDIA_1[../../samples/dialup/dialup.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/splash/splash.bkl,../../samples/widgets/widgets.bkl,../../tests/test.bkl,wx.bkl] ### COND_MONOLITHIC_0_USE_MEDIA_1="#" if test "x$MONOLITHIC" = "x0" -a "x$USE_MEDIA" = "x1" ; then COND_MONOLITHIC_0_USE_MEDIA_1="" diff --git a/samples/widgets/Makefile.in b/samples/widgets/Makefile.in index 8c4407bf70..6398cbcb27 100644 --- a/samples/widgets/Makefile.in +++ b/samples/widgets/Makefile.in @@ -29,7 +29,9 @@ TOOLKIT_LOWERCASE = @TOOLKIT_LOWERCASE@ TOOLKIT_VERSION = @TOOLKIT_VERSION@ TOOLCHAIN_FULLNAME = @TOOLCHAIN_FULLNAME@ EXTRALIBS = @EXTRALIBS@ +EXTRALIBS_HTML = @EXTRALIBS_HTML@ EXTRALIBS_GUI = @EXTRALIBS_GUI@ +EXTRALIBS_SDL = @EXTRALIBS_SDL@ HOST_SUFFIX = @HOST_SUFFIX@ SAMPLES_RPATH_FLAG = @SAMPLES_RPATH_FLAG@ SAMPLES_RPATH_POSTLINK = @SAMPLES_RPATH_POSTLINK@ @@ -48,6 +50,7 @@ WIDGETS_OBJECTS = \ widgets_button.o \ widgets_checkbox.o \ widgets_combobox.o \ + widgets_datepick.o \ widgets_gauge.o \ widgets_listbox.o \ widgets_notebook.o \ @@ -63,6 +66,7 @@ WIDGETS_OBJECTS = \ @COND_DEPS_TRACKING_0@CXXC = $(CXX) @COND_DEPS_TRACKING_1@CXXC = $(top_builddir)./bk-deps $(CXX) +@COND_USE_PLUGINS_0@PLUGIN_ADV_EXTRALIBS = $(EXTRALIBS_SDL) @COND_USE_GUI_0@PORTNAME = base @COND_USE_GUI_1@PORTNAME = $(TOOLKIT_LOWERCASE)$(TOOLKIT_VERSION) @COND_TOOLKIT_MAC@WXBASEPORT = _carbon @@ -106,13 +110,19 @@ COND_PLATFORM_OS2_1___widgets___os2_emxbindcmd = $(NM) widgets$(EXEEXT) | if \ @COND_TOOLKIT_COCOA@ widgets.app/Contents/PkgInfo @COND_TOOLKIT_MAC@____widgets_BUNDLE_TGT_REF_DEP = \ @COND_TOOLKIT_MAC@ widgets.app/Contents/PkgInfo +COND_MONOLITHIC_0___WXLIB_ADV_p = \ + -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_adv-$(WX_RELEASE)$(HOST_SUFFIX) +@COND_MONOLITHIC_0@__WXLIB_ADV_p = $(COND_MONOLITHIC_0___WXLIB_ADV_p) +COND_MONOLITHIC_0___WXLIB_HTML_p = \ + -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_html-$(WX_RELEASE)$(HOST_SUFFIX) +@COND_MONOLITHIC_0@__WXLIB_HTML_p = $(COND_MONOLITHIC_0___WXLIB_HTML_p) COND_MONOLITHIC_0___WXLIB_CORE_p = \ -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core-$(WX_RELEASE)$(HOST_SUFFIX) @COND_MONOLITHIC_0@__WXLIB_CORE_p = $(COND_MONOLITHIC_0___WXLIB_CORE_p) COND_MONOLITHIC_0___WXLIB_BASE_p = \ -lwx_base$(WXBASEPORT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX) @COND_MONOLITHIC_0@__WXLIB_BASE_p = $(COND_MONOLITHIC_0___WXLIB_BASE_p) -@COND_PLATFORM_WIN32_1@__widgets___win32rc = widgets_widgets_rc.o +@COND_PLATFORM_WIN32_1@__widgets___win32rc = widgets_sample_rc.o COND_MONOLITHIC_1___WXLIB_MONO_p = \ -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX) @COND_MONOLITHIC_1@__WXLIB_MONO_p = $(COND_MONOLITHIC_1___WXLIB_MONO_p) @@ -161,7 +171,7 @@ distclean: clean rm -f config.cache config.log config.status bk-deps bk-make-pch shared-ld-sh Makefile widgets$(EXEEXT): $(WIDGETS_OBJECTS) $(__widgets___win32rc) - $(CXX) -o $@ $(WIDGETS_OBJECTS) $(LDFLAGS) -L$(LIBDIRNAME) $(LDFLAGS_GUI) $(SAMPLES_RPATH_FLAG) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(__LIB_ZLIB_p) $(__LIB_ODBC_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(EXTRALIBS_FOR_GUI) + $(CXX) -o $@ $(WIDGETS_OBJECTS) $(LDFLAGS) -L$(LIBDIRNAME) $(LDFLAGS_GUI) $(SAMPLES_RPATH_FLAG) $(__WXLIB_ADV_p) $(PLUGIN_ADV_EXTRALIBS) $(__WXLIB_HTML_p) $(EXTRALIBS_HTML) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_ODBC_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(__widgets___mac_rezcmd) $(__widgets___mac_setfilecmd) $(__widgets___os2_emxbindcmd) @@ -198,6 +208,9 @@ widgets_checkbox.o: $(srcdir)/checkbox.cpp widgets_combobox.o: $(srcdir)/combobox.cpp $(CXXC) -c -o $@ $(WIDGETS_CXXFLAGS) $(srcdir)/combobox.cpp +widgets_datepick.o: $(srcdir)/datepick.cpp + $(CXXC) -c -o $@ $(WIDGETS_CXXFLAGS) $(srcdir)/datepick.cpp + widgets_gauge.o: $(srcdir)/gauge.cpp $(CXXC) -c -o $@ $(WIDGETS_CXXFLAGS) $(srcdir)/gauge.cpp @@ -225,7 +238,7 @@ widgets_textctrl.o: $(srcdir)/textctrl.cpp widgets_widgets.o: $(srcdir)/widgets.cpp $(CXXC) -c -o $@ $(WIDGETS_CXXFLAGS) $(srcdir)/widgets.cpp -widgets_widgets_rc.o: $(srcdir)/widgets.rc +widgets_sample_rc.o: $(srcdir)/../sample.rc $(WINDRES) -i$< -o$@ --define __WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p_2) $(__EXCEPTIONS_DEFINE_p_2) $(__RTTI_DEFINE_p_2) $(__THREAD_DEFINE_p_2) --include-dir $(srcdir) $(__DLLFLAG_p_2) --include-dir $(srcdir)/../../samples $(__RCDEFDIR_p_1) --include-dir $(top_srcdir)/include diff --git a/samples/widgets/button.cpp b/samples/widgets/button.cpp index 8e855553a3..1056653e38 100644 --- a/samples/widgets/button.cpp +++ b/samples/widgets/button.cpp @@ -79,7 +79,7 @@ enum class ButtonWidgetsPage : public WidgetsPage { public: - ButtonWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist); + ButtonWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist); virtual ~ButtonWidgetsPage(){}; virtual wxControl *GetWidget() const { return m_button; } @@ -154,9 +154,11 @@ END_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(ButtonWidgetsPage, _T("Button")); +IMPLEMENT_WIDGETS_PAGE(ButtonWidgetsPage, _T("Button"), + (int)wxPlatform(GENERIC_CTRLS).If(wxMSW,NATIVE_CTRLS) + ); -ButtonWidgetsPage::ButtonWidgetsPage(wxBookCtrlBase *book, +ButtonWidgetsPage::ButtonWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) : WidgetsPage(book) { diff --git a/samples/widgets/checkbox.cpp b/samples/widgets/checkbox.cpp index 5b41e219f3..c683f6774c 100644 --- a/samples/widgets/checkbox.cpp +++ b/samples/widgets/checkbox.cpp @@ -73,7 +73,7 @@ enum class CheckBoxWidgetsPage : public WidgetsPage { public: - CheckBoxWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist); + CheckBoxWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist); virtual ~CheckBoxWidgetsPage(){}; virtual wxControl *GetWidget() const { return m_checkbox; } @@ -148,9 +148,11 @@ END_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(CheckBoxWidgetsPage, wxT("CheckBox")); +IMPLEMENT_WIDGETS_PAGE(CheckBoxWidgetsPage, wxT("CheckBox"), + (int)wxPlatform(GENERIC_CTRLS).If(wxMSW,NATIVE_CTRLS) + ); -CheckBoxWidgetsPage::CheckBoxWidgetsPage(wxBookCtrlBase *book, +CheckBoxWidgetsPage::CheckBoxWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) : WidgetsPage(book) { diff --git a/samples/widgets/combobox.cpp b/samples/widgets/combobox.cpp index d3e703bea4..04c4214933 100644 --- a/samples/widgets/combobox.cpp +++ b/samples/widgets/combobox.cpp @@ -85,7 +85,7 @@ enum class ComboboxWidgetsPage : public WidgetsPage { public: - ComboboxWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist); + ComboboxWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist); virtual wxControl *GetWidget() const { return m_combobox; } virtual void RecreateWidget() { CreateCombo(); } @@ -192,9 +192,12 @@ END_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(ComboboxWidgetsPage, _T("Combobox")); +IMPLEMENT_WIDGETS_PAGE(ComboboxWidgetsPage, _T("Combobox"), + (int)wxPlatform(GENERIC_CTRLS).If(wxMSW,NATIVE_CTRLS) + | WITH_ITEMS_CTRLS | COMBO_CTRLS + ); -ComboboxWidgetsPage::ComboboxWidgetsPage(wxBookCtrlBase *book, +ComboboxWidgetsPage::ComboboxWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) : WidgetsPage(book) { diff --git a/samples/widgets/datepick.cpp b/samples/widgets/datepick.cpp new file mode 100644 index 0000000000..89e9173e2e --- /dev/null +++ b/samples/widgets/datepick.cpp @@ -0,0 +1,220 @@ +///////////////////////////////////////////////////////////////////////////// +// Program: wxWidgets Widgets Sample +// Name: datepick.cpp +// Purpose: Part of the widgets sample showing date picker +// Author: Dimitri Schoolwerth, Vadim Zeitlin +// Created: 27 Sep 2003 +// Id: $Id$ +// Copyright: (c) 2003 wxWindows team +// License: wxWindows license +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// for compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_DATEPICKCTRL + +// for all others, include the necessary headers +#ifndef WX_PRECOMP + #include "wx/app.h" + #include "wx/log.h" + + #include "wx/bitmap.h" + #include "wx/button.h" + #include "wx/checkbox.h" + #include "wx/radiobox.h" + #include "wx/statbox.h" + #include "wx/textctrl.h" + + #include "wx/sizer.h" +#endif + +#include "wx/datectrl.h" + +#include "widgets.h" + +#include "icons/datepick.xpm" + +// ---------------------------------------------------------------------------- +// constants +// ---------------------------------------------------------------------------- + +// control ids +enum +{ + DatePickerPage_Reset = wxID_HIGHEST, + DatePickerPage_Day, + DatePickerPage_Month, + DatePickerPage_Year, + DatePickerPage_Set, + DatePickerPage_Picker +}; + +// ---------------------------------------------------------------------------- +// CheckBoxWidgetsPage +// ---------------------------------------------------------------------------- + +class DatePickerWidgetsPage : public WidgetsPage +{ +public: + DatePickerWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist); + virtual ~DatePickerWidgetsPage(){}; + + virtual wxControl *GetWidget() const { return m_datePicker; } + virtual void RecreateWidget() { CreateDatePicker(); } + +protected: + // event handlers + void OnButtonSet(wxCommandEvent& event); + + void OnButtonReset(wxCommandEvent& event); + + // reset the date picker parameters + void Reset(); + + // (re)create the date picker + void CreateDatePicker(); + + // the controls + // ------------ + + // the checkbox itself and the sizer it is in + wxDatePickerCtrl *m_datePicker; + wxSizer *m_sizerDatePicker; + + wxTextCtrl *m_day; + wxTextCtrl *m_month; + wxTextCtrl *m_year; + + // the text entries for command parameters + wxTextCtrl *m_textLabel; + +private: + DECLARE_EVENT_TABLE() + DECLARE_WIDGETS_PAGE(DatePickerWidgetsPage) +}; + +// ---------------------------------------------------------------------------- +// event tables +// ---------------------------------------------------------------------------- + +BEGIN_EVENT_TABLE(DatePickerWidgetsPage, WidgetsPage) + EVT_BUTTON(DatePickerPage_Reset, DatePickerWidgetsPage::OnButtonReset) + EVT_BUTTON(DatePickerPage_Set, DatePickerWidgetsPage::OnButtonSet) +END_EVENT_TABLE() + +// ============================================================================ +// implementation +// ============================================================================ + +IMPLEMENT_WIDGETS_PAGE(DatePickerWidgetsPage, wxT("DatePicker"), + (int)wxPlatform(GENERIC_CTRLS).If(wxMSW,NATIVE_CTRLS) + | PICKER_CTRLS + ); + +DatePickerWidgetsPage::DatePickerWidgetsPage(WidgetsBookCtrl *book, + wxImageList *imaglist) + :WidgetsPage(book) +{ + imaglist->Add(wxBitmap(datepick_xpm)); + + wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); + + // left pane + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("Date details")); + + wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); + + sizerLeft->Add( CreateSizerWithTextAndLabel( wxT("&Day"), DatePickerPage_Day , &m_day ), + wxALL | wxALIGN_LEFT , 5 ); + + sizerLeft->Add( CreateSizerWithTextAndLabel( wxT("&Month"), DatePickerPage_Month , &m_month ), + wxALL | wxALIGN_LEFT , 5 ); + + sizerLeft->Add( CreateSizerWithTextAndLabel( wxT("&Year"), DatePickerPage_Year , &m_year ), + wxALL | wxALIGN_LEFT , 5 ); + + sizerLeft->Add( new wxButton( this, wxID_ANY, wxT("&Set date") ), + wxALL , 5 ); + + // right pane + wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL); + + m_datePicker = new wxDatePickerCtrl(this, DatePickerPage_Picker); + + sizerRight->Add(0, 0, 1, wxCENTRE); + sizerRight->Add(m_datePicker, 1, wxCENTRE); + sizerRight->Add(0, 0, 1, wxCENTRE); + sizerRight->SetMinSize(150, 0); + m_sizerDatePicker = sizerRight; // save it to modify it later + + // the 3 panes panes compose the window + sizerTop->Add(sizerLeft, 0, (wxALL & ~wxLEFT), 10); + sizerTop->Add(sizerRight, 1, wxGROW | (wxALL & ~wxRIGHT), 10); + + // final initializations + Reset(); + + SetSizer(sizerTop); + + sizerTop->Fit(this); +} + +void DatePickerWidgetsPage::Reset() +{ + const wxDateTime today = wxDateTime::Today(); + + m_datePicker->SetValue(today); + m_day->SetValue(wxString::Format(_T("%d"), today.GetDay())); + m_month->SetValue(wxString::Format(_T("%d"), today.GetMonth())); + m_year->SetValue(wxString::Format(_T("%d"), today.GetYear())); +} + +void DatePickerWidgetsPage::CreateDatePicker() +{ + const wxDateTime value = m_datePicker->GetValue(); + + size_t count = m_sizerDatePicker->GetChildren().GetCount(); + for ( size_t n = 0; n < count; n++ ) + { + m_sizerDatePicker->Remove(0); + } + + delete m_datePicker; + + m_datePicker = new wxDatePickerCtrl(this, DatePickerPage_Picker, value); + + m_sizerDatePicker->Add(0, 0, 1, wxCENTRE); + m_sizerDatePicker->Add(m_datePicker, 1, wxCENTRE); + m_sizerDatePicker->Add(0, 0, 1, wxCENTRE); + m_sizerDatePicker->Layout(); +} + +// ---------------------------------------------------------------------------- +// event handlers +// ---------------------------------------------------------------------------- + +void DatePickerWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event)) +{ + Reset(); + + CreateDatePicker(); +} + +void DatePickerWidgetsPage::OnButtonSet(wxCommandEvent& WXUNUSED(event)) +{ +} + +#endif // wxUSE_DATEPICKCTRL diff --git a/samples/widgets/gauge.cpp b/samples/widgets/gauge.cpp index 5b950ee073..5c779721cb 100644 --- a/samples/widgets/gauge.cpp +++ b/samples/widgets/gauge.cpp @@ -71,7 +71,7 @@ enum class GaugeWidgetsPage : public WidgetsPage { public: - GaugeWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist); + GaugeWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist); virtual ~GaugeWidgetsPage(); virtual wxControl *GetWidget() const { return m_gauge; } @@ -157,9 +157,11 @@ END_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(GaugeWidgetsPage, _T("Gauge")); +IMPLEMENT_WIDGETS_PAGE(GaugeWidgetsPage, _T("Gauge"), + (int)wxPlatform(GENERIC_CTRLS).If(wxMSW,NATIVE_CTRLS) + ); -GaugeWidgetsPage::GaugeWidgetsPage(wxBookCtrlBase *book, +GaugeWidgetsPage::GaugeWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) :WidgetsPage(book) { diff --git a/samples/widgets/icons/choicebk.xpm b/samples/widgets/icons/choicebk.xpm new file mode 100644 index 0000000000..7bfc01fcf3 --- /dev/null +++ b/samples/widgets/icons/choicebk.xpm @@ -0,0 +1,54 @@ +/* XPM */ +static char *choicebk_xpm[] = { +/* columns rows colors chars-per-pixel */ +"32 32 16 1", +" c Gray0", +". c #808000", +"X c #000080", +"o c #808080", +"O c #000000", +"+ c #808000", +"@ c #000080", +"# c none", +"$ c #808080", +"% c Red", +"& c Green", +"* c Yellow", +"= c Blue", +"- c Magenta", +"; c Cyan", +": c Gray100", +/* pixels */ +"################################", +"################################", +"################################", +"################################", +"################################", +"## ##", +"## ################ ##", +"## ################ ##### ##", +"## ################ ### ##", +"## ################ # ##", +"## ################ ##", +"## ##", +"################################", +"######$$$$$$$$$$$$$$$$$$$$$$$$##", +"######$::::::::::::::::::::::$##", +"####$$$$$$$$$$$$$$$$$$$$$$$$:$##", +"####$::::::::::::::::::::::$:$##", +"## :$:$##", +"## :::::::::::::::::::::: :$:$##", +"## :::::::::::::::::::::: :$:$##", +"## :::::::::::::::::::::: :$:$##", +"## :::::::::::::::::::::: :$:$##", +"## :::::::::::::::::::::: :$$$##", +"## :::::::::::::::::::::: :$####", +"## :::::::::::::::::::::: $$####", +"## :::::::::::::::::::::: ######", +"## ######", +"################################", +"################################", +"################################", +"################################", +"################################" +}; diff --git a/samples/widgets/icons/datepick.xpm b/samples/widgets/icons/datepick.xpm new file mode 100644 index 0000000000..85ee5c70a2 --- /dev/null +++ b/samples/widgets/icons/datepick.xpm @@ -0,0 +1,54 @@ +/* XPM */ +static char *datepick_xpm[] = { +/* columns rows colors chars-per-pixel */ +"32 32 16 1", +" c Gray0", +". c #808000", +"X c #000080", +"o c #808080", +"O c #000000", +"+ c #808000", +"@ c #000080", +"# c none", +"$ c #808080", +"% c Red", +"& c Green", +"* c Yellow", +"= c Blue", +"- c Magenta", +"; c Cyan", +": c Gray100", +/* pixels */ +"################################", +"################################", +"################################", +"################################", +"################################", +"## ##", +"## ::::::::::::::$::::::::::: ##", +"## :: ::::: ::::$:: ::: : : ##", +"## : :: ::: :::$$: :: :: : : ##", +"## : :: :: : :::$:: :: :: : ##", +"## : :: :::: ::$$:: :: :::: : ##", +"## :: ::::: ::$:::: ::::: : ##", +"## ::::::::::::$::::::::::::: ##", +"## ##", +"################################", +"## ##", +"## :::::::::::::::::::::::::: ##", +"## :::::::::::::::::::::::::: ##", +"## :: :: ::$ ::$$:: ::%-:: ##", +"## :: $::$ :: $:: $::$ ::%%:: ##", +"## :::::::::::::::::::::::::: ##", +"## :::::::::::::::::::::::::: ##", +"## :: $::$ ::$$::$ ::$ ::%%:: ##", +"## ::$ :: $:: :: $:: ::-%:: ##", +"## :::::::::::::::::::::::::: ##", +"## :::::::::::::::::::::::::: ##", +"## ##", +"################################", +"################################", +"################################", +"################################", +"################################" +}; diff --git a/samples/widgets/icons/listbook.xpm b/samples/widgets/icons/listbook.xpm new file mode 100644 index 0000000000..db21dd7066 --- /dev/null +++ b/samples/widgets/icons/listbook.xpm @@ -0,0 +1,54 @@ +/* XPM */ +static char *listbook_xpm[] = { +/* columns rows colors chars-per-pixel */ +"32 32 16 1", +" c Gray0", +". c #808000", +"X c #000080", +"o c #808080", +"O c #000000", +"+ c #808000", +"@ c #000080", +"# c none", +"$ c #808080", +"% c Red", +"& c Green", +"* c Yellow", +"= c Blue", +"- c Magenta", +"; c Cyan", +": c Gray100", +/* pixels */ +"################################", +"################################", +"################################", +"################################", +"################################", +"## ##", +"## :::::::: :::::::: :::::::: ##", +"## ::$$$$:: :$$::$$: ::$$$$:: ##", +"## :$$$$$$: :::$$::: :$$::$$: ##", +"## :::::::: :::::::: :::::::: ##", +"## : : : : : : : : : ##", +"## :::::::: :::::::: :::::::: ##", +"## ##", +"################################", +"######$$$$$$$$$$$$$$$$$$$$$$$$##", +"######$::::::::::::::::::::::$##", +"####$$$$$$$$$$$$$$$$$$$$$$$$:$##", +"####$::::::::::::::::::::::$:$##", +"## :$:$##", +"## :::::::::::::::::::::: :$:$##", +"## :::::::::::::::::::::: :$:$##", +"## :::::::::::::::::::::: :$:$##", +"## :::::::::::::::::::::: :$:$##", +"## :::::::::::::::::::::: :$$$##", +"## :::::::::::::::::::::: :$####", +"## :::::::::::::::::::::: $$####", +"## :::::::::::::::::::::: ######", +"## ######", +"################################", +"################################", +"################################", +"################################" +}; diff --git a/samples/widgets/icons/notebook.xpm b/samples/widgets/icons/notebook.xpm index 2be2c47432..7b68b5a0ab 100644 --- a/samples/widgets/icons/notebook.xpm +++ b/samples/widgets/icons/notebook.xpm @@ -24,28 +24,28 @@ static char *notebook_xpm[] = { "################################", "################################", "################################", -"### # # ###", -"## :::::::$ :::::::$ :::::::$ ##", -"## :######$ :######$ :######$ ##", -"## :######$ :######$ :######$ ##", -"## :######$ ##", -"## :########################$ ##", -"## :########################$ ##", -"## :########################$ ##", -"## :########################$ ##", -"## :########################$ ##", -"## :########################$ ##", -"## :########################$ ##", -"## :########################$ ##", -"## :########################$ ##", -"## :########################$ ##", -"## :########################$ ##", -"## :########################$ ##", -"## :########################$ ##", -"## $$$$$$$$$$$$$$$$$$$$$$$$$$ ##", -"## ##", -"################################", -"################################", +"###################$$$$$$$######", +"##################$:::::::$#####", +"###########$$$$$$$$:::::::$#####", +"##########$:::::::$:::::::$#####", +"### $:::::::$:::::::$#####", +"## ::::::: :::::::$:::::::$$$$##", +"## ::::::: :::::::$::::::::::$##", +"## ::::::: :::::::$$$$$$$$$$:$##", +"## ::::::: ::::::::::::::::$:$##", +"## ::::::: :$:$##", +"## :::::::::::::::::::::: :$:$##", +"## :::::::::::::::::::::: :$:$##", +"## :::::::::::::::::::::: :$:$##", +"## :::::::::::::::::::::: :$:$##", +"## :::::::::::::::::::::: :$:$##", +"## :::::::::::::::::::::: :$:$##", +"## :::::::::::::::::::::: :$:$##", +"## :::::::::::::::::::::: :$$$##", +"## :::::::::::::::::::::: :$####", +"## :::::::::::::::::::::: $$####", +"## :::::::::::::::::::::: ######", +"## ######", "################################", "################################", "################################", diff --git a/samples/widgets/listbox.cpp b/samples/widgets/listbox.cpp index 82db404606..0a40eb74e1 100644 --- a/samples/widgets/listbox.cpp +++ b/samples/widgets/listbox.cpp @@ -76,7 +76,7 @@ enum class ListboxWidgetsPage : public WidgetsPage { public: - ListboxWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist); + ListboxWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist); virtual wxControl *GetWidget() const { return m_lbox; } virtual void RecreateWidget() { CreateLbox(); } @@ -193,9 +193,12 @@ END_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(ListboxWidgetsPage, _T("Listbox")); +IMPLEMENT_WIDGETS_PAGE(ListboxWidgetsPage, _T("Listbox"), + (int)wxPlatform(GENERIC_CTRLS).If(wxMSW,NATIVE_CTRLS) + | WITH_ITEMS_CTRLS + ); -ListboxWidgetsPage::ListboxWidgetsPage(wxBookCtrlBase *book, +ListboxWidgetsPage::ListboxWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) : WidgetsPage(book) { diff --git a/samples/widgets/makefile.bcc b/samples/widgets/makefile.bcc index 15a9645509..f8742ac09e 100644 --- a/samples/widgets/makefile.bcc +++ b/samples/widgets/makefile.bcc @@ -37,6 +37,7 @@ WIDGETS_OBJECTS = \ $(OBJS)\widgets_button.obj \ $(OBJS)\widgets_checkbox.obj \ $(OBJS)\widgets_combobox.obj \ + $(OBJS)\widgets_datepick.obj \ $(OBJS)\widgets_gauge.obj \ $(OBJS)\widgets_listbox.obj \ $(OBJS)\widgets_notebook.obj \ @@ -167,6 +168,14 @@ __DLLFLAG_p = -DWXUSINGDLL __DLLFLAG_p_1 = -dWXUSINGDLL !endif !if "$(MONOLITHIC)" == "0" +__WXLIB_ADV_p = \ + wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_adv.lib +!endif +!if "$(MONOLITHIC)" == "0" +__WXLIB_HTML_p = \ + wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_html.lib +!endif +!if "$(MONOLITHIC)" == "0" __WXLIB_CORE_p = \ wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core.lib !endif @@ -223,9 +232,9 @@ clean: -if exist $(OBJS)\widgets.ilf del $(OBJS)\widgets.ilf -if exist $(OBJS)\widgets.ils del $(OBJS)\widgets.ils -$(OBJS)\widgets.exe: $(WIDGETS_OBJECTS) $(OBJS)\widgets_widgets.res +$(OBJS)\widgets.exe: $(WIDGETS_OBJECTS) $(OBJS)\widgets_sample.res ilink32 -Tpe -q $(LDFLAGS) -L$(BCCDIR)\lib -L$(BCCDIR)\lib\psdk $(__DEBUGINFO) -L$(LIBDIRNAME) -aa @&&| - c0w32.obj $(WIDGETS_OBJECTS),$@,, $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) ole2w32.lib oleacc.lib odbc32.lib import32.lib cw32$(__THREADSFLAG_5)$(__RUNTIME_LIBS_8).lib,, $(OBJS)\widgets_widgets.res + c0w32.obj $(WIDGETS_OBJECTS),$@,, $(__WXLIB_ADV_p) $(__WXLIB_HTML_p) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) ole2w32.lib oleacc.lib odbc32.lib import32.lib cw32$(__THREADSFLAG_5)$(__RUNTIME_LIBS_8).lib,, $(OBJS)\widgets_sample.res | $(OBJS)\widgets_button.obj: .\button.cpp @@ -237,6 +246,9 @@ $(OBJS)\widgets_checkbox.obj: .\checkbox.cpp $(OBJS)\widgets_combobox.obj: .\combobox.cpp $(CXX) -q -c -P -o$@ $(WIDGETS_CXXFLAGS) $** +$(OBJS)\widgets_datepick.obj: .\datepick.cpp + $(CXX) -q -c -P -o$@ $(WIDGETS_CXXFLAGS) $** + $(OBJS)\widgets_gauge.obj: .\gauge.cpp $(CXX) -q -c -P -o$@ $(WIDGETS_CXXFLAGS) $** @@ -264,6 +276,6 @@ $(OBJS)\widgets_textctrl.obj: .\textctrl.cpp $(OBJS)\widgets_widgets.obj: .\widgets.cpp $(CXX) -q -c -P -o$@ $(WIDGETS_CXXFLAGS) $** -$(OBJS)\widgets_widgets.res: .\widgets.rc +$(OBJS)\widgets_sample.res: .\..\sample.rc brcc32 -32 -r -fo$@ -i$(BCCDIR)\include -d__WXMSW__ $(__WXUNIV_DEFINE_p_1) $(__DEBUG_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) $(__UNICODE_DEFINE_p_1) $(__MSLU_DEFINE_p_1) -i$(SETUPHDIR) -i.\..\..\include -i. $(__DLLFLAG_p_1) -i.\..\..\samples -dNOPCH $** diff --git a/samples/widgets/makefile.gcc b/samples/widgets/makefile.gcc index cce47fdead..0b70216fa9 100644 --- a/samples/widgets/makefile.gcc +++ b/samples/widgets/makefile.gcc @@ -30,6 +30,7 @@ WIDGETS_OBJECTS = \ $(OBJS)\widgets_button.o \ $(OBJS)\widgets_checkbox.o \ $(OBJS)\widgets_combobox.o \ + $(OBJS)\widgets_datepick.o \ $(OBJS)\widgets_gauge.o \ $(OBJS)\widgets_listbox.o \ $(OBJS)\widgets_notebook.o \ @@ -39,7 +40,7 @@ WIDGETS_OBJECTS = \ $(OBJS)\widgets_static.o \ $(OBJS)\widgets_textctrl.o \ $(OBJS)\widgets_widgets.o \ - $(OBJS)\widgets_widgets_rc.o + $(OBJS)\widgets_sample_rc.o ### Conditionally set variables: ### @@ -158,6 +159,14 @@ ifeq ($(SHARED),1) __DLLFLAG_p_1 = --define WXUSINGDLL endif ifeq ($(MONOLITHIC),0) +__WXLIB_ADV_p = \ + -lwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_adv +endif +ifeq ($(MONOLITHIC),0) +__WXLIB_HTML_p = \ + -lwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_html +endif +ifeq ($(MONOLITHIC),0) __WXLIB_CORE_p = \ -lwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core endif @@ -218,8 +227,8 @@ clean: -if exist $(OBJS)\*.d del $(OBJS)\*.d -if exist $(OBJS)\widgets.exe del $(OBJS)\widgets.exe -$(OBJS)\widgets.exe: $(WIDGETS_OBJECTS) $(OBJS)\widgets_widgets_rc.o - $(CXX) -o $@ $(WIDGETS_OBJECTS) $(LDFLAGS) $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) -Wl,--subsystem,windows -mwindows $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lodbc32 +$(OBJS)\widgets.exe: $(WIDGETS_OBJECTS) $(OBJS)\widgets_sample_rc.o + $(CXX) -o $@ $(WIDGETS_OBJECTS) $(LDFLAGS) $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) -Wl,--subsystem,windows -mwindows $(__WXLIB_ADV_p) $(__WXLIB_HTML_p) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lodbc32 $(OBJS)\widgets_button.o: ./button.cpp $(CXX) -c -o $@ $(WIDGETS_CXXFLAGS) $(CPPDEPS) $< @@ -230,6 +239,9 @@ $(OBJS)\widgets_checkbox.o: ./checkbox.cpp $(OBJS)\widgets_combobox.o: ./combobox.cpp $(CXX) -c -o $@ $(WIDGETS_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\widgets_datepick.o: ./datepick.cpp + $(CXX) -c -o $@ $(WIDGETS_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\widgets_gauge.o: ./gauge.cpp $(CXX) -c -o $@ $(WIDGETS_CXXFLAGS) $(CPPDEPS) $< @@ -257,7 +269,7 @@ $(OBJS)\widgets_textctrl.o: ./textctrl.cpp $(OBJS)\widgets_widgets.o: ./widgets.cpp $(CXX) -c -o $@ $(WIDGETS_CXXFLAGS) $(CPPDEPS) $< -$(OBJS)\widgets_widgets_rc.o: ./widgets.rc +$(OBJS)\widgets_sample_rc.o: ./../sample.rc windres --use-temp-file -i$< -o$@ --define __WXMSW__ $(__WXUNIV_DEFINE_p_1) $(__DEBUG_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) $(__UNICODE_DEFINE_p_1) $(__MSLU_DEFINE_p_1) --include-dir $(SETUPHDIR) --include-dir ./../../include --include-dir . $(__DLLFLAG_p_1) --include-dir ./../../samples --define NOPCH .PHONY: all clean diff --git a/samples/widgets/makefile.vc b/samples/widgets/makefile.vc index d125680212..fb186dc7aa 100644 --- a/samples/widgets/makefile.vc +++ b/samples/widgets/makefile.vc @@ -30,6 +30,7 @@ WIDGETS_OBJECTS = \ $(OBJS)\widgets_button.obj \ $(OBJS)\widgets_checkbox.obj \ $(OBJS)\widgets_combobox.obj \ + $(OBJS)\widgets_datepick.obj \ $(OBJS)\widgets_gauge.obj \ $(OBJS)\widgets_listbox.obj \ $(OBJS)\widgets_notebook.obj \ @@ -39,7 +40,7 @@ WIDGETS_OBJECTS = \ $(OBJS)\widgets_static.obj \ $(OBJS)\widgets_textctrl.obj \ $(OBJS)\widgets_widgets.obj \ - $(OBJS)\widgets_widgets.res + $(OBJS)\widgets_sample.res ### Conditionally set variables: ### @@ -257,6 +258,14 @@ __DLLFLAG_p = /DWXUSINGDLL __DLLFLAG_p_1 = /d WXUSINGDLL !endif !if "$(MONOLITHIC)" == "0" +__WXLIB_ADV_p = \ + wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_adv.lib +!endif +!if "$(MONOLITHIC)" == "0" +__WXLIB_HTML_p = \ + wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_html.lib +!endif +!if "$(MONOLITHIC)" == "0" __WXLIB_CORE_p = \ wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core.lib !endif @@ -298,9 +307,9 @@ clean: -if exist $(OBJS)\widgets.ilk del $(OBJS)\widgets.ilk -if exist $(OBJS)\widgets.pdb del $(OBJS)\widgets.pdb -$(OBJS)\widgets.exe: $(WIDGETS_OBJECTS) $(OBJS)\widgets_widgets.res +$(OBJS)\widgets.exe: $(WIDGETS_OBJECTS) $(OBJS)\widgets_sample.res link /NOLOGO /OUT:$@ $(LDFLAGS) $(__DEBUGINFO_1) $(LINK_TARGET_CPU) /LIBPATH:$(LIBDIRNAME) /SUBSYSTEM:WINDOWS @<< - $(WIDGETS_OBJECTS) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib + $(WIDGETS_OBJECTS) $(__WXLIB_ADV_p) $(__WXLIB_HTML_p) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib << $(OBJS)\widgets_button.obj: .\button.cpp @@ -312,6 +321,9 @@ $(OBJS)\widgets_checkbox.obj: .\checkbox.cpp $(OBJS)\widgets_combobox.obj: .\combobox.cpp $(CXX) /c /nologo /TP /Fo$@ $(WIDGETS_CXXFLAGS) $** +$(OBJS)\widgets_datepick.obj: .\datepick.cpp + $(CXX) /c /nologo /TP /Fo$@ $(WIDGETS_CXXFLAGS) $** + $(OBJS)\widgets_gauge.obj: .\gauge.cpp $(CXX) /c /nologo /TP /Fo$@ $(WIDGETS_CXXFLAGS) $** @@ -339,6 +351,6 @@ $(OBJS)\widgets_textctrl.obj: .\textctrl.cpp $(OBJS)\widgets_widgets.obj: .\widgets.cpp $(CXX) /c /nologo /TP /Fo$@ $(WIDGETS_CXXFLAGS) $** -$(OBJS)\widgets_widgets.res: .\widgets.rc +$(OBJS)\widgets_sample.res: .\..\sample.rc rc /fo$@ /d WIN32 $(____DEBUGRUNTIME_2_p_1) $(__NO_VC_CRTDBG_p_1) /d __WXMSW__ $(__WXUNIV_DEFINE_p_1) $(__DEBUG_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) $(__UNICODE_DEFINE_p_1) $(__MSLU_DEFINE_p_1) /i $(SETUPHDIR) /i .\..\..\include /i . $(__DLLFLAG_p_1) /d _WINDOWS /i .\..\..\samples /d NOPCH $** diff --git a/samples/widgets/makefile.wat b/samples/widgets/makefile.wat index f1c49acdd8..e346b7db87 100644 --- a/samples/widgets/makefile.wat +++ b/samples/widgets/makefile.wat @@ -138,6 +138,16 @@ __EXCEPTIONSFLAG_8 = !ifeq USE_EXCEPTIONS 1 __EXCEPTIONSFLAG_8 = -xs !endif +__WXLIB_ADV_p = +!ifeq MONOLITHIC 0 +__WXLIB_ADV_p = & + wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_adv.lib +!endif +__WXLIB_HTML_p = +!ifeq MONOLITHIC 0 +__WXLIB_HTML_p = & + wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_html.lib +!endif __WXLIB_CORE_p = !ifeq MONOLITHIC 0 __WXLIB_CORE_p = & @@ -217,6 +227,7 @@ WIDGETS_OBJECTS = & $(OBJS)\widgets_button.obj & $(OBJS)\widgets_checkbox.obj & $(OBJS)\widgets_combobox.obj & + $(OBJS)\widgets_datepick.obj & $(OBJS)\widgets_gauge.obj & $(OBJS)\widgets_listbox.obj & $(OBJS)\widgets_notebook.obj & @@ -244,15 +255,15 @@ clean : .SYMBOLIC -if exist $(OBJS)\*.pch del $(OBJS)\*.pch -if exist $(OBJS)\widgets.exe del $(OBJS)\widgets.exe -$(OBJS)\widgets.exe : $(WIDGETS_OBJECTS) $(OBJS)\widgets_widgets.res +$(OBJS)\widgets.exe : $(WIDGETS_OBJECTS) $(OBJS)\widgets_sample.res @%create $(OBJS)\widgets.lbc @%append $(OBJS)\widgets.lbc option quiet @%append $(OBJS)\widgets.lbc name $^@ @%append $(OBJS)\widgets.lbc option caseexact @%append $(OBJS)\widgets.lbc $(LDFLAGS) $(__DEBUGINFO_1) libpath $(LIBDIRNAME) system nt_win ref '_WinMain@16' @for %i in ($(WIDGETS_OBJECTS)) do @%append $(OBJS)\widgets.lbc file %i - @for %i in ( $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib ) do @%append $(OBJS)\widgets.lbc library %i - @%append $(OBJS)\widgets.lbc option resource=$(OBJS)\widgets_widgets.res + @for %i in ( $(__WXLIB_ADV_p) $(__WXLIB_HTML_p) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib) do @%append $(OBJS)\widgets.lbc library %i + @%append $(OBJS)\widgets.lbc option resource=$(OBJS)\widgets_sample.res @for %i in () do @%append $(OBJS)\widgets.lbc option stack=%i wlink @$(OBJS)\widgets.lbc @@ -265,6 +276,9 @@ $(OBJS)\widgets_checkbox.obj : .AUTODEPEND .\checkbox.cpp $(OBJS)\widgets_combobox.obj : .AUTODEPEND .\combobox.cpp $(CXX) -bt=nt -zq -fo=$^@ $(WIDGETS_CXXFLAGS) $< +$(OBJS)\widgets_datepick.obj : .AUTODEPEND .\datepick.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(WIDGETS_CXXFLAGS) $< + $(OBJS)\widgets_gauge.obj : .AUTODEPEND .\gauge.cpp $(CXX) -bt=nt -zq -fo=$^@ $(WIDGETS_CXXFLAGS) $< @@ -292,6 +306,6 @@ $(OBJS)\widgets_textctrl.obj : .AUTODEPEND .\textctrl.cpp $(OBJS)\widgets_widgets.obj : .AUTODEPEND .\widgets.cpp $(CXX) -bt=nt -zq -fo=$^@ $(WIDGETS_CXXFLAGS) $< -$(OBJS)\widgets_widgets.res : .AUTODEPEND .\widgets.rc +$(OBJS)\widgets_sample.res : .AUTODEPEND .\..\sample.rc wrc -q -ad -bt=nt -r -fo=$^@ -d__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) $(__UNICODE_DEFINE_p) -i=$(SETUPHDIR) -i=.\..\..\include -i=. $(__DLLFLAG_p) -i=.\..\..\samples -dNOPCH $< diff --git a/samples/widgets/notebook.cpp b/samples/widgets/notebook.cpp index 0d15102e26..f65f461179 100644 --- a/samples/widgets/notebook.cpp +++ b/samples/widgets/notebook.cpp @@ -1,11 +1,11 @@ ///////////////////////////////////////////////////////////////////////////// // Program: wxWidgets Widgets Sample // Name: notebook.cpp -// Purpose: Part of the widgets sample showing wxNotebook -// Author: Vadim Zeitlin +// Purpose: Part of the widgets sample showing book controls +// Author: Vadim Zeitlin, Wlodzimierz ABX Skiba // Created: 06.04.01 // Id: $Id$ -// Copyright: (c) 2001 Vadim Zeitlin +// Copyright: (c) 2001 Vadim Zeitlin, 2006 Wlodzimierz Skiba // License: wxWindows license ///////////////////////////////////////////////////////////////////////////// @@ -24,7 +24,7 @@ #pragma hdrstop #endif -#if wxUSE_NOTEBOOK +#if wxUSE_BOOKCTRL // for all others, include the necessary headers #ifndef WX_PRECOMP @@ -42,11 +42,10 @@ #endif #include "wx/sizer.h" -#include "wx/notebook.h" +#include "wx/bookctrl.h" #include "wx/artprov.h" #include "widgets.h" -#include "icons/notebook.xpm" // ---------------------------------------------------------------------------- // constants @@ -55,21 +54,21 @@ // control ids enum { - NotebookPage_Reset = 100, - NotebookPage_SelectPage, - NotebookPage_AddPage, - NotebookPage_InsertPage, - NotebookPage_RemovePage, - NotebookPage_DeleteAll, - NotebookPage_InsertText, - NotebookPage_RemoveText, - NotebookPage_SelectText, - NotebookPage_NumPagesText, - NotebookPage_CurSelectText, - NotebookPage_Notebook + BookPage_Reset = wxID_HIGHEST, + BookPage_SelectPage, + BookPage_AddPage, + BookPage_InsertPage, + BookPage_RemovePage, + BookPage_DeleteAll, + BookPage_InsertText, + BookPage_RemoveText, + BookPage_SelectText, + BookPage_NumPagesText, + BookPage_CurSelectText, + BookPage_Book }; -// notebook orientations +// book orientations enum Orient { Orient_Top, @@ -80,22 +79,24 @@ enum Orient }; // ---------------------------------------------------------------------------- -// NotebookWidgetsPage +// BookWidgetsPage // ---------------------------------------------------------------------------- -class NotebookWidgetsPage : public WidgetsPage +class BookWidgetsPage : public WidgetsPage { public: - NotebookWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist); - virtual ~NotebookWidgetsPage(); + BookWidgetsPage(WidgetsBookCtrl *book); + virtual ~BookWidgetsPage(); - virtual wxControl *GetWidget() const { return m_notebook; } - virtual void RecreateWidget() { CreateNotebook(); } + virtual wxControl *GetWidget() const { return m_book; } + virtual void RecreateWidget() { RecreateBook(); } protected: // event handlers +#ifdef ABX void OnPageChanging(wxNotebookEvent& event); void OnPageChanged(wxNotebookEvent& event); +#endif void OnButtonReset(wxCommandEvent& event); void OnButtonDeleteAll(wxCommandEvent& event); @@ -115,11 +116,12 @@ protected: void OnUpdateUIResetButton(wxUpdateUIEvent& event); - // reset the wxNotebook parameters + // reset book parameters void Reset(); - // (re)create the wxNotebook - void CreateNotebook(); + // (re)create book + void RecreateBook(); + virtual wxBookCtrlBase *CreateBook(long flags) = 0; // create or destroy the image list void CreateImageList(); @@ -135,7 +137,7 @@ protected: // is the value in range? bool IsValidValue(int val) const - { return (val >= 0) && (val < (int) m_notebook->GetPageCount()); } + { return (val >= 0) && (val < (int) m_book->GetPageCount()); } // the controls // ------------ @@ -149,62 +151,58 @@ protected: *m_textRemove, *m_textSelect; - // the notebook itself and the sizer it is in - wxNotebook *m_notebook; - wxSizer *m_sizerNotebook; + // the book itself and the sizer it is in + wxBookCtrlBase *m_book; + wxSizer *m_sizerBook; - // thei mage list for our notebook + // thei mage list for our book wxImageList *m_imageList; private: DECLARE_EVENT_TABLE() - DECLARE_WIDGETS_PAGE(NotebookWidgetsPage) }; // ---------------------------------------------------------------------------- // event tables // ---------------------------------------------------------------------------- -BEGIN_EVENT_TABLE(NotebookWidgetsPage, WidgetsPage) - EVT_BUTTON(NotebookPage_Reset, NotebookWidgetsPage::OnButtonReset) - EVT_BUTTON(NotebookPage_SelectPage, NotebookWidgetsPage::OnButtonSelectPage) - EVT_BUTTON(NotebookPage_AddPage, NotebookWidgetsPage::OnButtonAddPage) - EVT_BUTTON(NotebookPage_InsertPage, NotebookWidgetsPage::OnButtonInsertPage) - EVT_BUTTON(NotebookPage_RemovePage, NotebookWidgetsPage::OnButtonRemovePage) - EVT_BUTTON(NotebookPage_DeleteAll, NotebookWidgetsPage::OnButtonDeleteAll) +BEGIN_EVENT_TABLE(BookWidgetsPage, WidgetsPage) + EVT_BUTTON(BookPage_Reset, BookWidgetsPage::OnButtonReset) + EVT_BUTTON(BookPage_SelectPage, BookWidgetsPage::OnButtonSelectPage) + EVT_BUTTON(BookPage_AddPage, BookWidgetsPage::OnButtonAddPage) + EVT_BUTTON(BookPage_InsertPage, BookWidgetsPage::OnButtonInsertPage) + EVT_BUTTON(BookPage_RemovePage, BookWidgetsPage::OnButtonRemovePage) + EVT_BUTTON(BookPage_DeleteAll, BookWidgetsPage::OnButtonDeleteAll) - EVT_UPDATE_UI(NotebookPage_NumPagesText, NotebookWidgetsPage::OnUpdateUINumPagesText) - EVT_UPDATE_UI(NotebookPage_CurSelectText, NotebookWidgetsPage::OnUpdateUICurSelectText) + EVT_UPDATE_UI(BookPage_NumPagesText, BookWidgetsPage::OnUpdateUINumPagesText) + EVT_UPDATE_UI(BookPage_CurSelectText, BookWidgetsPage::OnUpdateUICurSelectText) - EVT_UPDATE_UI(NotebookPage_SelectPage, NotebookWidgetsPage::OnUpdateUISelectButton) - EVT_UPDATE_UI(NotebookPage_InsertPage, NotebookWidgetsPage::OnUpdateUIInsertButton) - EVT_UPDATE_UI(NotebookPage_RemovePage, NotebookWidgetsPage::OnUpdateUIRemoveButton) + EVT_UPDATE_UI(BookPage_SelectPage, BookWidgetsPage::OnUpdateUISelectButton) + EVT_UPDATE_UI(BookPage_InsertPage, BookWidgetsPage::OnUpdateUIInsertButton) + EVT_UPDATE_UI(BookPage_RemovePage, BookWidgetsPage::OnUpdateUIRemoveButton) - EVT_NOTEBOOK_PAGE_CHANGING(wxID_ANY, NotebookWidgetsPage::OnPageChanging) +#ifdef ABX + EVT_NOTEBOOK_PAGE_CHANGING(wxID_ANY, BookWidgetsPage::OnPageChanging) EVT_NOTEBOOK_PAGE_CHANGED(wxID_ANY, NotebookWidgetsPage::OnPageChanged) +#endif - EVT_CHECKBOX(wxID_ANY, NotebookWidgetsPage::OnCheckOrRadioBox) - EVT_RADIOBOX(wxID_ANY, NotebookWidgetsPage::OnCheckOrRadioBox) + EVT_CHECKBOX(wxID_ANY, BookWidgetsPage::OnCheckOrRadioBox) + EVT_RADIOBOX(wxID_ANY, BookWidgetsPage::OnCheckOrRadioBox) END_EVENT_TABLE() // ============================================================================ // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(NotebookWidgetsPage, _T("Notebook")); - -NotebookWidgetsPage::NotebookWidgetsPage(wxBookCtrlBase *book, - wxImageList *imaglist) - : WidgetsPage(book) +BookWidgetsPage::BookWidgetsPage(WidgetsBookCtrl *book) + :WidgetsPage(book) { - imaglist->Add(wxBitmap(notebook_xpm)); - // init everything m_chkImages = NULL; m_imageList = NULL; - m_notebook = (wxNotebook *)NULL; - m_sizerNotebook = (wxSizer *)NULL; + m_book = NULL; + m_sizerBook = (wxSizer *)NULL; wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); @@ -232,7 +230,7 @@ NotebookWidgetsPage::NotebookWidgetsPage(wxBookCtrlBase *book, sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer sizerLeft->Add(m_radioOrient, 0, wxALL, 5); - wxButton *btn = new wxButton(this, NotebookPage_Reset, _T("&Reset")); + wxButton *btn = new wxButton(this, BookPage_Reset, _T("&Reset")); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane @@ -241,52 +239,48 @@ NotebookWidgetsPage::NotebookWidgetsPage(wxBookCtrlBase *book, wxTextCtrl *text; wxSizer *sizerRow = CreateSizerWithTextAndLabel(_T("Number of pages: "), - NotebookPage_NumPagesText, + BookPage_NumPagesText, &text); text->SetEditable(false); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndLabel(_T("Current selection: "), - NotebookPage_CurSelectText, + BookPage_CurSelectText, &text); text->SetEditable(false); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - sizerRow = CreateSizerWithTextAndButton(NotebookPage_SelectPage, + sizerRow = CreateSizerWithTextAndButton(BookPage_SelectPage, _T("&Select page"), - NotebookPage_SelectText, + BookPage_SelectText, &m_textSelect); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, NotebookPage_AddPage, _T("&Add page")); + btn = new wxButton(this, BookPage_AddPage, _T("&Add page")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - sizerRow = CreateSizerWithTextAndButton(NotebookPage_InsertPage, + sizerRow = CreateSizerWithTextAndButton(BookPage_InsertPage, _T("&Insert page at"), - NotebookPage_InsertText, + BookPage_InsertText, &m_textInsert); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - sizerRow = CreateSizerWithTextAndButton(NotebookPage_RemovePage, + sizerRow = CreateSizerWithTextAndButton(BookPage_RemovePage, _T("&Remove page"), - NotebookPage_RemoveText, + BookPage_RemoveText, &m_textRemove); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, NotebookPage_DeleteAll, _T("&Delete All")); + btn = new wxButton(this, BookPage_DeleteAll, _T("&Delete All")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); // right pane - wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL); - m_notebook = new wxNotebook(this, NotebookPage_Notebook); - sizerRight->Add(m_notebook, 1, wxGROW | wxALL, 5); - sizerRight->SetMinSize(150, 0); - m_sizerNotebook = sizerRight; // save it to modify it later + m_sizerBook = new wxBoxSizer(wxHORIZONTAL); - // the 3 panes panes compose the window + // the 3 panes compose the window sizerTop->Add(sizerLeft, 0, wxGROW | (wxALL & ~wxLEFT), 10); sizerTop->Add(sizerMiddle, 0, wxGROW | wxALL, 10); - sizerTop->Add(sizerRight, 1, wxGROW | (wxALL & ~wxRIGHT), 10); + sizerTop->Add(m_sizerBook, 1, wxGROW | (wxALL & ~wxRIGHT), 10); // final initializations Reset(); @@ -297,7 +291,7 @@ NotebookWidgetsPage::NotebookWidgetsPage(wxBookCtrlBase *book, sizerTop->Fit(this); } -NotebookWidgetsPage::~NotebookWidgetsPage() +BookWidgetsPage::~BookWidgetsPage() { delete m_imageList; } @@ -306,13 +300,13 @@ NotebookWidgetsPage::~NotebookWidgetsPage() // operations // ---------------------------------------------------------------------------- -void NotebookWidgetsPage::Reset() +void BookWidgetsPage::Reset() { m_chkImages->SetValue(true); m_radioOrient->SetSelection(Orient_Top); } -void NotebookWidgetsPage::CreateImageList() +void BookWidgetsPage::CreateImageList() { if ( m_chkImages->GetValue() ) { @@ -327,7 +321,8 @@ void NotebookWidgetsPage::CreateImageList() m_imageList->Add(wxArtProvider::GetIcon(wxART_ERROR, wxART_OTHER, size)); } - m_notebook->SetImageList(m_imageList); + if ( m_book ) + m_book->SetImageList(m_imageList); } else // no images { @@ -339,17 +334,17 @@ void NotebookWidgetsPage::CreateImageList() } // because of the bug in wxMSW we can't use SetImageList(NULL) - although - // it would be logical if this removed the image list from notebook, under - // MSW it crashes instead + // it would be logical if this removed the image list from book, under + // MSW it crashes instead - FIXME } -void NotebookWidgetsPage::CreateNotebook() +void BookWidgetsPage::RecreateBook() { int flags = ms_defaultFlags; switch ( m_radioOrient->GetSelection() ) { default: - wxFAIL_MSG( _T("unknown notebook orientation") ); + wxFAIL_MSG( _T("unknown orientation") ); // fall through case Orient_Top: @@ -369,49 +364,48 @@ void NotebookWidgetsPage::CreateNotebook() break; } - wxNotebook *old_note = m_notebook; + wxBookCtrlBase *oldBook = m_book; - m_notebook = new wxNotebook(this, NotebookPage_Notebook, - wxDefaultPosition, wxDefaultSize, - flags); + m_book = CreateBook(flags); CreateImageList(); - if ( old_note ) + if ( oldBook ) { - const int sel = old_note->GetSelection(); + const int sel = oldBook->GetSelection(); - const int count = old_note->GetPageCount(); + const int count = oldBook->GetPageCount(); // recreate the pages for ( int n = 0; n < count; n++ ) { - m_notebook->AddPage(CreateNewPage(), - old_note->GetPageText(n), - false, - m_chkImages->GetValue() ? - GetIconIndex() : -1); + m_book->AddPage(CreateNewPage(), + oldBook->GetPageText(n), + false, + m_chkImages->GetValue() ? + GetIconIndex() : -1); } - m_sizerNotebook->Detach( old_note ); - delete old_note; + m_sizerBook->Detach( oldBook ); + delete oldBook; // restore selection if ( sel != -1 ) { - m_notebook->SetSelection(sel); + m_book->SetSelection(sel); } } - m_sizerNotebook->Add(m_notebook, 1, wxGROW | wxALL, 5); - m_sizerNotebook->Layout(); + m_sizerBook->Add(m_book, 1, wxGROW | wxALL, 5); + m_sizerBook->SetMinSize(150, 0); + m_sizerBook->Layout(); } // ---------------------------------------------------------------------------- // helpers // ---------------------------------------------------------------------------- -int NotebookWidgetsPage::GetTextValue(wxTextCtrl *text) const +int BookWidgetsPage::GetTextValue(wxTextCtrl *text) const { long pos; if ( !text->GetValue().ToLong(&pos) ) @@ -420,109 +414,110 @@ int NotebookWidgetsPage::GetTextValue(wxTextCtrl *text) const return (int)pos; } -int NotebookWidgetsPage::GetIconIndex() const +int BookWidgetsPage::GetIconIndex() const { if ( m_imageList ) { int nImages = m_imageList->GetImageCount(); if ( nImages > 0 ) { - return m_notebook->GetPageCount() % nImages; + return m_book->GetPageCount() % nImages; } } return -1; } -wxWindow *NotebookWidgetsPage::CreateNewPage() +wxWindow *BookWidgetsPage::CreateNewPage() { - return new wxTextCtrl(m_notebook, wxID_ANY, _T("I'm a notebook page")); + return new wxTextCtrl(m_book, wxID_ANY, _T("I'm a book page")); } // ---------------------------------------------------------------------------- // event handlers // ---------------------------------------------------------------------------- -void NotebookWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event)) +void BookWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event)) { Reset(); - CreateNotebook(); + RecreateBook(); } -void NotebookWidgetsPage::OnButtonDeleteAll(wxCommandEvent& WXUNUSED(event)) +void BookWidgetsPage::OnButtonDeleteAll(wxCommandEvent& WXUNUSED(event)) { - m_notebook->DeleteAllPages(); + m_book->DeleteAllPages(); } -void NotebookWidgetsPage::OnButtonSelectPage(wxCommandEvent& WXUNUSED(event)) +void BookWidgetsPage::OnButtonSelectPage(wxCommandEvent& WXUNUSED(event)) { int pos = GetTextValue(m_textSelect); wxCHECK_RET( IsValidValue(pos), _T("button should be disabled") ); - m_notebook->SetSelection(pos); + m_book->SetSelection(pos); } -void NotebookWidgetsPage::OnButtonAddPage(wxCommandEvent& WXUNUSED(event)) +void BookWidgetsPage::OnButtonAddPage(wxCommandEvent& WXUNUSED(event)) { - m_notebook->AddPage(CreateNewPage(), _T("Added page"), false, - GetIconIndex()); + m_book->AddPage(CreateNewPage(), _T("Added page"), false, + GetIconIndex()); } -void NotebookWidgetsPage::OnButtonInsertPage(wxCommandEvent& WXUNUSED(event)) +void BookWidgetsPage::OnButtonInsertPage(wxCommandEvent& WXUNUSED(event)) { int pos = GetTextValue(m_textInsert); wxCHECK_RET( IsValidValue(pos), _T("button should be disabled") ); - m_notebook->InsertPage(pos, CreateNewPage(), _T("Inserted page"), false, - GetIconIndex()); + m_book->InsertPage(pos, CreateNewPage(), _T("Inserted page"), false, + GetIconIndex()); } -void NotebookWidgetsPage::OnButtonRemovePage(wxCommandEvent& WXUNUSED(event)) +void BookWidgetsPage::OnButtonRemovePage(wxCommandEvent& WXUNUSED(event)) { int pos = GetTextValue(m_textRemove); wxCHECK_RET( IsValidValue(pos), _T("button should be disabled") ); - m_notebook->DeletePage(pos); + m_book->DeletePage(pos); } -void NotebookWidgetsPage::OnUpdateUISelectButton(wxUpdateUIEvent& event) +void BookWidgetsPage::OnUpdateUISelectButton(wxUpdateUIEvent& event) { event.Enable( IsValidValue(GetTextValue(m_textSelect)) ); } -void NotebookWidgetsPage::OnUpdateUIInsertButton(wxUpdateUIEvent& event) +void BookWidgetsPage::OnUpdateUIInsertButton(wxUpdateUIEvent& event) { event.Enable( IsValidValue(GetTextValue(m_textInsert)) ); } -void NotebookWidgetsPage::OnUpdateUIRemoveButton(wxUpdateUIEvent& event) +void BookWidgetsPage::OnUpdateUIRemoveButton(wxUpdateUIEvent& event) { event.Enable( IsValidValue(GetTextValue(m_textRemove)) ); } -void NotebookWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event) +void BookWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event) { event.Enable( !m_chkImages->GetValue() || m_radioOrient->GetSelection() != wxBK_TOP ); } -void NotebookWidgetsPage::OnUpdateUINumPagesText(wxUpdateUIEvent& event) +void BookWidgetsPage::OnUpdateUINumPagesText(wxUpdateUIEvent& event) { - event.SetText( wxString::Format(_T("%d"), m_notebook->GetPageCount()) ); + event.SetText( wxString::Format(_T("%d"), m_book->GetPageCount()) ); } -void NotebookWidgetsPage::OnUpdateUICurSelectText(wxUpdateUIEvent& event) +void BookWidgetsPage::OnUpdateUICurSelectText(wxUpdateUIEvent& event) { - event.SetText( wxString::Format(_T("%d"), m_notebook->GetSelection()) ); + event.SetText( wxString::Format(_T("%d"), m_book->GetSelection()) ); } -void NotebookWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) +void BookWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) { - CreateNotebook(); + RecreateBook(); } -void NotebookWidgetsPage::OnPageChanging(wxNotebookEvent& event) +#ifdef ABX +void BookWidgetsPage::OnPageChanging(wxBookEvent& event) { wxLogMessage(_T("Notebook page changing from %d to %d (currently %d)."), event.GetOldSelection(), @@ -542,4 +537,155 @@ void NotebookWidgetsPage::OnPageChanged(wxNotebookEvent& event) event.Skip(); } +#endif + +#if wxUSE_NOTEBOOK + +#include "icons/notebook.xpm" +#include "wx/notebook.h" + +// ---------------------------------------------------------------------------- +// NotebookWidgetsPage +// ---------------------------------------------------------------------------- + +class NotebookWidgetsPage : public BookWidgetsPage +{ +public: + NotebookWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) + : BookWidgetsPage(book) + { + imaglist->Add(wxBitmap(notebook_xpm)); + RecreateBook(); + } + virtual ~NotebookWidgetsPage() {} + +protected: + + // (re)create book + virtual wxBookCtrlBase *CreateBook(long flags) + { + return new wxNotebook(this, BookPage_Book, + wxDefaultPosition, wxDefaultSize, + flags); + + } + +private: + DECLARE_EVENT_TABLE() + DECLARE_WIDGETS_PAGE(NotebookWidgetsPage) +}; + +// ---------------------------------------------------------------------------- +// event table +// ---------------------------------------------------------------------------- + +BEGIN_EVENT_TABLE(NotebookWidgetsPage, BookWidgetsPage) +END_EVENT_TABLE() + +IMPLEMENT_WIDGETS_PAGE(NotebookWidgetsPage, _T("Notebook"), + (int)wxPlatform(GENERIC_CTRLS).If(wxMSW,NATIVE_CTRLS) + .ElseIf(wxGTK,NATIVE_CTRLS) + | BOOK_CTRLS + ); + #endif // wxUSE_NOTEBOOK + +#if wxUSE_LISTBOOK + +#include "icons/listbook.xpm" +#include "wx/listbook.h" + +// ---------------------------------------------------------------------------- +// ListbookWidgetsPage +// ---------------------------------------------------------------------------- + +class ListbookWidgetsPage : public BookWidgetsPage +{ +public: + ListbookWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) + : BookWidgetsPage(book) + { + imaglist->Add(wxBitmap(listbook_xpm)); + RecreateBook(); + } + virtual ~ListbookWidgetsPage() {} + +protected: + + // (re)create book + virtual wxBookCtrlBase *CreateBook(long flags) + { + return new wxListbook(this, BookPage_Book, + wxDefaultPosition, wxDefaultSize, + flags); + + } + +private: + DECLARE_EVENT_TABLE() + DECLARE_WIDGETS_PAGE(ListbookWidgetsPage) +}; + +// ---------------------------------------------------------------------------- +// event table +// ---------------------------------------------------------------------------- + +BEGIN_EVENT_TABLE(ListbookWidgetsPage, BookWidgetsPage) +END_EVENT_TABLE() + +IMPLEMENT_WIDGETS_PAGE(ListbookWidgetsPage, _T("Listbook"), + GENERIC_CTRLS | BOOK_CTRLS + ); + +#endif // wxUSE_LISTBOOK + +#if wxUSE_CHOICEBOOK + +#include "icons/choicebk.xpm" +#include "wx/choicebk.h" + +// ---------------------------------------------------------------------------- +// ChoicebookWidgetsPage +// ---------------------------------------------------------------------------- + +class ChoicebookWidgetsPage : public BookWidgetsPage +{ +public: + ChoicebookWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) + : BookWidgetsPage(book) + { + imaglist->Add(wxBitmap(choicebk_xpm)); + RecreateBook(); + } + virtual ~ChoicebookWidgetsPage() {} + +protected: + + // (re)create book + virtual wxBookCtrlBase *CreateBook(long flags) + { + return new wxChoicebook(this, BookPage_Book, + wxDefaultPosition, wxDefaultSize, + flags); + + } + +private: + DECLARE_EVENT_TABLE() + DECLARE_WIDGETS_PAGE(ChoicebookWidgetsPage) +}; + +// ---------------------------------------------------------------------------- +// event table +// ---------------------------------------------------------------------------- + +BEGIN_EVENT_TABLE(ChoicebookWidgetsPage, BookWidgetsPage) +END_EVENT_TABLE() + +IMPLEMENT_WIDGETS_PAGE(ChoicebookWidgetsPage, _T("Choicebook"), + GENERIC_CTRLS | BOOK_CTRLS + ); + +#endif // wxUSE_CHOICEBOOK + +#endif // wxUSE_BOOKCTRL diff --git a/samples/widgets/radiobox.cpp b/samples/widgets/radiobox.cpp index 91f5cc9fa9..1fd80178a4 100644 --- a/samples/widgets/radiobox.cpp +++ b/samples/widgets/radiobox.cpp @@ -83,7 +83,7 @@ static const int TEST_BUTTON = 1; class RadioWidgetsPage : public WidgetsPage { public: - RadioWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist); + RadioWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist); virtual ~RadioWidgetsPage(){}; virtual wxControl *GetWidget() const { return m_radio; } @@ -173,9 +173,12 @@ END_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(RadioWidgetsPage, _T("Radio")); +IMPLEMENT_WIDGETS_PAGE(RadioWidgetsPage, _T("Radio"), + (int)wxPlatform(GENERIC_CTRLS).If(wxMSW,NATIVE_CTRLS) + | WITH_ITEMS_CTRLS + ); -RadioWidgetsPage::RadioWidgetsPage(wxBookCtrlBase *book, +RadioWidgetsPage::RadioWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) : WidgetsPage(book) { diff --git a/samples/widgets/slider.cpp b/samples/widgets/slider.cpp index b647856eb8..ce234a2c4d 100644 --- a/samples/widgets/slider.cpp +++ b/samples/widgets/slider.cpp @@ -89,7 +89,7 @@ enum class SliderWidgetsPage : public WidgetsPage { public: - SliderWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist); + SliderWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist); virtual ~SliderWidgetsPage(){}; virtual wxControl *GetWidget() const { return m_slider; } @@ -198,9 +198,11 @@ END_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(SliderWidgetsPage, _T("Slider")); +IMPLEMENT_WIDGETS_PAGE(SliderWidgetsPage, _T("Slider"), + (int)wxPlatform(GENERIC_CTRLS).If(wxMSW,NATIVE_CTRLS) + ); -SliderWidgetsPage::SliderWidgetsPage(wxBookCtrlBase *book, +SliderWidgetsPage::SliderWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) : WidgetsPage(book) { diff --git a/samples/widgets/spinbtn.cpp b/samples/widgets/spinbtn.cpp index a1ea73f112..1b0fbf2055 100644 --- a/samples/widgets/spinbtn.cpp +++ b/samples/widgets/spinbtn.cpp @@ -73,7 +73,7 @@ enum class SpinBtnWidgetsPage : public WidgetsPage { public: - SpinBtnWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist); + SpinBtnWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist); virtual ~SpinBtnWidgetsPage(){}; virtual wxControl *GetWidget() const { return m_spinbtn; } @@ -166,9 +166,12 @@ END_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(SpinBtnWidgetsPage, _T("Spin")); +IMPLEMENT_WIDGETS_PAGE(SpinBtnWidgetsPage, _T("Spin"), + (int)wxPlatform(GENERIC_CTRLS).If(wxMSW,NATIVE_CTRLS) + | EDITABLE_CTRLS + ); -SpinBtnWidgetsPage::SpinBtnWidgetsPage(wxBookCtrlBase *book, +SpinBtnWidgetsPage::SpinBtnWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) : WidgetsPage(book) { diff --git a/samples/widgets/static.cpp b/samples/widgets/static.cpp index 499a0037b6..1866e8d469 100644 --- a/samples/widgets/static.cpp +++ b/samples/widgets/static.cpp @@ -139,7 +139,7 @@ END_EVENT_TABLE() class StaticWidgetsPage : public WidgetsPage { public: - StaticWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist); + StaticWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist); virtual ~StaticWidgetsPage(){}; virtual wxControl *GetWidget() const { return m_statText; } @@ -204,9 +204,11 @@ END_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(StaticWidgetsPage, _T("Static")); +IMPLEMENT_WIDGETS_PAGE(StaticWidgetsPage, _T("Static"), + (int)wxPlatform(GENERIC_CTRLS).If(wxMSW,NATIVE_CTRLS) + ); -StaticWidgetsPage::StaticWidgetsPage(wxBookCtrlBase *book, +StaticWidgetsPage::StaticWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) : WidgetsPage(book) { diff --git a/samples/widgets/textctrl.cpp b/samples/widgets/textctrl.cpp index 6fd19a5497..c01eb60d76 100644 --- a/samples/widgets/textctrl.cpp +++ b/samples/widgets/textctrl.cpp @@ -132,7 +132,7 @@ class TextWidgetsPage : public WidgetsPage { public: // ctor(s) and dtor - TextWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist); + TextWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist); virtual ~TextWidgetsPage(){}; virtual wxControl *GetWidget() const { return m_text; } @@ -329,13 +329,16 @@ END_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(TextWidgetsPage, _T("Text")); +IMPLEMENT_WIDGETS_PAGE(TextWidgetsPage, _T("Text"), + (int)wxPlatform(GENERIC_CTRLS).If(wxMSW,NATIVE_CTRLS) + | EDITABLE_CTRLS + ); // ---------------------------------------------------------------------------- // TextWidgetsPage creation // ---------------------------------------------------------------------------- -TextWidgetsPage::TextWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist) +TextWidgetsPage::TextWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) : WidgetsPage(book) { imaglist->Add(wxBitmap(text_xpm)); diff --git a/samples/widgets/widgets.bkl b/samples/widgets/widgets.bkl index 804049b4bf..5c61f2efe7 100644 --- a/samples/widgets/widgets.bkl +++ b/samples/widgets/widgets.bkl @@ -4,12 +4,14 @@ - button.cpp checkbox.cpp combobox.cpp gauge.cpp listbox.cpp + button.cpp checkbox.cpp combobox.cpp datepick.cpp gauge.cpp listbox.cpp notebook.cpp radiobox.cpp slider.cpp spinbtn.cpp static.cpp textctrl.cpp widgets.cpp + adv + html core base - widgets.rc + ../sample.rc diff --git a/samples/widgets/widgets.cpp b/samples/widgets/widgets.cpp index 3473a56c9f..f432060c34 100644 --- a/samples/widgets/widgets.cpp +++ b/samples/widgets/widgets.cpp @@ -42,6 +42,7 @@ #include "wx/sysopt.h" #include "wx/bookctrl.h" +#include "wx/treebook.h" #include "wx/sizer.h" #include "wx/colordlg.h" #include "wx/fontdlg.h" @@ -49,6 +50,8 @@ #include "widgets.h" +#include "../sample.xpm" + // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- @@ -81,6 +84,17 @@ enum Widgets_GoToPageLast = Widgets_GoToPage + 100 }; +const wxChar *WidgetsCategories[MAX_PAGES] = { + wxT("Native"), + wxT("Generic"), + wxT("Pickers"), + wxT("Comboboxes"), + wxT("With items"), + wxT("Editable"), + wxT("Books"), + wxT("All controls") +}; + // ---------------------------------------------------------------------------- // our classes // ---------------------------------------------------------------------------- @@ -114,7 +128,7 @@ protected: void OnExit(wxCommandEvent& event); #if wxUSE_MENUS - void OnPageChanged(wxBookCtrlEvent& event); + void OnPageChanged(WidgetsBookCtrlEvent& event); void OnGoToPage(wxCommandEvent& event); #if wxUSE_TOOLTIPS @@ -130,6 +144,9 @@ protected: // initialize the book: add all pages to it void InitBook(); + // finding current page assuming book inside book + WidgetsPage *CurrentPage(); + private: // the panel containing everything wxPanel *m_panel; @@ -143,10 +160,7 @@ private: #endif // USE_LOG // the book containing the test pages - wxBookCtrlBase *m_book; - - // and the image list for it - wxImageList *m_imaglist; + WidgetsBookCtrl *m_book; #if wxUSE_MENUS // last chosen fg/bg colours and font @@ -242,7 +256,7 @@ BEGIN_EVENT_TABLE(WidgetsFrame, wxFrame) #endif // wxUSE_TOOLTIPS #if wxUSE_MENUS - EVT_BOOKCTRL_PAGE_CHANGED(Widgets_BookCtrl, WidgetsFrame::OnPageChanged) + EVT_WIDGETS_PAGE_CHANGED(wxID_ANY, WidgetsFrame::OnPageChanged) EVT_MENU_RANGE(Widgets_GoToPage, Widgets_GoToPageLast, WidgetsFrame::OnGoToPage) @@ -312,13 +326,15 @@ WidgetsFrame::WidgetsFrame(const wxString& title) wxCLIP_CHILDREN | wxTAB_TRAVERSAL) { + // set the frame icon + SetIcon(wxICON(sample)); + // init everything #if USE_LOG m_lboxLog = (wxListBox *)NULL; m_logTarget = (wxLog *)NULL; #endif // USE_LOG - m_book = (wxBookCtrlBase *)NULL; - m_imaglist = (wxImageList *)NULL; + m_book = (WidgetsBookCtrl *)NULL; #if wxUSE_MENUS // create the menubar @@ -364,7 +380,7 @@ WidgetsFrame::WidgetsFrame(const wxString& title) // Uncomment to suppress page theme (draw in solid colour) //style |= wxNB_NOPAGETHEME; - m_book = new wxBookCtrl(m_panel, Widgets_BookCtrl, wxDefaultPosition, + m_book = new WidgetsBookCtrl(m_panel, Widgets_BookCtrl, wxDefaultPosition, #ifdef __WXMOTIF__ wxSize(500, wxDefaultCoord), // under Motif, height is a function of the width... #else @@ -425,49 +441,121 @@ WidgetsFrame::WidgetsFrame(const wxString& title) void WidgetsFrame::InitBook() { - m_imaglist = new wxImageList(32, 32); + wxImageList *imageList = new wxImageList(32, 32); - ArrayWidgetsPage pages; - wxArrayString labels; + imageList->Add(wxBitmap(sample_xpm)); + +#if !USE_TREEBOOK + WidgetsBookCtrl *books[MAX_PAGES]; +#endif + + ArrayWidgetsPage pages[MAX_PAGES]; + wxArrayString labels[MAX_PAGES]; wxMenu *menuPages = new wxMenu; - unsigned nPage = 0; + unsigned int nPage = 0, nFKey = 0; + int cat, imageId = 1; // we need to first create all pages and only then add them to the book // as we need the image list first // // we also construct the pages menu during this first iteration - for ( WidgetsPageInfo *info = WidgetsPage::ms_widgetPages; - info; - info = info->GetNext(), nPage++ ) + for ( cat = 0; cat < MAX_PAGES; cat++ ) { - WidgetsPage *page = (*info->GetCtor())(m_book, m_imaglist); - pages.Add(page); - - labels.Add(info->GetLabel()); - menuPages->AppendRadioItem - ( - Widgets_GoToPage + nPage, - wxString::Format(wxT("%s\tF%u"), - info->GetLabel().c_str(), nPage + 1) - ); +#if USE_TREEBOOK + nPage++; // increase for parent page +#else + books[cat] = new WidgetsBookCtrl( m_book, wxID_ANY ); +#endif + + for ( WidgetsPageInfo *info = WidgetsPage::ms_widgetPages; + info; + info = info->GetNext() ) + { + if( (info->GetCategories() & ( 1 << cat )) == 0) + continue; + + WidgetsPage *page = (*info->GetCtor())( +#if USE_TREEBOOK + m_book +#else + books[cat] +#endif + , imageList); + pages[cat].Add(page); + + labels[cat].Add(info->GetLabel()); + if ( cat == ALL_PAGE ) + { + wxString radioLabel(info->GetLabel()); + nFKey++; + if ( nFKey <= 12 ) + { + radioLabel << wxT("\tF" ) << nFKey; + } + + menuPages->AppendRadioItem( + Widgets_GoToPage + nPage, + radioLabel + ); +#if !USE_TREEBOOK + // consider only for book in book architecture + nPage++; +#endif + } + +#if USE_TREEBOOK + // consider only for treebook architecture (with subpages) + nPage++; +#endif + } } GetMenuBar()->Append(menuPages, _T("&Page")); - m_book->SetImageList(m_imaglist); + m_book->AssignImageList(imageList); - // now do add them - size_t count = pages.GetCount(); - for ( size_t n = 0; n < count; n++ ) + for ( cat = 0; cat < MAX_PAGES; cat++ ) { - m_book->AddPage( - pages[n], - labels[n], - false, // don't select - n // image id - ); +#if USE_TREEBOOK + m_book->AddPage(NULL,WidgetsCategories[cat],false,0); +#else + m_book->AddPage(books[cat],WidgetsCategories[cat],false,0); + books[cat]->SetImageList(imageList); +#endif + + // now do add them + size_t count = pages[cat].GetCount(); + for ( size_t n = 0; n < count; n++ ) + { +#if USE_TREEBOOK + m_book->AddSubPage( +#else + books[cat]->AddPage( +#endif + pages[cat][n], + labels[cat][n], + false, // don't select + imageId++ + ); + } } + +#if USE_TREEBOOK + // for treebook page #0 is empty parent page only + m_book->SetSelection(1); +#endif +} + +WidgetsPage *WidgetsFrame::CurrentPage() +{ +#if USE_TREEBOOK + return wxStaticCast(m_book->GetCurrentPage(), WidgetsPage); +#else + WidgetsBookCtrl *book = wxStaticCast(m_book->GetCurrentPage(), WidgetsBookCtrl); + if (!book) return NULL; + return wxStaticCast(book->GetCurrentPage(), WidgetsPage); +#endif } WidgetsFrame::~WidgetsFrame() @@ -475,7 +563,6 @@ WidgetsFrame::~WidgetsFrame() #if USE_LOG delete m_logTarget; #endif // USE_LOG - delete m_imaglist; } // ---------------------------------------------------------------------------- @@ -496,15 +583,22 @@ void WidgetsFrame::OnButtonClearLog(wxCommandEvent& WXUNUSED(event)) #if wxUSE_MENUS -void WidgetsFrame::OnPageChanged(wxBookCtrlEvent& event) +void WidgetsFrame::OnPageChanged(WidgetsBookCtrlEvent& event) { - GetMenuBar()->Check(Widgets_GoToPage + event.GetSelection(), true); + wxMenuItem *item = GetMenuBar()->FindItem(Widgets_GoToPage + event.GetSelection()); + if (item) item->Check(); event.Skip(); } void WidgetsFrame::OnGoToPage(wxCommandEvent& event) { +#if USE_TREEBOOK m_book->SetSelection(event.GetId() - Widgets_GoToPage); +#else + m_book->SetSelection(m_book->GetPageCount()-1); + WidgetsBookCtrl *book = wxStaticCast(m_book->GetCurrentPage(), WidgetsBookCtrl); + book->SetSelection(event.GetId() - Widgets_GoToPage); +#endif } #if wxUSE_TOOLTIPS @@ -527,7 +621,7 @@ void WidgetsFrame::OnSetTooltip(wxCommandEvent& WXUNUSED(event)) s_tip = dialog.GetValue(); s_tip.Replace(_T("\\n"), _T("\n")); - WidgetsPage *page = wxStaticCast(m_book->GetCurrentPage(), WidgetsPage); + WidgetsPage *page = CurrentPage(); page->GetWidget()->SetToolTip(s_tip); wxControl *ctrl2 = page->GetWidget2(); @@ -541,7 +635,7 @@ void WidgetsFrame::OnSetFgCol(wxCommandEvent& WXUNUSED(event)) { #if wxUSE_COLOURDLG // allow for debugging the default colour the first time this is called - WidgetsPage *page = wxStaticCast(m_book->GetCurrentPage(), WidgetsPage); + WidgetsPage *page = CurrentPage(); if (!m_colFg.Ok()) m_colFg = page->GetForegroundColour(); @@ -568,7 +662,7 @@ void WidgetsFrame::OnSetFgCol(wxCommandEvent& WXUNUSED(event)) void WidgetsFrame::OnSetBgCol(wxCommandEvent& WXUNUSED(event)) { #if wxUSE_COLOURDLG - WidgetsPage *page = wxStaticCast(m_book->GetCurrentPage(), WidgetsPage); + WidgetsPage *page = CurrentPage(); if ( !m_colBg.Ok() ) m_colBg = page->GetBackgroundColour(); @@ -595,7 +689,7 @@ void WidgetsFrame::OnSetBgCol(wxCommandEvent& WXUNUSED(event)) void WidgetsFrame::OnSetFont(wxCommandEvent& WXUNUSED(event)) { #if wxUSE_FONTDLG - WidgetsPage *page = wxStaticCast(m_book->GetCurrentPage(), WidgetsPage); + WidgetsPage *page = CurrentPage(); if (!m_font.Ok()) m_font = page->GetFont(); @@ -621,7 +715,7 @@ void WidgetsFrame::OnSetFont(wxCommandEvent& WXUNUSED(event)) void WidgetsFrame::OnEnable(wxCommandEvent& event) { - WidgetsPage *page = wxStaticCast(m_book->GetCurrentPage(), WidgetsPage); + WidgetsPage *page = CurrentPage(); page->GetWidget()->Enable(event.IsChecked()); } @@ -647,7 +741,7 @@ void WidgetsFrame::OnSetBorder(wxCommandEvent& event) WidgetsPage::ms_defaultFlags &= ~wxBORDER_MASK; WidgetsPage::ms_defaultFlags |= border; - WidgetsPage *page = wxStaticCast(m_book->GetCurrentPage(), WidgetsPage); + WidgetsPage *page = CurrentPage(); page->RecreateWidget(); } @@ -657,8 +751,9 @@ void WidgetsFrame::OnSetBorder(wxCommandEvent& event) // WidgetsPageInfo // ---------------------------------------------------------------------------- -WidgetsPageInfo::WidgetsPageInfo(Constructor ctor, const wxChar *label) +WidgetsPageInfo::WidgetsPageInfo(Constructor ctor, const wxChar *label, int categories) : m_label(label) + , m_categories(categories) { m_ctor = ctor; @@ -716,7 +811,7 @@ WidgetsPageInfo::WidgetsPageInfo(Constructor ctor, const wxChar *label) int WidgetsPage::ms_defaultFlags = wxBORDER_DEFAULT; WidgetsPageInfo *WidgetsPage::ms_widgetPages = NULL; -WidgetsPage::WidgetsPage(wxBookCtrlBase *book) +WidgetsPage::WidgetsPage(WidgetsBookCtrl *book) : wxPanel(book, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_FULL_REPAINT_ON_RESIZE | diff --git a/samples/widgets/widgets.dsp b/samples/widgets/widgets.dsp index 6b95250127..45fb9399e9 100644 --- a/samples/widgets/widgets.dsp +++ b/samples/widgets/widgets.dsp @@ -65,8 +65,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 wxmswuniv27u_core.lib wxbase27u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivudll\widgets.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:windows -# ADD LINK32 wxmswuniv27u_core.lib wxbase27u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivudll\widgets.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:windows +# ADD BASE LINK32 wxmswuniv27u_adv.lib wxmswuniv27u_html.lib wxmswuniv27u_core.lib wxbase27u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivudll\widgets.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:windows +# ADD LINK32 wxmswuniv27u_adv.lib wxmswuniv27u_html.lib wxmswuniv27u_core.lib wxbase27u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivudll\widgets.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:windows !ELSEIF "$(CFG)" == "widgets - Win32 DLL Universal Unicode Debug" @@ -90,8 +90,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 wxmswuniv27ud_core.lib wxbase27ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivuddll\widgets.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:windows -# ADD LINK32 wxmswuniv27ud_core.lib wxbase27ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivuddll\widgets.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:windows +# ADD BASE LINK32 wxmswuniv27ud_adv.lib wxmswuniv27ud_html.lib wxmswuniv27ud_core.lib wxbase27ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivuddll\widgets.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:windows +# ADD LINK32 wxmswuniv27ud_adv.lib wxmswuniv27ud_html.lib wxmswuniv27ud_core.lib wxbase27ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivuddll\widgets.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:windows !ELSEIF "$(CFG)" == "widgets - Win32 DLL Universal Release" @@ -115,8 +115,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 wxmswuniv27_core.lib wxbase27.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivdll\widgets.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:windows -# ADD LINK32 wxmswuniv27_core.lib wxbase27.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivdll\widgets.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:windows +# ADD BASE LINK32 wxmswuniv27_adv.lib wxmswuniv27_html.lib wxmswuniv27_core.lib wxbase27.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivdll\widgets.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:windows +# ADD LINK32 wxmswuniv27_adv.lib wxmswuniv27_html.lib wxmswuniv27_core.lib wxbase27.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivdll\widgets.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:windows !ELSEIF "$(CFG)" == "widgets - Win32 DLL Universal Debug" @@ -140,8 +140,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 wxmswuniv27d_core.lib wxbase27d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivddll\widgets.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:windows -# ADD LINK32 wxmswuniv27d_core.lib wxbase27d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivddll\widgets.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:windows +# ADD BASE LINK32 wxmswuniv27d_adv.lib wxmswuniv27d_html.lib wxmswuniv27d_core.lib wxbase27d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivddll\widgets.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:windows +# ADD LINK32 wxmswuniv27d_adv.lib wxmswuniv27d_html.lib wxmswuniv27d_core.lib wxbase27d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivddll\widgets.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:windows !ELSEIF "$(CFG)" == "widgets - Win32 DLL Unicode Release" @@ -165,8 +165,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 wxmsw27u_core.lib wxbase27u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswudll\widgets.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:windows -# ADD LINK32 wxmsw27u_core.lib wxbase27u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswudll\widgets.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:windows +# ADD BASE LINK32 wxmsw27u_adv.lib wxmsw27u_html.lib wxmsw27u_core.lib wxbase27u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswudll\widgets.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:windows +# ADD LINK32 wxmsw27u_adv.lib wxmsw27u_html.lib wxmsw27u_core.lib wxbase27u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswudll\widgets.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:windows !ELSEIF "$(CFG)" == "widgets - Win32 DLL Unicode Debug" @@ -190,8 +190,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 wxmsw27ud_core.lib wxbase27ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswuddll\widgets.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:windows -# ADD LINK32 wxmsw27ud_core.lib wxbase27ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswuddll\widgets.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:windows +# ADD BASE LINK32 wxmsw27ud_adv.lib wxmsw27ud_html.lib wxmsw27ud_core.lib wxbase27ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswuddll\widgets.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:windows +# ADD LINK32 wxmsw27ud_adv.lib wxmsw27ud_html.lib wxmsw27ud_core.lib wxbase27ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswuddll\widgets.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:windows !ELSEIF "$(CFG)" == "widgets - Win32 DLL Release" @@ -215,8 +215,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 wxmsw27_core.lib wxbase27.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswdll\widgets.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:windows -# ADD LINK32 wxmsw27_core.lib wxbase27.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswdll\widgets.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:windows +# ADD BASE LINK32 wxmsw27_adv.lib wxmsw27_html.lib wxmsw27_core.lib wxbase27.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswdll\widgets.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:windows +# ADD LINK32 wxmsw27_adv.lib wxmsw27_html.lib wxmsw27_core.lib wxbase27.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswdll\widgets.exe" /libpath:".\..\..\lib\vc_dll" /subsystem:windows !ELSEIF "$(CFG)" == "widgets - Win32 DLL Debug" @@ -240,8 +240,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 wxmsw27d_core.lib wxbase27d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswddll\widgets.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:windows -# ADD LINK32 wxmsw27d_core.lib wxbase27d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswddll\widgets.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:windows +# ADD BASE LINK32 wxmsw27d_adv.lib wxmsw27d_html.lib wxmsw27d_core.lib wxbase27d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswddll\widgets.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:windows +# ADD LINK32 wxmsw27d_adv.lib wxmsw27d_html.lib wxmsw27d_core.lib wxbase27d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswddll\widgets.exe" /debug /libpath:".\..\..\lib\vc_dll" /subsystem:windows !ELSEIF "$(CFG)" == "widgets - Win32 Universal Unicode Release" @@ -265,8 +265,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 wxmswuniv27u_core.lib wxbase27u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivu\widgets.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:windows -# ADD LINK32 wxmswuniv27u_core.lib wxbase27u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivu\widgets.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:windows +# ADD BASE LINK32 wxmswuniv27u_adv.lib wxmswuniv27u_html.lib wxmswuniv27u_core.lib wxbase27u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivu\widgets.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:windows +# ADD LINK32 wxmswuniv27u_adv.lib wxmswuniv27u_html.lib wxmswuniv27u_core.lib wxbase27u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivu\widgets.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:windows !ELSEIF "$(CFG)" == "widgets - Win32 Universal Unicode Debug" @@ -290,8 +290,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 wxmswuniv27ud_core.lib wxbase27ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivud\widgets.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:windows -# ADD LINK32 wxmswuniv27ud_core.lib wxbase27ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivud\widgets.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:windows +# ADD BASE LINK32 wxmswuniv27ud_adv.lib wxmswuniv27ud_html.lib wxmswuniv27ud_core.lib wxbase27ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivud\widgets.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:windows +# ADD LINK32 wxmswuniv27ud_adv.lib wxmswuniv27ud_html.lib wxmswuniv27ud_core.lib wxbase27ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivud\widgets.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:windows !ELSEIF "$(CFG)" == "widgets - Win32 Universal Release" @@ -315,8 +315,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 wxmswuniv27_core.lib wxbase27.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswuniv\widgets.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:windows -# ADD LINK32 wxmswuniv27_core.lib wxbase27.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswuniv\widgets.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:windows +# ADD BASE LINK32 wxmswuniv27_adv.lib wxmswuniv27_html.lib wxmswuniv27_core.lib wxbase27.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswuniv\widgets.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:windows +# ADD LINK32 wxmswuniv27_adv.lib wxmswuniv27_html.lib wxmswuniv27_core.lib wxbase27.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswuniv\widgets.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:windows !ELSEIF "$(CFG)" == "widgets - Win32 Universal Debug" @@ -340,8 +340,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 wxmswuniv27d_core.lib wxbase27d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivd\widgets.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:windows -# ADD LINK32 wxmswuniv27d_core.lib wxbase27d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivd\widgets.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:windows +# ADD BASE LINK32 wxmswuniv27d_adv.lib wxmswuniv27d_html.lib wxmswuniv27d_core.lib wxbase27d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivd\widgets.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:windows +# ADD LINK32 wxmswuniv27d_adv.lib wxmswuniv27d_html.lib wxmswuniv27d_core.lib wxbase27d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswunivd\widgets.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:windows !ELSEIF "$(CFG)" == "widgets - Win32 Unicode Release" @@ -365,8 +365,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 wxmsw27u_core.lib wxbase27u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswu\widgets.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:windows -# ADD LINK32 wxmsw27u_core.lib wxbase27u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswu\widgets.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:windows +# ADD BASE LINK32 wxmsw27u_adv.lib wxmsw27u_html.lib wxmsw27u_core.lib wxbase27u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswu\widgets.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:windows +# ADD LINK32 wxmsw27u_adv.lib wxmsw27u_html.lib wxmsw27u_core.lib wxbase27u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswu\widgets.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:windows !ELSEIF "$(CFG)" == "widgets - Win32 Unicode Debug" @@ -390,8 +390,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 wxmsw27ud_core.lib wxbase27ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswud\widgets.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:windows -# ADD LINK32 wxmsw27ud_core.lib wxbase27ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswud\widgets.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:windows +# ADD BASE LINK32 wxmsw27ud_adv.lib wxmsw27ud_html.lib wxmsw27ud_core.lib wxbase27ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswud\widgets.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:windows +# ADD LINK32 wxmsw27ud_adv.lib wxmsw27ud_html.lib wxmsw27ud_core.lib wxbase27ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswud\widgets.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:windows !ELSEIF "$(CFG)" == "widgets - Win32 Release" @@ -415,8 +415,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 wxmsw27_core.lib wxbase27.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_msw\widgets.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:windows -# ADD LINK32 wxmsw27_core.lib wxbase27.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_msw\widgets.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:windows +# ADD BASE LINK32 wxmsw27_adv.lib wxmsw27_html.lib wxmsw27_core.lib wxbase27.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_msw\widgets.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:windows +# ADD LINK32 wxmsw27_adv.lib wxmsw27_html.lib wxmsw27_core.lib wxbase27.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_msw\widgets.exe" /libpath:".\..\..\lib\vc_lib" /subsystem:windows !ELSEIF "$(CFG)" == "widgets - Win32 Debug" @@ -440,8 +440,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 wxmsw27d_core.lib wxbase27d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswd\widgets.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:windows -# ADD LINK32 wxmsw27d_core.lib wxbase27d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswd\widgets.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:windows +# ADD BASE LINK32 wxmsw27d_adv.lib wxmsw27d_html.lib wxmsw27d_core.lib wxbase27d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswd\widgets.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:windows +# ADD LINK32 wxmsw27d_adv.lib wxmsw27d_html.lib wxmsw27d_core.lib wxbase27d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /machine:i386 /out:"vc_mswd\widgets.exe" /debug /libpath:".\..\..\lib\vc_lib" /subsystem:windows !ENDIF @@ -480,6 +480,10 @@ SOURCE=.\combobox.cpp # End Source File # Begin Source File +SOURCE=.\datepick.cpp +# End Source File +# Begin Source File + SOURCE=.\gauge.cpp # End Source File # Begin Source File @@ -496,6 +500,10 @@ SOURCE=.\radiobox.cpp # End Source File # Begin Source File +SOURCE=.\..\sample.rc +# End Source File +# Begin Source File + SOURCE=.\slider.cpp # End Source File # Begin Source File @@ -514,10 +522,6 @@ SOURCE=.\textctrl.cpp SOURCE=.\widgets.cpp # End Source File -# Begin Source File - -SOURCE=.\widgets.rc -# End Source File # End Group # End Target # End Project diff --git a/samples/widgets/widgets.h b/samples/widgets/widgets.h index d8e40df3ce..cb07dde406 100644 --- a/samples/widgets/widgets.h +++ b/samples/widgets/widgets.h @@ -12,10 +12,30 @@ #ifndef _WX_SAMPLE_WIDGETS_H_ #define _WX_SAMPLE_WIDGETS_H_ +#if wxUSE_TREEBOOK + #include "wx/treebook.h" + #define USE_TREEBOOK 1 + #define WidgetsBookCtrl wxTreebook + #define WidgetsBookCtrlEvent wxTreebookEvent + #define EVT_WIDGETS_PAGE_CHANGED(id,func) EVT_TREEBOOK_PAGE_CHANGED(id,func) +#else + #include "wx/bookctrl.h" + #define USE_TREEBOOK 0 + #define WidgetsBookCtrl wxBookCtrl + #define WidgetsBookCtrlEvent wxBookCtrlEvent + #define EVT_WIDGETS_PAGE_CHANGED(id,func) EVT_BOOKCTRL_PAGE_CHANGED(id,func) +#endif + +#if wxUSE_LOG && !defined(__SMARTPHONE__) + #define USE_LOG 1 +#else + #define USE_LOG 0 +#endif + class WXDLLEXPORT wxCheckBox; -class WXDLLEXPORT wxBookCtrlBase; class WXDLLEXPORT wxSizer; class WXDLLEXPORT wxTextCtrl; +class WXDLLEXPORT WidgetsBookCtrl; class WidgetsPageInfo; @@ -24,11 +44,31 @@ class WidgetsPageInfo; // all source files use wxImageList #include "wx/imaglist.h" -#if wxUSE_LOG && !defined(__SMARTPHONE__) - #define USE_LOG 1 -#else - #define USE_LOG 0 -#endif +// INTRODUCING NEW PAGES DON'T FORGET TO ADD ENTRIES TO 'WidgetsCategories' +enum +{ + NATIVE_PAGE = 0, + GENERIC_PAGE, + PICKER_PAGE, + COMBO_PAGE, + WITH_ITEMS_PAGE, + EDITABLE_PAGE, + BOOK_PAGE, + ALL_PAGE, + MAX_PAGES +}; + +enum +{ + NATIVE_CTRLS = 1 << NATIVE_PAGE, + GENERIC_CTRLS = 1 << GENERIC_PAGE, + PICKER_CTRLS = 1 << PICKER_PAGE, + COMBO_CTRLS = 1 << COMBO_PAGE, + WITH_ITEMS_CTRLS = 1 << WITH_ITEMS_PAGE, + EDITABLE_CTRLS = 1 << EDITABLE_PAGE, + BOOK_CTRLS = 1 << BOOK_PAGE, + ALL_CTRLS = 1 << ALL_PAGE +}; // ---------------------------------------------------------------------------- // WidgetsPage: a book page demonstrating some widget @@ -37,7 +77,7 @@ class WidgetsPageInfo; class WidgetsPage : public wxPanel { public: - WidgetsPage(wxBookCtrlBase *book); + WidgetsPage(WidgetsBookCtrl *book); // return the control shown by this page virtual wxControl *GetWidget() const = 0; @@ -91,14 +131,15 @@ public: class WidgetsPageInfo { public: - typedef WidgetsPage *(*Constructor)(wxBookCtrlBase *book, + typedef WidgetsPage *(*Constructor)(WidgetsBookCtrl *book, wxImageList *imaglist); // our ctor - WidgetsPageInfo(Constructor ctor, const wxChar *label); + WidgetsPageInfo(Constructor ctor, const wxChar *label, int categories); // accessors const wxString& GetLabel() const { return m_label; } + int GetCategories() const { return m_categories; } Constructor GetCtor() const { return m_ctor; } WidgetsPageInfo *GetNext() const { return m_next; } @@ -108,6 +149,9 @@ private: // the label of the page wxString m_label; + // the list (flags) for sharing page between categories + int m_categories; + // the function to create this page Constructor m_ctor; @@ -124,11 +168,11 @@ private: { return &ms_info##classname; } // and this one must be inserted somewhere in the source file -#define IMPLEMENT_WIDGETS_PAGE(classname, label) \ - WidgetsPage *wxCtorFor##classname(wxBookCtrlBase *book, \ +#define IMPLEMENT_WIDGETS_PAGE(classname, label, categories) \ + WidgetsPage *wxCtorFor##classname(WidgetsBookCtrl *book, \ wxImageList *imaglist) \ { return new classname(book, imaglist); } \ WidgetsPageInfo classname:: \ - ms_info##classname(wxCtorFor##classname, label) + ms_info##classname(wxCtorFor##classname, label, ALL_CTRLS | categories) #endif // _WX_SAMPLE_WIDGETS_H_ diff --git a/samples/widgets/widgets.rc b/samples/widgets/widgets.rc deleted file mode 100644 index b86c4e2265..0000000000 --- a/samples/widgets/widgets.rc +++ /dev/null @@ -1 +0,0 @@ -#include "wx/msw/wx.rc" -- 2.45.2