+ this->Connect(wxEVT_PAINT, wxPaintEventHandler(wxScrolled::OnPaint));
+
+ // by default, we're scrollable in both directions (but if one of the
+ // styles is specified explicitly, we shouldn't add the other one
+ // automatically)
+ if ( !(style & (wxHSCROLL | wxVSCROLL)) )
+ style |= wxHSCROLL | wxVSCROLL;
+
+ return T::Create(parent, winid, pos, size, style, name);
+ }
+
+ // we need to return a special WM_GETDLGCODE value to process just the
+ // arrows but let the other navigation characters through
+#ifdef __WXMSW__
+ virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
+ {
+ return FilterMSWWindowProc(nMsg, T::MSWWindowProc(nMsg, wParam, lParam));
+ }
+#endif // __WXMSW__
+
+ WX_FORWARD_TO_SCROLL_HELPER()
+
+protected:
+ virtual wxSize DoGetBestSize() const
+ {
+ return FilterBestSize(this, this, T::DoGetBestSize());
+ }
+
+private:
+ // this is needed for wxEVT_PAINT processing hack described in
+ // wxScrollHelperEvtHandler::ProcessEvent()
+ void OnPaint(wxPaintEvent& event)
+ {
+ // the user code didn't really draw the window if we got here, so set
+ // this flag to try to call OnDraw() later
+ ResetDrawnFlag();
+ event.Skip();
+ }
+
+ // VC++ 6 gives warning for the declaration of template member function
+ // without definition
+#ifndef __VISUALC6__
+ wxDECLARE_NO_COPY_CLASS(wxScrolled);
+#endif
+};
+
+#ifdef __VISUALC6__
+ // disable the warning about non dll-interface class used as base for
+ // dll-interface class: it's harmless in this case
+ #pragma warning(push)
+ #pragma warning(disable:4275)
+#endif
+
+// for compatibility with existing code, we provide wxScrolledWindow
+// "typedef" for wxScrolled<wxPanel>. It's not a real typedef because we
+// want wxScrolledWindow to show in wxRTTI information (the class is widely
+// used and likelihood of its wxRTTI information being used too is high):
+class WXDLLIMPEXP_CORE wxScrolledWindow : public wxScrolled<wxPanel>
+{
+public:
+ wxScrolledWindow() : wxScrolled<wxPanel>() {}
+ wxScrolledWindow(wxWindow *parent,
+ wxWindowID winid = wxID_ANY,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxScrolledWindowStyle,
+ const wxString& name = wxPanelNameStr)
+ : wxScrolled<wxPanel>(parent, winid, pos, size, style, name) {}
+
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxScrolledWindow)
+};
+
+typedef wxScrolled<wxWindow> wxScrolledCanvas;
+
+#ifdef __VISUALC6__
+ #pragma warning(pop)