X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cb7c02fd46c59ec4cb399435659db63eb0969d27..11e3c6ef36393fb5863ea2f9601d8facd73acb12:/samples/scroll/scroll.cpp?ds=sidebyside diff --git a/samples/scroll/scroll.cpp b/samples/scroll/scroll.cpp index 6a95bb19b1..342bdfdf27 100644 --- a/samples/scroll/scroll.cpp +++ b/samples/scroll/scroll.cpp @@ -5,7 +5,7 @@ // RCS-ID: $Id$ // Copyright: (C) 1998 Robert Roebling, 2002 Ron Lee, 2003 Matt Gregory // (C) 2008 Vadim Zeitlin -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" @@ -22,7 +22,7 @@ #include "wx/log.h" #include "wx/tglbtn.h" -#ifndef __WXMSW__ +#ifndef wxHAS_IMAGES_IN_RESOURCES #include "../sample.xpm" #endif @@ -652,13 +652,13 @@ public: // MyCanvas // ---------------------------------------------------------------------------- -const wxWindowID ID_ADDBUTTON = wxWindow::NewControlId(); -const wxWindowID ID_DELBUTTON = wxWindow::NewControlId(); -const wxWindowID ID_MOVEBUTTON = wxWindow::NewControlId(); -const wxWindowID ID_SCROLLWIN = wxWindow::NewControlId(); -const wxWindowID ID_QUERYPOS = wxWindow::NewControlId(); +const wxWindowIDRef ID_ADDBUTTON = wxWindow::NewControlId(); +const wxWindowIDRef ID_DELBUTTON = wxWindow::NewControlId(); +const wxWindowIDRef ID_MOVEBUTTON = wxWindow::NewControlId(); +const wxWindowIDRef ID_SCROLLWIN = wxWindow::NewControlId(); +const wxWindowIDRef ID_QUERYPOS = wxWindow::NewControlId(); -const wxWindowID ID_NEWBUTTON = wxWindow::NewControlId(); +const wxWindowIDRef ID_NEWBUTTON = wxWindow::NewControlId(); BEGIN_EVENT_TABLE(MyCanvas, wxScrolled) EVT_PAINT( MyCanvas::OnPaint) @@ -797,7 +797,7 @@ MySizerScrolledWindow::MySizerScrolledWindow(wxWindow *parent) m_button = new wxButton( this, wxID_RESIZE_FRAME, "Press me", wxDefaultPosition, SMALL_BUTTON ); - sizer->Add(m_button, wxSizerFlags().Centre().Border(20)); + sizer->Add(m_button, wxSizerFlags().Centre().Border(wxALL, 20)); sizer->Add(new wxStaticText(this, wxID_ANY, "This is just"), wxSizerFlags().Centre()); sizer->Add(new wxStaticText(this, wxID_ANY, "some decoration"), @@ -1233,10 +1233,8 @@ MyAutoScrollingWindow::DCNormalize(int x, int y, int w, int h) void MyAutoScrollingWindow::OnDraw(wxDC& dc) { dc.SetFont(m_font); - wxBrush normBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW) - , wxSOLID); - wxBrush selBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT) - , wxSOLID); + wxBrush normBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); + wxBrush selBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT)); dc.SetPen(*wxTRANSPARENT_PEN); const wxString str = sm_testData; size_t strLength = str.length(); @@ -1314,7 +1312,7 @@ void MyAutoScrollingWindow::OnMouseMove(wxMouseEvent& event) // set the new cursor position m_cursor = DeviceCoordsToGraphicalChars(event.GetPosition()); // draw/erase selection - // MyRefresh(); + MyRefresh(); // capture mouse to activate auto-scrolling if (!HasCapture()) { CaptureMouse();