BEGIN_EVENT_TABLE(wxGridHeaderCtrl, wxHeaderCtrl)
EVT_HEADER_CLICK(wxID_ANY, wxGridHeaderCtrl::OnClick)
+ EVT_HEADER_DCLICK(wxID_ANY, wxGridHeaderCtrl::OnDoubleClick)
+ EVT_HEADER_RIGHT_CLICK(wxID_ANY, wxGridHeaderCtrl::OnRightClick)
EVT_HEADER_BEGIN_RESIZE(wxID_ANY, wxGridHeaderCtrl::OnBeginResize)
EVT_HEADER_RESIZING(wxID_ANY, wxGridHeaderCtrl::OnResizing)
oper.SelectSize(rect) = oper.Select(size);
int subtractLines = 0;
- const int lineStart = oper.PosToLine(this, posLineStart);
+ const int lineStart = doper.PosToLine(this, posLineStart);
if ( lineStart >= 0 )
{
// ensure that if we have a multi-cell block we redraw all of
// it by increasing the refresh area to cover it entirely if a
// part of it is affected
- const int lineEnd = oper.PosToLine(this, posLineEnd, true);
+ const int lineEnd = doper.PosToLine(this, posLineEnd, true);
for ( int line = lineStart; line < lineEnd; line++ )
{
int cellLines = oper.Select(
wxGrid::UpdateBlockBeingSelected(int topRow, int leftCol,
int bottomRow, int rightCol)
{
+ MakeCellVisible(m_selectedBlockCorner);
+ m_selectedBlockCorner = wxGridCellCoords(bottomRow, rightCol);
+
if ( m_selection )
{
switch ( m_selection->GetSelectionMode() )
}
}
- m_selectedBlockCorner = wxGridCellCoords(bottomRow, rightCol);
- MakeCellVisible(m_selectedBlockCorner);
-
EnsureFirstLessThanSecond(topRow, bottomRow);
EnsureFirstLessThanSecond(leftCol, rightCol);
bool wxGrid::IsCurrentCellReadOnly() const
{
- // const_cast
- wxGridCellAttr* attr = ((wxGrid *)this)->GetCellAttr(m_currentCellCoords);
+ wxGridCellAttr*
+ attr = const_cast<wxGrid *>(this)->GetCellAttr(m_currentCellCoords);
bool readonly = attr->IsReadOnly();
attr->DecRef();
else if ( line > 0 &&
pos - oper.GetLineStartPos(this,
line) < WXGRID_LABEL_EDGE_ZONE )
- return line - 1;
+ {
+ return oper.GetLineBefore(this, line);
+ }
}
return -1;
}
}
+void wxGrid::RefreshAttr(int row, int col)
+{
+ if ( m_attrCache.row == row && m_attrCache.col == col )
+ ClearAttrCache();
+}
+
+
void wxGrid::CacheAttr(int row, int col, wxGridCellAttr *attr) const
{
if ( attr != NULL )
{
- wxGrid *self = (wxGrid *)this; // const_cast
+ wxGrid * const self = const_cast<wxGrid *>(this);
self->ClearAttrCache();
self->m_attrCache.row = row;
wxSize wxGrid::DoGetBestSize() const
{
- wxGrid *self = (wxGrid *)this; // const_cast
+ wxGrid * const self = const_cast<wxGrid *>(this);
// we do the same as in AutoSize() here with the exception that we don't
// change the column/row sizes, only calculate them