本文整理汇总了C++中KIWAY_PLAYER::Kiway方法的典型用法代码示例。如果您正苦于以下问题:C++ KIWAY_PLAYER::Kiway方法的具体用法?C++ KIWAY_PLAYER::Kiway怎么用?C++ KIWAY_PLAYER::Kiway使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KIWAY_PLAYER
的用法示例。
在下文中一共展示了KIWAY_PLAYER::Kiway方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetActiveFootprintViewer
FOOTPRINT_VIEWER_FRAME* FOOTPRINT_VIEWER_FRAME::GetActiveFootprintViewer( const KIWAY_PLAYER* aParent )
{
wxASSERT( aParent );
// We search only within the current project, and do so by limiting
// the search scope to a wxWindow hierarchy subset. Find the top most
// KIWAY_PLAYER which is part of this PROJECT by matching its KIWAY* to the
// most immediate parent's.
// NOTE: an open FOOTPRINT_VIEWER_FRAME may have either the PCB_EDIT_FRAME
// or the FOOTPRINT_EDIT_FRAME as parent.
KIWAY* kiway = &aParent->Kiway();
wxWindow* frame;
while( (frame = aParent->GetParent()) != NULL )
{
// will go NULL when we reach a non-KIWAY_PLAYER
KIWAY_PLAYER* kwp = dynamic_cast<KIWAY_PLAYER*>( frame );
if( kwp && &kwp->Kiway() == kiway )
aParent = kwp;
else
break;
}
return (FOOTPRINT_VIEWER_FRAME*) wxWindow::FindWindowByName(
GetFootprintViewerFrameName(), aParent );
}
示例2: OnImportEagleFiles
void KICAD_MANAGER_FRAME::OnImportEagleFiles( wxCommandEvent& event )
{
// Close other windows.
if( !Kiway().PlayersClose( false ) )
return;
wxString title = _( "Import Eagle Project Files" );
int style = wxFD_OPEN | wxFD_FILE_MUST_EXIST;
wxString default_dir = GetMruPath();
ClearMsg();
wxFileDialog schdlg( this, title, default_dir, wxEmptyString,
EagleFilesWildcard(), style );
if( schdlg.ShowModal() == wxID_CANCEL )
return;
wxFileName sch( schdlg.GetPath() );
sch.SetExt( SchematicFileExtension );
wxFileName pro = sch;
pro.SetExt( ProjectFileExtension );
wxString protitle = _( "KiCad Project Destination" );
// Don't use wxFileDialog here. On GTK builds, the default path is returned unless a
// file is actually selected.
wxDirDialog prodlg( this, protitle, pro.GetPath(), wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
if( prodlg.ShowModal() == wxID_CANCEL )
return;
pro.SetPath( prodlg.GetPath() );
// Check if the project directory is empty
wxDir directory( pro.GetPath() );
if( directory.HasFiles() )
{
wxString msg = _( "The selected directory is not empty. We recommend you "
"create projects in their own clean directory.\n\nDo you "
"want to create a new empty directory for the project?" );
KIDIALOG dlg( this, msg, _( "Confirmation" ), wxYES_NO | wxICON_WARNING );
dlg.DoNotShowCheckbox( __FILE__, __LINE__ );
if( dlg.ShowModal() == wxID_YES )
{
// Append a new directory with the same name of the project file
// and try to create it
pro.AppendDir( pro.GetName() );
if( !wxMkdir( pro.GetPath() ) )
// There was a problem, undo
pro.RemoveLastDir();
}
}
wxFileName pcb( sch );
pro.SetExt( ProjectFileExtension ); // enforce extension
pcb.SetExt( LegacyPcbFileExtension ); // enforce extension
if( !pro.IsAbsolute() )
pro.MakeAbsolute();
SetProjectFileName( pro.GetFullPath() );
wxString prj_filename = GetProjectFileName();
if( sch.FileExists() )
{
KIWAY_PLAYER* schframe = Kiway().Player( FRAME_SCH, false );
if( !schframe )
{
try // SCH frame was not available, try to start it
{
schframe = Kiway().Player( FRAME_SCH, true );
}
catch( const IO_ERROR& err )
{
wxMessageBox( _( "Eeschema failed to load:\n" ) + err.What(),
_( "KiCad Error" ), wxOK | wxICON_ERROR, this );
return;
}
}
std::string packet = StrPrintf( "%d\n%s", SCH_IO_MGR::SCH_EAGLE,
TO_UTF8( sch.GetFullPath() ) );
schframe->Kiway().ExpressMail( FRAME_SCH, MAIL_IMPORT_FILE, packet, this );
if( !schframe->IsShown() ) // the frame exists, (created by the dialog field editor)
// but no project loaded.
{
schframe->Show( true );
}
//.........这里部分代码省略.........