From d6bcbc5cdfb4033f76bda059ddb131cef54102a5 Mon Sep 17 00:00:00 2001 From: Miguel Angel Ajo Date: Fri, 15 Mar 2013 15:50:54 +0100 Subject: [PATCH] Fixed wxGrid re-creation and missing icon for dialog --- pcbnew/footprint_wizard_frame.cpp | 41 +++++++++++++++++++------------ 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index b22250bf27..48b94378ce 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -123,9 +123,11 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( FOOTPRINT_EDIT_FRAME* parent, m_showAxis = true; // true to draw axis. // Give an icon - wxIcon icon; - icon.CopyFromBitmap( KiBitmap( module_wizard_xpm) ); - SetIcon( icon ); + + // Disabled for now, it raises an assert error in wxwidgets + // wxIcon icon; + // icon.CopyFromBitmap( KiBitmap( module_wizard_xpm) ); + // SetIcon( icon ); m_HotkeysZoomAndGridList = g_Module_Viewer_Hokeys_Descr; m_FootprintWizard = NULL; @@ -185,9 +187,22 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( FOOTPRINT_EDIT_FRAME* parent, m_ParameterGridWindow->SetSashVisible( wxSASH_RIGHT, true ); m_ParameterGridWindow->SetExtraBorderSize( EXTRA_BORDER_SIZE ); - m_ParameterGrid = new wxGrid(m_ParameterGridWindow, + m_ParameterGrid = new wxGrid( m_ParameterGridWindow, ID_FOOTPRINT_WIZARD_PARAMETER_LIST, - wxPoint(0,0),wxDefaultSize); + wxPoint( 0 , 0 ), + wxDefaultSize ); + + m_ParameterGrid->CreateGrid( 1, 3 ); + + // Columns + m_ParameterGrid->AutoSizeColumns(); + m_ParameterGrid->SetColLabelSize( 20 ); + m_ParameterGrid->SetColLabelValue( 0, _("Parameter") ); + m_ParameterGrid->SetColLabelValue( 1, _("Value") ); + m_ParameterGrid->SetColLabelValue( 2, _("Units") ); + m_ParameterGrid->SetColLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); + + ReCreatePageList(); @@ -406,13 +421,6 @@ void FOOTPRINT_WIZARD_FRAME::ReCreateParameterList() m_ParameterGrid->ClearGrid(); - // Columns - m_ParameterGrid->AutoSizeColumns(); - m_ParameterGrid->SetColLabelSize( 20 ); - m_ParameterGrid->SetColLabelValue( 0, _("Parameter") ); - m_ParameterGrid->SetColLabelValue( 1, _("Value") ); - m_ParameterGrid->SetColLabelValue( 2, _("Units") ); - m_ParameterGrid->SetColLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); // Rows m_ParameterGrid->AutoSizeRows(); @@ -421,12 +429,13 @@ void FOOTPRINT_WIZARD_FRAME::ReCreateParameterList() m_ParameterGrid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); // Get the list of names, values, and types - wxArrayString fpList = m_FootprintWizard->GetParameterNames(page); - wxArrayString fvList = m_FootprintWizard->GetParameterValues(page); - wxArrayString ptList = m_FootprintWizard->GetParameterTypes(page); + wxArrayString fpList = m_FootprintWizard->GetParameterNames( page ); + wxArrayString fvList = m_FootprintWizard->GetParameterValues( page ); + wxArrayString ptList = m_FootprintWizard->GetParameterTypes( page ); // Dimension the wxGrid - m_ParameterGrid->CreateGrid(fpList.size(),3); + m_ParameterGrid->DeleteRows( 0, m_ParameterGrid->GetNumberRows() ); + m_ParameterGrid->AppendRows( fpList.size() ); for (unsigned int i=0; i