Patch from Jed Burgess that optionally allows the grid to notify when
a drag event happens on a cell. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28911 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1301,6 +1301,10 @@ public:
|
||||
void DisableDragGridSize() { EnableDragGridSize(false); }
|
||||
bool CanDragGridSize() { return m_canDragGridSize; }
|
||||
|
||||
void EnableDragCell( bool enable = true );
|
||||
void DisableDragCell() { EnableDragCell( false ); }
|
||||
bool CanDragCell() { return m_canDragCell; }
|
||||
|
||||
// this sets the specified attribute for this cell or in this row/col
|
||||
void SetAttr(int row, int col, wxGridCellAttr *attr);
|
||||
void SetRowAttr(int row, wxGridCellAttr *attr);
|
||||
@@ -1854,6 +1858,7 @@ protected:
|
||||
bool m_canDragRowSize;
|
||||
bool m_canDragColSize;
|
||||
bool m_canDragGridSize;
|
||||
bool m_canDragCell;
|
||||
int m_dragLastPos;
|
||||
int m_dragRowOrCol;
|
||||
bool m_isDragging;
|
||||
@@ -2084,6 +2089,7 @@ BEGIN_DECLARE_EVENT_TYPES()
|
||||
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_EDITOR_SHOWN, 1593)
|
||||
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_EDITOR_HIDDEN, 1594)
|
||||
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_EDITOR_CREATED, 1595)
|
||||
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_BEGIN_DRAG, 1596)
|
||||
END_DECLARE_EVENT_TYPES()
|
||||
|
||||
|
||||
@@ -2108,6 +2114,7 @@ typedef void (wxEvtHandler::*wxGridEditorCreatedEventFunction)(wxGridEditorCreat
|
||||
#define EVT_GRID_EDITOR_SHOWN(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_SHOWN, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
|
||||
#define EVT_GRID_EDITOR_HIDDEN(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_HIDDEN, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
|
||||
#define EVT_GRID_EDITOR_CREATED(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_CREATED, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEditorCreatedEventFunction, &fn ), NULL ),
|
||||
#define EVT_GRID_CELL_BEGIN_DRAG(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_BEGIN_DRAG, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
|
||||
|
||||
// The same as above but with the ability to specify an identifier
|
||||
#define EVT_GRID_CMD_CELL_LEFT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_LEFT_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
|
||||
@@ -2126,6 +2133,7 @@ typedef void (wxEvtHandler::*wxGridEditorCreatedEventFunction)(wxGridEditorCreat
|
||||
#define EVT_GRID_CMD_EDITOR_SHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_SHOWN, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
|
||||
#define EVT_GRID_CMD_EDITOR_HIDDEN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_HIDDEN, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
|
||||
#define EVT_GRID_CMD_EDITOR_CREATED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_CREATED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEditorCreatedEventFunction, &fn ), NULL ),
|
||||
#define EVT_GRID_CMD_CELL_BEGIN_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_BEGIN_DRAG, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
|
||||
|
||||
#if 0 // TODO: implement these ? others ?
|
||||
|
||||
|
Reference in New Issue
Block a user