void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent ) { wxCHECK_RET( aComponent != NULL && aComponent->Type() == SCH_COMPONENT_T, wxT( "Invalid component object pointer. Bad Programmer!" ) ); m_canvas->SetIgnoreMouseEvents( true ); DIALOG_EDIT_COMPONENT_IN_SCHEMATIC* dlg = new DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( this ); dlg->InitBuffers( aComponent ); // make sure the chipnameTextCtrl is wide enough to hold any unusually long chip names: EnsureTextCtrlWidth( dlg->chipnameTextCtrl ); // This dialog itself subsequently can invoke a KIWAY_PLAYER as a quasimodal // frame. Therefore this dialog as a modal frame parent, MUST be run under // quasimodal mode for the quasimodal frame support to work. So don't use // the QUASIMODAL macros here. int ret = dlg->ShowQuasiModal(); if( m_autoplaceFields ) aComponent->AutoAutoplaceFields( GetScreen() ); m_canvas->SetIgnoreMouseEvents( false ); m_canvas->MoveCursorToCrossHair(); dlg->Destroy(); if( ret == wxID_OK ) GetCanvas()->Refresh(); }
void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent ) { wxCHECK_RET( aComponent != NULL && aComponent->Type() == SCH_COMPONENT_T, wxT( "Invalid component object pointer. Bad Programmer!" ) ); m_canvas->SetIgnoreMouseEvents( true ); DIALOG_EDIT_COMPONENT_IN_SCHEMATIC* dlg = new DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( this ); dlg->InitBuffers( aComponent ); // make sure the chipnameTextCtrl is wide enough to hold any unusually long chip names: EnsureTextCtrlWidth( dlg->chipnameTextCtrl ); dlg->ShowQuasiModal(); m_canvas->SetIgnoreMouseEvents( false ); m_canvas->MoveCursorToCrossHair(); dlg->Destroy(); }