X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aba4387c4c71fb812c6a07a7abb495606c5ef4af..830efc9b0cb87eae22d4435af7858175017522ab:/samples/config/conftest.cpp diff --git a/samples/config/conftest.cpp b/samples/config/conftest.cpp index 16ced7f3fe..b85f46e015 100644 --- a/samples/config/conftest.cpp +++ b/samples/config/conftest.cpp @@ -100,6 +100,11 @@ bool MyApp::OnInit() wxConfigBase *pConfig = wxConfigBase::Get(); + // uncomment this to force writing back of the defaults for all values + // if they're not present in the config - this can give the user an idea + // of all possible settings for this program + pConfig->SetRecordDefaults(); + // or you could also write something like this: // wxFileConfig *pConfig = new wxFileConfig("conftest"); // wxConfigBase::Set(pConfig); @@ -194,11 +199,11 @@ MyFrame::MyFrame() wxString s; if ( pConfig->Read("TestValue", &s) ) { - wxLogStatus(this, "TestValue from config is '%s'", s.c_str()); + wxLogStatus(this, wxT("TestValue from config is '%s'"), s.c_str()); } else { - wxLogStatus(this, "TestValue not found in the config"); + wxLogStatus(this, wxT("TestValue not found in the config")); } } @@ -209,7 +214,7 @@ void MyFrame::OnQuit(wxCommandEvent&) void MyFrame::OnAbout(wxCommandEvent&) { - wxMessageBox(_T("wxConfig demo\n© Vadim Zeitlin 1998"), _T("About"), + wxMessageBox(_T("wxConfig demo\n© 1998-2001 Vadim Zeitlin"), _T("About"), wxICON_INFORMATION | wxOK); } @@ -246,5 +251,5 @@ MyFrame::~MyFrame() pConfig->Write("/MainFrame/w", (long) w); pConfig->Write("/MainFrame/h", (long) h); - pConfig->Write("/TestValue", ""); + pConfig->Write("/TestValue", wxT("A test value")); }