wxUSE_CONFIG_NATIVE fix

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4795 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-12-02 16:32:16 +00:00
parent 4304b42f1a
commit 16193c2b68
4 changed files with 30 additions and 9 deletions

View File

@@ -44,12 +44,12 @@
#define wxCONFIG_IMMUTABLE_PREFIX '!' #define wxCONFIG_IMMUTABLE_PREFIX '!'
#endif #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 // (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 // FALSE) or wxRegConfig (if it's true and we're under Win32) or wxIniConfig
// (under Win16)) // (under Win16))
#ifndef wxCONFIG_WIN32_NATIVE #ifndef wxUSE_CONFIG_NATIVE
#define wxCONFIG_WIN32_NATIVE TRUE #define wxUSE_CONFIG_NATIVE 1
#endif #endif
// Style flags for constructor style parameter // Style flags for constructor style parameter
@@ -93,7 +93,7 @@ public:
static wxConfigBase *Get() { if ( !ms_pConfig ) Create(); return ms_pConfig; } static wxConfigBase *Get() { if ( !ms_pConfig ) Create(); return ms_pConfig; }
// create a new config object: this function will create the "best" // create a new config object: this function will create the "best"
// implementation of wxConfig available for the current platform, see // 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. // the created object and also sets it as ms_pConfig.
static wxConfigBase *Create(); static wxConfigBase *Create();
// should Get() try to create a new log object if the current one is NULL? // 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 // under Windows we prefer to use the native implementation
#if defined(__WXMSW__) && wxCONFIG_WIN32_NATIVE #if defined(__WXMSW__) && wxUSE_CONFIG_NATIVE
#ifdef __WIN32__ #ifdef __WIN32__
#define wxConfig wxRegConfig #define wxConfig wxRegConfig
#define sm_classwxConfig sm_classwxRegConfig #define sm_classwxConfig sm_classwxRegConfig

View File

@@ -3,7 +3,7 @@
#include "wx/confbase.h" #include "wx/confbase.h"
#if defined(__WXMSW__) && defined(wxCONFIG_WIN32_NATIVE) #if defined(__WXMSW__) && wxUSE_CONFIG_NATIVE
# ifdef __WIN32__ # ifdef __WIN32__
# include "wx/msw/regconf.h" # include "wx/msw/regconf.h"
#else #else

View File

@@ -47,8 +47,29 @@
// General features // 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 #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 #define wxUSE_DIALUP_MANAGER 1
// Use wxDialUpManager class // Use wxDialUpManager class
#define wxUSE_POSTSCRIPT 0 #define wxUSE_POSTSCRIPT 0

View File

@@ -23,7 +23,7 @@
#pragma hdrstop #pragma hdrstop
#endif //__BORLANDC__ #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/app.h"
#include "wx/file.h" #include "wx/file.h"
@@ -75,7 +75,7 @@ wxConfigBase *wxConfigBase::Create()
{ {
if ( ms_bAutoCreate && ms_pConfig == NULL ) { if ( ms_bAutoCreate && ms_pConfig == NULL ) {
ms_pConfig = ms_pConfig =
#if defined(__WXMSW__) && defined(wxCONFIG_WIN32_NATIVE) #if defined(__WXMSW__) && wxUSE_CONFIG_NATIVE
#ifdef __WIN32__ #ifdef __WIN32__
new wxRegConfig(wxTheApp->GetAppName(), wxTheApp->GetVendorName()); new wxRegConfig(wxTheApp->GetAppName(), wxTheApp->GetVendorName());
#else //WIN16 #else //WIN16