+ 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
+#if !defined(__VISUALC__) || wxCHECK_VISUALC_VERSION(7)
+ DECLARE_NO_COPY_CLASS(wxScrolled)