X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/945d96f6e25215eb9adaf98a09942d1d0b94c35d..6cd674726b8ae173a567410b03bfa94423c69926:/samples/regtest/regtest.cpp diff --git a/samples/regtest/regtest.cpp b/samples/regtest/regtest.cpp index b3e3367cbf..a7dc10aceb 100644 --- a/samples/regtest/regtest.cpp +++ b/samples/regtest/regtest.cpp @@ -181,7 +181,7 @@ class RegFrame : public wxFrame { public: // ctor & dtor - RegFrame(wxFrame *parent, wxChar *title, int x, int y, int w, int h); + RegFrame(wxFrame *parent, const wxChar *title, int x, int y, int w, int h); virtual ~RegFrame(); // callbacks @@ -233,7 +233,7 @@ enum Menu_Delete, Menu_Info, - Ctrl_RegTree = 200, + Ctrl_RegTree = 200 }; // ---------------------------------------------------------------------------- @@ -318,6 +318,9 @@ IMPLEMENT_APP(RegApp) // `Main program' equivalent, creating windows and returning main app frame bool RegApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // create the main frame window and show it RegFrame *frame = new RegFrame(NULL, _T("wxRegTest"), 50, 50, 600, 350); frame->Show(true); @@ -331,7 +334,7 @@ bool RegApp::OnInit() // RegFrame // ---------------------------------------------------------------------------- -RegFrame::RegFrame(wxFrame *parent, wxChar *title, int x, int y, int w, int h) +RegFrame::RegFrame(wxFrame *parent, const wxChar *title, int x, int y, int w, int h) : wxFrame(parent, wxID_ANY, title, wxPoint(x, y), wxSize(w, h)) { // this reduces flicker effects @@ -361,9 +364,11 @@ RegFrame::RegFrame(wxFrame *parent, wxChar *title, int x, int y, int w, int h) m_treeCtrl = new RegTreeCtrl(this, Ctrl_RegTree); #endif +#if wxUSE_STATUSBAR // create the status line // ---------------------- CreateStatusBar(2); +#endif // wxUSE_STATUSBAR } RegFrame::~RegFrame() @@ -383,7 +388,7 @@ void RegFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxMessageDialog dialog(this, _T("wxRegistry sample\n") - _T("© 1998, 2000 Vadim Zeitlin"), + _T("(c) 1998, 2000 Vadim Zeitlin"), _T("About wxRegTest"), wxOK); dialog.ShowModal(); @@ -697,8 +702,12 @@ void RegTreeCtrl::OnChar(wxKeyEvent& event) void RegTreeCtrl::OnSelChanged(wxTreeEvent& event) { +#if wxUSE_STATUSBAR wxFrame *pFrame = (wxFrame *) wxWindow::GetParent(); pFrame->SetStatusText(GetNode(event)->FullName(), 1); +#else + wxUnusedVar(event); +#endif // wxUSE_STATUSBAR } void RegTreeCtrl::OnItemExpanding(wxTreeEvent& event) @@ -958,7 +967,7 @@ bool RegTreeCtrl::TreeNode::OnExpand() while ( bCont ) { wxString strItem; - if (str.IsEmpty()) + if (str.empty()) strItem = _T(""); else strItem = str;