+#else // !WXWIN_COMPATIBILITY_2_8
+
+// shortcut to avoid checking compatibility modes later
+// remove this and all references to wxVarVScrollLegacyAdaptor once
+// wxWidgets 2.6 and 2.8 compatibility is removed
+typedef wxVarVScrollHelper wxVarVScrollLegacyAdaptor;
+
+#endif // WXWIN_COMPATIBILITY_2_8/!WXWIN_COMPATIBILITY_2_8
+
+
+// this macro must be used in declaration of wxVarScrollHelperBase-derived
+// classes
+#define WX_FORWARD_TO_VAR_SCROLL_HELPER() \
+public: \
+ virtual void PrepareDC(wxDC& dc) { DoPrepareDC(dc); } \
+ virtual bool Layout() { return ScrollLayout(); }
+
+
+
+// ===========================================================================
+// wxVScrolledWindow
+// ===========================================================================
+
+// In the name of this class, "V" may stand for "variable" because it can be
+// used for scrolling rows of variable heights; "virtual", because it is not
+// necessary to know the heights of all rows in advance -- only those which
+// are shown on the screen need to be measured; or even "vertical", because
+// this class only supports scrolling vertically.
+
+// In any case, this is a generalization of the wxScrolledWindow class which
+// can be only used when all rows have the same heights. It lacks some other
+// wxScrolledWindow features however, notably it can't scroll only a rectangle
+// of the window and not its entire client area.
+
+class WXDLLEXPORT wxVScrolledWindow : public wxPanel,
+ public wxVarVScrollLegacyAdaptor
+{
+public:
+ // constructors and such
+ // ---------------------
+
+ // default ctor, you must call Create() later
+ wxVScrolledWindow() : wxVarVScrollLegacyAdaptor(this) { }
+
+ // normal ctor, no need to call Create() after this one
+ //
+ // note that wxVSCROLL is always automatically added to our style, there is
+ // no need to specify it explicitly
+ wxVScrolledWindow(wxWindow *parent,
+ wxWindowID id = wxID_ANY,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxPanelNameStr)
+ : wxVarVScrollLegacyAdaptor(this)
+ {
+ (void)Create(parent, id, pos, size, style, name);
+ }
+
+ // same as the previous ctor but returns status code: true if ok
+ //
+ // just as with the ctor above, wxVSCROLL style is always used, there is no
+ // need to specify it
+ bool Create(wxWindow *parent,
+ wxWindowID id = wxID_ANY,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxPanelNameStr)
+ {
+ return wxPanel::Create(parent, id, pos, size, style | wxVSCROLL, name);
+ }
+
+#if WXWIN_COMPATIBILITY_2_8
+ // Make sure we prefer our version of HitTest rather than wxWindow's
+ // These functions should no longer be masked in favor of VirtualHitTest()
+ int HitTest(wxCoord WXUNUSED(x), wxCoord y) const
+ { return wxVarVScrollHelper::VirtualHitTest(y); }
+ int HitTest(const wxPoint& pt) const
+ { return HitTest(pt.x, pt.y); }
+#endif // WXWIN_COMPATIBILITY_2_8
+
+ WX_FORWARD_TO_VAR_SCROLL_HELPER()
+
+#ifdef __WXMAC__
+protected:
+ virtual void UpdateMacScrollWindow() { Update(); }
+#endif // __WXMAC__