Loading pcbnew/menubarmodedit.cpp +71 −77 Original line number Diff line number Diff line /***********************************************************************/ /* menubarmodedit.cpp - creation du menu general de l'editeur de module*/ /***********************************************************************/ /************************************************/ /* menubarmodedit.cpp - Module editor menu bar. */ /************************************************/ #include "fctsys.h" #include "common.h" Loading @@ -13,13 +13,7 @@ #include "pcbnew_id.h" /***********************************************/ void WinEDA_ModuleEditFrame::ReCreateMenuBar() /***********************************************/ /* Cree ou reinitialise le menu du haut d'ecran */ { wxMenuBar* menuBar = GetMenuBar(); wxMenuItem* item; Loading @@ -28,9 +22,6 @@ wxMenuItem * item; { menuBar = new wxMenuBar(); ///////////////////////////// // Ajustage de dimensions: // ///////////////////////////// wxMenu* sizes_menu = new wxMenu; item = new wxMenuItem( sizes_menu, ID_PCB_DRAWINGS_WIDTHS_SETUP, Loading @@ -40,12 +31,14 @@ wxMenuItem * item; sizes_menu->Append( item ); item = new wxMenuItem( sizes_menu, ID_PCB_PAD_SETUP, _( "Pad Settings" ), _("Adjust size,shape,layers... for Pads")); _( "Adjust size, shape, layers... for pads" ) ); item->SetBitmap( pad_xpm ); sizes_menu->Append( item ); item = new wxMenuItem(sizes_menu, ID_PCB_USER_GRID_SETUP, _("User Grid Size"), _("Adjust User Grid")); item = new wxMenuItem( sizes_menu, ID_PCB_USER_GRID_SETUP, _( "User Grid Size" ), _( "Adjust user grid" ) ); item->SetBitmap( grid_xpm ); sizes_menu->Append( item ); Loading @@ -58,8 +51,8 @@ wxMenuItem * item; // Contents item = new wxMenuItem( helpMenu, ID_GENERAL_HELP, _("&Contents"), // Menu entry name _("Open the pcbnew manual")); // Statusbar message _( "&Contents" ), _( "Open the pcbnew manual" ) ); item->SetBitmap( help_xpm ); helpMenu->Append( item ); Loading @@ -67,8 +60,8 @@ wxMenuItem * item; // About pcbnew item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT, _("&About pcbnew"), // Menu entry name _("About pcbnew PCB designer")); // Statusbar message _( "&About pcbnew" ), _( "About pcbnew PCB designer" ) ); item->SetBitmap( info_xpm ); helpMenu->Append( item ); Loading @@ -76,7 +69,10 @@ wxMenuItem * item; // Menu Display 3D: // ////////////////////// wxMenu* Display3DMenu = new wxMenu; item = new wxMenuItem(Display3DMenu , ID_MENU_PCB_SHOW_3D_FRAME, _("3D Display"), _("Show board in 3D viewer")); item = new wxMenuItem( Display3DMenu, ID_MENU_PCB_SHOW_3D_FRAME, _( "3D Display" ), _( "Show board in 3D viewer" ) ); item->SetBitmap( show_3d_xpm ); Display3DMenu->Append( item ); Loading @@ -88,5 +84,3 @@ wxMenuItem * item; SetMenuBar( menuBar ); } } pcbnew/menubarpcb.cpp +18 −24 Original line number Diff line number Diff line /******************************************************************/ /* menubarpcb.cpp - creation du menu general de l'editeur de board*/ /******************************************************************/ /*****************************************/ /* menubarpcb.cpp - PCB editor menu bar. */ /*****************************************/ #include "fctsys.h" #include "appl_wxstruct.h" #include "common.h" Loading @@ -11,12 +11,8 @@ #include "hotkeys.h" #include "pcbnew_id.h" /***********************************************/ void WinEDA_PcbFrame::ReCreateMenuBar() /***********************************************/ /* Cree ou reinitialise le menu du haut d'ecran */ void WinEDA_PcbFrame::ReCreateMenuBar() { wxMenuItem* item; wxMenuBar* menuBar = GetMenuBar(); Loading Loading @@ -62,7 +58,8 @@ void WinEDA_PcbFrame::ReCreateMenuBar() // Add save menu filesMenu->AppendSeparator(); item = new wxMenuItem( filesMenu, ID_SAVE_BOARD, _( "&Save Board\tCtrl-S" ), _( "Save current board" ) ); _( "&Save Board\tCtrl-S" ), _( "Save current board" ) ); item->SetBitmap( save_xpm ); filesMenu->Append( item ); Loading Loading @@ -125,7 +122,8 @@ void WinEDA_PcbFrame::ReCreateMenuBar() item->SetBitmap( import_xpm ); // @todo need better bitmap submenuImport->Append( item ); /* would be implemented in WinEDA_PcbFrame::ImportSpecctraDesign() in specctra_import.cpp /* would be implemented in WinEDA_PcbFrame::ImportSpecctraDesign() in * specctra_import.cpp * item = new wxMenuItem(submenuImport, ID_GEN_IMPORT_SPECCTRA_DESIGN, * _("&Specctra Design"), _("Import a \"Specctra Design\" (*.dsn) file") ); * item->SetBitmap(export_xpm); // @todo need better bitmap Loading Loading @@ -167,7 +165,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar() wxGetApp().m_fileHistory.AddFilesToMenu( filesMenu ); /////////////////////////////////// // Preferences an configuration // // Preferences and configuration // /////////////////////////////////// wxMenu* configmenu = new wxMenu; item = new wxMenuItem( configmenu, ID_CONFIG_REQ, _( "&Library" ), Loading @@ -175,8 +173,9 @@ void WinEDA_PcbFrame::ReCreateMenuBar() item->SetBitmap( library_xpm ); configmenu->Append( item ); item = new wxMenuItem( configmenu, ID_COLORS_SETUP, _( "&Colors and Visibility" ), _( "Select colors and visibilty of layers and some items" ) ); item = new wxMenuItem( configmenu, ID_COLORS_SETUP, _( "&Colors and Visibility" ), _( "Select colors and visibility of layers and some items" ) ); item->SetBitmap( palette_xpm ); configmenu->Append( item ); Loading @@ -185,7 +184,8 @@ void WinEDA_PcbFrame::ReCreateMenuBar() item->SetBitmap( preference_xpm ); configmenu->Append( item ); item = new wxMenuItem( configmenu, ID_PCB_DISPLAY_OPTIONS_SETUP, _( "&Display" ), item = new wxMenuItem( configmenu, ID_PCB_DISPLAY_OPTIONS_SETUP, _( "&Display" ), _( "Select how items (pads, tracks texts ... ) are displayed" ) ); item->SetBitmap( display_options_xpm ); configmenu->Append( item ); Loading @@ -206,13 +206,13 @@ void WinEDA_PcbFrame::ReCreateMenuBar() configmenu->Append( item ); //////////////////////////////////////////////////////////// // Add access to the Design Rules Dialog and layers setup // //////////////////////////////////////////////////////////// wxMenu* designRulesMenu = new wxMenu; item = new wxMenuItem( designRulesMenu, ID_MENU_PCB_SHOW_DESIGN_RULES_DIALOG, _( "Design Rules" ), _( "Open the design rules dialog editor" ) ); _( "Design Rules" ), _( "Open the design rules dialog editor" ) ); item->SetBitmap( hammer_xpm ); designRulesMenu->Append( item ); Loading Loading @@ -255,9 +255,6 @@ void WinEDA_PcbFrame::ReCreateMenuBar() item->SetBitmap( save_xpm ); sizes_menu->Append( item ); ////////////////////////////////////////////////////////////////// // Menu postprocess ( generation fichiers percage, placement... // ////////////////////////////////////////////////////////////////// wxMenu* postprocess_menu = new wxMenu; item = new wxMenuItem( postprocess_menu, ID_PCB_GEN_POS_MODULES_FILE, _( "Generate &Modules Position" ), Loading @@ -283,9 +280,6 @@ void WinEDA_PcbFrame::ReCreateMenuBar() item->SetBitmap( tools_xpm ); postprocess_menu->Append( item ); ////////////////////////// // Menu d'outils divers // ////////////////////////// wxMenu* miscellaneous_menu = new wxMenu; item = new wxMenuItem( miscellaneous_menu, ID_PCB_GLOBAL_DELETE, _( "Global &Deletions" ), Loading pcbnew/mirepcb.cpp +54 −62 Original line number Diff line number Diff line /*********************************************/ /* Functions to edite targets (class MIRE) */ /*********************************************/ /********************************************/ /* Functions to edit targets (class MIRE) */ /********************************************/ #include "fctsys.h" #include "common.h" Loading @@ -15,12 +15,16 @@ /* Routines Locales */ static void AbortMoveAndEditTarget( WinEDA_DrawPanel* Panel, wxDC* DC ); static void ShowTargetShapeWhileMovingMouse( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); static void ShowTargetShapeWhileMovingMouse( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); /* Local variables : */ static int MireDefaultSize = 5000; static MIREPCB s_TargetCopy( NULL ); /* Used to store "old" values of the current item * parameters before edition (used in undo/redo or cancel operations) static MIREPCB s_TargetCopy( NULL ); /* Used to store "old" values of the * current item parameters before * edition (used in undo/redo or * cancel operations) */ /************************************/ Loading @@ -38,11 +42,10 @@ private: WinEDA_ValueCtrl* m_MireSizeCtrl; wxRadioBox* m_MireShape; public: // Constructor and destructor WinEDA_MirePropertiesFrame( WinEDA_PcbFrame* parent, MIREPCB* Mire, wxDC* DC, const wxPoint& pos ); public: WinEDA_MirePropertiesFrame( WinEDA_PcbFrame* parent, MIREPCB* Mire, wxDC* DC, const wxPoint& pos ); ~WinEDA_MirePropertiesFrame() { } private: Loading @@ -58,20 +61,19 @@ EVT_BUTTON( wxID_CANCEL, WinEDA_MirePropertiesFrame::OnCancelClick ) END_EVENT_TABLE() /***************************************************************/ void WinEDA_PcbFrame::InstallMireOptionsFrame( MIREPCB* MirePcb, wxDC* DC, const wxPoint& pos ) /***************************************************************/ { WinEDA_MirePropertiesFrame* frame = new WinEDA_MirePropertiesFrame( this, MirePcb, DC, pos ); WinEDA_MirePropertiesFrame* frame = new WinEDA_MirePropertiesFrame( this, MirePcb, DC, pos ); frame->ShowModal(); frame->Destroy(); } WinEDA_MirePropertiesFrame::WinEDA_MirePropertiesFrame( WinEDA_PcbFrame* parent, WinEDA_MirePropertiesFrame::WinEDA_MirePropertiesFrame( WinEDA_PcbFrame* parent, MIREPCB* Mire, wxDC* DC, const wxPoint& framepos ) : wxDialog( parent, -1, _( "Target Properties" ), framepos, wxSize( 270, 210 ), Loading @@ -93,7 +95,7 @@ WinEDA_MirePropertiesFrame::WinEDA_MirePropertiesFrame( WinEDA_PcbFrame* parent, MainBoxSizer->Add( LeftBoxSizer, 0, wxGROW | wxALL, 5 ); MainBoxSizer->Add( RightBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); /* Creation des boutons de commande */ /* Create of the command buttons. */ Button = new wxButton( this, wxID_OK, _( "OK" ) ); RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); Loading @@ -103,12 +105,14 @@ WinEDA_MirePropertiesFrame::WinEDA_MirePropertiesFrame( WinEDA_PcbFrame* parent, // Size: m_MireSizeCtrl = new WinEDA_ValueCtrl( this, _( "Size" ), m_MirePcb->m_Size, g_UnitMetric, LeftBoxSizer, m_Parent->m_InternalUnits ); g_UnitMetric, LeftBoxSizer, m_Parent->m_InternalUnits ); // Width: m_MireWidthCtrl = new WinEDA_ValueCtrl( this, _( "Width" ), m_MirePcb->m_Width, g_UnitMetric, LeftBoxSizer, m_Parent->m_InternalUnits ); g_UnitMetric, LeftBoxSizer, m_Parent->m_InternalUnits ); // Shape wxString shape_list[2] = { _( "shape +" ), _( "shape X" ) }; Loading @@ -124,44 +128,42 @@ WinEDA_MirePropertiesFrame::WinEDA_MirePropertiesFrame( WinEDA_PcbFrame* parent, } /**********************************************************************/ void WinEDA_MirePropertiesFrame::OnCancelClick( wxCommandEvent& WXUNUSED (event) ) /**********************************************************************/ void WinEDA_MirePropertiesFrame::OnCancelClick( wxCommandEvent& WXUNUSED( event ) ) { EndModal( -1 ); } /**************************************************************************/ void WinEDA_MirePropertiesFrame::OnOkClick( wxCommandEvent& event ) /**************************************************************************/ /* Met a jour les differents parametres pour le composant en cours d'dition /* Updates the different parameters for the component being edited */ void WinEDA_MirePropertiesFrame::OnOkClick( wxCommandEvent& event ) { m_MirePcb->Draw( m_Parent->DrawPanel, m_DC, GR_XOR ); // Save old item in undo list, if is is not curently edited (will be later if so) // Save old item in undo list, if is is not currently edited (will be later // if so) if( m_MirePcb->m_Flags == 0 ) m_Parent->SaveCopyInUndoList( m_MirePcb, UR_CHANGED ); if( m_MirePcb->m_Flags != 0) // other edition in progress (MOVE, NEW ..) m_MirePcb->m_Flags |= IN_EDIT; // set flag in edit to force undo/redo/abort proper operation if( m_MirePcb->m_Flags != 0 ) // other edition in progress (MOVE, // NEW ..) m_MirePcb->m_Flags |= IN_EDIT; // set flag in edit to force // undo/redo/abort proper operation m_MirePcb->m_Width = m_MireWidthCtrl->GetValue(); MireDefaultSize = m_MirePcb->m_Size = m_MireSizeCtrl->GetValue(); m_MirePcb->m_Shape = m_MireShape->GetSelection() ? 1 : 0; m_MirePcb->Draw( m_Parent->DrawPanel, m_DC, (m_MirePcb->m_Flags & IS_MOVED) ? GR_XOR : GR_OR ); m_MirePcb->Draw( m_Parent->DrawPanel, m_DC, ( m_MirePcb->m_Flags & IS_MOVED ) ? GR_XOR : GR_OR ); m_Parent->GetScreen()->SetModify(); EndModal( 1 ); } /**************************************************************/ void WinEDA_PcbFrame::Delete_Mire( MIREPCB* MirePcb, wxDC* DC ) /**************************************************************/ { if( MirePcb == NULL ) return; Loading @@ -172,9 +174,7 @@ void WinEDA_PcbFrame::Delete_Mire( MIREPCB* MirePcb, wxDC* DC ) } /**********************************************************/ static void AbortMoveAndEditTarget( WinEDA_DrawPanel* Panel, wxDC* DC ) /**********************************************************/ { BASE_SCREEN* screen = Panel->GetScreen(); MIREPCB* MirePcb = (MIREPCB*) screen->GetCurItem(); Loading Loading @@ -209,12 +209,9 @@ static void AbortMoveAndEditTarget( WinEDA_DrawPanel* Panel, wxDC* DC ) } /*****************************************************/ MIREPCB* WinEDA_PcbFrame::Create_Mire( wxDC* DC ) /*****************************************************/ /* Routine de creation d'un Draw Symbole Pcb type MIRE /* Draw Symbol PCB type MIRE. */ MIREPCB* WinEDA_PcbFrame::Create_Mire( wxDC* DC ) { MIREPCB* MirePcb = new MIREPCB( GetBoard() ); Loading @@ -232,12 +229,9 @@ MIREPCB* WinEDA_PcbFrame::Create_Mire( wxDC* DC ) } /**********************************************************************/ void WinEDA_PcbFrame::StartMove_Mire( MIREPCB* MirePcb, wxDC* DC ) /**********************************************************************/ /* Routine d'initialisation du deplacement d'une mire /* Routine to initialize the displacement of a focal */ void WinEDA_PcbFrame::StartMove_Mire( MIREPCB* MirePcb, wxDC* DC ) { if( MirePcb == NULL ) return; Loading @@ -250,9 +244,7 @@ void WinEDA_PcbFrame::StartMove_Mire( MIREPCB* MirePcb, wxDC* DC ) } /**************************************************************/ void WinEDA_PcbFrame::Place_Mire( MIREPCB* MirePcb, wxDC* DC ) /**************************************************************/ { if( MirePcb == NULL ) return; Loading @@ -273,7 +265,9 @@ void WinEDA_PcbFrame::Place_Mire( MIREPCB* MirePcb, wxDC* DC ) if( MirePcb->m_Flags == IS_MOVED ) { SaveCopyInUndoList( MirePcb, UR_MOVED, MirePcb->m_Pos - s_TargetCopy.m_Pos ); SaveCopyInUndoList( MirePcb, UR_MOVED, MirePcb->m_Pos - s_TargetCopy.m_Pos ); MirePcb->m_Flags = 0; return; } Loading @@ -288,10 +282,10 @@ void WinEDA_PcbFrame::Place_Mire( MIREPCB* MirePcb, wxDC* DC ) } /******************************************************************************/ static void ShowTargetShapeWhileMovingMouse( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) /*********************************************************************************/ /* redessin du contour de la piste lors des deplacements de la souris */ /* Redraw the contour of the track while moving the mouse */ static void ShowTargetShapeWhileMovingMouse( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) { BASE_SCREEN* screen = panel->GetScreen(); MIREPCB* MirePcb = (MIREPCB*) screen->GetCurItem(); Loading @@ -299,12 +293,10 @@ static void ShowTargetShapeWhileMovingMouse( WinEDA_DrawPanel* panel, wxDC* DC, if( MirePcb == NULL ) return; /* efface ancienne position */ if( erase ) MirePcb->Draw( panel, DC, GR_XOR ); MirePcb->m_Pos = screen->m_Curseur; // Reaffichage MirePcb->Draw( panel, DC, GR_XOR ); } Loading
pcbnew/menubarmodedit.cpp +71 −77 Original line number Diff line number Diff line /***********************************************************************/ /* menubarmodedit.cpp - creation du menu general de l'editeur de module*/ /***********************************************************************/ /************************************************/ /* menubarmodedit.cpp - Module editor menu bar. */ /************************************************/ #include "fctsys.h" #include "common.h" Loading @@ -13,13 +13,7 @@ #include "pcbnew_id.h" /***********************************************/ void WinEDA_ModuleEditFrame::ReCreateMenuBar() /***********************************************/ /* Cree ou reinitialise le menu du haut d'ecran */ { wxMenuBar* menuBar = GetMenuBar(); wxMenuItem* item; Loading @@ -28,9 +22,6 @@ wxMenuItem * item; { menuBar = new wxMenuBar(); ///////////////////////////// // Ajustage de dimensions: // ///////////////////////////// wxMenu* sizes_menu = new wxMenu; item = new wxMenuItem( sizes_menu, ID_PCB_DRAWINGS_WIDTHS_SETUP, Loading @@ -40,12 +31,14 @@ wxMenuItem * item; sizes_menu->Append( item ); item = new wxMenuItem( sizes_menu, ID_PCB_PAD_SETUP, _( "Pad Settings" ), _("Adjust size,shape,layers... for Pads")); _( "Adjust size, shape, layers... for pads" ) ); item->SetBitmap( pad_xpm ); sizes_menu->Append( item ); item = new wxMenuItem(sizes_menu, ID_PCB_USER_GRID_SETUP, _("User Grid Size"), _("Adjust User Grid")); item = new wxMenuItem( sizes_menu, ID_PCB_USER_GRID_SETUP, _( "User Grid Size" ), _( "Adjust user grid" ) ); item->SetBitmap( grid_xpm ); sizes_menu->Append( item ); Loading @@ -58,8 +51,8 @@ wxMenuItem * item; // Contents item = new wxMenuItem( helpMenu, ID_GENERAL_HELP, _("&Contents"), // Menu entry name _("Open the pcbnew manual")); // Statusbar message _( "&Contents" ), _( "Open the pcbnew manual" ) ); item->SetBitmap( help_xpm ); helpMenu->Append( item ); Loading @@ -67,8 +60,8 @@ wxMenuItem * item; // About pcbnew item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT, _("&About pcbnew"), // Menu entry name _("About pcbnew PCB designer")); // Statusbar message _( "&About pcbnew" ), _( "About pcbnew PCB designer" ) ); item->SetBitmap( info_xpm ); helpMenu->Append( item ); Loading @@ -76,7 +69,10 @@ wxMenuItem * item; // Menu Display 3D: // ////////////////////// wxMenu* Display3DMenu = new wxMenu; item = new wxMenuItem(Display3DMenu , ID_MENU_PCB_SHOW_3D_FRAME, _("3D Display"), _("Show board in 3D viewer")); item = new wxMenuItem( Display3DMenu, ID_MENU_PCB_SHOW_3D_FRAME, _( "3D Display" ), _( "Show board in 3D viewer" ) ); item->SetBitmap( show_3d_xpm ); Display3DMenu->Append( item ); Loading @@ -88,5 +84,3 @@ wxMenuItem * item; SetMenuBar( menuBar ); } }
pcbnew/menubarpcb.cpp +18 −24 Original line number Diff line number Diff line /******************************************************************/ /* menubarpcb.cpp - creation du menu general de l'editeur de board*/ /******************************************************************/ /*****************************************/ /* menubarpcb.cpp - PCB editor menu bar. */ /*****************************************/ #include "fctsys.h" #include "appl_wxstruct.h" #include "common.h" Loading @@ -11,12 +11,8 @@ #include "hotkeys.h" #include "pcbnew_id.h" /***********************************************/ void WinEDA_PcbFrame::ReCreateMenuBar() /***********************************************/ /* Cree ou reinitialise le menu du haut d'ecran */ void WinEDA_PcbFrame::ReCreateMenuBar() { wxMenuItem* item; wxMenuBar* menuBar = GetMenuBar(); Loading Loading @@ -62,7 +58,8 @@ void WinEDA_PcbFrame::ReCreateMenuBar() // Add save menu filesMenu->AppendSeparator(); item = new wxMenuItem( filesMenu, ID_SAVE_BOARD, _( "&Save Board\tCtrl-S" ), _( "Save current board" ) ); _( "&Save Board\tCtrl-S" ), _( "Save current board" ) ); item->SetBitmap( save_xpm ); filesMenu->Append( item ); Loading Loading @@ -125,7 +122,8 @@ void WinEDA_PcbFrame::ReCreateMenuBar() item->SetBitmap( import_xpm ); // @todo need better bitmap submenuImport->Append( item ); /* would be implemented in WinEDA_PcbFrame::ImportSpecctraDesign() in specctra_import.cpp /* would be implemented in WinEDA_PcbFrame::ImportSpecctraDesign() in * specctra_import.cpp * item = new wxMenuItem(submenuImport, ID_GEN_IMPORT_SPECCTRA_DESIGN, * _("&Specctra Design"), _("Import a \"Specctra Design\" (*.dsn) file") ); * item->SetBitmap(export_xpm); // @todo need better bitmap Loading Loading @@ -167,7 +165,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar() wxGetApp().m_fileHistory.AddFilesToMenu( filesMenu ); /////////////////////////////////// // Preferences an configuration // // Preferences and configuration // /////////////////////////////////// wxMenu* configmenu = new wxMenu; item = new wxMenuItem( configmenu, ID_CONFIG_REQ, _( "&Library" ), Loading @@ -175,8 +173,9 @@ void WinEDA_PcbFrame::ReCreateMenuBar() item->SetBitmap( library_xpm ); configmenu->Append( item ); item = new wxMenuItem( configmenu, ID_COLORS_SETUP, _( "&Colors and Visibility" ), _( "Select colors and visibilty of layers and some items" ) ); item = new wxMenuItem( configmenu, ID_COLORS_SETUP, _( "&Colors and Visibility" ), _( "Select colors and visibility of layers and some items" ) ); item->SetBitmap( palette_xpm ); configmenu->Append( item ); Loading @@ -185,7 +184,8 @@ void WinEDA_PcbFrame::ReCreateMenuBar() item->SetBitmap( preference_xpm ); configmenu->Append( item ); item = new wxMenuItem( configmenu, ID_PCB_DISPLAY_OPTIONS_SETUP, _( "&Display" ), item = new wxMenuItem( configmenu, ID_PCB_DISPLAY_OPTIONS_SETUP, _( "&Display" ), _( "Select how items (pads, tracks texts ... ) are displayed" ) ); item->SetBitmap( display_options_xpm ); configmenu->Append( item ); Loading @@ -206,13 +206,13 @@ void WinEDA_PcbFrame::ReCreateMenuBar() configmenu->Append( item ); //////////////////////////////////////////////////////////// // Add access to the Design Rules Dialog and layers setup // //////////////////////////////////////////////////////////// wxMenu* designRulesMenu = new wxMenu; item = new wxMenuItem( designRulesMenu, ID_MENU_PCB_SHOW_DESIGN_RULES_DIALOG, _( "Design Rules" ), _( "Open the design rules dialog editor" ) ); _( "Design Rules" ), _( "Open the design rules dialog editor" ) ); item->SetBitmap( hammer_xpm ); designRulesMenu->Append( item ); Loading Loading @@ -255,9 +255,6 @@ void WinEDA_PcbFrame::ReCreateMenuBar() item->SetBitmap( save_xpm ); sizes_menu->Append( item ); ////////////////////////////////////////////////////////////////// // Menu postprocess ( generation fichiers percage, placement... // ////////////////////////////////////////////////////////////////// wxMenu* postprocess_menu = new wxMenu; item = new wxMenuItem( postprocess_menu, ID_PCB_GEN_POS_MODULES_FILE, _( "Generate &Modules Position" ), Loading @@ -283,9 +280,6 @@ void WinEDA_PcbFrame::ReCreateMenuBar() item->SetBitmap( tools_xpm ); postprocess_menu->Append( item ); ////////////////////////// // Menu d'outils divers // ////////////////////////// wxMenu* miscellaneous_menu = new wxMenu; item = new wxMenuItem( miscellaneous_menu, ID_PCB_GLOBAL_DELETE, _( "Global &Deletions" ), Loading
pcbnew/mirepcb.cpp +54 −62 Original line number Diff line number Diff line /*********************************************/ /* Functions to edite targets (class MIRE) */ /*********************************************/ /********************************************/ /* Functions to edit targets (class MIRE) */ /********************************************/ #include "fctsys.h" #include "common.h" Loading @@ -15,12 +15,16 @@ /* Routines Locales */ static void AbortMoveAndEditTarget( WinEDA_DrawPanel* Panel, wxDC* DC ); static void ShowTargetShapeWhileMovingMouse( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); static void ShowTargetShapeWhileMovingMouse( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); /* Local variables : */ static int MireDefaultSize = 5000; static MIREPCB s_TargetCopy( NULL ); /* Used to store "old" values of the current item * parameters before edition (used in undo/redo or cancel operations) static MIREPCB s_TargetCopy( NULL ); /* Used to store "old" values of the * current item parameters before * edition (used in undo/redo or * cancel operations) */ /************************************/ Loading @@ -38,11 +42,10 @@ private: WinEDA_ValueCtrl* m_MireSizeCtrl; wxRadioBox* m_MireShape; public: // Constructor and destructor WinEDA_MirePropertiesFrame( WinEDA_PcbFrame* parent, MIREPCB* Mire, wxDC* DC, const wxPoint& pos ); public: WinEDA_MirePropertiesFrame( WinEDA_PcbFrame* parent, MIREPCB* Mire, wxDC* DC, const wxPoint& pos ); ~WinEDA_MirePropertiesFrame() { } private: Loading @@ -58,20 +61,19 @@ EVT_BUTTON( wxID_CANCEL, WinEDA_MirePropertiesFrame::OnCancelClick ) END_EVENT_TABLE() /***************************************************************/ void WinEDA_PcbFrame::InstallMireOptionsFrame( MIREPCB* MirePcb, wxDC* DC, const wxPoint& pos ) /***************************************************************/ { WinEDA_MirePropertiesFrame* frame = new WinEDA_MirePropertiesFrame( this, MirePcb, DC, pos ); WinEDA_MirePropertiesFrame* frame = new WinEDA_MirePropertiesFrame( this, MirePcb, DC, pos ); frame->ShowModal(); frame->Destroy(); } WinEDA_MirePropertiesFrame::WinEDA_MirePropertiesFrame( WinEDA_PcbFrame* parent, WinEDA_MirePropertiesFrame::WinEDA_MirePropertiesFrame( WinEDA_PcbFrame* parent, MIREPCB* Mire, wxDC* DC, const wxPoint& framepos ) : wxDialog( parent, -1, _( "Target Properties" ), framepos, wxSize( 270, 210 ), Loading @@ -93,7 +95,7 @@ WinEDA_MirePropertiesFrame::WinEDA_MirePropertiesFrame( WinEDA_PcbFrame* parent, MainBoxSizer->Add( LeftBoxSizer, 0, wxGROW | wxALL, 5 ); MainBoxSizer->Add( RightBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); /* Creation des boutons de commande */ /* Create of the command buttons. */ Button = new wxButton( this, wxID_OK, _( "OK" ) ); RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); Loading @@ -103,12 +105,14 @@ WinEDA_MirePropertiesFrame::WinEDA_MirePropertiesFrame( WinEDA_PcbFrame* parent, // Size: m_MireSizeCtrl = new WinEDA_ValueCtrl( this, _( "Size" ), m_MirePcb->m_Size, g_UnitMetric, LeftBoxSizer, m_Parent->m_InternalUnits ); g_UnitMetric, LeftBoxSizer, m_Parent->m_InternalUnits ); // Width: m_MireWidthCtrl = new WinEDA_ValueCtrl( this, _( "Width" ), m_MirePcb->m_Width, g_UnitMetric, LeftBoxSizer, m_Parent->m_InternalUnits ); g_UnitMetric, LeftBoxSizer, m_Parent->m_InternalUnits ); // Shape wxString shape_list[2] = { _( "shape +" ), _( "shape X" ) }; Loading @@ -124,44 +128,42 @@ WinEDA_MirePropertiesFrame::WinEDA_MirePropertiesFrame( WinEDA_PcbFrame* parent, } /**********************************************************************/ void WinEDA_MirePropertiesFrame::OnCancelClick( wxCommandEvent& WXUNUSED (event) ) /**********************************************************************/ void WinEDA_MirePropertiesFrame::OnCancelClick( wxCommandEvent& WXUNUSED( event ) ) { EndModal( -1 ); } /**************************************************************************/ void WinEDA_MirePropertiesFrame::OnOkClick( wxCommandEvent& event ) /**************************************************************************/ /* Met a jour les differents parametres pour le composant en cours d'dition /* Updates the different parameters for the component being edited */ void WinEDA_MirePropertiesFrame::OnOkClick( wxCommandEvent& event ) { m_MirePcb->Draw( m_Parent->DrawPanel, m_DC, GR_XOR ); // Save old item in undo list, if is is not curently edited (will be later if so) // Save old item in undo list, if is is not currently edited (will be later // if so) if( m_MirePcb->m_Flags == 0 ) m_Parent->SaveCopyInUndoList( m_MirePcb, UR_CHANGED ); if( m_MirePcb->m_Flags != 0) // other edition in progress (MOVE, NEW ..) m_MirePcb->m_Flags |= IN_EDIT; // set flag in edit to force undo/redo/abort proper operation if( m_MirePcb->m_Flags != 0 ) // other edition in progress (MOVE, // NEW ..) m_MirePcb->m_Flags |= IN_EDIT; // set flag in edit to force // undo/redo/abort proper operation m_MirePcb->m_Width = m_MireWidthCtrl->GetValue(); MireDefaultSize = m_MirePcb->m_Size = m_MireSizeCtrl->GetValue(); m_MirePcb->m_Shape = m_MireShape->GetSelection() ? 1 : 0; m_MirePcb->Draw( m_Parent->DrawPanel, m_DC, (m_MirePcb->m_Flags & IS_MOVED) ? GR_XOR : GR_OR ); m_MirePcb->Draw( m_Parent->DrawPanel, m_DC, ( m_MirePcb->m_Flags & IS_MOVED ) ? GR_XOR : GR_OR ); m_Parent->GetScreen()->SetModify(); EndModal( 1 ); } /**************************************************************/ void WinEDA_PcbFrame::Delete_Mire( MIREPCB* MirePcb, wxDC* DC ) /**************************************************************/ { if( MirePcb == NULL ) return; Loading @@ -172,9 +174,7 @@ void WinEDA_PcbFrame::Delete_Mire( MIREPCB* MirePcb, wxDC* DC ) } /**********************************************************/ static void AbortMoveAndEditTarget( WinEDA_DrawPanel* Panel, wxDC* DC ) /**********************************************************/ { BASE_SCREEN* screen = Panel->GetScreen(); MIREPCB* MirePcb = (MIREPCB*) screen->GetCurItem(); Loading Loading @@ -209,12 +209,9 @@ static void AbortMoveAndEditTarget( WinEDA_DrawPanel* Panel, wxDC* DC ) } /*****************************************************/ MIREPCB* WinEDA_PcbFrame::Create_Mire( wxDC* DC ) /*****************************************************/ /* Routine de creation d'un Draw Symbole Pcb type MIRE /* Draw Symbol PCB type MIRE. */ MIREPCB* WinEDA_PcbFrame::Create_Mire( wxDC* DC ) { MIREPCB* MirePcb = new MIREPCB( GetBoard() ); Loading @@ -232,12 +229,9 @@ MIREPCB* WinEDA_PcbFrame::Create_Mire( wxDC* DC ) } /**********************************************************************/ void WinEDA_PcbFrame::StartMove_Mire( MIREPCB* MirePcb, wxDC* DC ) /**********************************************************************/ /* Routine d'initialisation du deplacement d'une mire /* Routine to initialize the displacement of a focal */ void WinEDA_PcbFrame::StartMove_Mire( MIREPCB* MirePcb, wxDC* DC ) { if( MirePcb == NULL ) return; Loading @@ -250,9 +244,7 @@ void WinEDA_PcbFrame::StartMove_Mire( MIREPCB* MirePcb, wxDC* DC ) } /**************************************************************/ void WinEDA_PcbFrame::Place_Mire( MIREPCB* MirePcb, wxDC* DC ) /**************************************************************/ { if( MirePcb == NULL ) return; Loading @@ -273,7 +265,9 @@ void WinEDA_PcbFrame::Place_Mire( MIREPCB* MirePcb, wxDC* DC ) if( MirePcb->m_Flags == IS_MOVED ) { SaveCopyInUndoList( MirePcb, UR_MOVED, MirePcb->m_Pos - s_TargetCopy.m_Pos ); SaveCopyInUndoList( MirePcb, UR_MOVED, MirePcb->m_Pos - s_TargetCopy.m_Pos ); MirePcb->m_Flags = 0; return; } Loading @@ -288,10 +282,10 @@ void WinEDA_PcbFrame::Place_Mire( MIREPCB* MirePcb, wxDC* DC ) } /******************************************************************************/ static void ShowTargetShapeWhileMovingMouse( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) /*********************************************************************************/ /* redessin du contour de la piste lors des deplacements de la souris */ /* Redraw the contour of the track while moving the mouse */ static void ShowTargetShapeWhileMovingMouse( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) { BASE_SCREEN* screen = panel->GetScreen(); MIREPCB* MirePcb = (MIREPCB*) screen->GetCurItem(); Loading @@ -299,12 +293,10 @@ static void ShowTargetShapeWhileMovingMouse( WinEDA_DrawPanel* panel, wxDC* DC, if( MirePcb == NULL ) return; /* efface ancienne position */ if( erase ) MirePcb->Draw( panel, DC, GR_XOR ); MirePcb->m_Pos = screen->m_Curseur; // Reaffichage MirePcb->Draw( panel, DC, GR_XOR ); }