X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/329e86bfdedacf2736fa77eea1ae171c3c732355..83a5b533e2fbce8e272ff1c91310ad415ad00b97:/include/wx/generic/gridg.h diff --git a/include/wx/generic/gridg.h b/include/wx/generic/gridg.h index f753026d00..dd880fa622 100644 --- a/include/wx/generic/gridg.h +++ b/include/wx/generic/gridg.h @@ -186,7 +186,7 @@ public: void UpdateDimensions(); void SetCurrentRect (int Row, int Column, int canvasW = -1, int canvasH = -1); - void HighlightCell (wxDC *dc); + void HighlightCell(wxDC *dc, bool doHighlight); void DrawCellText(); void SetGridClippingRegion(wxDC *dc); @@ -247,6 +247,7 @@ protected: bool m_editable; bool m_editInPlace; bool m_inOnTextInPlace; + bool m_inScroll; int m_totalRows; int m_totalCols; @@ -283,6 +284,7 @@ protected: wxBrush m_labelBackgroundBrush; wxFont m_labelTextFont; wxPen m_divisionPen; + wxPen m_highlightPen; wxBitmap* m_doubleBufferingBitmap; // Position of Edit control @@ -350,6 +352,12 @@ public: : wxGenericGrid(parent, x, y, width, height, style, name) { } + wxGrid(wxWindow *parent, wxWindowID id, const wxPoint& pos, + const wxSize& size, long style = 0, const wxString& name = "grid") + : wxGenericGrid(parent, id, pos, size, style, name) + { + } + }; class WXDLLEXPORT wxGridEvent : public wxCommandEvent @@ -380,6 +388,13 @@ public: bool m_control; bool m_shift; wxGridCell* m_cell; + + int GetRow() const { return m_row; } + int GetCol() const { return m_col; } + wxPoint GetPosition() const { return wxPoint( m_x, m_y ); } + wxGridCell* GetCell() const { return m_cell; } + bool ControlDown() const { return m_control; } + bool ShiftDown() const { return m_shift; } }; const wxEventType wxEVT_GRID_SELECT_CELL = wxEVT_FIRST + 1575; @@ -395,15 +410,15 @@ const wxEventType wxEVT_GRID_LABEL_RCLICK = wxEVT_FIRST + 1583; typedef void (wxEvtHandler::*wxGridEventFunction)(wxGridEvent&); -#define EVT_GRID_SELECT_CELL(fn) { wxEVT_GRID_SELECT_CELL, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL }, -#define EVT_GRID_CREATE_CELL(fn) { wxEVT_GRID_CREATE_CELL, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL }, -#define EVT_GRID_CHANGE_LABELS(fn) { wxEVT_GRID_CHANGE_LABELS, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL }, -#define EVT_GRID_CHANGE_SEL_LABEL(fn) { wxEVT_GRID_CHANGE_SEL_LABEL, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL }, -#define EVT_GRID_CELL_CHANGE(fn) { wxEVT_GRID_CELL_CHANGE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL }, -#define EVT_GRID_CELL_LCLICK(fn) { wxEVT_GRID_CELL_LCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL }, -#define EVT_GRID_CELL_RCLICK(fn) { wxEVT_GRID_CELL_RCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL }, -#define EVT_GRID_LABEL_LCLICK(fn) { wxEVT_GRID_LABEL_LCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL }, -#define EVT_GRID_LABEL_RCLICK(fn) { wxEVT_GRID_LABEL_RCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL }, +#define EVT_GRID_SELECT_CELL(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_GRID_SELECT_CELL, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL), +#define EVT_GRID_CREATE_CELL(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_GRID_CREATE_CELL, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL), +#define EVT_GRID_CHANGE_LABELS(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_GRID_CHANGE_LABELS, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL), +#define EVT_GRID_CHANGE_SEL_LABEL(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_GRID_CHANGE_SEL_LABEL, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL), +#define EVT_GRID_CELL_CHANGE(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_GRID_CELL_CHANGE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL), +#define EVT_GRID_CELL_LCLICK(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_GRID_CELL_LCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL), +#define EVT_GRID_CELL_RCLICK(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_GRID_CELL_RCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL), +#define EVT_GRID_LABEL_LCLICK(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_GRID_LABEL_LCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL), +#define EVT_GRID_LABEL_RCLICK(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_GRID_LABEL_RCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL), #endif // __GRIDH_G__