X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/29efc6e4a478652d6f59fb3f5ca7990d78a8ead4..bca8c756a30d54ee4fade96a091d78ad8988fd23:/include/wx/generic/private/grid.h diff --git a/include/wx/generic/private/grid.h b/include/wx/generic/private/grid.h index e2ed4757d8..d0a2844284 100644 --- a/include/wx/generic/private/grid.h +++ b/include/wx/generic/private/grid.h @@ -107,7 +107,7 @@ public: // we can't know in advance whether we can sort by this column or not // with wxGrid API so suppose we can by default int flags = wxCOL_SORTABLE; - if ( m_grid->CanDragColSize() ) + if ( m_grid->CanDragColSize(m_col) ) flags |= wxCOL_RESIZABLE; if ( m_grid->CanDragColMove() ) flags |= wxCOL_REORDERABLE; @@ -195,7 +195,12 @@ private: // as this is done by the user we should notify the main program about // it - GetOwner()->SendEvent(wxEVT_GRID_COL_SIZE, -1, idx); + + // make up a dummy event for the grid event to use -- unfortunately we + // can't do anything else here + wxMouseEvent e; + e.SetState(wxGetMouseState()); + GetOwner()->SendSizeEvent(wxEVT_GRID_COL_SIZE, -1, idx, e); } // overridden to react to the columns order changes in the customization @@ -226,7 +231,12 @@ private: void OnEndResize(wxHeaderCtrlEvent& event) { - GetOwner()->DoEndDragResizeCol(); + // we again need to pass a mouse event to be used for the grid event + // generation but we don't have it here so use a dummy one as in + // UpdateColumnVisibility() + wxMouseEvent e; + e.SetState(wxGetMouseState()); + GetOwner()->DoEndDragResizeCol(e); event.Skip(); } @@ -244,7 +254,7 @@ private: wxVector m_columns; DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxGridHeaderCtrl) + wxDECLARE_NO_COPY_CLASS(wxGridHeaderCtrl); }; // common base class for various grid subwindows @@ -272,7 +282,7 @@ protected: wxGrid *m_owner; DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxGridSubwindow) + wxDECLARE_NO_COPY_CLASS(wxGridSubwindow); }; class WXDLLIMPEXP_ADV wxGridRowLabelWindow : public wxGridSubwindow @@ -290,7 +300,7 @@ private: void OnMouseWheel( wxMouseEvent& event ); DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxGridRowLabelWindow) + wxDECLARE_NO_COPY_CLASS(wxGridRowLabelWindow); }; @@ -309,7 +319,7 @@ private: void OnMouseWheel( wxMouseEvent& event ); DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxGridColLabelWindow) + wxDECLARE_NO_COPY_CLASS(wxGridColLabelWindow); }; @@ -327,7 +337,7 @@ private: void OnPaint( wxPaintEvent& event ); DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxGridCornerLabelWindow) + wxDECLARE_NO_COPY_CLASS(wxGridCornerLabelWindow); }; class WXDLLIMPEXP_ADV wxGridWindow : public wxGridSubwindow @@ -356,7 +366,7 @@ private: void OnFocus( wxFocusEvent& ); DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxGridWindow) + wxDECLARE_NO_COPY_CLASS(wxGridWindow); }; // ---------------------------------------------------------------------------- @@ -497,8 +507,8 @@ public: // Set the row height or column width virtual void SetLineSize(wxGrid *grid, int line, int size) const = 0; - // True if rows/columns can be resized by user - virtual bool CanResizeLines(const wxGrid *grid) const = 0; + // Set the row default height or column default width + virtual void SetDefaultLineSize(wxGrid *grid, int size, bool resizeExisting) const = 0; // Return the index of the line at the given position @@ -569,8 +579,8 @@ public: { return grid->GetRowMinimalHeight(line); } virtual void SetLineSize(wxGrid *grid, int line, int size) const { grid->SetRowSize(line, size); } - virtual bool CanResizeLines(const wxGrid *grid) const - { return grid->CanDragRowSize(); } + virtual void SetDefaultLineSize(wxGrid *grid, int size, bool resizeExisting) const + { grid->SetDefaultRowSize(size, resizeExisting); } virtual int GetLineAt(const wxGrid * WXUNUSED(grid), int line) const { return line; } // TODO: implement row reordering @@ -630,8 +640,8 @@ public: { return grid->GetColMinimalWidth(line); } virtual void SetLineSize(wxGrid *grid, int line, int size) const { grid->SetColSize(line, size); } - virtual bool CanResizeLines(const wxGrid *grid) const - { return grid->CanDragColSize(); } + virtual void SetDefaultLineSize(wxGrid *grid, int size, bool resizeExisting) const + { grid->SetDefaultColSize(size, resizeExisting); } virtual int GetLineAt(const wxGrid *grid, int line) const { return grid->GetColAt(line); } @@ -785,7 +795,7 @@ struct wxGridDataTypeInfo wxGridCellRenderer* m_renderer; wxGridCellEditor* m_editor; - DECLARE_NO_COPY_CLASS(wxGridDataTypeInfo) + wxDECLARE_NO_COPY_CLASS(wxGridDataTypeInfo); };