X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8520f1374ceec64abae3802984c4f8654d8836ba..6854c3fccb22b37bd8858dd3c3f01c968ee8608b:/samples/regtest/regtest.cpp diff --git a/samples/regtest/regtest.cpp b/samples/regtest/regtest.cpp index 4cca25f55d..4ead1d3df7 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 }; // ---------------------------------------------------------------------------- @@ -259,9 +259,10 @@ END_EVENT_TABLE() #if DO_REGTEST BEGIN_EVENT_TABLE(RegTreeCtrl, wxTreeCtrl) - EVT_TREE_DELETE_ITEM (Ctrl_RegTree, RegTreeCtrl::OnDeleteItem) - EVT_TREE_ITEM_EXPANDING(Ctrl_RegTree, RegTreeCtrl::OnItemExpanding) - EVT_TREE_SEL_CHANGED (Ctrl_RegTree, RegTreeCtrl::OnSelChanged) + EVT_TREE_DELETE_ITEM (Ctrl_RegTree, RegTreeCtrl::OnDeleteItem) + EVT_TREE_ITEM_EXPANDING (Ctrl_RegTree, RegTreeCtrl::OnItemExpanding) + EVT_TREE_ITEM_COLLAPSING(Ctrl_RegTree, RegTreeCtrl::OnItemExpanding) + EVT_TREE_SEL_CHANGED (Ctrl_RegTree, RegTreeCtrl::OnSelChanged) EVT_TREE_BEGIN_LABEL_EDIT(Ctrl_RegTree, RegTreeCtrl::OnBeginEdit) EVT_TREE_END_LABEL_EDIT (Ctrl_RegTree, RegTreeCtrl::OnEndEdit) @@ -318,6 +319,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 +335,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 @@ -385,7 +389,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(); @@ -710,7 +714,7 @@ void RegTreeCtrl::OnSelChanged(wxTreeEvent& event) void RegTreeCtrl::OnItemExpanding(wxTreeEvent& event) { TreeNode *pNode = GetNode(event); - bool bExpanding = event.GetKeyCode() == wxTREE_EXPAND_EXPAND; + bool bExpanding = event.GetEventType() == wxEVT_COMMAND_TREE_ITEM_EXPANDING; // expansion might take some time wxSetCursor(*wxHOURGLASS_CURSOR); @@ -964,7 +968,7 @@ bool RegTreeCtrl::TreeNode::OnExpand() while ( bCont ) { wxString strItem; - if (str.IsEmpty()) + if (str.empty()) strItem = _T(""); else strItem = str;