cleanup - reformatting

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38846 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Surovell
2006-04-19 15:38:26 +00:00
parent 6d49e4bbed
commit ccdee36f75

View File

@@ -693,8 +693,7 @@ void wxGridCellTextEditor::DoBeginEdit(const wxString& startValue)
Text()->SetFocus(); Text()->SetFocus();
} }
bool wxGridCellTextEditor::EndEdit(int row, int col, bool wxGridCellTextEditor::EndEdit(int row, int col, wxGrid* grid)
wxGrid* grid)
{ {
wxASSERT_MSG(m_control, wxT("The wxGridCellEditor must be created first!")); wxASSERT_MSG(m_control, wxT("The wxGridCellEditor must be created first!"));
@@ -3853,7 +3852,7 @@ void wxGridCornerLabelWindow::OnPaint( wxPaintEvent& WXUNUSED(event) )
dc.SetPen( *wxWHITE_PEN ); dc.SetPen( *wxWHITE_PEN );
dc.DrawLine( 1, 1, client_width - 1, 1 ); dc.DrawLine( 1, 1, client_width - 1, 1 );
dc.DrawLine( 1, 1, 1, client_height - 1 ); dc.DrawLine( 1, 1, 1, client_height - 1 );
#endif // __WXGTK__/!__WXGTK__ #endif
} }
void wxGridCornerLabelWindow::OnMouseEvent( wxMouseEvent& event ) void wxGridCornerLabelWindow::OnMouseEvent( wxMouseEvent& event )
@@ -3909,7 +3908,9 @@ wxGridWindow::wxGridWindow( wxGrid *parent,
wxWindowID id, wxWindowID id,
const wxPoint &pos, const wxPoint &pos,
const wxSize &size ) const wxSize &size )
: wxWindow( parent, id, pos, size, wxWANTS_CHARS | wxBORDER_NONE | wxCLIP_CHILDREN|wxFULL_REPAINT_ON_RESIZE, : wxWindow(
parent, id, pos, size,
wxWANTS_CHARS | wxBORDER_NONE | wxCLIP_CHILDREN | wxFULL_REPAINT_ON_RESIZE,
wxT("grid window") ) wxT("grid window") )
{ {
m_owner = parent; m_owner = parent;
@@ -3922,15 +3923,15 @@ void wxGridWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
wxPaintDC dc( this ); wxPaintDC dc( this );
m_owner->PrepareDC( dc ); m_owner->PrepareDC( dc );
wxRegion reg = GetUpdateRegion(); wxRegion reg = GetUpdateRegion();
wxGridCellCoordsArray DirtyCells = m_owner->CalcCellsExposed( reg ); wxGridCellCoordsArray dirtyCells = m_owner->CalcCellsExposed( reg );
m_owner->DrawGridCellArea( dc , DirtyCells); m_owner->DrawGridCellArea( dc, dirtyCells );
#if WXGRID_DRAW_LINES #if WXGRID_DRAW_LINES
m_owner->DrawAllGridLines( dc, reg ); m_owner->DrawAllGridLines( dc, reg );
#endif #endif
m_owner->DrawGridSpace( dc ); m_owner->DrawGridSpace( dc );
m_owner->DrawHighlight( dc , DirtyCells ); m_owner->DrawHighlight( dc, dirtyCells );
} }
void wxGridWindow::ScrollWindow( int dx, int dy, const wxRect *rect ) void wxGridWindow::ScrollWindow( int dx, int dy, const wxRect *rect )
@@ -4003,6 +4004,7 @@ static int CoordToRowOrCol(int coord, int defaultDist, int minDist,
#define internalYToRow(y) CoordToRowOrCol(y, m_defaultRowHeight, \ #define internalYToRow(y) CoordToRowOrCol(y, m_defaultRowHeight, \
m_minAcceptableRowHeight, \ m_minAcceptableRowHeight, \
m_rowBottoms, m_numRows, true) m_rowBottoms, m_numRows, true)
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
#if wxUSE_EXTENDED_RTTI #if wxUSE_EXTENDED_RTTI
@@ -4051,7 +4053,7 @@ wxEND_HANDLERS_TABLE()
wxCONSTRUCTOR_5( wxGrid , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle ) wxCONSTRUCTOR_5( wxGrid , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle )
/* /*
TODO : Expose more information of a list's layout etc. via appropriate objects (<EFBFBD><EFBFBD> la NotebookPageInfo) TODO : Expose more information of a list's layout, etc. via appropriate objects (e.g., NotebookPageInfo)
*/ */
#else #else
IMPLEMENT_DYNAMIC_CLASS( wxGrid, wxScrolledWindow ) IMPLEMENT_DYNAMIC_CLASS( wxGrid, wxScrolledWindow )
@@ -4325,10 +4327,10 @@ void wxGrid::Init()
} }
else else
{ {
m_labelBackgroundColour = wxColour( _T("WHITE") ); m_labelBackgroundColour = wxColour( wxT("WHITE") );
} }
m_labelTextColour = wxColour( _T("BLACK") ); m_labelTextColour = wxColour( wxT("BLACK") );
// init attr cache // init attr cache
m_attrCache.row = -1; m_attrCache.row = -1;
@@ -4728,6 +4730,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
attrProvider->UpdateAttrCols( 0, -GetNumberCols() ); attrProvider->UpdateAttrCols( 0, -GetNumberCols() );
#endif #endif
} }
if ( !GetBatchCount() ) if ( !GetBatchCount() )
{ {
CalcDimensions(); CalcDimensions();
@@ -4854,6 +4857,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
if (attrProvider) if (attrProvider)
{ {
attrProvider->UpdateAttrCols( pos, -((int)numCols) ); attrProvider->UpdateAttrCols( pos, -((int)numCols) );
// ifdef'd out following patch from Paul Gammans // ifdef'd out following patch from Paul Gammans
#if 0 #if 0
// No need to touch row attributes, unless we // No need to touch row attributes, unless we
@@ -4865,6 +4869,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
attrProvider->UpdateAttrRows( 0, -GetNumberRows() ); attrProvider->UpdateAttrRows( 0, -GetNumberRows() );
#endif #endif
} }
if ( !GetBatchCount() ) if ( !GetBatchCount() )
{ {
CalcDimensions(); CalcDimensions();
@@ -5111,7 +5116,8 @@ void wxGrid::ProcessRowLabelMouseEvent( wxMouseEvent& event )
if (m_isDragging) if (m_isDragging)
{ {
if (m_rowLabelWin->HasCapture()) m_rowLabelWin->ReleaseMouse(); if (m_rowLabelWin->HasCapture())
m_rowLabelWin->ReleaseMouse();
m_isDragging = false; m_isDragging = false;
} }
@@ -5167,7 +5173,6 @@ void wxGrid::ProcessRowLabelMouseEvent( wxMouseEvent& event )
else else
{ {
// starting to drag-resize a row // starting to drag-resize a row
//
if ( CanDragRowSize() ) if ( CanDragRowSize() )
ChangeCursorMode(WXGRID_CURSOR_RESIZE_ROW, m_rowLabelWin); ChangeCursorMode(WXGRID_CURSOR_RESIZE_ROW, m_rowLabelWin);
} }
@@ -5329,7 +5334,8 @@ void wxGrid::ProcessColLabelMouseEvent( wxMouseEvent& event )
if (m_isDragging) if (m_isDragging)
{ {
if (m_colLabelWin->HasCapture()) m_colLabelWin->ReleaseMouse(); if (m_colLabelWin->HasCapture())
m_colLabelWin->ReleaseMouse();
m_isDragging = false; m_isDragging = false;
} }
@@ -5996,6 +6002,7 @@ void wxGrid::DoEndDragResizeRow()
rect.height = ch - rect.y; rect.height = ch - rect.y;
m_rowLabelWin->Refresh( true, &rect ); m_rowLabelWin->Refresh( true, &rect );
rect.width = cw; rect.width = cw;
// if there is a multicell block, paint all of it // if there is a multicell block, paint all of it
if (m_table) if (m_table)
{ {
@@ -6495,53 +6502,36 @@ void wxGrid::OnKeyDown( wxKeyEvent& event )
if ( !parent->GetEventHandler()->ProcessEvent( keyEvt ) ) if ( !parent->GetEventHandler()->ProcessEvent( keyEvt ) )
{ {
// try local handlers // try local handlers
// //
switch ( event.GetKeyCode() ) switch ( event.GetKeyCode() )
{ {
case WXK_UP: case WXK_UP:
if ( event.ControlDown() ) if ( event.ControlDown() )
{
MoveCursorUpBlock( event.ShiftDown() ); MoveCursorUpBlock( event.ShiftDown() );
}
else else
{
MoveCursorUp( event.ShiftDown() ); MoveCursorUp( event.ShiftDown() );
}
break; break;
case WXK_DOWN: case WXK_DOWN:
if ( event.ControlDown() ) if ( event.ControlDown() )
{
MoveCursorDownBlock( event.ShiftDown() ); MoveCursorDownBlock( event.ShiftDown() );
}
else else
{
MoveCursorDown( event.ShiftDown() ); MoveCursorDown( event.ShiftDown() );
}
break; break;
case WXK_LEFT: case WXK_LEFT:
if ( event.ControlDown() ) if ( event.ControlDown() )
{
MoveCursorLeftBlock( event.ShiftDown() ); MoveCursorLeftBlock( event.ShiftDown() );
}
else else
{
MoveCursorLeft( event.ShiftDown() ); MoveCursorLeft( event.ShiftDown() );
}
break; break;
case WXK_RIGHT: case WXK_RIGHT:
if ( event.ControlDown() ) if ( event.ControlDown() )
{
MoveCursorRightBlock( event.ShiftDown() ); MoveCursorRightBlock( event.ShiftDown() );
}
else else
{
MoveCursorRight( event.ShiftDown() ); MoveCursorRight( event.ShiftDown() );
}
break; break;
case WXK_RETURN: case WXK_RETURN:
@@ -6641,12 +6631,12 @@ void wxGrid::OnKeyDown( wxKeyEvent& event )
} }
break; break;
} }
if ( !IsEditable() ) if ( !IsEditable() )
{
MoveCursorRight( false ); MoveCursorRight( false );
else
event.Skip();
break; break;
}
// Otherwise fall through to default
default: default:
event.Skip(); event.Skip();
@@ -7518,8 +7508,7 @@ void wxGrid::DrawColLabel( wxDC& dc, int col )
int colRight = GetColRight(col) - 1; int colRight = GetColRight(col) - 1;
dc.SetPen( wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DDKSHADOW), 1, wxSOLID) ); dc.SetPen( wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DDKSHADOW), 1, wxSOLID) );
dc.DrawLine( colRight, 0, dc.DrawLine( colRight, 0, colRight, m_colLabelHeight - 1 );
colRight, m_colLabelHeight-1 );
dc.DrawLine( colLeft, 0, colRight, 0 ); dc.DrawLine( colLeft, 0, colRight, 0 );
@@ -9125,6 +9114,7 @@ void wxGrid::SetCellHighlightROPenWidth(int width)
int col = m_currentCellCoords.GetCol(); int col = m_currentCellCoords.GetCol();
if ( GetColWidth(col) <= 0 || GetRowHeight(row) <= 0 ) if ( GetColWidth(col) <= 0 || GetRowHeight(row) <= 0 )
return; return;
wxRect rect = CellToRect(row, col); wxRect rect = CellToRect(row, col);
m_gridWin->Refresh(true, &rect); m_gridWin->Refresh(true, &rect);
} }
@@ -9831,7 +9821,7 @@ void wxGrid::SetColSize( int col, int width )
// (VZ) // (VZ)
// No, because it is reasonable to assume the library user know's // No, because it is reasonable to assume the library user know's
// what he is doing. However whe should test against the weaker // what he is doing. However whe should test against the weaker
// constariant of minimalAcceptableWidth, as this breaks rendering // constraint of minimalAcceptableWidth, as this breaks rendering
// //
// This test then fixes sf.net bug #645734 // This test then fixes sf.net bug #645734