// Clear() is necessary. If false, the whole canvas is invalidated and a
// Clear() is necessary. Disable for when the scroll increment is used to
// actually scroll a non-constant distance
+ //
+ // Notice that calling this method with a false argument doesn't disable
+ // scrolling the window in this direction, it just changes the mechanism by
+ // which it is implemented to not use wxWindow::ScrollWindow().
virtual void EnableScrolling(bool x_scrolling, bool y_scrolling);
// Disable use of keyboard keys for scrolling. By default cursor movement
// delete the event handler we installed
void DeleteEvtHandler();
- // calls wxScrollHelperEvtHandler::ResetDrawnFlag(), see explanation
- // in wxScrollHelperEvtHandler::ProcessEvent()
- void ResetDrawnFlag();
-
// this function should be overridden to return the size available for
// m_targetWindow inside m_win of the given size
//
wxTimer *m_timerAutoScroll;
+ // The number of pixels to scroll in horizontal and vertical directions
+ // respectively.
+ //
+ // If 0, means that the scrolling in the given direction is disabled.
int m_xScrollPixelsPerLine;
int m_yScrollPixelsPerLine;
int m_xScrollPosition;
this->MacSetClipChildren(true);
#endif
- 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;
+#ifdef __WXOSX__
+ bool retval = T::Create(parent, winid, pos, size, style, name);
+ if ( retval && (style & wxALWAYS_SHOW_SB) )
+ ShowScrollbars(wxSHOW_SB_ALWAYS, wxSHOW_SB_ALWAYS);
+ return retval;
+#else
if ( style & wxALWAYS_SHOW_SB )
ShowScrollbars(wxSHOW_SB_ALWAYS, wxSHOW_SB_ALWAYS);
return T::Create(parent, winid, pos, size, style, name);
+#endif
}
+#ifdef __WXMSW__
// 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));
}
+
+ // Take into account the scroll origin.
+ virtual void MSWAdjustBrushOrg(int* xOrg, int* yOrg) const
+ {
+ CalcUnscrolledPosition(*xOrg, *yOrg, xOrg, yOrg);
+ }
#endif // __WXMSW__
WX_FORWARD_TO_SCROLL_HELPER()
}
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__