- // child controls
- wxPanel *panel = new wxPanel(this);
- (void)new wxStaticText(panel, wxID_ANY, _T("These controls remember their values!"),
- wxPoint(10, 10), wxSize(300, 20));
- m_text = new wxTextCtrl(panel, wxID_ANY, _T(""), wxPoint(10, 40), wxSize(300, 20));
- m_check = new wxCheckBox(panel, wxID_ANY, _T("show welcome message box at startup"),
- wxPoint(10, 70), wxSize(300, 20));
-
- // restore the control's values from the config
-
- // NB: in this program, the config object is already created at this moment
- // because we had called Get() from MyApp::OnInit(). However, if you later
- // change the code and don't create it before this line, it won't break
- // anything - unlike if you manually create wxConfig object with Create()
- // or in any other way (then you must be sure to create it before using it!).
- wxConfigBase *pConfig = wxConfigBase::Get();
-
- // we could write Read("/Controls/Text") as well, it's just to show SetPath()
- pConfig->SetPath(_T("/Controls"));
-
- m_text->SetValue(pConfig->Read(_T("Text"), _T("")));
- m_check->SetValue(pConfig->Read(_T("Check"), 1l) != 0);
-
- // SetPath() understands ".."
- pConfig->SetPath(_T("../MainFrame"));
-
- // restore frame position and size
- int x = pConfig->Read(_T("x"), 50),
- y = pConfig->Read(_T("y"), 50),
- w = pConfig->Read(_T("w"), 350),
- h = pConfig->Read(_T("h"), 200);
- Move(x, y);
- SetClientSize(w, h);
-
- pConfig->SetPath(_T("/"));
- wxString s;
- if ( pConfig->Read(_T("TestValue"), &s) )
- {
- wxLogStatus(this, wxT("TestValue from config is '%s'"), s.c_str());
- }
- else
- {
- wxLogStatus(this, wxT("TestValue not found in the config"));
- }
+ // child controls
+ wxPanel *panel = new wxPanel(this);
+ (void)new wxStaticText(panel, wxID_ANY, wxT("These controls remember their values!"),
+ wxPoint(10, 10), wxSize(300, 20));
+ m_text = new wxTextCtrl(panel, wxID_ANY, wxT(""), wxPoint(10, 40), wxSize(300, 20));
+ m_check = new wxCheckBox(panel, wxID_ANY, wxT("show welcome message box at startup"),
+ wxPoint(10, 70), wxSize(300, 20));
+
+ // restore the control's values from the config
+
+ // NB: in this program, the config object is already created at this moment
+ // because we had called Get() from MyApp::OnInit(). However, if you later
+ // change the code and don't create it before this line, it won't break
+ // anything - unlike if you manually create wxConfig object with Create()
+ // or in any other way (then you must be sure to create it before using it!).
+ wxConfigBase *pConfig = wxConfigBase::Get();
+
+ // we could write Read("/Controls/Text") as well, it's just to show SetPath()
+ pConfig->SetPath(wxT("/Controls"));
+
+ m_text->SetValue(pConfig->Read(wxT("Text"), wxT("")));
+ m_check->SetValue(pConfig->Read(wxT("Check"), 1l) != 0);
+
+ // SetPath() understands ".."
+ pConfig->SetPath(wxT("../MainFrame"));
+
+ // restore frame position and size
+ int x = pConfig->Read(wxT("x"), 50),
+ y = pConfig->Read(wxT("y"), 50),
+ w = pConfig->Read(wxT("w"), 350),
+ h = pConfig->Read(wxT("h"), 200);
+ Move(x, y);
+ SetClientSize(w, h);
+
+ pConfig->SetPath(wxT("/"));
+ wxString s;
+ if ( pConfig->Read(wxT("TestValue"), &s) )
+ {
+ wxLogStatus(this, wxT("TestValue from config is '%s'"), s.c_str());
+ }
+ else
+ {
+ wxLogStatus(this, wxT("TestValue not found in the config"));
+ }