+
+
+// ===========================================================================
+// wxHScrolledWindow
+// ===========================================================================
+
+// In the name of this class, "H" stands for "horizontal" because it can be
+// used for scrolling columns of variable widths. It is not necessary to know
+// the widths of all columns in advance -- only those which are shown on the
+// screen need to be measured.
+
+// This is a generalization of the wxScrolledWindow class which can be only
+// used when all columns have the same width. 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 wxHScrolledWindow : public wxPanel,
+ public wxVarHScrollHelper
+{
+public:
+ // constructors and such
+ // ---------------------
+
+ // default ctor, you must call Create() later
+ wxHScrolledWindow() : wxVarHScrollHelper(this) { }
+
+ // normal ctor, no need to call Create() after this one
+ //
+ // note that wxHSCROLL is always automatically added to our style, there is
+ // no need to specify it explicitly
+ wxHScrolledWindow(wxWindow *parent,
+ wxWindowID id = wxID_ANY,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxPanelNameStr)
+ : wxVarHScrollHelper(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, wxHSCROLL 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 | wxHSCROLL, name);
+ }
+
+ // Make sure we prefer our version of HitTest rather than wxWindow's
+ int HitTest(wxCoord x, wxCoord WXUNUSED(y)) const
+ { return wxVarHScrollHelper::HitTest(x); }
+ int HitTest(const wxPoint& pt) const
+ { return HitTest(pt.x, pt.y); }
+
+ WX_FORWARD_TO_VAR_SCROLL_HELPER()
+
+#ifdef __WXMAC__
+protected:
+ virtual void UpdateMacScrollWindow() { Update(); }
+#endif // __WXMAC__
+
+private:
+ DECLARE_NO_COPY_CLASS(wxHScrolledWindow)
+ DECLARE_ABSTRACT_CLASS(wxHScrolledWindow)
+};
+
+
+
+// ===========================================================================
+// wxHVScrolledWindow
+// ===========================================================================
+
+// This window inherits all functionality of both vertical and horizontal
+// scrolled windows automatically handling everything needed to scroll both
+// axis simultaneously.
+
+class WXDLLEXPORT wxHVScrolledWindow : public wxPanel,
+ public wxVarHVScrollHelper
+{
+public:
+ // constructors and such
+ // ---------------------
+
+ // default ctor, you must call Create() later
+ wxHVScrolledWindow()
+ : wxPanel(),
+ wxVarHVScrollHelper(this) { }
+
+ // normal ctor, no need to call Create() after this one
+ //
+ // note that wxVSCROLL and wxHSCROLL are always automatically added to our
+ // style, there is no need to specify them explicitly
+ wxHVScrolledWindow(wxWindow *parent,
+ wxWindowID id = wxID_ANY,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxPanelNameStr)
+ : wxPanel(),
+ wxVarHVScrollHelper(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 and wxHSCROLL styles are always
+ // used, there is no need to specify them
+ 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 | wxHSCROLL, name);
+ }
+
+ // Make sure we prefer our version of HitTest rather than wxWindow's
+ wxPosition HitTest(wxCoord x, wxCoord y) const
+ { return wxVarHVScrollHelper::HitTest(x, y); }
+ wxPosition HitTest(const wxPoint &pt) const
+ { return HitTest(pt.x, pt.y); }
+
+ WX_FORWARD_TO_VAR_SCROLL_HELPER()
+
+#ifdef __WXMAC__
+protected:
+ virtual void UpdateMacScrollWindow() { Update(); }
+#endif // __WXMAC__
+
+private:
+ DECLARE_NO_COPY_CLASS(wxHVScrolledWindow)
+ DECLARE_ABSTRACT_CLASS(wxHVScrolledWindow)
+};
+