本文整理汇总了C++中FOOTPRINT_VIEWER_FRAME类的典型用法代码示例。如果您正苦于以下问题:C++ FOOTPRINT_VIEWER_FRAME类的具体用法?C++ FOOTPRINT_VIEWER_FRAME怎么用?C++ FOOTPRINT_VIEWER_FRAME使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FOOTPRINT_VIEWER_FRAME类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Kiway
wxString PCB_BASE_FRAME::SelectFootprintFromLibBrowser()
{
// Close the current non-modal Lib browser if opened, and open a new one, in "modal" mode:
FOOTPRINT_VIEWER_FRAME* viewer;
viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_PCB_MODULE_VIEWER, false );
if( viewer )
viewer->Destroy();
viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_PCB_MODULE_VIEWER_MODAL, true );
wxString fpid;
viewer->ShowModal( &fpid, this );
//DBG(printf("%s: fpid:'%s'\n", __func__, TO_UTF8( fpid ) );)
viewer->Destroy();
return fpid;
}
示例2: Kiway
wxString PCB_BASE_FRAME::SelectFootprintFromLibBrowser()
{
// Close the current non-modal Lib browser if opened, and open a new one, in "modal" mode:
FOOTPRINT_VIEWER_FRAME* viewer;
viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_PCB_MODULE_VIEWER, false );
if( viewer )
viewer->Destroy();
SetFocus();
// Creates the modal Lib browser:
viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_PCB_MODULE_VIEWER_MODAL, true, this );
wxString fpid;
int ret = viewer->ShowModal( &fpid, this );
(void) ret; // make static analyser quiet
viewer->Destroy();
return fpid;
}
示例3: INSTALL_UNBUFFERED_DC
void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
{
int id = event.GetId();
wxPoint pos;
INSTALL_UNBUFFERED_DC( dc, m_canvas );
wxGetMousePosition( &pos.x, &pos.y );
pos.y += 20;
switch( id )
{
case wxID_CUT:
case wxID_COPY:
case ID_TOOLBARH_PCB_SELECT_LAYER:
case ID_MODEDIT_PAD_SETTINGS:
case ID_PCB_USER_GRID_SETUP:
case ID_POPUP_PCB_ROTATE_TEXTEPCB:
case ID_POPUP_PCB_EDIT_TEXTEPCB:
case ID_POPUP_PCB_ROTATE_TEXTMODULE:
case ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE:
case ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE:
case ID_POPUP_PCB_EDIT_TEXTMODULE:
case ID_POPUP_PCB_APPLY_PAD_SETTINGS:
case ID_POPUP_PCB_COPY_PAD_SETTINGS:
case ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS:
case ID_POPUP_PCB_STOP_CURRENT_DRAWING:
case ID_POPUP_MODEDIT_EDIT_BODY_ITEM:
case ID_POPUP_MODEDIT_EDIT_WIDTH_ALL_EDGE:
case ID_POPUP_MODEDIT_EDIT_LAYER_ALL_EDGE:
case ID_POPUP_MODEDIT_ENTER_EDGE_WIDTH:
case ID_POPUP_PCB_DELETE_EDGE:
case ID_POPUP_PCB_DELETE_TEXTMODULE:
case ID_POPUP_PCB_DELETE_PAD:
case ID_POPUP_DELETE_BLOCK:
case ID_POPUP_PLACE_BLOCK:
case ID_POPUP_ZOOM_BLOCK:
case ID_POPUP_MIRROR_X_BLOCK:
case ID_POPUP_ROTATE_BLOCK:
case ID_POPUP_COPY_BLOCK:
break;
case ID_POPUP_CANCEL_CURRENT_COMMAND:
default:
if( m_canvas->IsMouseCaptured() )
{
// for all other commands: stop the move in progress
m_canvas->CallEndMouseCapture( &dc );
}
if( id != ID_POPUP_CANCEL_CURRENT_COMMAND )
SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
break;
}
switch( id )
{
case ID_EXIT:
Close( true );
break;
case ID_MODEDIT_SELECT_CURRENT_LIB:
{
wxString library = SelectLibrary( GetCurrentLib() );
if( library.size() )
{
Prj().SetRString( PROJECT::PCB_LIB_NICKNAME, library );
updateTitle();
}
}
break;
case ID_OPEN_MODULE_VIEWER:
{
FOOTPRINT_VIEWER_FRAME* viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_PCB_MODULE_VIEWER, false );
if( !viewer )
{
viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_PCB_MODULE_VIEWER, true );
viewer->Show( true );
viewer->Zoom_Automatique( false );
}
else
{
// On Windows, Raise() does not bring the window on screen, when iconized
if( viewer->IsIconized() )
viewer->Iconize( false );
viewer->Raise();
// Raising the window does not set the focus on Linux. This should work on
// any platform.
if( wxWindow::FindFocus() != viewer )
viewer->SetFocus();
}
}
break;
//.........这里部分代码省略.........
示例4: switch
void FOOTPRINT_EDIT_FRAME::ProcessPreferences( wxCommandEvent& event )
{
int id = event.GetId();
switch( id )
{
// Hotkey IDs
case ID_PREFERENCES_HOTKEY_EXPORT_CONFIG:
ExportHotkeyConfigToFile( g_Module_Editor_Hokeys_Descr, wxT( "pcbnew" ) );
break;
case ID_PREFERENCES_HOTKEY_IMPORT_CONFIG:
ImportHotkeyConfigFromFile( g_Module_Editor_Hokeys_Descr, wxT( "pcbnew" ) );
break;
case ID_PREFERENCES_HOTKEY_SHOW_EDITOR:
InstallHotkeyFrame( this, g_Module_Editor_Hokeys_Descr );
break;
case ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST:
// Display current hotkey list for the footprint editor.
DisplayHotkeyList( this, g_Module_Editor_Hokeys_Descr );
break;
case ID_PCB_LIB_WIZARD:
case ID_PCB_LIB_TABLE_EDIT:
{
bool tableChanged = false;
int r = 0;
if( id == ID_PCB_LIB_TABLE_EDIT )
r = InvokePcbLibTableEditor( this, &GFootprintTable, Prj().PcbFootprintLibs() );
else
r = InvokeFootprintWizard( this, &GFootprintTable, Prj().PcbFootprintLibs() );
if( r & 1 )
{
try
{
FILE_OUTPUTFORMATTER sf( FP_LIB_TABLE::GetGlobalTableFileName() );
GFootprintTable.Format( &sf, 0 );
tableChanged = true;
}
catch( const IO_ERROR& ioe )
{
wxString msg = wxString::Format( _(
"Error occurred saving the global footprint library "
"table:\n\n%s" ),
GetChars( ioe.errorText.GetData() )
);
wxMessageBox( msg, _( "File Save Error" ), wxOK | wxICON_ERROR );
}
}
if( r & 2 )
{
wxString tblName = Prj().FootprintLibTblName();
try
{
Prj().PcbFootprintLibs()->Save( tblName );
tableChanged = true;
}
catch( const IO_ERROR& ioe )
{
wxString msg = wxString::Format( _(
"Error occurred saving project specific footprint library "
"table:\n\n%s" ),
GetChars( ioe.errorText )
);
wxMessageBox( msg, _( "File Save Error" ), wxOK | wxICON_ERROR );
}
}
FOOTPRINT_VIEWER_FRAME* viewer;
viewer = (FOOTPRINT_VIEWER_FRAME*)Kiway().Player( FRAME_PCB_MODULE_VIEWER, false );
if( tableChanged && viewer != NULL )
viewer->ReCreateLibraryList();
}
break;
case wxID_PREFERENCES:
InvokeFPEditorPrefsDlg( this );
break;
default:
DisplayError( this, wxT( "FOOTPRINT_EDIT_FRAME::ProcessPreferences error" ) );
}
}
示例5: switch
//.........这里部分代码省略.........
catch( const IO_ERROR& ioe )
{
wxString msg = wxString::Format( _(
"Error occurred saving the global footprint library "
"table:\n\n%s" ),
GetChars( ioe.errorText.GetData() )
);
wxMessageBox( msg, _( "File Save Error" ), wxOK | wxICON_ERROR );
}
}
// If no board file is defined, do not save the project specific library table. It
// is kept in memory and created in the path when the new board is saved.
if( (r & 2) && !GetBoard()->GetFileName().IsEmpty() )
{
wxString tblName = Prj().FootprintLibTblName();
try
{
Prj().PcbFootprintLibs()->Save( tblName );
tableChanged = true;
}
catch( const IO_ERROR& ioe )
{
wxString msg = wxString::Format( _(
"Error occurred saving project specific footprint library "
"table:\n\n%s" ),
GetChars( ioe.errorText )
);
wxMessageBox( msg, _( "File Save Error" ), wxOK | wxICON_ERROR );
}
}
FOOTPRINT_VIEWER_FRAME* viewer;
if( tableChanged && (viewer = (FOOTPRINT_VIEWER_FRAME*)Kiway().Player( FRAME_PCB_MODULE_VIEWER, false )) != NULL )
{
viewer->ReCreateLibraryList();
}
}
break;
case ID_PCB_3DSHAPELIB_WIZARD:
#ifdef BUILD_GITHUB_PLUGIN
Invoke3DShapeLibsDownloaderWizard( this );
#endif
break;
case ID_PCB_MASK_CLEARANCE:
{
DIALOG_PADS_MASK_CLEARANCE dlg( this );
if( dlg.ShowModal() == 1 && IsGalCanvasActive() )
{
for( MODULE* module = GetBoard()->m_Modules; module; module = module->Next() )
module->ViewUpdate();
GetGalCanvas()->Refresh();
}
}
break;
case wxID_PREFERENCES:
{
DIALOG_GENERALOPTIONS dlg( this );
dlg.ShowModal();
示例6: switch
void PCB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
{
int id = event.GetId();
wxFileName fn;
switch( id )
{
case ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER_DIALOG:
m_show_layer_manager_tools = ! m_show_layer_manager_tools;
m_auimgr.GetPane( wxT( "m_LayersManagerToolBar" ) ).Show( m_show_layer_manager_tools );
m_auimgr.Update();
GetMenuBar()->SetLabel( ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER_DIALOG,
m_show_layer_manager_tools ?
_("Hide &Layers Manager" ) : _("Show &Layers Manager" ));
break;
case ID_MENU_PCB_SHOW_HIDE_MUWAVE_TOOLBAR:
m_show_microwave_tools = ! m_show_microwave_tools;
m_auimgr.GetPane( wxT( "m_microWaveToolBar" ) ).Show( m_show_microwave_tools );
m_auimgr.Update();
GetMenuBar()->SetLabel( ID_MENU_PCB_SHOW_HIDE_MUWAVE_TOOLBAR,
m_show_microwave_tools ?
_( "Hide Microwave Toolbar" ): _( "Show Microwave Toolbar" ));
break;
case ID_PCB_LAYERS_SETUP:
InstallDialogLayerSetup();
break;
case ID_PCB_LIB_TABLE_EDIT:
{
bool tableChanged = false;
int r = InvokePcbLibTableEditor( this, &GFootprintTable, FootprintLibs() );
if( r & 1 )
{
try
{
FILE_OUTPUTFORMATTER sf( FP_LIB_TABLE::GetGlobalTableFileName() );
GFootprintTable.Format( &sf, 0 );
tableChanged = true;
}
catch( const IO_ERROR& ioe )
{
wxString msg = wxString::Format( _(
"Error occurred saving the global footprint library "
"table:\n\n%s" ),
GetChars( ioe.errorText.GetData() )
);
wxMessageBox( msg, _( "File Save Error" ), wxOK | wxICON_ERROR );
}
}
// If no board file is defined, do not save the project specific library table. It
// is kept in memory and created in the path when the new board is saved.
if( (r & 2) && !GetBoard()->GetFileName().IsEmpty() )
{
wxString tblName = Prj().FootprintLibTblName();
try
{
FootprintLibs()->Save( tblName );
tableChanged = true;
}
catch( const IO_ERROR& ioe )
{
wxString msg = wxString::Format( _(
"Error occurred saving project specific footprint library "
"table:\n\n%s" ),
GetChars( ioe.errorText )
);
wxMessageBox( msg, _( "File Save Error" ), wxOK | wxICON_ERROR );
}
}
FOOTPRINT_VIEWER_FRAME* viewer;
if( tableChanged && (viewer = FOOTPRINT_VIEWER_FRAME::GetActiveFootprintViewer( this )) != NULL )
{
viewer->ReCreateLibraryList();
}
}
break;
case ID_PCB_MASK_CLEARANCE:
{
DIALOG_PADS_MASK_CLEARANCE dlg( this );
dlg.ShowModal();
}
break;
case wxID_PREFERENCES:
{
DIALOG_GENERALOPTIONS dlg( this );
dlg.ShowModal();
}
//.........这里部分代码省略.........
示例7: INSTALL_UNBUFFERED_DC
void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
{
int id = event.GetId();
wxPoint pos;
bool redraw = false;
INSTALL_UNBUFFERED_DC( dc, m_canvas );
wxGetMousePosition( &pos.x, &pos.y );
pos.y += 20;
switch( id )
{
case wxID_CUT:
case wxID_COPY:
case ID_TOOLBARH_PCB_SELECT_LAYER:
case ID_MODEDIT_PAD_SETTINGS:
case ID_PCB_USER_GRID_SETUP:
case ID_POPUP_PCB_ROTATE_TEXTEPCB:
case ID_POPUP_PCB_EDIT_TEXTEPCB:
case ID_POPUP_PCB_ROTATE_TEXTMODULE:
case ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE:
case ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE:
case ID_POPUP_PCB_EDIT_TEXTMODULE:
case ID_POPUP_PCB_IMPORT_PAD_SETTINGS:
case ID_POPUP_PCB_EXPORT_PAD_SETTINGS:
case ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS:
case ID_POPUP_PCB_STOP_CURRENT_DRAWING:
case ID_POPUP_MODEDIT_EDIT_BODY_ITEM:
case ID_POPUP_MODEDIT_EDIT_WIDTH_CURRENT_EDGE:
case ID_POPUP_MODEDIT_EDIT_WIDTH_ALL_EDGE:
case ID_POPUP_MODEDIT_EDIT_LAYER_CURRENT_EDGE:
case ID_POPUP_MODEDIT_EDIT_LAYER_ALL_EDGE:
case ID_POPUP_MODEDIT_ENTER_EDGE_WIDTH:
case ID_POPUP_PCB_DELETE_EDGE:
case ID_POPUP_PCB_DELETE_TEXTMODULE:
case ID_POPUP_PCB_DELETE_PAD:
case ID_POPUP_DELETE_BLOCK:
case ID_POPUP_PLACE_BLOCK:
case ID_POPUP_ZOOM_BLOCK:
case ID_POPUP_MIRROR_X_BLOCK:
case ID_POPUP_ROTATE_BLOCK:
case ID_POPUP_COPY_BLOCK:
break;
case ID_POPUP_CANCEL_CURRENT_COMMAND:
default:
if( m_canvas->IsMouseCaptured() )
{
// for all other commands: stop the move in progress
m_canvas->CallEndMouseCapture( &dc );
}
if( id != ID_POPUP_CANCEL_CURRENT_COMMAND )
SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
break;
}
switch( id )
{
case ID_EXIT:
Close( true );
break;
case ID_MODEDIT_SELECT_CURRENT_LIB:
Select_Active_Library();
break;
case ID_OPEN_MODULE_VIEWER:
{
FOOTPRINT_VIEWER_FRAME * viewer = FOOTPRINT_VIEWER_FRAME::GetActiveFootprintViewer();
if( viewer == NULL )
{
viewer = new FOOTPRINT_VIEWER_FRAME( this, NULL );
viewer->Show( true );
viewer->Zoom_Automatique( false );
}
else
{
if( viewer->IsIconized() )
viewer->Iconize( false );
viewer->Raise();
// Raising the window does not set the focus on Linux. This should work on
// any platform.
if( wxWindow::FindFocus() != viewer )
viewer->SetFocus();
}
}
break;
case ID_MODEDIT_DELETE_PART:
DeleteModuleFromCurrentLibrary();
break;
case ID_MODEDIT_NEW_MODULE:
{
//.........这里部分代码省略.........
示例8: INSTALL_UNBUFFERED_DC
//.........这里部分代码省略.........
case 0:
break;
case ID_OPEN_MODULE_EDITOR:
{
FOOTPRINT_EDIT_FRAME* editor = (FOOTPRINT_EDIT_FRAME*) Kiway().Player( FRAME_PCB_MODULE_EDITOR, false );
if( !editor )
{
editor = (FOOTPRINT_EDIT_FRAME*) Kiway().Player( FRAME_PCB_MODULE_EDITOR, true );
editor->Show( true );
editor->Zoom_Automatique( false );
}
else
{
/* not needed on linux, other platforms need this?
if( editor->IsIconized() )
editor->Iconize( false );
*/
editor->Raise();
// Raising the window does not set the focus on Linux. This should work on
// any platform.
if( wxWindow::FindFocus() != editor )
editor->SetFocus();
}
}
break;
case ID_OPEN_MODULE_VIEWER:
{
FOOTPRINT_VIEWER_FRAME* viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_PCB_MODULE_VIEWER, false );
if( !viewer )
{
viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_PCB_MODULE_VIEWER, true );
viewer->Show( true );
viewer->Zoom_Automatique( false );
}
else
{
/* not needed on linux, other platforms need this?
if( viewer->IsIconized() )
viewer->Iconize( false );
*/
viewer->Raise();
// Raising the window does not set the focus on Linux. This should work on
// any platform.
if( wxWindow::FindFocus() != viewer )
viewer->SetFocus();
}
}
break;
case ID_PCB_GLOBAL_DELETE:
InstallPcbGlobalDeleteFrame( wxDefaultPosition );
break;
case ID_POPUP_PLACE_BLOCK:
GetScreen()->m_BlockLocate.SetCommand( BLOCK_MOVE );
m_canvas->SetAutoPanRequest( false );
示例9: CreateWindow
wxWindow* CreateWindow( wxWindow* aParent, int aClassId, KIWAY* aKiway, int aCtlBits = 0 )
{
switch( aClassId )
{
case FRAME_PCB:
{
PCB_EDIT_FRAME* frame = new PCB_EDIT_FRAME( aKiway, aParent );
frame->Zoom_Automatique( true );
#if defined(KICAD_SCRIPTING)
// give the scripting helpers access to our frame
ScriptingSetPcbEditFrame( frame );
#endif
if( Kiface().IsSingle() )
{
// only run this under single_top, not under a project manager.
CreateServer( frame, KICAD_PCB_PORT_SERVICE_NUMBER );
}
return frame;
}
break;
case FRAME_PCB_MODULE_EDITOR:
{
FOOTPRINT_EDIT_FRAME* frame = new FOOTPRINT_EDIT_FRAME( aKiway, aParent );
frame->Zoom_Automatique( true );
/* Read a default config file in case no project given on command line.
frame->LoadProjectFile( wxEmptyString, true );
*/
return frame;
}
break;
case FRAME_PCB_MODULE_VIEWER:
case FRAME_PCB_MODULE_VIEWER_MODAL:
{
FOOTPRINT_VIEWER_FRAME* frame = new FOOTPRINT_VIEWER_FRAME(
aKiway, aParent, FRAME_T( aClassId ) );
frame->Zoom_Automatique( true );
/* Read a default config file in case no project given on command line.
frame->LoadProjectFile( wxEmptyString, true );
*/
return frame;
}
break;
case FRAME_PCB_FOOTPRINT_WIZARD_MODAL:
{
FOOTPRINT_WIZARD_FRAME* frame = new FOOTPRINT_WIZARD_FRAME(
aKiway, aParent, FRAME_T( aClassId ) );
return frame;
}
break;
default:
;
}
return NULL;
}