本文整理汇总了C++中KIWAY_PLAYER::OpenProjectFiles方法的典型用法代码示例。如果您正苦于以下问题:C++ KIWAY_PLAYER::OpenProjectFiles方法的具体用法?C++ KIWAY_PLAYER::OpenProjectFiles怎么用?C++ KIWAY_PLAYER::OpenProjectFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KIWAY_PLAYER
的用法示例。
在下文中一共展示了KIWAY_PLAYER::OpenProjectFiles方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RunEeschema
void KICAD_MANAGER_FRAME::RunEeschema( const wxString& aProjectSchematicFileName )
{
KIWAY_PLAYER* frame = Kiway.Player( FRAME_SCH, false );
// Please: note: DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::initBuffers() calls
// Kiway.Player( FRAME_SCH, true )
// therefore, the schematic editor is sometimes running, but the schematic project
// is not loaded, if the library editor was called, and the dialog field editor was used.
// On linux, it happens the first time the schematic editor is launched, if
// library editor was running, and the dialog field editor was open
// On Windows, it happens always after the library editor was called,
// and the dialog field editor was used
if( !frame )
{
frame = Kiway.Player( FRAME_SCH, true );
}
if( !frame->IsShown() ) // the frame exists, (created by the dialog field editor)
// but no project loaded.
{
frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectSchematicFileName ) );
frame->Show( true );
}
// On Windows, Raise() does not bring the window on screen, when iconized or not shown
// On linux, Raise() brings the window on screen, but this code works fine
if( frame->IsIconized() )
frame->Iconize( false );
frame->Raise();
}
示例2: RunPcbNew
void KICAD_MANAGER_FRAME::RunPcbNew( const wxString& aProjectBoardFileName )
{
KIWAY_PLAYER* frame;
try
{
frame = Kiway().Player( FRAME_PCB, true );
}
catch( const IO_ERROR& err )
{
wxMessageBox( _( "Pcbnew failed to load:\n" ) + err.What(), _( "KiCad Error" ),
wxOK | wxICON_ERROR, this );
return;
}
if( !frame->IsVisible() ) // A hidden frame might not have the board loaded.
{
if( !frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectBoardFileName ) ) )
return;
frame->Show( true );
}
// On Windows, Raise() does not bring the window on screen, when iconized
if( frame->IsIconized() )
frame->Iconize( false );
frame->Raise();
}
示例3: RunEeschema
void KICAD_MANAGER_FRAME::RunEeschema( const wxString& aProjectSchematicFileName )
{
KIWAY_PLAYER* frame;
try
{
frame = 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;
}
if( !frame->IsShown() ) // A hidden frame might not have the project loaded.
{
if( !frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectSchematicFileName ) ) )
return;
frame->Show( true );
}
// On Windows, Raise() does not bring the window on screen, when iconized or not shown
// On linux, Raise() brings the window on screen, but this code works fine
if( frame->IsIconized() )
{
frame->Iconize( false );
// If an iconized frame was created by Pcbnew, Iconize( false ) is not enough
// to show the frame at its normal size: Maximize should be called.
frame->Maximize( false );
}
frame->Raise();
}
示例4: RunEeschema
void KICAD_MANAGER_FRAME::RunEeschema( const wxString& aProjectSchematicFileName )
{
KIWAY_PLAYER* frame = Kiway.Player( FRAME_SCH, false );
if( !frame )
{
frame = Kiway.Player( FRAME_SCH, true );
frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectSchematicFileName ) );
frame->Show( true );
}
frame->Raise();
}
示例5: RunPcbNew
void KICAD_MANAGER_FRAME::RunPcbNew( const wxString& aProjectBoardFileName )
{
#if 0 // line 171 of modview_frame.cpp breaks this code
KIWAY_PLAYER* frame = Kiway.Player( FRAME_PCB, false );
if( !frame )
{
frame = Kiway.Player( FRAME_PCB, true );
frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectBoardFileName ) );
frame->Show( true );
}
#else
KIWAY_PLAYER* frame = Kiway.Player( FRAME_PCB, true );
if( !frame->IsVisible() )
{
frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectBoardFileName ) );
frame->Show( true );
}
#endif
frame->Raise();
}
示例6: OnRunCvpcb
void KICAD_MANAGER_FRAME::OnRunCvpcb( wxCommandEvent& event )
{
wxFileName fn( GetProjectFileName() );
fn.SetExt( NetlistFileExtension );
KIWAY_PLAYER* frame = Kiway.Player( FRAME_CVPCB, false );
if( !frame )
{
frame = Kiway.Player( FRAME_CVPCB, true );
frame->OpenProjectFiles( std::vector<wxString>( 1, fn.GetFullPath() ) );
frame->Show( true );
}
frame->Raise();
}
示例7: MacOpenFile
void PGM_SINGLE_TOP::MacOpenFile( const wxString& aFileName )
{
wxFileName filename( aFileName );
if( filename.FileExists() )
{
#if 0
// this pulls in EDA_DRAW_FRAME type info, which we don't want in
// the single_top link image.
KIWAY_PLAYER* frame = dynamic_cast<KIWAY_PLAYER*>( App().GetTopWindow() );
#else
KIWAY_PLAYER* frame = (KIWAY_PLAYER*) App().GetTopWindow();
#endif
if( frame )
frame->OpenProjectFiles( std::vector<wxString>( 1, aFileName ) );
}
}
示例8: RunPcbNew
void KICAD_MANAGER_FRAME::RunPcbNew( const wxString& aProjectBoardFileName )
{
KIWAY_PLAYER* frame = Kiway.Player( FRAME_PCB, true );
// a pcb frame can be already existing, but not yet used.
// this is the case when running the footprint editor, or the footprint viewer first
// if the frame is not visible, the board is not yet loaded
if( !frame->IsVisible() )
{
frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectBoardFileName ) );
frame->Show( true );
}
// On Windows, Raise() does not bring the window on screen, when iconized
if( frame->IsIconized() )
frame->Iconize( false );
frame->Raise();
}
示例9: wxLogError
bool PGM_SINGLE_TOP::OnPgmInit( wxApp* aWxApp )
{
// first thing: set m_wx_app
m_wx_app = aWxApp;
wxString absoluteArgv0 = wxStandardPaths::Get().GetExecutablePath();
if( !wxIsAbsolutePath( absoluteArgv0 ) )
{
wxLogError( wxT( "No meaningful argv[0]" ) );
return false;
}
if( !initPgm() )
return false;
#if !defined(BUILD_KIWAY_DLL)
// Get the getter, it is statically linked into this binary image.
KIFACE_GETTER_FUNC* getter = &KIFACE_GETTER;
int kiface_version;
// Get the KIFACE.
KIFACE* kiface = getter( &kiface_version, KIFACE_VERSION, this );
// Trick the KIWAY into thinking it loaded a KIFACE, by recording the KIFACE
// in the KIWAY. It needs to be there for KIWAY::OnKiwayEnd() anyways.
Kiway.set_kiface( KIWAY::KifaceType( TOP_FRAME ), kiface );
#endif
// Use KIWAY to create a top window, which registers its existence also.
// "TOP_FRAME" is a macro that is passed on compiler command line from CMake,
// and is one of the types in FRAME_T.
KIWAY_PLAYER* frame = Kiway.Player( TOP_FRAME, true );
Kiway.SetTop( frame );
App().SetTopWindow( frame ); // wxApp gets a face.
// Open project or file specified on the command line:
int argc = App().argc;
if( argc > 1 )
{
/*
gerbview handles multiple project data files, i.e. gerber files on
cmd line. Others currently do not, they handle only one. For common
code simplicity we simply pass all the arguments in however, each
program module can do with them what they want, ignore, complain
whatever. We don't establish policy here, as this is a multi-purpose
launcher.
*/
std::vector<wxString> argSet;
for( int i=1; i<argc; ++i )
{
argSet.push_back( App().argv[i] );
}
// special attention to the first argument: argv[1] (==argSet[0])
wxFileName argv1( argSet[0] );
if( argc == 2 )
{
#if defined(PGM_DATA_FILE_EXT)
// PGM_DATA_FILE_EXT, if present, may be different for each compile,
// it may come from CMake on the compiler command line, but often does not.
// This facillity is mostly useful for those program modules
// supporting a single argv[1].
if( !argv1.GetExt() )
argv1.SetExt( wxT( PGM_DATA_FILE_EXT ) );
#endif
argv1.MakeAbsolute();
argSet[0] = argv1.GetFullPath();
}
// Use the KIWAY_PLAYER::OpenProjectFiles() API function:
if( !frame->OpenProjectFiles( argSet ) )
{
// OpenProjectFiles() API asks that it report failure to the UI.
// Nothing further to say here.
// We've already initialized things at this point, but wx won't call OnExit if
// we fail out. Call our own cleanup routine here to ensure the relevant resources
// are freed at the right time (if they aren't, segfaults will occur).
OnPgmExit();
// Fail the process startup if the file could not be opened,
// although this is an optional choice, one that can be reversed
// also in the KIFACE specific OpenProjectFiles() return value.
return false;
}
}
frame->Show();
return true;
//.........这里部分代码省略.........