本文整理汇总了C++中KIWAY_PLAYER类的典型用法代码示例。如果您正苦于以下问题:C++ KIWAY_PLAYER类的具体用法?C++ KIWAY_PLAYER怎么用?C++ KIWAY_PLAYER使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KIWAY_PLAYER类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wxASSERT
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: getSelectedFieldNdx
void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::showButtonHandler( wxCommandEvent& event )
{
unsigned fieldNdx = getSelectedFieldNdx();
if( fieldNdx == DATASHEET )
{
wxString datasheet_uri = fieldValueTextCtrl->GetValue();
::wxLaunchDefaultBrowser( datasheet_uri );
}
else if( fieldNdx == FOOTPRINT )
{
// pick a footprint using the footprint picker.
wxString fpid;
KIWAY_PLAYER* frame = Kiway().Player( FRAME_PCB_MODULE_VIEWER_MODAL, true );
if( frame->ShowModal( &fpid, this ) )
{
// DBG( printf( "%s: %s\n", __func__, TO_UTF8( fpid ) ); )
fieldValueTextCtrl->SetValue( fpid );
}
frame->Destroy();
}
}
示例3: Pgm
void KIWAY::SetLanguage( int aLanguage )
{
Pgm().SetLanguageIdentifier( aLanguage );
Pgm().SetLanguage();
#if 1
// This is a risky hack that goes away if we allow the language to be
// set only from the top most frame if !Kiface.IsSingle()
// Only for the C++ project manager, and not for the python one and not for
// single_top do we look for the EDA_BASE_FRAME as the top level window.
// For single_top this is not needed because that window is registered in
// the array below.
if( m_ctl & KFCTL_CPP_PROJECT_SUITE )
{
// A dynamic_cast could be better, but creates link issues
// (some basic_frame functions not found) on some platforms,
// so a static_cast is used.
EDA_BASE_FRAME* top = static_cast<EDA_BASE_FRAME*>( m_top );
if( top )
top->ShowChangedLanguage();
}
#endif
for( unsigned i=0; i < KIWAY_PLAYER_COUNT; ++i )
{
KIWAY_PLAYER* frame = GetPlayerFrame( ( FRAME_T )i );
if( frame )
{
frame->ShowChangedLanguage();
}
}
}
示例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: OnRunSchLibEditor
void KICAD_MANAGER_FRAME::OnRunSchLibEditor( wxCommandEvent& event )
{
KIWAY_PLAYER* frame = Kiway.Player( FRAME_SCH_LIB_EDITOR, false );
if( !frame )
{
frame = Kiway.Player( FRAME_SCH_LIB_EDITOR, true );
// frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectSchematicFileName ) );
frame->Show( true );
}
frame->Raise();
}
示例6: OnRunPcbFpEditor
void KICAD_MANAGER_FRAME::OnRunPcbFpEditor( wxCommandEvent& event )
{
KIWAY_PLAYER* frame = Kiway.Player( FRAME_PCB_MODULE_EDITOR, false );
if( !frame )
{
frame = Kiway.Player( FRAME_PCB_MODULE_EDITOR, true );
// frame->OpenProjectFiles( std::vector<wxString>( 1, aProjectBoardFileName ) );
frame->Show( true );
}
frame->Raise();
}
示例7: Kiway
void DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick( wxCommandEvent& aEvent )
{
// pick a footprint using the footprint picker.
wxString fpid;
KIWAY_PLAYER* frame = Kiway().Player( FRAME_PCB_MODULE_VIEWER_MODAL, true );
if( frame->ShowModal( &fpid, this ) )
{
m_TextValue->SetValue( fpid );
}
frame->Destroy();
}
示例8: 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();
}
示例9: fn
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();
}
示例10: filename
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 ) );
}
}
示例11: OnRunPcbFpEditor
void KICAD_MANAGER_FRAME::OnRunPcbFpEditor( wxCommandEvent& event )
{
KIWAY_PLAYER* frame = Kiway.Player( FRAME_PCB_MODULE_EDITOR, false );
if( !frame )
{
frame = Kiway.Player( FRAME_PCB_MODULE_EDITOR, true );
// 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();
}
示例12: wxASSERT_MSG
KIWAY_PLAYER* KIWAY::Player( FRAME_T aFrameType, bool doCreate, KIWAY_PLAYER* aParent )
{
// Since this will be called from python, cannot assume that code will
// not pass a bad aFrameType.
if( unsigned( aFrameType ) >= KIWAY_PLAYER_COUNT )
{
// @todo : throw an exception here for python's benefit, at least that
// way it gets some explanatory text.
wxASSERT_MSG( 0, wxT( "caller has a bug, passed a bad aFrameType" ) );
return NULL;
}
// return the previously opened window
KIWAY_PLAYER* frame = GetPlayerFrame( aFrameType );
if( frame )
return frame;
if( doCreate )
{
FACE_T face_type = KifaceType( aFrameType );
wxASSERT( face_type != FACE_T(-1) );
KIFACE* kiface = KiFACE( face_type );
wxASSERT( kiface );
if( kiface )
{
frame = (KIWAY_PLAYER*) kiface->CreateWindow(
aParent, // Parent window of frame, NULL in non modal mode
aFrameType,
this,
m_ctl // questionable need, these same flags where passed to the KIFACE::OnKifaceStart()
);
wxASSERT( frame );
m_playerFrameName[aFrameType] = frame->GetName();
return frame;
}
}
return NULL;
}
示例13: 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();
}
示例14: 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();
}
示例15: Player
bool KIWAY::ProcessEvent( wxEvent& aEvent )
{
KIWAY_EXPRESS* mail = dynamic_cast<KIWAY_EXPRESS*>( &aEvent );
if( mail )
{
FRAME_T dest = mail->Dest();
// see if recipient is alive
KIWAY_PLAYER* alive = Player( dest, false );
if( alive )
{
#if 1
return alive->ProcessEvent( aEvent );
#else
alive->KiwayMailIn( *mail );
return true;
#endif
}
}
return false;
}