wxScrolled<>: document how to drag between windows

This commit is contained in:
Bill Su
2026-03-16 21:09:34 -04:00
parent dfa3946048
commit 708eeb7786
2 changed files with 30 additions and 1 deletions
+1 -1
View File
@@ -168,7 +168,7 @@ public:
wxEventType& evtHorzScroll,
wxEventType& evtVertScroll) const;
// wxWidgets <= 3.3.1 mostly restricted autoscroll to the
// wxWidgets <= 3.3.2 mostly restricted autoscroll to the
// window holding the mouse capture. However, when dragging
// objects between windows, the destination window should be
// the window that is scrolling (to allow positioning the
+29
View File
@@ -116,6 +116,18 @@ enum wxScrollbarVisibility
To disable autoscrolling completely, call DisableAutoScrollOutside()
without calling EnableAutoScrollInside().
wxWidgets <= 3.3.2 mostly restricted autoscroll to the window holding the
mouse capture. However, when dragging objects between windows, the
destination window, which may or may not be the capturing window, should be
the window that is scrolling (to allow positioning the dragged object).
To support this, as of wxWidgets 3.3.3, a window can call
EnableAutoscrollWithoutCapture() when processing a drag-enter, and
DisableAutoscrollWithoutCapture() when processing a drag-exit or drag-drop.
(If a window supports dragging content to another window, it should use
EnableAutoScrollInside() and DisableAutoScrollOutside() to avoid
autoscrolling while a destination window is also autoscrolling.) See the
shape frame portion of the @sample{dnd} for an example of dragging
from one window to another.
@beginStyleTable
@style{wxHSCROLL}
@@ -541,6 +553,23 @@ public:
*/
void Scroll(const wxPoint& pt);
/**
Set this window to autoscroll even if it has not captured the mouse
(assuming the mouse cursor is in its autoscroll zone). This is
intended to be called on drag-enter to support drag and drop between
windows.
@since 3.3.0
*/
void EnableAutoscrollWithoutCapture();
/**
Undo EnableAutoscrollWithoutCapture(). This is intended to be called on
drag-exit and drag-drop when supporting drag and drop between windows.
@since 3.3.0
*/
void DisableAutoscrollWithoutCapture();
/**
Set the horizontal and vertical scrolling increment only. See the
pixelsPerUnit parameter in SetScrollbars().