/////////////////////////////////////////////////////////////////////////////
-// Name: vscroll.cpp
+// Name: samples/vscroll/vstest.cpp
// Purpose: VScroll wxWidgets sample
// Author: Vadim Zeitlin
// Modified by:
// ----------------------------------------------------------------------------
// the application icon (under Windows and OS/2 it is in resources)
-#if !defined(__WXMSW__) && !defined(__WXOS2__)
- #include "mondrian.xpm"
+#if !defined(__WXMSW__) && !defined(__WXPM__)
+ #include "../sample.xpm"
#endif
// ----------------------------------------------------------------------------
class VScrollWindow : public wxVScrolledWindow
{
public:
- VScrollWindow(wxFrame *frame) : wxVScrolledWindow(frame, -1)
+ VScrollWindow(wxFrame *frame) : wxVScrolledWindow(frame, wxID_ANY)
{
m_frame = frame;
void OnIdle(wxIdleEvent&)
{
+#if wxUSE_STATUSBAR
m_frame->SetStatusText(wxString::Format
(
_T("Page size = %d, pos = %d, max = %d"),
GetScrollPos(wxVERTICAL),
GetScrollRange(wxVERTICAL)
));
+#endif // wxUSE_STATUSBAR
m_changed = false;
}
enum
{
// menu items
- VScroll_Quit = 1,
+ VScroll_Quit = wxID_EXIT,
// it is important for the id corresponding to the "About" command to have
// this standard value as otherwise it won't be handled properly under Mac
// 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;
}
// ----------------------------------------------------------------------------
// frame constructor
VScrollFrame::VScrollFrame()
: wxFrame(NULL,
- -1,
+ wxID_ANY,
_T("VScroll wxWidgets Sample"),
wxDefaultPosition,
wxSize(400, 350))
{
// set the frame icon
- SetIcon(wxICON(mondrian));
+ SetIcon(wxICON(sample));
#if wxUSE_MENUS
// create a menu bar
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);