本文整理汇总了C++中Kiface函数的典型用法代码示例。如果您正苦于以下问题:C++ Kiface函数的具体用法?C++ Kiface怎么用?C++ Kiface使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Kiface函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Prj
bool SCH_EDIT_FRAME::LoadProjectFile()
{
// Read library list and library path list
bool ret = Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH, GetProjectFileParameters() );
// Read schematic editor setup
ret &= Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH_EDIT, GetProjectFileParameters() );
// Verify some values, because the config file can be edited by hand,
// and have bad values:
LIB_PART::SetSubpartIdNotation(
LIB_PART::GetSubpartIdSeparator(),
LIB_PART::GetSubpartFirstId() );
// Load the page layout decr file, from the filename stored in
// BASE_SCREEN::m_PageLayoutDescrFileName, read in config project file
// If empty, or not existing, the default descr is loaded
WORKSHEET_LAYOUT& pglayout = WORKSHEET_LAYOUT::GetTheInstance();
wxString pg_fullfilename = WORKSHEET_LAYOUT::MakeFullFileName(
BASE_SCREEN::m_PageLayoutDescrFileName,
Prj().GetProjectPath() );
pglayout.SetPageLayout( pg_fullfilename );
return ret;
}
示例2: AUTOPLACER
AUTOPLACER( SCH_COMPONENT* aComponent, SCH_SCREEN* aScreen )
:m_screen( aScreen ), m_component( aComponent )
{
m_component->GetFields( m_fields, /* aVisibleOnly */ true );
Kiface().KifaceSettings()->Read( AUTOPLACE_JUSTIFY_KEY, &m_allow_rejustify, true );
Kiface().KifaceSettings()->Read( AUTOPLACE_ALIGN_KEY, &m_align_to_grid, false );
m_comp_bbox = m_component->GetBodyBoundingBox();
m_fbox_size = ComputeFBoxSize( /* aDynamic */ true );
m_power_symbol = ! m_component->IsInNetlist();
if( aScreen )
get_possible_colliders( m_colliders );
}
示例3: Kiface
EDA_DRAW_PANEL_GAL::GAL_TYPE EDA_DRAW_FRAME::LoadCanvasTypeSetting()
{
EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE;
wxConfigBase* cfg = Kiface().KifaceSettings();
if( cfg )
{
canvasType = (EDA_DRAW_PANEL_GAL::GAL_TYPE)
cfg->ReadLong( GetCanvasTypeKey(), EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE );
}
if( canvasType < EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE
|| canvasType >= EDA_DRAW_PANEL_GAL::GAL_TYPE_LAST )
{
assert( false );
canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE;
}
// Coerce the value into a GAL type when Legacy is not available
// Default to Cairo, and on the first, user will be prompted for OpenGL
if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE
&& !ADVANCED_CFG::GetCfg().AllowLegacyCanvas() )
{
#ifdef __WXMAC__
// Cairo renderer doesn't handle Retina displays
canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL;
#else
canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO;
#endif
}
return canvasType;
}
示例4: Pgm
void EDA_DRAW_FRAME::CommonSettingsChanged()
{
EDA_BASE_FRAME::CommonSettingsChanged();
wxConfigBase* settings = Pgm().CommonSettings();
int autosaveInterval;
settings->Read( AUTOSAVE_INTERVAL_KEY, &autosaveInterval );
SetAutoSaveInterval( autosaveInterval );
int historySize;
settings->Read( FILE_HISTORY_SIZE_KEY, &historySize, DEFAULT_FILE_HISTORY_SIZE );
Kiface().GetFileHistory().SetMaxFiles( (unsigned) std::max( 0, historySize ) );
bool option;
settings->Read( ENBL_MOUSEWHEEL_PAN_KEY, &option );
m_canvas->SetEnableMousewheelPan( option );
settings->Read( ENBL_ZOOM_NO_CENTER_KEY, &option );
m_canvas->SetEnableZoomNoCenter( option );
settings->Read( ENBL_AUTO_PAN_KEY, &option );
m_canvas->SetEnableAutoPan( option );
m_galDisplayOptions.ReadCommonConfig( *settings, this );
}
示例5: Kiface
void LAYERS_MAP_DIALOG::OnGetSetup( wxCommandEvent& event )
{
wxConfigBase* config = Kiface().KifaceSettings();
config->Read( wxT("BrdLayersCount"), &m_exportBoardCopperLayersCount );
normalizeBrdLayersCount();
int idx = ( m_exportBoardCopperLayersCount / 2 ) - 1;
m_comboCopperLayersCount->SetSelection( idx );
wxString key;
for( int ii = 0; ii < GERBER_DRAWLAYERS_COUNT; ++ii )
{
key.Printf( wxT("GbrLyr%dToPcb"), ii );
int ilayer;
config->Read( key, &ilayer);
m_layersLookUpTable[ii] = ilayer;
}
for( int ii = 0; ii < m_gerberActiveLayersCount; ii++ )
{
LAYER_NUM layer = m_layersLookUpTable[ii];
if( layer == UNSELECTED_LAYER )
{
m_layersList[ii]->SetLabel( _( "Do not export" ) );
m_layersList[ii]->SetForegroundColour( *wxBLUE );
}
else
{
m_layersList[ii]->SetLabel( GetPCBDefaultLayerName( layer ) );
m_layersList[ii]->SetForegroundColour( wxColour( 255, 0, 128 ) );
}
}
}
示例6: Kiface
wxConfigBase* EDA_BASE_FRAME::config()
{
// KICAD_MANAGER_FRAME overrides this
wxConfigBase* ret = Kiface().KifaceSettings();
wxASSERT( ret );
return ret;
}
示例7: dlg
void CVPCB_MAINFRAME::SaveProjectFile( wxCommandEvent& aEvent )
{
wxFileName fn = m_NetlistFileName;
fn.SetExt( ProjectFileExtension );
if( aEvent.GetId() == ID_SAVE_PROJECT_AS || !m_NetlistFileName.IsOk() )
{
wxFileDialog dlg( this, _( "Save Project File" ), fn.GetPath(),
wxEmptyString, ProjectFileWildcard, wxFD_SAVE );
if( dlg.ShowModal() == wxID_CANCEL )
return;
fn = dlg.GetPath();
if( !fn.HasExt() )
fn.SetExt( ProjectFileExtension );
}
if( !IsWritable( fn ) )
return;
// was:
// Pgm().WriteProjectConfig( fn.GetFullPath(), GROUP, GetProjectFileParameters() );
PROJECT& prj = Prj();
prj.ConfigSave( Kiface().KifaceSearch(), fn.GetFullPath(), GROUP_CVP, GetProjectFileParameters() );
}
示例8: DIALOG_EXPORT_3DFILE
DIALOG_EXPORT_3DFILE( PCB_EDIT_FRAME* parent ) :
DIALOG_EXPORT_3DFILE_BASE( parent )
{
m_parent = parent;
m_config = Kiface().KifaceSettings();
m_filePicker->SetFocus();
m_config->Read( OPTKEY_OUTPUT_UNIT, &m_unitsOpt, 1 );
m_config->Read( OPTKEY_3DFILES_OPT, &m_copy3DFilesOpt, false );
m_config->Read( OPTKEY_USE_RELATIVE_PATHS, &m_useRelativePathsOpt, false );
m_config->Read( OPTKEY_USE_PLAIN_PCB, &m_usePlainPCBOpt, false );
m_config->Read( OPTKEY_VRML_REF_UNITS, &m_RefUnits, 0 );
m_config->Read( OPTKEY_VRML_REF_X, &m_XRef, 0.0 );
m_config->Read( OPTKEY_VRML_REF_Y, &m_YRef, 0.0 );
m_rbSelectUnits->SetSelection( m_unitsOpt );
m_cbCopyFiles->SetValue( m_copy3DFilesOpt );
m_cbUseRelativePaths->SetValue( m_useRelativePathsOpt );
m_cbPlainPCB->SetValue( m_usePlainPCBOpt );
m_VRML_RefUnitChoice->SetSelection( m_RefUnits );
wxString tmpStr;
tmpStr << m_XRef;
m_VRML_Xref->SetValue( tmpStr );
tmpStr = wxT( "" );
tmpStr << m_YRef;
m_VRML_Yref->SetValue( tmpStr );
m_sdbSizer1OK->SetDefault();
// Now all widgets have the size fixed, call FinishDialogSettings
FinishDialogSettings();
Connect( ID_USE_ABS_PATH, wxEVT_UPDATE_UI,
wxUpdateUIEventHandler( DIALOG_EXPORT_3DFILE::OnUpdateUseRelativePath ) );
}
示例9: ExpandEnvVarSubstitutions
const wxString WORKSHEET_LAYOUT::MakeFullFileName( const wxString& aShortFileName,
const wxString& aProjectPath )
{
wxString fullFileName = ExpandEnvVarSubstitutions( aShortFileName );
if( fullFileName.IsEmpty() )
return fullFileName;
wxFileName fn = fullFileName;
if( fn.IsAbsolute() )
return fullFileName;
// the path is not absolute: search it in project path, and then in
// kicad valid paths
if( !aProjectPath.IsEmpty() )
{
fn.MakeAbsolute( aProjectPath );
if( wxFileExists( fn.GetFullPath() ) )
return fn.GetFullPath();
}
fn = fullFileName;
wxString name = Kiface().KifaceSearch().FindValidPath( fn.GetFullName() );
if( !name.IsEmpty() )
fullFileName = name;
return fullFileName;
}
示例10: OnUpdatePCBFromSch
void PCB_EDIT_FRAME::OnUpdatePCBFromSch( wxCommandEvent& event )
{
if( Kiface().IsSingle() )
{
DisplayError( this, _( "Cannot update the PCB, because the Kicad is"
" opened in stand-alone mode. In order to create/update"
" PCBs from schematics, you need to launch Kicad shell"
" and create a PCB project." ) );
return;
} else {
KIWAY_PLAYER* frame = Kiway().Player( FRAME_SCH, true );
wxFileName schfn = Prj().AbsolutePath( Prj().GetProjectName() );
schfn.SetExt( SchematicFileExtension );
if( !frame->IsVisible() )
{
frame->OpenProjectFiles( std::vector<wxString>( 1, schfn.GetFullPath() ) );
frame->Show( false );
}
Kiway().ExpressMail( FRAME_SCH, MAIL_SCH_PCB_UPDATE_REQUEST, "", this );
}
}
示例11: Kiface
const wxString WORKSHEET_LAYOUT::MakeShortFileName( const wxString& aFullFileName,
const wxString& aProjectPath )
{
wxString shortFileName = aFullFileName;
wxFileName fn = aFullFileName;
if( fn.IsRelative() )
return shortFileName;
if( ! aProjectPath.IsEmpty() && aFullFileName.StartsWith( aProjectPath ) )
{
fn.MakeRelativeTo( aProjectPath );
shortFileName = fn.GetFullPath();
return shortFileName;
}
wxString fileName = Kiface().KifaceSearch().FindValidPath( fn.GetFullName() );
if( !fileName.IsEmpty() )
{
fn = fileName;
shortFileName = fn.GetFullName();
return shortFileName;
}
return shortFileName;
}
示例12: DIALOG_PLOT_SCHEMATIC_BASE
DIALOG_PLOT_SCHEMATIC::DIALOG_PLOT_SCHEMATIC( SCH_EDIT_FRAME* parent ) :
DIALOG_PLOT_SCHEMATIC_BASE( parent ),
m_parent( parent ),
m_plotFormat( PLOT_FORMAT_UNDEFINED ),
m_defaultLineWidth( parent, m_lineWidthLabel, m_lineWidthCtrl, m_lineWidthUnits, true ),
m_penWidth( parent, m_penWidthLabel, m_penWidthCtrl, m_penWidthUnits, true )
{
m_config = Kiface().KifaceSettings();
m_configChanged = false;
m_browseButton->SetBitmap( KiBitmap( folder_xpm ) );
// We use a sdbSizer to get platform-dependent ordering of the action buttons, but
// that requires us to correct the button labels here.
m_sdbSizer1OK->SetLabel( _( "Plot All Pages" ) );
m_sdbSizer1Apply->SetLabel( _( "Plot Current Page" ) );
m_sdbSizer1Cancel->SetLabel( _( "Close" ) );
m_sdbSizer1->Layout();
m_sdbSizer1OK->SetDefault();
initDlg();
// Now all widgets have the size fixed, call FinishDialogSettings
FinishDialogSettings();
}
示例13: GetFileFromHistory
wxString EDA_BASE_FRAME::GetFileFromHistory( int cmdId, const wxString& type,
wxFileHistory* aFileHistory )
{
wxFileHistory* fileHistory = aFileHistory;
if( !fileHistory )
fileHistory = &Kiface().GetFileHistory();
int baseId = fileHistory->GetBaseId();
wxASSERT( cmdId >= baseId && cmdId < baseId + (int) fileHistory->GetCount() );
unsigned i = cmdId - baseId;
if( i < fileHistory->GetCount() )
{
wxString fn = fileHistory->GetHistoryFile( i );
if( wxFileName::FileExists( fn ) )
return fn;
else
{
wxString msg = wxString::Format(
wxT( "file '%s' was not found." ),
GetChars( fn ) );
wxMessageBox( msg );
fileHistory->RemoveFileFromHistory( i );
}
}
return wxEmptyString;
}
示例14: DisplayInfoMessage
void PCB_EDIT_FRAME::ArchiveModulesOnBoard( bool aNewModulesOnly )
{
if( GetBoard()->m_Modules == NULL )
{
DisplayInfoMessage( this, FMT_NO_MODULES );
return;
}
PROJECT& prj = Prj();
SEARCH_STACK& search = Kiface().KifaceSearch();
wxString last_nickname = prj.RPath(PROJECT::PCB_LIB).LastVisitedPath( search );
wxString nickname = SelectLibrary( last_nickname );
if( !nickname )
return;
prj.RPath(PROJECT::PCB_LIB).SaveLastVisitedPath( nickname );
if( !aNewModulesOnly )
{
wxString msg = wxString::Format( FMT_OK_OVERWRITE, GetChars( nickname ) );
if( !IsOK( this, msg ) )
return;
}
m_canvas->SetAbortRequest( false );
try
{
// Delete old library if we're replacing it entirely.
if( !aNewModulesOnly )
{
FootprintLibs()->FootprintLibDelete( nickname );
FootprintLibs()->FootprintLibCreate( nickname );
for( MODULE* m = GetBoard()->m_Modules; m; m = m->Next() )
{
FootprintLibs()->FootprintSave( nickname, m, true );
}
}
else
{
for( MODULE* m = GetBoard()->m_Modules; m; m = m->Next() )
{
FootprintLibs()->FootprintSave( nickname, m, false );
// Check for request to stop backup (ESCAPE key actuated)
if( m_canvas->GetAbortRequest() )
break;
}
}
}
catch( const IO_ERROR& ioe )
{
DisplayError( this, ioe.errorText );
}
}
示例15: fn
void CVPCB_MAINFRAME::LoadProjectFile( const wxString& aFileName )
{
wxFileName fn( aFileName );
PROJECT& prj = Prj();
m_ModuleLibNames.Clear();
m_AliasLibNames.Clear();
fn.SetExt( ProjectFileExtension );
// was: Pgm().ReadProjectConfig( fn.GetFullPath(), GROUP, GetProjectFileParameters(), false );
prj.ConfigLoad( Kiface().KifaceSearch(), fn.GetFullPath(), GROUP_CVP, GetProjectFileParameters(), false );
if( m_NetlistFileExtension.IsEmpty() )
m_NetlistFileExtension = wxT( "net" );
// empty the table, Load() it again below.
FootprintLibs()->Clear();
/* this is done by ConfigLoad(), and that sets the env var too.
prj.SetProjectFullName( fn.GetFullPath() );
*/
wxString projectFpLibTableFileName = prj.FootprintLibTblName();
try
{
FootprintLibs()->Load( projectFpLibTableFileName );
}
catch( const IO_ERROR& ioe )
{
DisplayError( this, ioe.errorText );
}
}