(hopefully) finished subcell selection
[wxWidgets.git] / include / wx / vscroll.h
index 9bf5cce2d9059dff512f1b4efe01e8ebabcca287..8ba386cc2f833be04660a3d632547d3e29b8991d 100644 (file)
@@ -32,7 +32,7 @@
    horizontal scrolling; it can't scroll another window nor only a rectangle
    of the window and not its entire client area.
  */
-class wxVScrolledWindow : public wxPanel
+class WXDLLEXPORT wxVScrolledWindow : public wxPanel
 {
 public:
     // constructors and such
@@ -90,6 +90,17 @@ public:
     virtual bool ScrollLines(int lines);
     virtual bool ScrollPages(int pages);
 
+    // redraw the specified line
+    void RefreshLine(size_t line);
+
+    // return the item at the specified (in physical coordinates) position or
+    // wxNOT_FOUND if none, i.e. if it is below the last item
+    int HitTest(wxCoord x, wxCoord y) const;
+    int HitTest(const wxPoint& pt) const { return HitTest(pt.x, pt.y); }
+
+    // recalculate all our parameters and redisplay all lines
+    virtual void RefreshAll();
+
 
     // accessors
     // ---------
@@ -104,8 +115,12 @@ public:
     // get the last currently visible line
     size_t GetLastVisibleLine() const { return m_lineFirst + m_nVisible - 1; }
 
+    // is this line currently visible?
+    bool IsVisible(size_t line) const
+        { return line >= m_lineFirst && line <= GetLastVisibleLine(); }
+
 
-//protected:
+protected:
     // this function must be overridden in the derived class and it should
     // return the height of the given line in pixels
     virtual wxCoord OnGetLineHeight(size_t n) const = 0;
@@ -125,14 +140,14 @@ public:
     // usual
     virtual void OnGetLinesHint(size_t lineMin, size_t lineMax) const { }
 
-protected:
+
     // the event handlers
     void OnSize(wxSizeEvent& event);
     void OnScroll(wxScrollWinEvent& event);
 
     // find the index of the line we need to show at the top of the window such
-    // that the last line shown is the given one
-    size_t FindFirstFromBottom(size_t lineLast);
+    // that the last (fully or partially) visible line is the given one
+    size_t FindFirstFromBottom(size_t lineLast, bool fullyVisible = false);
 
     // get the total height of the lines between lineMin (inclusive) and
     // lineMax (exclusive)