From 16193c2b68e0a45d4aa22a923e9ff2b708e4b80c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 2 Dec 1999 16:32:16 +0000 Subject: [PATCH] wxUSE_CONFIG_NATIVE fix git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4795 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/confbase.h | 10 +++++----- include/wx/config.h | 2 +- include/wx/msw/setup0.h | 23 ++++++++++++++++++++++- src/common/config.cpp | 4 ++-- 4 files changed, 30 insertions(+), 9 deletions(-) diff --git a/include/wx/confbase.h b/include/wx/confbase.h index 46336d3d65..abb5f96dd0 100644 --- a/include/wx/confbase.h +++ b/include/wx/confbase.h @@ -44,12 +44,12 @@ #define wxCONFIG_IMMUTABLE_PREFIX '!' #endif -/// should we use registry instead of configuration files under Win32? +/// should we use registry instead of configuration files under Windows? // (i.e. whether wxConfigBase::Create() will create a wxFileConfig (if it's // FALSE) or wxRegConfig (if it's true and we're under Win32) or wxIniConfig // (under Win16)) -#ifndef wxCONFIG_WIN32_NATIVE - #define wxCONFIG_WIN32_NATIVE TRUE +#ifndef wxUSE_CONFIG_NATIVE + #define wxUSE_CONFIG_NATIVE 1 #endif // Style flags for constructor style parameter @@ -93,7 +93,7 @@ public: static wxConfigBase *Get() { if ( !ms_pConfig ) Create(); return ms_pConfig; } // create a new config object: this function will create the "best" // implementation of wxConfig available for the current platform, see - // comments near definition wxCONFIG_WIN32_NATIVE for details. It returns + // comments near definition wxUSE_CONFIG_NATIVE for details. It returns // the created object and also sets it as ms_pConfig. static wxConfigBase *Create(); // should Get() try to create a new log object if the current one is NULL? @@ -279,7 +279,7 @@ private: // ---------------------------------------------------------------------------- // under Windows we prefer to use the native implementation -#if defined(__WXMSW__) && wxCONFIG_WIN32_NATIVE +#if defined(__WXMSW__) && wxUSE_CONFIG_NATIVE #ifdef __WIN32__ #define wxConfig wxRegConfig #define sm_classwxConfig sm_classwxRegConfig diff --git a/include/wx/config.h b/include/wx/config.h index d9ffb9fa58..41afd94b01 100644 --- a/include/wx/config.h +++ b/include/wx/config.h @@ -3,7 +3,7 @@ #include "wx/confbase.h" -#if defined(__WXMSW__) && defined(wxCONFIG_WIN32_NATIVE) +#if defined(__WXMSW__) && wxUSE_CONFIG_NATIVE # ifdef __WIN32__ # include "wx/msw/regconf.h" #else diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index 1a73808f9e..6e207d34cf 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -47,8 +47,29 @@ // General features // ---------------------------------------------------------------------------- +// Setting wxUSE_CONFIG to 1 enables the use of wxConfig and related classes +// which allow the application to store its settings in the persistent +// storage. Setting this to 1 will also enable on-demand creation of the +// global config object in wxApp. +// +// See also wxUSE_CONFIG_NATIVE below. +// +// Recommended setting: 1 #define wxUSE_CONFIG 1 - // Use wxConfig, with CreateConfig in wxApp + +// If wxUSE_CONFIG is 1, you may choose to use either the native config +// classes under Windows (using .INI files under Win16 and the registry under +// Win32) or the portable text file format used by the config classes under +// Unix. +// +// Default is 1 to use native classes. Note that you may still use +// wxFileConfig even if you set this to 1 - just the config object created by +// default for the applications needs will be a wxRegConfig or wxIniConfig and +// not wxFileConfig. +// +// Recommended setting: 1 +#define wxUSE_CONFIG_NATIVE 1 + #define wxUSE_DIALUP_MANAGER 1 // Use wxDialUpManager class #define wxUSE_POSTSCRIPT 0 diff --git a/src/common/config.cpp b/src/common/config.cpp index 19822e4691..57d71204e3 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -23,7 +23,7 @@ #pragma hdrstop #endif //__BORLANDC__ -#if wxUSE_CONFIG && ((wxUSE_FILE && wxUSE_TEXTFILE) || defined(wxCONFIG_WIN32_NATIVE)) +#if wxUSE_CONFIG && ((wxUSE_FILE && wxUSE_TEXTFILE) || wxUSE_CONFIG_NATIVE)) #include "wx/app.h" #include "wx/file.h" @@ -75,7 +75,7 @@ wxConfigBase *wxConfigBase::Create() { if ( ms_bAutoCreate && ms_pConfig == NULL ) { ms_pConfig = - #if defined(__WXMSW__) && defined(wxCONFIG_WIN32_NATIVE) + #if defined(__WXMSW__) && wxUSE_CONFIG_NATIVE #ifdef __WIN32__ new wxRegConfig(wxTheApp->GetAppName(), wxTheApp->GetVendorName()); #else //WIN16 -- 2.45.2