本文整理汇总了C++中FOOTPRINT_WIZARD::GetParameterNames方法的典型用法代码示例。如果您正苦于以下问题:C++ FOOTPRINT_WIZARD::GetParameterNames方法的具体用法?C++ FOOTPRINT_WIZARD::GetParameterNames怎么用?C++ FOOTPRINT_WIZARD::GetParameterNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FOOTPRINT_WIZARD
的用法示例。
在下文中一共展示了FOOTPRINT_WIZARD::GetParameterNames方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReCreateParameterList
void FOOTPRINT_WIZARD_FRAME::ReCreateParameterList()
{
if( m_parameterGrid == NULL )
return;
FOOTPRINT_WIZARD* footprintWizard = GetMyWizard();
if( footprintWizard == NULL )
return;
int page = m_pageList->GetSelection();
if( page<0 )
return;
m_parameterGrid->ClearGrid();
// Rows
m_parameterGrid->AutoSizeRows();
m_parameterGrid->EnableDragRowSize( true );
m_parameterGrid->SetRowLabelSize( 1 );
m_parameterGrid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Get the list of names, values, and types
wxArrayString fpList = footprintWizard->GetParameterNames( page );
wxArrayString fvList = footprintWizard->GetParameterValues( page );
wxArrayString ptList = footprintWizard->GetParameterTypes( page );
// Dimension the wxGrid
m_parameterGrid->DeleteRows( 0, m_parameterGrid->GetNumberRows() );
m_parameterGrid->AppendRows( fpList.size() );
wxString name, value, units;
for( unsigned int i = 0; i<fpList.size(); i++ )
{
name = fpList[i];
value = fvList[i];
m_parameterGrid->SetCellValue( i, 0, name );
m_parameterGrid->SetReadOnly( i, 0 );
if( ptList[i]==wxT( "IU" ) )
{
LOCALE_IO toggle;
// We are handling internal units, so convert them to the current
// system selected units and store into value.
double dValue;
value.ToDouble( &dValue );
dValue = To_User_Unit( g_UserUnit, dValue );
if( g_UserUnit==INCHES ) // we convert inches into mils for more detail
{
dValue = dValue * 1000.0;
units = wxT( "mils" );
}
else if( g_UserUnit==MILLIMETRES )
{
units = wxT( "mm" );
}
std::string s = Double2Str( dValue );
value = FROM_UTF8( s.c_str() );
}
else if( ptList[i]==wxT( "UNITS" ) ) // 1,2,3,4,5 ... N
{
units = wxT( "" );
}
m_parameterGrid->SetCellValue( i, 1, value );
m_parameterGrid->SetCellValue( i, 2, units );
m_parameterGrid->SetReadOnly( i, 2 );
}
m_parameterGrid->AutoSizeColumns();
}
示例2: ReCreateParameterList
void FOOTPRINT_WIZARD_FRAME::ReCreateParameterList()
{
if( m_parameterGrid == NULL )
return;
FOOTPRINT_WIZARD* footprintWizard = GetMyWizard();
if( footprintWizard == NULL )
return;
int page = m_pageList->GetSelection();
if( page<0 )
return;
m_parameterGrid->ClearGrid();
// Get the list of names, values, and types
wxArrayString fpList = footprintWizard->GetParameterNames( page );
wxArrayString fvList = footprintWizard->GetParameterValues( page );
wxArrayString ptList = footprintWizard->GetParameterTypes( page );
// Dimension the wxGrid
if( m_parameterGrid->GetNumberRows() > 0 )
m_parameterGrid->DeleteRows( 0, m_parameterGrid->GetNumberRows() );
m_parameterGrid->AppendRows( fpList.size() );
wxString value, units;
for( unsigned int i = 0; i< fpList.size(); i++ )
{
value = fvList[i];
m_parameterGrid->SetCellValue( i, m_columnPrmName, fpList[i] );
m_parameterGrid->SetReadOnly( i, m_columnPrmName );
if( ptList[i]==wxT( "IU" ) )
{
LOCALE_IO toggle;
// We are handling internal units, so convert them to the current
// system selected units and store into value.
double dValue;
value.ToDouble( &dValue );
dValue = To_User_Unit( g_UserUnit, dValue );
if( g_UserUnit==INCHES ) // we convert inches into mils for more detail
{
dValue = dValue * 1000.0;
units = wxT( "mils" );
}
else if( g_UserUnit==MILLIMETRES )
{
units = wxT( "mm" );
}
// Use Double2Str to build the string, because useless trailing 0
// are removed. The %f format does not remove them
std::string s = Double2Str( dValue );
value = FROM_UTF8( s.c_str() );
}
else if( ptList[i]==wxT( "UNITS" ) ) // 1,2,3,4,5 ... N
{
units = wxT( "" );
}
m_parameterGrid->SetCellValue( i, m_columnPrmValue, value );
m_parameterGrid->SetCellValue( i, m_columnPrmUnit, units );
m_parameterGrid->SetReadOnly( i, m_columnPrmUnit );
}
m_parameterGrid->AutoSizeColumns();
}