added ChangeCursorMode() method, rewrote the col/row resizing code to capture/release mouse properly

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5963 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-02-11 17:43:42 +00:00
parent c3b177ae63
commit e2b42eebeb
2 changed files with 137 additions and 60 deletions

View File

@@ -949,14 +949,28 @@ protected:
bool m_inOnKeyDown;
int m_batchCount;
int m_cursorMode;
enum { WXGRID_CURSOR_SELECT_CELL,
WXGRID_CURSOR_RESIZE_ROW,
WXGRID_CURSOR_RESIZE_COL,
WXGRID_CURSOR_SELECT_ROW,
WXGRID_CURSOR_SELECT_COL
enum CursorMode
{
WXGRID_CURSOR_SELECT_CELL,
WXGRID_CURSOR_RESIZE_ROW,
WXGRID_CURSOR_RESIZE_COL,
WXGRID_CURSOR_SELECT_ROW,
WXGRID_CURSOR_SELECT_COL
};
// this method not only sets m_cursorMode but also sets the correct cursor
// for the given mode and, if captureMouse is not FALSE releases the mouse
// if it was captured and captures it if it must be captured
//
// for this to work, you should always use it and not set m_cursorMode
// directly!
void ChangeCursorMode(CursorMode mode,
wxWindow *win = (wxWindow *)NULL,
bool captureMouse = TRUE);
wxWindow *m_winCapture; // the window which captured the mouse
CursorMode m_cursorMode;
int m_dragLastPos;
int m_dragRowOrCol;
bool m_isDragging;