From a94529575ab6f932469299d6dd8aaa58561ff2ec Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 15 Jul 2013 15:14:59 +0000 Subject: [PATCH] Add wxUSE_PREFERENCES_EDITOR and the corresponding configure option. This was somehow forgotten when wxPreferencesEditor was added. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- configure | 54 ++++++++++++++++++++++++++++++++++- configure.in | 8 +++++- include/wx/chkconf.h | 28 ++++++++++++++++++ include/wx/gtk/setup0.h | 10 +++++++ include/wx/motif/setup0.h | 10 +++++++ include/wx/msw/setup0.h | 10 +++++++ include/wx/msw/wince/setup.h | 10 +++++++ include/wx/os2/setup0.h | 10 +++++++ include/wx/osx/setup0.h | 10 +++++++ include/wx/preferences.h | 5 ++++ include/wx/setup_inc.h | 10 +++++++ include/wx/univ/setup0.h | 10 +++++++ setup.h.in | 2 ++ setup.h_vms | 2 ++ src/common/preferencescmn.cpp | 4 +++ src/generic/preferencesg.cpp | 4 +++ src/osx/cocoa/preferences.mm | 4 +++ 17 files changed, 189 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 62c43ba92b..119a6b8e19 100755 --- a/configure +++ b/configure @@ -1288,6 +1288,7 @@ enable_notebook enable_notifmsg enable_odcombobox enable_popupwin +enable_prefseditor enable_radiobox enable_radiobtn enable_richmsgdlg @@ -2222,6 +2223,7 @@ Optional Features: --enable-notifmsg use wxNotificationMessage class --enable-odcombobox use wxOwnerDrawnComboBox class --enable-popupwin use wxPopUpWindow class + --enable-prefseditor use wxPreferencesEditor class --enable-radiobox use wxRadioBox class --enable-radiobtn use wxRadioButton class --enable-richmsgdlg use wxRichMessageDialog class @@ -13035,6 +13037,50 @@ fi $as_echo "$result" >&6; } + enablestring= + defaultval=$wxUSE_ALL_FEATURES + if test -z "$defaultval"; then + if test x"$enablestring" = xdisable; then + defaultval=yes + else + defaultval=no + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --${enablestring:-enable}-prefseditor" >&5 +$as_echo_n "checking for --${enablestring:-enable}-prefseditor... " >&6; } + # Check whether --enable-prefseditor was given. +if test "${enable_prefseditor+set}" = set; then : + enableval=$enable_prefseditor; + if test "$enableval" = yes; then + wx_cv_use_prefseditor='wxUSE_PREFERENCES_EDITOR=yes' + else + wx_cv_use_prefseditor='wxUSE_PREFERENCES_EDITOR=no' + fi + +else + + wx_cv_use_prefseditor='wxUSE_PREFERENCES_EDITOR=${'DEFAULT_wxUSE_PREFERENCES_EDITOR":-$defaultval}" + +fi + + + eval "$wx_cv_use_prefseditor" + + if test x"$enablestring" = xdisable; then + if test $wxUSE_PREFERENCES_EDITOR = no; then + result=yes + else + result=no + fi + else + result=$wxUSE_PREFERENCES_EDITOR + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 +$as_echo "$result" >&6; } + + enablestring= defaultval=$wxUSE_ALL_FEATURES if test -z "$defaultval"; then @@ -36642,6 +36688,12 @@ $as_echo "$as_me: WARNING: wxPopupWindow not yet supported under PM... disabled" fi fi +if test "$wxUSE_PREFERENCES_EDITOR" = "yes"; then + $as_echo "#define wxUSE_PREFERENCES_EDITOR 1" >>confdefs.h + + SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS prefseditor" +fi + if test "$wxUSE_DIALUP_MANAGER" = "yes"; then if test "$wxUSE_MAC" = 1 -o "$wxUSE_OLD_COCOA" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Dialup manager not supported on this platform... disabled" >&5 @@ -37745,7 +37797,7 @@ if test "$wxUSE_GUI" = "yes"; then SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS artprov controls dialogs drawing \ - erase event exec font image minimal preferences render \ + erase event exec font image minimal render \ shaped svg taborder vscroll widgets wrapsizer" if test "$wxUSE_MONOLITHIC" != "yes"; then diff --git a/configure.in b/configure.in index e420dd5be5..6139892b0d 100644 --- a/configure.in +++ b/configure.in @@ -971,6 +971,7 @@ WX_ARG_FEATURE(notebook, [ --enable-notebook use wxNotebook class], wx WX_ARG_FEATURE(notifmsg, [ --enable-notifmsg use wxNotificationMessage class], wxUSE_NOTIFICATION_MESSAGE) WX_ARG_FEATURE(odcombobox, [ --enable-odcombobox use wxOwnerDrawnComboBox class], wxUSE_ODCOMBOBOX) WX_ARG_FEATURE(popupwin, [ --enable-popupwin use wxPopUpWindow class], wxUSE_POPUPWIN) +WX_ARG_FEATURE(prefseditor, [ --enable-prefseditor use wxPreferencesEditor class], wxUSE_PREFERENCES_EDITOR) WX_ARG_FEATURE(radiobox, [ --enable-radiobox use wxRadioBox class], wxUSE_RADIOBOX) WX_ARG_FEATURE(radiobtn, [ --enable-radiobtn use wxRadioButton class], wxUSE_RADIOBTN) WX_ARG_FEATURE(richmsgdlg, [ --enable-richmsgdlg use wxRichMessageDialog class], wxUSE_RICHMSGDLG) @@ -7077,6 +7078,11 @@ if test "$wxUSE_POPUPWIN" = "yes"; then fi fi +if test "$wxUSE_PREFERENCES_EDITOR" = "yes"; then + AC_DEFINE(wxUSE_PREFERENCES_EDITOR) + SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS prefseditor" +fi + if test "$wxUSE_DIALUP_MANAGER" = "yes"; then if test "$wxUSE_MAC" = 1 -o "$wxUSE_OLD_COCOA" = 1; then AC_MSG_WARN([Dialup manager not supported on this platform... disabled]) @@ -7813,7 +7819,7 @@ if test "$wxUSE_GUI" = "yes"; then dnl TODO some samples are never built so far: mfc (requires VC++) SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS artprov controls dialogs drawing \ - erase event exec font image minimal preferences render \ + erase event exec font image minimal render \ shaped svg taborder vscroll widgets wrapsizer" if test "$wxUSE_MONOLITHIC" != "yes"; then diff --git a/include/wx/chkconf.h b/include/wx/chkconf.h index ad5744acaf..c6822ef947 100644 --- a/include/wx/chkconf.h +++ b/include/wx/chkconf.h @@ -936,6 +936,14 @@ # endif #endif /* !defined(wxUSE_POPUPWIN) */ +#ifndef wxUSE_PREFERENCES_EDITOR +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_PREFERENCES_EDITOR must be defined, please read comment near the top of this file." +# else +# define wxUSE_PREFERENCES_EDITOR 0 +# endif +#endif /* !defined(wxUSE_PREFERENCES_EDITOR) */ + #ifndef wxUSE_PRINTING_ARCHITECTURE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_PRINTING_ARCHITECTURE must be defined, please read comment near the top of this file." @@ -2192,6 +2200,26 @@ # endif #endif /* wxUSE_WEBVIEW && !any web view backend */ +#if wxUSE_PREFERENCES_EDITOR + /* + We can use either a generic implementation, using wxNotebook, or a + native one under wxOSX/Cocoa but then we must be using the native + toolbar. + */ +# if !wxUSE_NOTEBOOK +# ifdef __WXOSX_COCOA__ +# if !wxUSE_TOOLBAR || !wxOSX_USE_NATIVE_TOOLBAR +# error "wxUSE_PREFERENCES_EDITOR requires native toolbar in wxOSX" +# endif +# else +# error "wxUSE_PREFERENCES_EDITOR requires wxNotebook" +# endif +# else +# undef wxUSE_PREFERENCES_EDITOR +# define wxUSE_PREFERENCES_EDITOR 0 +# endif +#endif /* wxUSE_PREFERENCES_EDITOR */ + #endif /* wxUSE_GUI */ #endif /* _WX_CHKCONF_H_ */ diff --git a/include/wx/gtk/setup0.h b/include/wx/gtk/setup0.h index b5bfb413b0..d00331db0b 100644 --- a/include/wx/gtk/setup0.h +++ b/include/wx/gtk/setup0.h @@ -1098,6 +1098,16 @@ // Recommended setting: 1 #define wxUSE_NOTIFICATION_MESSAGE 1 +// wxPreferencesEditor provides a common API for different ways of presenting +// the standard "Preferences" or "Properties" dialog under different platforms +// (e.g. some use modal dialogs, some use modeless ones; some apply the changes +// immediately while others require an explicit "Apply" button). +// +// Default is 1. +// +// Recommended setting: 1 (but can be safely disabled if you don't use it) +#define wxUSE_PREFERENCES_EDITOR 1 + // wxRichToolTip is a customizable tooltip class which has more functionality // than the stock (but native, unlike this class) wxToolTip. // diff --git a/include/wx/motif/setup0.h b/include/wx/motif/setup0.h index ce146a7adf..d6f9a72702 100644 --- a/include/wx/motif/setup0.h +++ b/include/wx/motif/setup0.h @@ -1098,6 +1098,16 @@ // Recommended setting: 1 #define wxUSE_NOTIFICATION_MESSAGE 1 +// wxPreferencesEditor provides a common API for different ways of presenting +// the standard "Preferences" or "Properties" dialog under different platforms +// (e.g. some use modal dialogs, some use modeless ones; some apply the changes +// immediately while others require an explicit "Apply" button). +// +// Default is 1. +// +// Recommended setting: 1 (but can be safely disabled if you don't use it) +#define wxUSE_PREFERENCES_EDITOR 1 + // wxRichToolTip is a customizable tooltip class which has more functionality // than the stock (but native, unlike this class) wxToolTip. // diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index 453a5a0ed7..b5607221dc 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -1098,6 +1098,16 @@ // Recommended setting: 1 #define wxUSE_NOTIFICATION_MESSAGE 1 +// wxPreferencesEditor provides a common API for different ways of presenting +// the standard "Preferences" or "Properties" dialog under different platforms +// (e.g. some use modal dialogs, some use modeless ones; some apply the changes +// immediately while others require an explicit "Apply" button). +// +// Default is 1. +// +// Recommended setting: 1 (but can be safely disabled if you don't use it) +#define wxUSE_PREFERENCES_EDITOR 1 + // wxRichToolTip is a customizable tooltip class which has more functionality // than the stock (but native, unlike this class) wxToolTip. // diff --git a/include/wx/msw/wince/setup.h b/include/wx/msw/wince/setup.h index feacc9d617..0c36942d85 100644 --- a/include/wx/msw/wince/setup.h +++ b/include/wx/msw/wince/setup.h @@ -1098,6 +1098,16 @@ // Recommended setting: 1 #define wxUSE_NOTIFICATION_MESSAGE 1 +// wxPreferencesEditor provides a common API for different ways of presenting +// the standard "Preferences" or "Properties" dialog under different platforms +// (e.g. some use modal dialogs, some use modeless ones; some apply the changes +// immediately while others require an explicit "Apply" button). +// +// Default is 1. +// +// Recommended setting: 1 (but can be safely disabled if you don't use it) +#define wxUSE_PREFERENCES_EDITOR 1 + // wxRichToolTip is a customizable tooltip class which has more functionality // than the stock (but native, unlike this class) wxToolTip. // diff --git a/include/wx/os2/setup0.h b/include/wx/os2/setup0.h index c5522b1f17..71638ae67c 100644 --- a/include/wx/os2/setup0.h +++ b/include/wx/os2/setup0.h @@ -1098,6 +1098,16 @@ // Recommended setting: 1 #define wxUSE_NOTIFICATION_MESSAGE 1 +// wxPreferencesEditor provides a common API for different ways of presenting +// the standard "Preferences" or "Properties" dialog under different platforms +// (e.g. some use modal dialogs, some use modeless ones; some apply the changes +// immediately while others require an explicit "Apply" button). +// +// Default is 1. +// +// Recommended setting: 1 (but can be safely disabled if you don't use it) +#define wxUSE_PREFERENCES_EDITOR 1 + // wxRichToolTip is a customizable tooltip class which has more functionality // than the stock (but native, unlike this class) wxToolTip. // diff --git a/include/wx/osx/setup0.h b/include/wx/osx/setup0.h index a20acabe4b..0792461b9b 100644 --- a/include/wx/osx/setup0.h +++ b/include/wx/osx/setup0.h @@ -1099,6 +1099,16 @@ // Recommended setting: 1 #define wxUSE_NOTIFICATION_MESSAGE 1 +// wxPreferencesEditor provides a common API for different ways of presenting +// the standard "Preferences" or "Properties" dialog under different platforms +// (e.g. some use modal dialogs, some use modeless ones; some apply the changes +// immediately while others require an explicit "Apply" button). +// +// Default is 1. +// +// Recommended setting: 1 (but can be safely disabled if you don't use it) +#define wxUSE_PREFERENCES_EDITOR 1 + // wxRichToolTip is a customizable tooltip class which has more functionality // than the stock (but native, unlike this class) wxToolTip. // diff --git a/include/wx/preferences.h b/include/wx/preferences.h index fb6387a075..f93472e4f2 100644 --- a/include/wx/preferences.h +++ b/include/wx/preferences.h @@ -12,6 +12,9 @@ #define _WX_PREFERENCES_H_ #include "wx/defs.h" + +#if wxUSE_PREFERENCES_EDITOR + #include "wx/bitmap.h" #include "wx/vector.h" @@ -138,4 +141,6 @@ private: wxDECLARE_NO_COPY_CLASS(wxPreferencesEditor); }; +#endif // wxUSE_PREFERENCES_EDITOR + #endif // _WX_PREFERENCES_H_ diff --git a/include/wx/setup_inc.h b/include/wx/setup_inc.h index 712dcca883..e4fdcff6b3 100644 --- a/include/wx/setup_inc.h +++ b/include/wx/setup_inc.h @@ -1094,6 +1094,16 @@ // Recommended setting: 1 #define wxUSE_NOTIFICATION_MESSAGE 1 +// wxPreferencesEditor provides a common API for different ways of presenting +// the standard "Preferences" or "Properties" dialog under different platforms +// (e.g. some use modal dialogs, some use modeless ones; some apply the changes +// immediately while others require an explicit "Apply" button). +// +// Default is 1. +// +// Recommended setting: 1 (but can be safely disabled if you don't use it) +#define wxUSE_PREFERENCES_EDITOR 1 + // wxRichToolTip is a customizable tooltip class which has more functionality // than the stock (but native, unlike this class) wxToolTip. // diff --git a/include/wx/univ/setup0.h b/include/wx/univ/setup0.h index 66227d0b77..c235024dd7 100644 --- a/include/wx/univ/setup0.h +++ b/include/wx/univ/setup0.h @@ -1097,6 +1097,16 @@ // Recommended setting: 1 #define wxUSE_NOTIFICATION_MESSAGE 1 +// wxPreferencesEditor provides a common API for different ways of presenting +// the standard "Preferences" or "Properties" dialog under different platforms +// (e.g. some use modal dialogs, some use modeless ones; some apply the changes +// immediately while others require an explicit "Apply" button). +// +// Default is 1. +// +// Recommended setting: 1 (but can be safely disabled if you don't use it) +#define wxUSE_PREFERENCES_EDITOR 1 + // wxRichToolTip is a customizable tooltip class which has more functionality // than the stock (but native, unlike this class) wxToolTip. // diff --git a/setup.h.in b/setup.h.in index 8aaf1f5f18..b5cc4e1eee 100644 --- a/setup.h.in +++ b/setup.h.in @@ -474,6 +474,8 @@ #define wxUSE_NOTIFICATION_MESSAGE 0 +#define wxUSE_PREFERENCES_EDITOR 0 + #define wxUSE_RICHTOOLTIP 0 #define wxUSE_SASH 0 diff --git a/setup.h_vms b/setup.h_vms index dbf8f2dd74..79676b277f 100644 --- a/setup.h_vms +++ b/setup.h_vms @@ -414,6 +414,8 @@ typedef pid_t GPid; #define wxUSE_POPUPWIN 1 #endif +#define wxUSE_PREFERENCES_EDITOR 1 + #define wxUSE_TIPWINDOW 1 #define wxUSE_STC 1 diff --git a/src/common/preferencescmn.cpp b/src/common/preferencescmn.cpp index f4dca37a23..cb86a8f456 100644 --- a/src/common/preferencescmn.cpp +++ b/src/common/preferencescmn.cpp @@ -23,6 +23,8 @@ #pragma hdrstop #endif +#if wxUSE_PREFERENCES_EDITOR + #include "wx/private/preferences.h" #include "wx/intl.h" @@ -67,3 +69,5 @@ void wxPreferencesEditor::Dismiss() { m_impl->Dismiss(); } + +#endif // wxUSE_PREFERENCES_EDITOR diff --git a/src/generic/preferencesg.cpp b/src/generic/preferencesg.cpp index 65eeaa4b9d..cd846713da 100644 --- a/src/generic/preferencesg.cpp +++ b/src/generic/preferencesg.cpp @@ -23,6 +23,8 @@ #pragma hdrstop #endif +#if wxUSE_PREFERENCES_EDITOR + #include "wx/private/preferences.h" #ifndef wxHAS_PREF_EDITOR_NATIVE @@ -255,3 +257,5 @@ wxPreferencesEditorImpl* wxPreferencesEditorImpl::Create(const wxString& title) } #endif // !wxHAS_PREF_EDITOR_NATIVE + +#endif // wxUSE_PREFERENCES_EDITOR diff --git a/src/osx/cocoa/preferences.mm b/src/osx/cocoa/preferences.mm index 14a971d7e5..3eb6d06628 100644 --- a/src/osx/cocoa/preferences.mm +++ b/src/osx/cocoa/preferences.mm @@ -23,6 +23,8 @@ #pragma hdrstop #endif +#if wxUSE_PREFERENCES_EDITOR + #include "wx/private/preferences.h" #ifdef wxHAS_PREF_EDITOR_NATIVE @@ -256,3 +258,5 @@ wxPreferencesEditorImpl* wxPreferencesEditorImpl::Create(const wxString& title) } #endif // wxHAS_PREF_EDITOR_NATIVE + +#endif // wxUSE_PREFERENCES_EDITOR -- 2.47.2