wxSplitterWindow mouse capture improvements and cleanup.
- Handle mouse-capture-lost event to abort dragging mode. - Remember mouse and sash position on buttondown event and use them as absolute reference during dragging. Avoid delta values from one mousemove to the next as this may introduce a skew during dragging and especially when coordinate clipping occurs. - Clear the requested sash position when dragging in live mode. - Draw the tracker at correct coordinates - taking into account the width of the pen used to draw the tracker. - The old code did not clearly distinguish between live vs. tracking mode in some places. Closes #11076. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61615 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -193,6 +193,9 @@ public:
|
||||
// Handles mouse events
|
||||
void OnMouseEvent(wxMouseEvent& ev);
|
||||
|
||||
// Aborts dragging mode
|
||||
void OnMouseCaptureLost(wxMouseCaptureLostEvent& event);
|
||||
|
||||
// Adjusts the panes
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
@@ -275,16 +278,16 @@ protected:
|
||||
wxWindow* m_windowOne;
|
||||
wxWindow* m_windowTwo;
|
||||
int m_dragMode;
|
||||
int m_oldX;
|
||||
int m_oldY;
|
||||
int m_oldX; // current tracker position if not live mode
|
||||
int m_oldY; // current tracker position if not live mode
|
||||
int m_sashPosition; // Number of pixels from left or top
|
||||
double m_sashGravity;
|
||||
int m_sashSize;
|
||||
wxSize m_lastSize;
|
||||
int m_requestedSashPosition;
|
||||
int m_sashPositionCurrent; // while dragging
|
||||
int m_firstX;
|
||||
int m_firstY;
|
||||
wxPoint m_ptStart; // mouse position when dragging started
|
||||
int m_sashStart; // sash position when dragging started
|
||||
int m_minimumPaneSize;
|
||||
wxCursor m_sashCursorWE;
|
||||
wxCursor m_sashCursorNS;
|
||||
|
Reference in New Issue
Block a user