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);
void SetColAttr(int col, wxGridCellAttr *attr);
+ // returns the attribute we may modify in place: a new one if this cell
+ // doesn't have any yet or the existing one if it does
+ //
+ // DecRef() must be called on the returned pointer, as usual
+ wxGridCellAttr *GetOrCreateCellAttr(int row, int col) const;
+
+
// shortcuts for setting the column parameters
// set the format for the data in the column: default is string
//
wxGrid( wxWindow *parent,
- int x, int y, int w = wxDefaultSize.x, int h = wxDefaultSize.y,
+ int x, int y, int w = wxDefaultCoord, int h = wxDefaultCoord,
long style = wxWANTS_CHARS,
const wxString& name = wxPanelNameStr )
: wxScrolledWindow( parent, wxID_ANY, wxPoint(x,y), wxSize(w,h),
// do we have some place to store attributes in?
bool CanHaveAttributes();
- // returns the attribute we may modify in place: a new one if this cell
- // doesn't have any yet or the existing one if it does
- //
- // DecRef() must be called on the returned pointer, as usual
- wxGridCellAttr *GetOrCreateCellAttr(int row, int col) const;
-
// cell attribute cache (currently we only cache 1, may be will do
// more/better later)
struct CachedAttr
bool m_canDragRowSize;
bool m_canDragColSize;
bool m_canDragGridSize;
+ bool m_canDragCell;
int m_dragLastPos;
int m_dragRowOrCol;
bool m_isDragging;
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()
#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 ),
#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 ?