]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/scroll/scroll.cpp
In virtual list mode, map first row to 1, not to 0 as this is reserved for an invalid...
[wxWidgets.git] / samples / scroll / scroll.cpp
index 98a9d01dad25e9bf0f366cae86159c9d7b12c22c..874783a1bbb4f179e4fbf1b5822686bcbe1703c8 100644 (file)
 #include "wx/log.h"
 #include "wx/tglbtn.h"
 
+#ifndef __WXMSW__
+    #include "../sample.xpm"
+#endif
+
 // ----------------------------------------------------------------------------
 // a trivial example
 // ----------------------------------------------------------------------------
@@ -854,6 +858,8 @@ END_EVENT_TABLE()
 MyFrame::MyFrame()
        : wxFrame(NULL, wxID_ANY, "wxWidgets scroll sample")
 {
+    SetIcon(wxICON(sample));
+
     wxMenu *menuFile = new wxMenu;
     menuFile->Append(wxID_ABOUT, "&About..");
     menuFile->AppendSeparator();
@@ -1234,7 +1240,7 @@ void MyAutoScrollingWindow::OnDraw(wxDC& dc)
     dc.SetPen(*wxTRANSPARENT_PEN);
     const wxString str = sm_testData;
     size_t strLength = str.length();
-    wxString::const_iterator str_i;
+    wxString::const_iterator str_i = str.begin();
 
     // draw the characters
     // 1. for each update region
@@ -1308,7 +1314,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();