X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dacaa6f142afa4cc4e56457b8fc776d502852ab8..c4e2838090992384911a6a6aa44cac985d79a555:/samples/vscroll/vstest.cpp diff --git a/samples/vscroll/vstest.cpp b/samples/vscroll/vstest.cpp index d5e9b9a263..c1e18c8248 100644 --- a/samples/vscroll/vstest.cpp +++ b/samples/vscroll/vstest.cpp @@ -1,11 +1,11 @@ ///////////////////////////////////////////////////////////////////////////// // Name: vscroll.cpp -// Purpose: VScroll wxWindows sample +// Purpose: VScroll wxWidgets sample // Author: Vadim Zeitlin // Modified by: // Created: 04/01/98 // RCS-ID: $Id$ -// Copyright: (c) 2003 Vadim Zeitlin +// Copyright: (c) 2003 Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -25,7 +25,7 @@ #endif // for all others, include the necessary headers (this file is usually all you -// need because it includes almost all "standard" wxWindows headers) +// need because it includes almost all "standard" wxWidgets headers) #ifndef WX_PRECOMP #include "wx/wx.h" #include "wx/app.h" @@ -82,14 +82,14 @@ public: } private: - // any class wishing to process wxWindows events must use this macro + // any class wishing to process wxWidgets events must use this macro DECLARE_EVENT_TABLE() }; class VScrollWindow : public wxVScrolledWindow { public: - VScrollWindow(wxFrame *frame) : wxVScrolledWindow(frame, -1) + VScrollWindow(wxFrame *frame) : wxVScrolledWindow(frame, wxID_ANY) { m_frame = frame; @@ -100,6 +100,7 @@ public: void OnIdle(wxIdleEvent&) { +#if wxUSE_STATUSBAR m_frame->SetStatusText(wxString::Format ( _T("Page size = %d, pos = %d, max = %d"), @@ -107,6 +108,7 @@ public: GetScrollPos(wxVERTICAL), GetScrollRange(wxVERTICAL) )); +#endif // wxUSE_STATUSBAR m_changed = false; } @@ -181,10 +183,10 @@ enum }; // ---------------------------------------------------------------------------- -// event tables and other macros for wxWindows +// event tables and other macros for wxWidgets // ---------------------------------------------------------------------------- -// the event tables connect the wxWindows events with the functions (event +// the event tables connect the wxWidgets events with the functions (event // handlers) which process them. It can be also done at run-time, but for the // simple menu events like this the static method is much simpler. BEGIN_EVENT_TABLE(VScrollFrame, wxFrame) @@ -193,7 +195,7 @@ BEGIN_EVENT_TABLE(VScrollFrame, wxFrame) EVT_SIZE(VScrollFrame::OnSize) END_EVENT_TABLE() -// Create a new application object: this macro will allow wxWindows to create +// Create a new application object: this macro will allow wxWidgets to create // the application object during program execution (it's better than using a // static object for many reasons) and also declares the accessor function // wxGetApp() which will return the reference of the right type (i.e. VScrollApp and @@ -216,10 +218,10 @@ bool VScrollApp::OnInit() // and show it (the frames, unlike simple controls, are not shown when // created initially) - frame->Show(TRUE); + frame->Show(true); // ok - return TRUE; + return true; } // ---------------------------------------------------------------------------- @@ -229,8 +231,8 @@ bool VScrollApp::OnInit() // frame constructor VScrollFrame::VScrollFrame() : wxFrame(NULL, - -1, - _T("VScroll wxWindows Sample"), + wxID_ANY, + _T("VScroll wxWidgets Sample"), wxDefaultPosition, wxSize(400, 350)) { @@ -259,7 +261,7 @@ VScrollFrame::VScrollFrame() #if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); - SetStatusText(_T("Welcome to wxWindows!")); + SetStatusText(_T("Welcome to wxWidgets!")); #endif // wxUSE_STATUSBAR // create our one and only child -- it will take our entire client area @@ -272,15 +274,15 @@ VScrollFrame::VScrollFrame() void VScrollFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { - // TRUE is to force the frame to close - Close(TRUE); + // true is to force the frame to close + Close(true); } void VScrollFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxMessageBox(_T("VScroll shows how to implement scrolling with\n") _T("variable line heights.\n") - _T("© 2003 Vadim Zeitlin"), + _T("(c) 2003 Vadim Zeitlin"), _T("About VScroll"), wxOK | wxICON_INFORMATION, this);