cleanup - reformatting
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38846 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -693,8 +693,7 @@ void wxGridCellTextEditor::DoBeginEdit(const wxString& startValue)
|
||||
Text()->SetFocus();
|
||||
}
|
||||
|
||||
bool wxGridCellTextEditor::EndEdit(int row, int col,
|
||||
wxGrid* grid)
|
||||
bool wxGridCellTextEditor::EndEdit(int row, int col, wxGrid* grid)
|
||||
{
|
||||
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.DrawLine( 1, 1, client_width - 1, 1 );
|
||||
dc.DrawLine( 1, 1, 1, client_height - 1 );
|
||||
#endif // __WXGTK__/!__WXGTK__
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxGridCornerLabelWindow::OnMouseEvent( wxMouseEvent& event )
|
||||
@@ -3909,7 +3908,9 @@ wxGridWindow::wxGridWindow( wxGrid *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint &pos,
|
||||
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") )
|
||||
{
|
||||
m_owner = parent;
|
||||
@@ -3922,15 +3923,15 @@ void wxGridWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
||||
wxPaintDC dc( this );
|
||||
m_owner->PrepareDC( dc );
|
||||
wxRegion reg = GetUpdateRegion();
|
||||
wxGridCellCoordsArray DirtyCells = m_owner->CalcCellsExposed( reg );
|
||||
m_owner->DrawGridCellArea( dc , DirtyCells);
|
||||
wxGridCellCoordsArray dirtyCells = m_owner->CalcCellsExposed( reg );
|
||||
m_owner->DrawGridCellArea( dc, dirtyCells );
|
||||
|
||||
#if WXGRID_DRAW_LINES
|
||||
m_owner->DrawAllGridLines( dc, reg );
|
||||
#endif
|
||||
|
||||
m_owner->DrawGridSpace( dc );
|
||||
m_owner->DrawHighlight( dc , DirtyCells );
|
||||
m_owner->DrawHighlight( dc, dirtyCells );
|
||||
}
|
||||
|
||||
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, \
|
||||
m_minAcceptableRowHeight, \
|
||||
m_rowBottoms, m_numRows, true)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
@@ -4051,7 +4053,7 @@ wxEND_HANDLERS_TABLE()
|
||||
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
|
||||
IMPLEMENT_DYNAMIC_CLASS( wxGrid, wxScrolledWindow )
|
||||
@@ -4325,10 +4327,10 @@ void wxGrid::Init()
|
||||
}
|
||||
else
|
||||
{
|
||||
m_labelBackgroundColour = wxColour( _T("WHITE") );
|
||||
m_labelBackgroundColour = wxColour( wxT("WHITE") );
|
||||
}
|
||||
|
||||
m_labelTextColour = wxColour( _T("BLACK") );
|
||||
m_labelTextColour = wxColour( wxT("BLACK") );
|
||||
|
||||
// init attr cache
|
||||
m_attrCache.row = -1;
|
||||
@@ -4728,6 +4730,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
|
||||
attrProvider->UpdateAttrCols( 0, -GetNumberCols() );
|
||||
#endif
|
||||
}
|
||||
|
||||
if ( !GetBatchCount() )
|
||||
{
|
||||
CalcDimensions();
|
||||
@@ -4854,6 +4857,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
|
||||
if (attrProvider)
|
||||
{
|
||||
attrProvider->UpdateAttrCols( pos, -((int)numCols) );
|
||||
|
||||
// ifdef'd out following patch from Paul Gammans
|
||||
#if 0
|
||||
// No need to touch row attributes, unless we
|
||||
@@ -4865,6 +4869,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
|
||||
attrProvider->UpdateAttrRows( 0, -GetNumberRows() );
|
||||
#endif
|
||||
}
|
||||
|
||||
if ( !GetBatchCount() )
|
||||
{
|
||||
CalcDimensions();
|
||||
@@ -5111,7 +5116,8 @@ void wxGrid::ProcessRowLabelMouseEvent( wxMouseEvent& event )
|
||||
|
||||
if (m_isDragging)
|
||||
{
|
||||
if (m_rowLabelWin->HasCapture()) m_rowLabelWin->ReleaseMouse();
|
||||
if (m_rowLabelWin->HasCapture())
|
||||
m_rowLabelWin->ReleaseMouse();
|
||||
m_isDragging = false;
|
||||
}
|
||||
|
||||
@@ -5167,7 +5173,6 @@ void wxGrid::ProcessRowLabelMouseEvent( wxMouseEvent& event )
|
||||
else
|
||||
{
|
||||
// starting to drag-resize a row
|
||||
//
|
||||
if ( CanDragRowSize() )
|
||||
ChangeCursorMode(WXGRID_CURSOR_RESIZE_ROW, m_rowLabelWin);
|
||||
}
|
||||
@@ -5329,7 +5334,8 @@ void wxGrid::ProcessColLabelMouseEvent( wxMouseEvent& event )
|
||||
|
||||
if (m_isDragging)
|
||||
{
|
||||
if (m_colLabelWin->HasCapture()) m_colLabelWin->ReleaseMouse();
|
||||
if (m_colLabelWin->HasCapture())
|
||||
m_colLabelWin->ReleaseMouse();
|
||||
m_isDragging = false;
|
||||
}
|
||||
|
||||
@@ -5996,6 +6002,7 @@ void wxGrid::DoEndDragResizeRow()
|
||||
rect.height = ch - rect.y;
|
||||
m_rowLabelWin->Refresh( true, &rect );
|
||||
rect.width = cw;
|
||||
|
||||
// if there is a multicell block, paint all of it
|
||||
if (m_table)
|
||||
{
|
||||
@@ -6495,53 +6502,36 @@ void wxGrid::OnKeyDown( wxKeyEvent& event )
|
||||
|
||||
if ( !parent->GetEventHandler()->ProcessEvent( keyEvt ) )
|
||||
{
|
||||
|
||||
// try local handlers
|
||||
//
|
||||
switch ( event.GetKeyCode() )
|
||||
{
|
||||
case WXK_UP:
|
||||
if ( event.ControlDown() )
|
||||
{
|
||||
MoveCursorUpBlock( event.ShiftDown() );
|
||||
}
|
||||
else
|
||||
{
|
||||
MoveCursorUp( event.ShiftDown() );
|
||||
}
|
||||
break;
|
||||
|
||||
case WXK_DOWN:
|
||||
if ( event.ControlDown() )
|
||||
{
|
||||
MoveCursorDownBlock( event.ShiftDown() );
|
||||
}
|
||||
else
|
||||
{
|
||||
MoveCursorDown( event.ShiftDown() );
|
||||
}
|
||||
break;
|
||||
|
||||
case WXK_LEFT:
|
||||
if ( event.ControlDown() )
|
||||
{
|
||||
MoveCursorLeftBlock( event.ShiftDown() );
|
||||
}
|
||||
else
|
||||
{
|
||||
MoveCursorLeft( event.ShiftDown() );
|
||||
}
|
||||
break;
|
||||
|
||||
case WXK_RIGHT:
|
||||
if ( event.ControlDown() )
|
||||
{
|
||||
MoveCursorRightBlock( event.ShiftDown() );
|
||||
}
|
||||
else
|
||||
{
|
||||
MoveCursorRight( event.ShiftDown() );
|
||||
}
|
||||
break;
|
||||
|
||||
case WXK_RETURN:
|
||||
@@ -6641,12 +6631,12 @@ void wxGrid::OnKeyDown( wxKeyEvent& event )
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ( !IsEditable() )
|
||||
{
|
||||
MoveCursorRight( false );
|
||||
else
|
||||
event.Skip();
|
||||
break;
|
||||
}
|
||||
// Otherwise fall through to default
|
||||
|
||||
default:
|
||||
event.Skip();
|
||||
@@ -7518,8 +7508,7 @@ void wxGrid::DrawColLabel( wxDC& dc, int col )
|
||||
int colRight = GetColRight(col) - 1;
|
||||
|
||||
dc.SetPen( wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DDKSHADOW), 1, wxSOLID) );
|
||||
dc.DrawLine( colRight, 0,
|
||||
colRight, m_colLabelHeight-1 );
|
||||
dc.DrawLine( colRight, 0, colRight, m_colLabelHeight - 1 );
|
||||
|
||||
dc.DrawLine( colLeft, 0, colRight, 0 );
|
||||
|
||||
@@ -9125,6 +9114,7 @@ void wxGrid::SetCellHighlightROPenWidth(int width)
|
||||
int col = m_currentCellCoords.GetCol();
|
||||
if ( GetColWidth(col) <= 0 || GetRowHeight(row) <= 0 )
|
||||
return;
|
||||
|
||||
wxRect rect = CellToRect(row, col);
|
||||
m_gridWin->Refresh(true, &rect);
|
||||
}
|
||||
@@ -9831,7 +9821,7 @@ void wxGrid::SetColSize( int col, int width )
|
||||
// (VZ)
|
||||
// No, because it is reasonable to assume the library user know's
|
||||
// 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
|
||||
|
||||
|
Reference in New Issue
Block a user