X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ca65c0440a7163e4e37e48b1c4329709d722db47..27d2dbbccadf25bb1d892fe1c4afbf74cf76bb36:/include/wx/generic/grid.h diff --git a/include/wx/generic/grid.h b/include/wx/generic/grid.h index dae05bca18..acc6edbbbb 100644 --- a/include/wx/generic/grid.h +++ b/include/wx/generic/grid.h @@ -1301,11 +1301,22 @@ 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); 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 @@ -1533,7 +1544,7 @@ public: // 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), @@ -1790,12 +1801,6 @@ protected: // 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 @@ -1854,6 +1859,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 +2090,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 +2115,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 +2134,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 ?