Fix incorrect vertical position of check boxes in some wxGrid on wxWidgets 3.1.4.

Fix also 2 compil warnings.

These fixes come from the master branch
This commit is contained in:
jean-pierre charras 2020-10-04 09:42:18 +02:00
parent ca8f026bc3
commit 89951b01ff
7 changed files with 8 additions and 9 deletions

View File

@ -102,7 +102,7 @@ DIALOG_FOOTPRINT_BOARD_EDITOR::DIALOG_FOOTPRINT_BOARD_EDITOR( PCB_EDIT_FRAME* aP
wxGridCellAttr* attr = new wxGridCellAttr;
attr->SetRenderer( new wxGridCellBoolRenderer() );
attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS
attr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM );
attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
m_modelsGrid->SetColAttr( 1, attr );
m_modelsGrid->SetWindowStyleFlag( m_modelsGrid->GetWindowStyle() & ~wxHSCROLL );

View File

@ -100,7 +100,7 @@ DIALOG_FOOTPRINT_FP_EDITOR::DIALOG_FOOTPRINT_FP_EDITOR( FOOTPRINT_EDIT_FRAME* aP
wxGridCellAttr* attr = new wxGridCellAttr;
attr->SetRenderer( new wxGridCellBoolRenderer() );
attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS
attr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM );
attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
m_modelsGrid->SetColAttr( 1, attr );
m_modelsGrid->SetWindowStyleFlag( m_modelsGrid->GetWindowStyle() & ~wxHSCROLL );

View File

@ -91,8 +91,6 @@ DIALOG_EXPORT_SVG::DIALOG_EXPORT_SVG( PCB_BASE_FRAME* aParent, BOARD* aBoard ) :
m_board = aBoard;
m_config = Kiface().KifaceSettings();
memset( m_boxSelectLayer, 0, sizeof( m_boxSelectLayer ) );
m_browseButton->SetBitmap( KiBitmap( folder_xpm ) );
initDialog();

View File

@ -191,7 +191,7 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataToWindow()
#define SET_BOOL_VALUE( aRow, aCol, aValue ) \
attr = new wxGridCellAttr; \
attr->SetRenderer( new wxGridCellBoolRenderer() ); \
attr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM ); \
attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); \
attr->SetReadOnly(); \
m_grid->SetAttr( aRow, aCol, attr ); \
m_grid->SetCellValue( aRow, aCol, ( aValue ) ? "1" : "" )

View File

@ -113,7 +113,7 @@ bool PANEL_MODEDIT_DEFAULTS::TransferDataToWindow()
auto attr = new wxGridCellAttr;
attr->SetRenderer( new wxGridCellBoolRenderer() );
attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS
attr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM );
attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
m_grid->SetAttr( i, COL_TEXT_ITALIC, attr );
}
}

View File

@ -115,13 +115,13 @@ bool PANEL_SETUP_TEXT_AND_GRAPHICS::TransferDataToWindow()
auto attr = new wxGridCellAttr;
attr->SetRenderer( new wxGridCellBoolRenderer() );
attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS
attr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM );
attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
m_grid->SetAttr( i, COL_TEXT_ITALIC, attr );
attr = new wxGridCellAttr;
attr->SetRenderer( new wxGridCellBoolRenderer() );
attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS
attr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM );
attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
m_grid->SetAttr( i, COL_TEXT_UPRIGHT, attr );
}
}

View File

@ -889,7 +889,8 @@ void DisposeOutPts( OutPt*& pp )
inline void InitEdge( TEdge* e, TEdge* eNext, TEdge* ePrev, const IntPoint& Pt )
{
std::memset( e, 0, sizeof(TEdge) );
// This clears the C++ way
*e = TEdge( { 0 } );
e->Next = eNext;
e->Prev = ePrev;