X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/73145b0ed18e99b66988c3caf6ad9119911913bb..2c326adae6bcbcc9510710116ae9eb4b5581192d:/include/wx/generic/grid.h diff --git a/include/wx/generic/grid.h b/include/wx/generic/grid.h index 8ece9e5136..cfa4ceaad4 100644 --- a/include/wx/generic/grid.h +++ b/include/wx/generic/grid.h @@ -11,21 +11,18 @@ #include "wx/defs.h" -#if !defined(wxUSE_NEW_GRID) || !(wxUSE_NEW_GRID) -#include "wx/generic/gridg.h" -#else - #ifndef __WXGRID_H__ #define __WXGRID_H__ -#if defined(__GNUG__) && !defined(__APPLE__) +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "grid.h" #endif -#include "wx/hash.h" +#include "wx/hashmap.h" #include "wx/panel.h" #include "wx/scrolwin.h" #include "wx/string.h" +#include "wx/arrstr.h" #include "wx/scrolbar.h" #include "wx/event.h" #include "wx/combobox.h" @@ -68,22 +65,25 @@ // forward declarations // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxGrid; -class WXDLLEXPORT wxGridCellAttr; -class WXDLLEXPORT wxGridCellAttrProviderData; -class WXDLLEXPORT wxGridColLabelWindow; -class WXDLLEXPORT wxGridCornerLabelWindow; -class WXDLLEXPORT wxGridRowLabelWindow; -class WXDLLEXPORT wxGridTableBase; -class WXDLLEXPORT wxGridWindow; -class WXDLLEXPORT wxGridTypeRegistry; -class WXDLLEXPORT wxGridSelection; +class WXDLLIMPEXP_ADV wxGrid; +class WXDLLIMPEXP_ADV wxGridCellAttr; +class WXDLLIMPEXP_ADV wxGridCellAttrProviderData; +class WXDLLIMPEXP_ADV wxGridColLabelWindow; +class WXDLLIMPEXP_ADV wxGridCornerLabelWindow; +class WXDLLIMPEXP_ADV wxGridRowLabelWindow; +class WXDLLIMPEXP_ADV wxGridTableBase; +class WXDLLIMPEXP_ADV wxGridWindow; +class WXDLLIMPEXP_ADV wxGridTypeRegistry; +class WXDLLIMPEXP_ADV wxGridSelection; class WXDLLEXPORT wxCheckBox; class WXDLLEXPORT wxComboBox; class WXDLLEXPORT wxTextCtrl; class WXDLLEXPORT wxSpinCtrl; +WX_DECLARE_HASH_MAP_WITH_DECL( long, long, wxIntegerHash, wxIntegerEqual, + wxLongToLongHashMap, class WXDLLIMPEXP_ADV ); + // ---------------------------------------------------------------------------- // macros // ---------------------------------------------------------------------------- @@ -99,7 +99,7 @@ class WXDLLEXPORT wxSpinCtrl; // class is not documented and is not public at all // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxGridCellWorker : public wxClientDataContainer +class WXDLLIMPEXP_ADV wxGridCellWorker : public wxClientDataContainer { public: wxGridCellWorker() { m_nRef = 1; } @@ -135,7 +135,7 @@ private: // predefined derived classes or derive your own class from it. // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxGridCellRenderer : public wxGridCellWorker +class WXDLLIMPEXP_ADV wxGridCellRenderer : public wxGridCellWorker { public: // draw the given cell on the provided DC inside the given rectangle @@ -163,7 +163,7 @@ public: }; // the default renderer for the cells containing string data -class WXDLLEXPORT wxGridCellStringRenderer : public wxGridCellRenderer +class WXDLLIMPEXP_ADV wxGridCellStringRenderer : public wxGridCellRenderer { public: // draw the string @@ -197,7 +197,7 @@ protected: }; // the default renderer for the cells containing numeric (long) data -class WXDLLEXPORT wxGridCellNumberRenderer : public wxGridCellStringRenderer +class WXDLLIMPEXP_ADV wxGridCellNumberRenderer : public wxGridCellStringRenderer { public: // draw the string right aligned @@ -220,7 +220,7 @@ protected: wxString GetString(wxGrid& grid, int row, int col); }; -class WXDLLEXPORT wxGridCellFloatRenderer : public wxGridCellStringRenderer +class WXDLLIMPEXP_ADV wxGridCellFloatRenderer : public wxGridCellStringRenderer { public: wxGridCellFloatRenderer(int width = -1, int precision = -1); @@ -261,7 +261,7 @@ private: }; // renderer for boolean fields -class WXDLLEXPORT wxGridCellBoolRenderer : public wxGridCellRenderer +class WXDLLIMPEXP_ADV wxGridCellBoolRenderer : public wxGridCellRenderer { public: // draw a check mark or nothing @@ -293,7 +293,7 @@ private: // even for the entire grid. // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxGridCellEditor : public wxGridCellWorker +class WXDLLIMPEXP_ADV wxGridCellEditor : public wxGridCellWorker { public: wxGridCellEditor(); @@ -302,6 +302,9 @@ public: wxControl* GetControl() { return m_control; } void SetControl(wxControl* control) { m_control = control; } + wxGridCellAttr* GetCellAttr() { return m_attr; } + void SetCellAttr(wxGridCellAttr* attr) { m_attr = attr; } + // Creates the actual edit control virtual void Create(wxWindow* parent, wxWindowID id, @@ -368,6 +371,9 @@ protected: // the control we show on screen wxControl* m_control; + // a temporary pointer to the attribute being edited + wxGridCellAttr* m_attr; + // if we change the colours/font of the control from the default ones, we // must restore the default later and we save them here between calls to // Show(TRUE) and Show(FALSE) @@ -378,12 +384,14 @@ protected: // suppress the stupid gcc warning about the class having private dtor and // no friends friend class wxGridCellEditorDummyFriend; + + DECLARE_NO_COPY_CLASS(wxGridCellEditor) }; #if wxUSE_TEXTCTRL // the editor for string/text data -class WXDLLEXPORT wxGridCellTextEditor : public wxGridCellEditor +class WXDLLIMPEXP_ADV wxGridCellTextEditor : public wxGridCellEditor { public: wxGridCellTextEditor(); @@ -422,10 +430,12 @@ protected: private: size_t m_maxChars; // max number of chars allowed wxString m_startValue; + + DECLARE_NO_COPY_CLASS(wxGridCellTextEditor) }; // the editor for numeric (long) data -class WXDLLEXPORT wxGridCellNumberEditor : public wxGridCellTextEditor +class WXDLLIMPEXP_ADV wxGridCellNumberEditor : public wxGridCellTextEditor { public: // allows to specify the range - if min == max == -1, no range checking is @@ -467,10 +477,12 @@ private: m_max; long m_valueOld; + + DECLARE_NO_COPY_CLASS(wxGridCellNumberEditor) }; // the editor for floating point numbers (double) data -class WXDLLEXPORT wxGridCellFloatEditor : public wxGridCellTextEditor +class WXDLLIMPEXP_ADV wxGridCellFloatEditor : public wxGridCellTextEditor { public: wxGridCellFloatEditor(int width = -1, int precision = -1); @@ -500,6 +512,8 @@ private: int m_width, m_precision; double m_valueOld; + + DECLARE_NO_COPY_CLASS(wxGridCellFloatEditor) }; #endif // wxUSE_TEXTCTRL @@ -507,9 +521,11 @@ private: #if wxUSE_CHECKBOX // the editor for boolean data -class WXDLLEXPORT wxGridCellBoolEditor : public wxGridCellEditor +class WXDLLIMPEXP_ADV wxGridCellBoolEditor : public wxGridCellEditor { public: + wxGridCellBoolEditor() { } + virtual void Create(wxWindow* parent, wxWindowID id, wxEvtHandler* evtHandler); @@ -535,6 +551,8 @@ protected: private: bool m_startValue; + + DECLARE_NO_COPY_CLASS(wxGridCellBoolEditor) }; #endif // wxUSE_CHECKBOX @@ -542,13 +560,15 @@ private: #if wxUSE_COMBOBOX // the editor for string data allowing to choose from the list of strings -class WXDLLEXPORT wxGridCellChoiceEditor : public wxGridCellEditor +class WXDLLIMPEXP_ADV wxGridCellChoiceEditor : public wxGridCellEditor { public: // if !allowOthers, user can't type a string not in choices array wxGridCellChoiceEditor(size_t count = 0, const wxString choices[] = NULL, bool allowOthers = FALSE); + wxGridCellChoiceEditor(const wxArrayString& choices, + bool allowOthers = FALSE); virtual void Create(wxWindow* parent, wxWindowID id, @@ -578,6 +598,8 @@ protected: wxString m_startValue; wxArrayString m_choices; bool m_allowOthers; + + DECLARE_NO_COPY_CLASS(wxGridCellChoiceEditor) }; #endif // wxUSE_COMBOBOX @@ -588,7 +610,7 @@ protected: // class may be returned by wxGridTable::GetAttr(). // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxGridCellAttr : public wxClientDataContainer +class WXDLLIMPEXP_ADV wxGridCellAttr : public wxClientDataContainer { public: enum wxAttrKind @@ -643,7 +665,8 @@ public: m_vAlign = vAlign; } void SetSize(int num_rows, int num_cols); - void SetOverflow( bool allow ) { m_overflow = allow; } + void SetOverflow(bool allow = TRUE) + { m_overflow = allow ? Overflow : SingleCell; } void SetReadOnly(bool isReadOnly = TRUE) { m_isReadOnly = isReadOnly ? ReadOnly : ReadWrite; } @@ -663,13 +686,15 @@ public: bool HasRenderer() const { return m_renderer != NULL; } bool HasEditor() const { return m_editor != NULL; } bool HasReadWriteMode() const { return m_isReadOnly != Unset; } + bool HasOverflowMode() const { return m_overflow != UnsetOverflow; } const wxColour& GetTextColour() const; const wxColour& GetBackgroundColour() const; const wxFont& GetFont() const; void GetAlignment(int *hAlign, int *vAlign) const; void GetSize(int *num_rows, int *num_cols) const; - bool GetOverflow() const { return m_overflow; } + bool GetOverflow() const + { return m_overflow != SingleCell; } wxGridCellRenderer *GetRenderer(wxGrid* grid, int row, int col) const; wxGridCellEditor *GetEditor(wxGrid* grid, int row, int col) const; @@ -687,6 +712,13 @@ private: ReadOnly }; + enum wxAttrOverflowMode + { + UnsetOverflow = -1, + Overflow, + SingleCell + }; + // the common part of all ctors void Init(wxGridCellAttr *attrDefault = NULL); @@ -707,7 +739,8 @@ private: m_vAlign; int m_sizeRows, m_sizeCols; - bool m_overflow; + + wxAttrOverflowMode m_overflow; wxGridCellRenderer* m_renderer; wxGridCellEditor* m_editor; @@ -737,7 +770,7 @@ private: // the default implementation is reasonably efficient for the generic case, // but you might still wish to implement your own for some specific situations // if you have performance problems with the stock one -class WXDLLEXPORT wxGridCellAttrProvider : public wxClientDataContainer +class WXDLLIMPEXP_ADV wxGridCellAttrProvider : public wxClientDataContainer { public: wxGridCellAttrProvider(); @@ -762,6 +795,8 @@ private: void InitData(); wxGridCellAttrProviderData *m_data; + + DECLARE_NO_COPY_CLASS(wxGridCellAttrProvider) }; ////////////////////////////////////////////////////////////////////// @@ -771,7 +806,7 @@ private: ////////////////////////////////////////////////////////////////////// -class WXDLLEXPORT wxGridTableBase : public wxObject, public wxClientDataContainer +class WXDLLIMPEXP_ADV wxGridTableBase : public wxObject, public wxClientDataContainer { public: wxGridTableBase(); @@ -850,6 +885,7 @@ private: wxGridCellAttrProvider *m_attrProvider; DECLARE_ABSTRACT_CLASS( wxGridTableBase ); + DECLARE_NO_COPY_CLASS(wxGridTableBase) }; @@ -871,7 +907,7 @@ enum wxGridTableRequest wxGRIDTABLE_NOTIFY_COLS_DELETED }; -class WXDLLEXPORT wxGridTableMessage +class WXDLLIMPEXP_ADV wxGridTableMessage { public: wxGridTableMessage(); @@ -893,6 +929,8 @@ private: int m_id; int m_comInt1; int m_comInt2; + + DECLARE_NO_COPY_CLASS(wxGridTableMessage) }; @@ -901,7 +939,8 @@ private: // A 2-dimensional array of strings for data values // -WX_DECLARE_EXPORTED_OBJARRAY(wxArrayString, wxGridStringArray); +WX_DECLARE_OBJARRAY_WITH_DECL(wxArrayString, wxGridStringArray, + class WXDLLIMPEXP_ADV); @@ -911,7 +950,7 @@ WX_DECLARE_EXPORTED_OBJARRAY(wxArrayString, wxGridStringArray); // that are stored in memory // -class WXDLLEXPORT wxGridStringTable : public wxGridTableBase +class WXDLLIMPEXP_ADV wxGridStringTable : public wxGridTableBase { public: wxGridStringTable(); @@ -950,7 +989,7 @@ private: wxArrayString m_rowLabels; wxArrayString m_colLabels; - DECLARE_DYNAMIC_CLASS( wxGridStringTable ) + DECLARE_DYNAMIC_CLASS_NO_COPY( wxGridStringTable ) }; @@ -963,7 +1002,7 @@ private: // wxGridCellCoords: location of a cell in the grid // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxGridCellCoords +class WXDLLIMPEXP_ADV wxGridCellCoords { public: wxGridCellCoords() { m_row = m_col = -1; } @@ -1010,26 +1049,31 @@ private: // For comparisons... // -extern WXDLLEXPORT wxGridCellCoords wxGridNoCellCoords; -extern WXDLLEXPORT wxRect wxGridNoCellRect; +extern WXDLLIMPEXP_ADV wxGridCellCoords wxGridNoCellCoords; +extern WXDLLIMPEXP_ADV wxRect wxGridNoCellRect; // An array of cell coords... // -WX_DECLARE_EXPORTED_OBJARRAY(wxGridCellCoords, wxGridCellCoordsArray); +WX_DECLARE_OBJARRAY_WITH_DECL(wxGridCellCoords, wxGridCellCoordsArray, + class WXDLLIMPEXP_ADV); // ---------------------------------------------------------------------------- // wxGrid // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxGrid : public wxScrolledWindow +class WXDLLIMPEXP_ADV wxGrid : public wxScrolledWindow { public: - wxGrid() - { - Create(); - } + wxGrid() ; - wxGrid( wxWindow *parent, + wxGrid( wxWindow *parent, + wxWindowID id, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxWANTS_CHARS, + const wxString& name = wxPanelNameStr ); + + bool Create( wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, @@ -1109,11 +1153,13 @@ public: // void DrawTextRectangle( wxDC& dc, const wxString&, const wxRect&, int horizontalAlignment = wxALIGN_LEFT, - int verticalAlignment = wxALIGN_TOP ); + int verticalAlignment = wxALIGN_TOP, + int textOrientation = wxHORIZONTAL ); void DrawTextRectangle( wxDC& dc, const wxArrayString& lines, const wxRect&, int horizontalAlignment = wxALIGN_LEFT, - int verticalAlignment = wxALIGN_TOP ); + int verticalAlignment = wxALIGN_TOP, + int textOrientation = wxHORIZONTAL ); // Split a string containing newline chararcters into an array of @@ -1225,6 +1271,7 @@ public: wxFont GetLabelFont() { return m_labelFont; } void GetRowLabelAlignment( int *horiz, int *vert ); void GetColLabelAlignment( int *horiz, int *vert ); + int GetColLabelTextOrientation(); wxString GetRowLabelValue( int row ); wxString GetColLabelValue( int col ); wxColour GetGridLineColour() { return m_gridLineColour; } @@ -1239,6 +1286,7 @@ public: void SetLabelFont( const wxFont& ); void SetRowLabelAlignment( int horiz, int vert ); void SetColLabelAlignment( int horiz, int vert ); + void SetColLabelTextOrientation( int textOrientation ); void SetRowLabelValue( int row, const wxString& ); void SetColLabelValue( int col, const wxString& ); void SetGridLineColour( const wxColour& ); @@ -1315,12 +1363,30 @@ public: // and also set the grid size to just fit its contents void AutoSize(); + // autosize row height depending on label text + void AutoSizeRowLabelSize( int row ); + + // autosize column width depending on label text + void AutoSizeColLabelSize( int col ); + // column won't be resized to be lesser width - this must be called during // the grid creation because it won't resize the column if it's already // narrower than the minimal width void SetColMinimalWidth( int col, int width ); void SetRowMinimalHeight( int row, int width ); + /* These members can be used to query and modify the minimal + * acceptable size of grid rows and columns. Call this function in + * your code which creates the grid if you want to display cells + * with a size smaller than the default acceptable minimum size. + * Like the members SetColMinimalWidth and SetRowMinimalWidth, + * the existing rows or columns will not be checked/resized. + */ + void SetColMinimalAcceptableWidth( int width ); + void SetRowMinimalAcceptableHeight( int width ); + int GetColMinimalAcceptableWidth() const; + int GetRowMinimalAcceptableHeight() const; + void SetDefaultCellBackgroundColour( const wxColour& ); void SetCellBackgroundColour( int row, int col, const wxColour& ); void SetDefaultCellTextColour( const wxColour& ); @@ -1656,6 +1722,7 @@ protected: void InitRowHeights(); int m_defaultRowHeight; + int m_minAcceptableRowHeight; wxArrayInt m_rowHeights; wxArrayInt m_rowBottoms; @@ -1663,6 +1730,7 @@ protected: void InitColWidths(); int m_defaultColWidth; + int m_minAcceptableColWidth; wxArrayInt m_colWidths; wxArrayInt m_colRights; @@ -1694,6 +1762,7 @@ protected: int m_rowLabelVertAlign; int m_colLabelHorizAlign; int m_colLabelVertAlign; + int m_colLabelTextOrientation; bool m_defaultRowLabelValues; bool m_defaultColLabelValues; @@ -1714,8 +1783,8 @@ protected: // if a column has a minimal width, it will be the value for it in this // hash table - wxHashTableLong m_colMinWidths, - m_rowMinHeights; + wxLongToLongHashMap m_colMinWidths, + m_rowMinHeights; // get the minimal width of the given column/row int GetColMinimalWidth(int col) const; @@ -1843,17 +1912,19 @@ protected: bool GetModelValues(); bool SetModelValues(); - friend class WXDLLEXPORT wxGridSelection; + friend class WXDLLIMPEXP_ADV wxGridSelection; DECLARE_DYNAMIC_CLASS( wxGrid ) DECLARE_EVENT_TABLE() + DECLARE_NO_COPY_CLASS(wxGrid) }; + // ---------------------------------------------------------------------------- // Grid event class and event types // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxGridEvent : public wxNotifyEvent +class WXDLLIMPEXP_ADV wxGridEvent : public wxNotifyEvent { public: wxGridEvent() @@ -1886,10 +1957,10 @@ protected: bool m_shift; bool m_alt; - DECLARE_DYNAMIC_CLASS(wxGridEvent) + DECLARE_DYNAMIC_CLASS_NO_COPY(wxGridEvent) }; -class WXDLLEXPORT wxGridSizeEvent : public wxNotifyEvent +class WXDLLIMPEXP_ADV wxGridSizeEvent : public wxNotifyEvent { public: wxGridSizeEvent() @@ -1918,11 +1989,11 @@ protected: bool m_shift; bool m_alt; - DECLARE_DYNAMIC_CLASS(wxGridSizeEvent) + DECLARE_DYNAMIC_CLASS_NO_COPY(wxGridSizeEvent) }; -class WXDLLEXPORT wxGridRangeSelectEvent : public wxNotifyEvent +class WXDLLIMPEXP_ADV wxGridRangeSelectEvent : public wxNotifyEvent { public: wxGridRangeSelectEvent() @@ -1965,11 +2036,11 @@ protected: bool m_shift; bool m_alt; - DECLARE_DYNAMIC_CLASS(wxGridRangeSelectEvent) + DECLARE_DYNAMIC_CLASS_NO_COPY(wxGridRangeSelectEvent) }; -class WXDLLEXPORT wxGridEditorCreatedEvent : public wxCommandEvent { +class WXDLLIMPEXP_ADV wxGridEditorCreatedEvent : public wxCommandEvent { public: wxGridEditorCreatedEvent() : wxCommandEvent() @@ -1995,26 +2066,27 @@ private: wxControl* m_ctrl; DECLARE_DYNAMIC_CLASS(wxGridEditorCreatedEvent) + DECLARE_NO_COPY_CLASS(wxGridEditorCreatedEvent) }; BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EVENT_TYPE(wxEVT_GRID_CELL_LEFT_CLICK, 1580) - DECLARE_EVENT_TYPE(wxEVT_GRID_CELL_RIGHT_CLICK, 1581) - DECLARE_EVENT_TYPE(wxEVT_GRID_CELL_LEFT_DCLICK, 1582) - DECLARE_EVENT_TYPE(wxEVT_GRID_CELL_RIGHT_DCLICK, 1583) - DECLARE_EVENT_TYPE(wxEVT_GRID_LABEL_LEFT_CLICK, 1584) - DECLARE_EVENT_TYPE(wxEVT_GRID_LABEL_RIGHT_CLICK, 1585) - DECLARE_EVENT_TYPE(wxEVT_GRID_LABEL_LEFT_DCLICK, 1586) - DECLARE_EVENT_TYPE(wxEVT_GRID_LABEL_RIGHT_DCLICK, 1587) - DECLARE_EVENT_TYPE(wxEVT_GRID_ROW_SIZE, 1588) - DECLARE_EVENT_TYPE(wxEVT_GRID_COL_SIZE, 1589) - DECLARE_EVENT_TYPE(wxEVT_GRID_RANGE_SELECT, 1590) - DECLARE_EVENT_TYPE(wxEVT_GRID_CELL_CHANGE, 1591) - DECLARE_EVENT_TYPE(wxEVT_GRID_SELECT_CELL, 1592) - DECLARE_EVENT_TYPE(wxEVT_GRID_EDITOR_SHOWN, 1593) - DECLARE_EVENT_TYPE(wxEVT_GRID_EDITOR_HIDDEN, 1594) - DECLARE_EVENT_TYPE(wxEVT_GRID_EDITOR_CREATED, 1595) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_LEFT_CLICK, 1580) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_RIGHT_CLICK, 1581) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_LEFT_DCLICK, 1582) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_RIGHT_DCLICK, 1583) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_LABEL_LEFT_CLICK, 1584) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_LABEL_RIGHT_CLICK, 1585) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_LABEL_LEFT_DCLICK, 1586) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_LABEL_RIGHT_DCLICK, 1587) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_ROW_SIZE, 1588) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_COL_SIZE, 1589) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_RANGE_SELECT, 1590) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_CHANGE, 1591) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_SELECT_CELL, 1592) + 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) END_DECLARE_EVENT_TYPES() @@ -2023,22 +2095,22 @@ typedef void (wxEvtHandler::*wxGridSizeEventFunction)(wxGridSizeEvent&); typedef void (wxEvtHandler::*wxGridRangeSelectEventFunction)(wxGridRangeSelectEvent&); typedef void (wxEvtHandler::*wxGridEditorCreatedEventFunction)(wxGridEditorCreatedEvent&); -#define EVT_GRID_CELL_LEFT_CLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_LEFT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL ), -#define EVT_GRID_CELL_RIGHT_CLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_RIGHT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL ), -#define EVT_GRID_CELL_LEFT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL ), -#define EVT_GRID_CELL_RIGHT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_RIGHT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL ), -#define EVT_GRID_LABEL_LEFT_CLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_LEFT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL ), -#define EVT_GRID_LABEL_RIGHT_CLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_RIGHT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL ), -#define EVT_GRID_LABEL_LEFT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL ), -#define EVT_GRID_LABEL_RIGHT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_RIGHT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL ), -#define EVT_GRID_ROW_SIZE(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_ROW_SIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridSizeEventFunction) &fn, NULL ), -#define EVT_GRID_COL_SIZE(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_COL_SIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridSizeEventFunction) &fn, NULL ), -#define EVT_GRID_RANGE_SELECT(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_RANGE_SELECT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridRangeSelectEventFunction) &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_SELECT_CELL(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_SELECT_CELL, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL ), -#define EVT_GRID_EDITOR_SHOWN(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_SHOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL ), -#define EVT_GRID_EDITOR_HIDDEN(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_HIDDEN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL ), -#define EVT_GRID_EDITOR_CREATED(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_CREATED, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEditorCreatedEventFunction) &fn, NULL ), +#define EVT_GRID_CELL_LEFT_CLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_LEFT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), +#define EVT_GRID_CELL_RIGHT_CLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_RIGHT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), +#define EVT_GRID_CELL_LEFT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), +#define EVT_GRID_CELL_RIGHT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_RIGHT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), +#define EVT_GRID_LABEL_LEFT_CLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_LEFT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), +#define EVT_GRID_LABEL_RIGHT_CLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_RIGHT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), +#define EVT_GRID_LABEL_LEFT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), +#define EVT_GRID_LABEL_RIGHT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_RIGHT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), +#define EVT_GRID_ROW_SIZE(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_ROW_SIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridSizeEventFunction, &fn ), NULL ), +#define EVT_GRID_COL_SIZE(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_COL_SIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridSizeEventFunction, &fn ), NULL ), +#define EVT_GRID_RANGE_SELECT(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_RANGE_SELECT, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridRangeSelectEventFunction, &fn ), NULL ), +#define EVT_GRID_CELL_CHANGE(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_CHANGE, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), +#define EVT_GRID_SELECT_CELL(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_SELECT_CELL, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), +#define EVT_GRID_EDITOR_SHOWN(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_SHOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), +#define EVT_GRID_EDITOR_HIDDEN(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_HIDDEN, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), +#define EVT_GRID_EDITOR_CREATED(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_CREATED, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEditorCreatedEventFunction, &fn ), NULL ), #if 0 // TODO: implement these ? others ? @@ -2047,12 +2119,11 @@ extern const int wxEVT_GRID_CREATE_CELL; extern const int wxEVT_GRID_CHANGE_LABELS; extern const int wxEVT_GRID_CHANGE_SEL_LABEL; -#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_CREATE_CELL(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CREATE_CELL, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), +#define EVT_GRID_CHANGE_LABELS(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CHANGE_LABELS, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), +#define EVT_GRID_CHANGE_SEL_LABEL(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CHANGE_SEL_LABEL, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #endif -#endif // #ifndef __WXGRID_H__ +#endif // ifndef wxUSE_GRID -#endif // ifndef wxUSE_NEW_GRID