void SetRowLabelValue( int row, const wxString& );
void SetColLabelValue( int col, const wxString& );
void SetGridLineColour( const wxColour& );
+
+ void EnableDragRowSize( bool enable = TRUE );
+ void DisableDragRowSize() { EnableDragRowSize( FALSE ); }
+ bool CanDragRowSize() { return m_canDragRowSize; }
+ void EnableDragColSize( bool enable = TRUE );
+ void DisableDragColSize() { EnableDragColSize( FALSE ); }
+ bool CanDragColSize() { return m_canDragColSize; }
// this sets the specified attribute for all cells in this row/col
void SetRowAttr(int row, wxGridCellAttr *attr);
wxWindow *m_winCapture; // the window which captured the mouse
CursorMode m_cursorMode;
+ bool m_canDragRowSize;
+ bool m_canDragColSize;
int m_dragLastPos;
int m_dragRowOrCol;
bool m_isDragging;
m_cursorMode = WXGRID_CURSOR_SELECT_CELL;
m_winCapture = (wxWindow *)NULL;
+ m_canDragRowSize = TRUE;
+ m_canDragColSize = TRUE;
m_dragLastPos = -1;
m_dragRowOrCol = -1;
m_isDragging = FALSE;
{
// starting to drag-resize a row
//
- ChangeCursorMode(WXGRID_CURSOR_RESIZE_ROW, m_rowLabelWin);
+ if ( CanDragRowSize() )
+ ChangeCursorMode(WXGRID_CURSOR_RESIZE_ROW, m_rowLabelWin);
}
}
if ( m_cursorMode == WXGRID_CURSOR_SELECT_CELL )
{
// don't capture the mouse yet
- ChangeCursorMode(WXGRID_CURSOR_RESIZE_ROW, m_rowLabelWin, FALSE);
+ if ( CanDragRowSize() )
+ ChangeCursorMode(WXGRID_CURSOR_RESIZE_ROW, m_rowLabelWin, FALSE);
}
}
else if ( m_cursorMode != WXGRID_CURSOR_SELECT_CELL )
{
// starting to drag-resize a col
//
- ChangeCursorMode(WXGRID_CURSOR_RESIZE_COL, m_colLabelWin);
+ if ( CanDragColSize() )
+ ChangeCursorMode(WXGRID_CURSOR_RESIZE_COL, m_colLabelWin);
}
}
if ( m_cursorMode == WXGRID_CURSOR_SELECT_CELL )
{
// don't capture the cursor yet
- ChangeCursorMode(WXGRID_CURSOR_RESIZE_COL, m_colLabelWin, FALSE);
+ if ( CanDragColSize() )
+ ChangeCursorMode(WXGRID_CURSOR_RESIZE_COL, m_colLabelWin, FALSE);
}
}
else if ( m_cursorMode != WXGRID_CURSOR_SELECT_CELL )
if ( m_cursorMode == WXGRID_CURSOR_SELECT_CELL )
{
- ChangeCursorMode(WXGRID_CURSOR_RESIZE_ROW);
+ if ( CanDragRowSize() )
+ ChangeCursorMode(WXGRID_CURSOR_RESIZE_ROW);
}
return;
if ( m_cursorMode == WXGRID_CURSOR_SELECT_CELL )
{
- ChangeCursorMode(WXGRID_CURSOR_RESIZE_COL);
+ if ( CanDragColSize() )
+ ChangeCursorMode(WXGRID_CURSOR_RESIZE_COL);
}
return;
// row/col size
// ----------------------------------------------------------------------------
+void wxGrid::EnableDragRowSize( bool enable )
+{
+ m_canDragRowSize = enable;
+}
+
+
+void wxGrid::EnableDragColSize( bool enable )
+{
+ m_canDragColSize = enable;
+}
+
+
void wxGrid::SetDefaultRowSize( int height, bool resizeExistingRows )
{
m_defaultRowHeight = wxMax( height, WXGRID_MIN_ROW_HEIGHT );