diff --git a/3d-viewer/3d_draw.cpp b/3d-viewer/3d_draw.cpp index b027b85448..fa51fcb044 100644 --- a/3d-viewer/3d_draw.cpp +++ b/3d-viewer/3d_draw.cpp @@ -111,7 +111,7 @@ void Pcb3D_GLCanvas::Redraw( bool finish ) */ GLuint Pcb3D_GLCanvas::CreateDrawGL_List() { - WinEDA_BasePcbFrame* pcbframe = m_Parent->m_Parent; + PCB_BASE_FRAME* pcbframe = m_Parent->m_Parent; BOARD* pcb = pcbframe->GetBoard(); TRACK* track; SEGZONE* segzone; diff --git a/3d-viewer/3d_frame.cpp b/3d-viewer/3d_frame.cpp index 6c68d61a36..f23a41a3c5 100644 --- a/3d-viewer/3d_frame.cpp +++ b/3d-viewer/3d_frame.cpp @@ -45,11 +45,10 @@ BEGIN_EVENT_TABLE( WinEDA3D_DrawFrame, wxFrame ) EVT_CLOSE( WinEDA3D_DrawFrame::OnCloseWindow ) END_EVENT_TABLE() -WinEDA3D_DrawFrame::WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent, - const wxString& title, - long style ) : - wxFrame( parent, DISPLAY3D_FRAME, title, wxPoint( -1, -1 ), - wxSize( -1, -1 ), style ) +WinEDA3D_DrawFrame::WinEDA3D_DrawFrame( PCB_BASE_FRAME* parent, + const wxString& title, + long style ) : + wxFrame( parent, DISPLAY3D_FRAME, title, wxPoint( -1, -1 ), wxSize( -1, -1 ), style ) { m_FrameName = wxT( "Frame3D" ); m_Canvas = NULL; diff --git a/3d-viewer/3d_viewer.h b/3d-viewer/3d_viewer.h index 646043108b..1baa31a3c9 100644 --- a/3d-viewer/3d_viewer.h +++ b/3d-viewer/3d_viewer.h @@ -203,7 +203,7 @@ public: class WinEDA3D_DrawFrame : public wxFrame { public: - WinEDA_BasePcbFrame* m_Parent; + PCB_BASE_FRAME* m_Parent; private: wxString m_FrameName; // name used for writing and reading setup // It is "Frame3D" @@ -217,7 +217,7 @@ private: bool m_reloadRequest; public: - WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent, const wxString& title, + WinEDA3D_DrawFrame( PCB_BASE_FRAME* parent, const wxString& title, long style = KICAD_DEFAULT_3D_DRAWFRAME_STYLE ); ~WinEDA3D_DrawFrame() { diff --git a/common/class_layerchoicebox.cpp b/common/class_layerchoicebox.cpp index 96bfde1b88..850eaaff79 100644 --- a/common/class_layerchoicebox.cpp +++ b/common/class_layerchoicebox.cpp @@ -106,7 +106,7 @@ int WinEDALayerChoiceBox::SetLayerSelection( int layer ) // Reload the Layers void WinEDALayerChoiceBox::Resync() { - WinEDA_BasePcbFrame* pcbFrame = (WinEDA_BasePcbFrame*) GetParent()->GetParent(); + PCB_BASE_FRAME* pcbFrame = (PCB_BASE_FRAME*) GetParent()->GetParent(); BOARD* board = pcbFrame->GetBoard(); wxASSERT( board != NULL ); @@ -152,7 +152,7 @@ void WinEDALayerChoiceBox::Resync() void WinEDALayerChoiceBox::ResyncBitmapOnly() { - WinEDA_BasePcbFrame* pcbFrame = (WinEDA_BasePcbFrame*) GetParent()->GetParent(); + PCB_BASE_FRAME* pcbFrame = (PCB_BASE_FRAME*) GetParent()->GetParent(); BOARD* board = pcbFrame->GetBoard(); int elements = GetCount(); diff --git a/common/drawframe.cpp b/common/drawframe.cpp index 1012edeb4b..0a83faadbe 100644 --- a/common/drawframe.cpp +++ b/common/drawframe.cpp @@ -174,16 +174,15 @@ void EDA_DRAW_FRAME::OnToggleGridState( wxCommandEvent& aEvent ) void EDA_DRAW_FRAME::OnSelectUnits( wxCommandEvent& aEvent ) { - if( aEvent.GetId() == ID_TB_OPTIONS_SELECT_UNIT_MM && g_UserUnit != MILLIMETRES ) { g_UserUnit = MILLIMETRES; - UpdateStatusBar(); + unitsChangeRefresh(); } else if( aEvent.GetId() == ID_TB_OPTIONS_SELECT_UNIT_INCH && g_UserUnit != INCHES ) { g_UserUnit = INCHES; - UpdateStatusBar(); + unitsChangeRefresh(); } } diff --git a/cvpcb/class_DisplayFootprintsFrame.cpp b/cvpcb/class_DisplayFootprintsFrame.cpp index 9dabe7c604..375c925cd5 100644 --- a/cvpcb/class_DisplayFootprintsFrame.cpp +++ b/cvpcb/class_DisplayFootprintsFrame.cpp @@ -24,7 +24,7 @@ -BEGIN_EVENT_TABLE( DISPLAY_FOOTPRINTS_FRAME, WinEDA_BasePcbFrame ) +BEGIN_EVENT_TABLE( DISPLAY_FOOTPRINTS_FRAME, PCB_BASE_FRAME ) EVT_CLOSE( DISPLAY_FOOTPRINTS_FRAME::OnCloseWindow ) EVT_SIZE( DISPLAY_FOOTPRINTS_FRAME::OnSize ) EVT_TOOL( ID_OPTIONS_SETUP, DISPLAY_FOOTPRINTS_FRAME::InstallOptionsDisplay ) @@ -49,7 +49,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : - WinEDA_BasePcbFrame( father, CVPCB_DISPLAY_FRAME, title, pos, size, style ) + PCB_BASE_FRAME( father, CVPCB_DISPLAY_FRAME, title, pos, size, style ) { m_FrameName = wxT( "CmpFrame" ); m_Draw_Axis = true; // true to draw axis. diff --git a/cvpcb/class_DisplayFootprintsFrame.h b/cvpcb/class_DisplayFootprintsFrame.h index cf7066fc4e..ba01d28f54 100644 --- a/cvpcb/class_DisplayFootprintsFrame.h +++ b/cvpcb/class_DisplayFootprintsFrame.h @@ -5,7 +5,7 @@ /* class DISPLAY_FOOTPRINTS_FRAME: used to display footprints */ /*******************************************************/ -class DISPLAY_FOOTPRINTS_FRAME : public WinEDA_BasePcbFrame +class DISPLAY_FOOTPRINTS_FRAME : public PCB_BASE_FRAME { public: DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father, const wxString& title, @@ -57,7 +57,7 @@ public: /* SaveCopyInUndoList() virtual * currently: do nothing in cvpcb. - * but but be defined because it is a pure virtual in WinEDA_BasePcbFrame + * but but be defined because it is a pure virtual in PCB_BASE_FRAME */ virtual void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy, UndoRedoOpType aTypeCommand = UR_UNSPECIFIED, diff --git a/cvpcb/dialogs/dialog_display_options.cpp b/cvpcb/dialogs/dialog_display_options.cpp index 06447890e8..3bc7d92808 100644 --- a/cvpcb/dialogs/dialog_display_options.cpp +++ b/cvpcb/dialogs/dialog_display_options.cpp @@ -26,13 +26,12 @@ void DISPLAY_FOOTPRINTS_FRAME::InstallOptionsDisplay( wxCommandEvent& event ) } -DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::DIALOG_FOOTPRINTS_DISPLAY_OPTIONS( - WinEDA_BasePcbFrame* parent ) - : DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE( parent) +DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::DIALOG_FOOTPRINTS_DISPLAY_OPTIONS( PCB_BASE_FRAME* parent ) + : DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE( parent ) { m_Parent = parent; - initDialog( ); + initDialog(); GetSizer()->SetSizeHints( this ); Centre(); diff --git a/cvpcb/dialogs/dialog_display_options.h b/cvpcb/dialogs/dialog_display_options.h index b2d4c90806..eca0ebe7e0 100644 --- a/cvpcb/dialogs/dialog_display_options.h +++ b/cvpcb/dialogs/dialog_display_options.h @@ -18,10 +18,10 @@ class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS : public DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE { private: -WinEDA_BasePcbFrame * m_Parent; +PCB_BASE_FRAME * m_Parent; public: - DIALOG_FOOTPRINTS_DISPLAY_OPTIONS( WinEDA_BasePcbFrame* parent ); + DIALOG_FOOTPRINTS_DISPLAY_OPTIONS( PCB_BASE_FRAME* parent ); ~DIALOG_FOOTPRINTS_DISPLAY_OPTIONS(); diff --git a/gerbview/dialogs/dialog_print_using_printer.cpp b/gerbview/dialogs/dialog_print_using_printer.cpp index 72950e3db9..f82d8f3d0d 100644 --- a/gerbview/dialogs/dialog_print_using_printer.cpp +++ b/gerbview/dialogs/dialog_print_using_printer.cpp @@ -198,7 +198,7 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( ) } // Disable checkboxes if the corresponding layer is not enabled - BOARD* board = ((WinEDA_BasePcbFrame*)m_Parent)->GetBoard(); + BOARD* board = ((PCB_BASE_FRAME*)m_Parent)->GetBoard(); for( int layer = 0; layerIsLayerEnabled( layer ) ) diff --git a/gerbview/gerberframe.cpp b/gerbview/gerberframe.cpp index 586e1bbafd..eefe5a53be 100644 --- a/gerbview/gerberframe.cpp +++ b/gerbview/gerberframe.cpp @@ -25,7 +25,7 @@ /* class WinEDA_GerberFrame for GerbView*/ /****************************************/ -BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame ) +BEGIN_EVENT_TABLE( WinEDA_GerberFrame, PCB_BASE_FRAME ) EVT_CLOSE( WinEDA_GerberFrame::OnCloseWindow ) EVT_SIZE( WinEDA_GerberFrame::OnSize ) @@ -124,7 +124,7 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father, const wxPoint& pos, const wxSize& size, long style ) : - WinEDA_BasePcbFrame( father, GERBER_FRAME, title, pos, size, style ) + PCB_BASE_FRAME( father, GERBER_FRAME, title, pos, size, style ) { m_FrameName = wxT( "GerberFrame" ); m_show_layer_manager_tools = true; @@ -271,7 +271,7 @@ void WinEDA_GerberFrame::LoadSettings() if( config == NULL ) return; - WinEDA_BasePcbFrame::LoadSettings(); + PCB_BASE_FRAME::LoadSettings(); config->Read( GerbviewDrawModeOption, &m_displayMode, 0l ); long pageSize_opt; config->Read( GerbviewShowPageSizeOption, &pageSize_opt, 0l ); @@ -303,7 +303,7 @@ void WinEDA_GerberFrame::SaveSettings() if( config == NULL ) return; - WinEDA_BasePcbFrame::SaveSettings(); + PCB_BASE_FRAME::SaveSettings(); wxRealPoint GridSize = GetScreen()->GetGridSize(); diff --git a/gerbview/pcbplot.cpp b/gerbview/pcbplot.cpp index 6144339770..93a08e1dac 100644 --- a/gerbview/pcbplot.cpp +++ b/gerbview/pcbplot.cpp @@ -15,7 +15,7 @@ PCB_Plot_Options g_pcb_plot_options; /**************************************************************/ -/* void WinEDA_BasePcbFrame::ToPlotter(wxCommandEvent& event) */ +/* void PCB_BASE_FRAME::ToPlotter(wxCommandEvent& event) */ /***************************************************************/ /** TODO */ diff --git a/gerbview/wxGerberFrame.h b/gerbview/wxGerberFrame.h index dac3a7ff72..f281dab2c0 100644 --- a/gerbview/wxGerberFrame.h +++ b/gerbview/wxGerberFrame.h @@ -37,7 +37,7 @@ class DCODE_SELECTION_BOX; * class WinEDA_GerberFrame: this is the main window used in gerbview ******************************************************************/ -class WinEDA_GerberFrame : public WinEDA_BasePcbFrame +class WinEDA_GerberFrame : public PCB_BASE_FRAME { friend class PCB_LAYER_WIDGET; @@ -230,7 +230,7 @@ public: WinEDA_GerberFrame( wxWindow* father, const wxString& title, /** * Load applications settings specific to the PCBNew. * - * This overrides the base class WinEDA_BasePcbFrame::LoadSettings() to + * This overrides the base class PCB_BASE_FRAME::LoadSettings() to * handle settings specific common to the PCB layout application. It * calls down to the base class to load settings common to all PCB type * drawing frames. Please put your application settings for PCBNew here @@ -241,7 +241,7 @@ public: WinEDA_GerberFrame( wxWindow* father, const wxString& title, /** * Save applications settings common to PCB draw frame objects. * - * This overrides the base class WinEDA_BasePcbFrame::SaveSettings() to + * This overrides the base class PCB_BASE_FRAME::SaveSettings() to * save settings specific to the PCB layout application main window. It * calls down to the base class to save settings common to all PCB type * drawing frames. Please put your application settings for PCBNew here @@ -416,7 +416,7 @@ public: WinEDA_GerberFrame( wxWindow* father, const wxString& title, /* SaveCopyInUndoList() virtual * currently: do nothing in gerbview. - * but must be defined because it is a pure virtual in WinEDA_BasePcbFrame + * but must be defined because it is a pure virtual in PCB_BASE_FRAME */ virtual void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy, diff --git a/include/wxBasePcbFrame.h b/include/wxBasePcbFrame.h index 71628f9689..1dcb5dbe9e 100644 --- a/include/wxBasePcbFrame.h +++ b/include/wxBasePcbFrame.h @@ -22,7 +22,7 @@ /* Forward declarations of classes. */ class WinEDA_Toolbar; class WinEDA_CvpcbFrame; -class WinEDA_PcbFrame; +class PCB_EDIT_FRAME; class WinEDA_ModuleEditFrame; class BOARD; class TEXTE_PCB; @@ -44,10 +44,10 @@ class GENERAL_COLLECTORS_GUIDE; /******************************************************************/ -/* class WinEDA_BasePcbFrame: Basic class for pcbnew and gerbview */ +/* class PCB_BASE_FRAME: Basic class for pcbnew and gerbview */ /******************************************************************/ -class WinEDA_BasePcbFrame : public EDA_DRAW_FRAME +class PCB_BASE_FRAME : public EDA_DRAW_FRAME { public: bool m_DisplayPadFill; // How show pads @@ -70,14 +70,14 @@ protected: void updateGridSelectBox(); void updateZoomSelectBox(); + virtual void unitsChangeRefresh(); public: - WinEDA_BasePcbFrame( wxWindow* father, int idtype, - const wxString& title, - const wxPoint& pos, const wxSize& size, - long style = KICAD_DEFAULT_DRAWFRAME_STYLE ); + PCB_BASE_FRAME( wxWindow* father, int idtype, const wxString& title, + const wxPoint& pos, const wxSize& size, + long style = KICAD_DEFAULT_DRAWFRAME_STYLE ); - ~WinEDA_BasePcbFrame(); + ~PCB_BASE_FRAME(); /** * Function SetBoard diff --git a/include/wxPcbStruct.h b/include/wxPcbStruct.h index beecd3f4d5..defac2a734 100644 --- a/include/wxPcbStruct.h +++ b/include/wxPcbStruct.h @@ -42,14 +42,14 @@ class PCB_LAYER_WIDGET; /** - * See also class WinEDA_BasePcbFrame(): Basic class for pcbnew and gerbview. + * See also class PCB_BASE_FRAME(): Basic class for pcbnew and gerbview. */ /*****************************************************/ -/* class WinEDA_PcbFrame: the main frame for Pcbnew */ +/* class PCB_EDIT_FRAME: the main frame for Pcbnew */ /*****************************************************/ -class WinEDA_PcbFrame : public WinEDA_BasePcbFrame +class PCB_EDIT_FRAME : public PCB_BASE_FRAME { friend class PCB_LAYER_WIDGET; @@ -111,14 +111,7 @@ protected: */ void syncLayerWidget( ); - /** - * Function syncLayerBox - * updates the currently "selected" layer within m_SelLayerBox - * The currently active layer, as defined by the return value of - * getActiveLayer(). And updates the colored icon in the toolbar. - */ - void syncLayerBox(); - + virtual void unitsChangeRefresh(); public: WinEDALayerChoiceBox* m_SelLayerBox; // a combo box to display and @@ -139,11 +132,11 @@ public: public: - WinEDA_PcbFrame( wxWindow* father, const wxString& title, - const wxPoint& pos, const wxSize& size, - long style = KICAD_DEFAULT_DRAWFRAME_STYLE ); + PCB_EDIT_FRAME( wxWindow* father, const wxString& title, + const wxPoint& pos, const wxSize& size, + long style = KICAD_DEFAULT_DRAWFRAME_STYLE ); - ~WinEDA_PcbFrame(); + ~PCB_EDIT_FRAME(); void OnQuit( wxCommandEvent& event ); @@ -164,6 +157,8 @@ public: // User interface update command event handlers. void OnUpdateSave( wxUpdateUIEvent& aEvent ); + void OnUpdateLayerPair( wxUpdateUIEvent& aEvent ); + void OnUpdateLayerSelectBox( wxUpdateUIEvent& aEvent ); void OnUpdateDrcEnable( wxUpdateUIEvent& aEvent ); void OnUpdateShowBoardRatsnest( wxUpdateUIEvent& aEvent ); void OnUpdateShowModuleRatsnest( wxUpdateUIEvent& aEvent ); @@ -173,8 +168,10 @@ public: void OnUpdateHighContrastDisplayMode( wxUpdateUIEvent& aEvent ); void OnUpdateShowLayerManager( wxUpdateUIEvent& aEvent ); void OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent ); - void OnUpdateAuxilaryToolbar( wxUpdateUIEvent& aEvent ); + void OnUpdateSelectViaSize( wxUpdateUIEvent& aEvent ); void OnUpdateZoneDisplayStyle( wxUpdateUIEvent& aEvent ); + void OnUpdateSelectTrackWidth( wxUpdateUIEvent& aEvent ); + void OnUpdateSelectAutoTrackWidth( wxUpdateUIEvent& aEvent ); /** * Function PrintPage , virtual @@ -243,7 +240,7 @@ public: /** * Load applications settings specific to PCBNew. * - * This overrides the base class WinEDA_BasePcbFrame::LoadSettings() to + * This overrides the base class PCB_BASE_FRAME::LoadSettings() to * handle settings specific common to the PCB layout application. It * calls down to the base class to load settings common to all PCB type * drawing frames. Please put your application settings for PCBNew here @@ -254,7 +251,7 @@ public: /** * Save applications settings common to PCBNew. * - * This overrides the base class WinEDA_BasePcbFrame::SaveSettings() to + * This overrides the base class PCB_BASE_FRAME::SaveSettings() to * save settings specific to the PCB layout application main window. It * calls down to the base class to save settings common to all PCB type * drawing frames. Please put your application settings for PCBNew here @@ -710,7 +707,7 @@ public: void Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC ); void InstallGraphicItemPropertiesDialog( DRAWSEGMENT* aItem, wxDC* aDC ); - // Footprint edition (see also WinEDA_BasePcbFrame) + // Footprint edition (see also PCB_BASE_FRAME) void InstallModuleOptionsFrame( MODULE* Module, wxDC* DC ); void StartMove_Module( MODULE* module, wxDC* DC ); @@ -742,7 +739,7 @@ public: MODULE* aNewModule, PICKED_ITEMS_LIST* aUndoPickList ); - // loading modules: see WinEDA_BasePcbFrame + // loading modules: see PCB_BASE_FRAME // Board handling void RemoveStruct( BOARD_ITEM* Item, wxDC* DC ); diff --git a/include/wxstruct.h b/include/wxstruct.h index b07779b958..9c5dce851b 100644 --- a/include/wxstruct.h +++ b/include/wxstruct.h @@ -251,6 +251,15 @@ protected: m_currentScreen = aScreen; } + /** + * Function unitsChangeRefresh + * is called when when the units setting has changed to allow for any derived classes + * to handle refreshing and controls that have units based measurements in them. The + * default version only updates the status bar. Don't forget to call the default + * in your derived class or the status bar will not get updated properly. + */ + virtual void unitsChangeRefresh() { UpdateStatusBar(); } + public: EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& title, diff --git a/pcbnew/ar_protos.h b/pcbnew/ar_protos.h index e500ec8f90..5c1fcb97b7 100644 --- a/pcbnew/ar_protos.h +++ b/pcbnew/ar_protos.h @@ -56,7 +56,7 @@ int GetApxDist( int, int, int, int ); int CalcDist( int, int, int ,int ); /* BOARD.CPP */ -bool ComputeMatriceSize( WinEDA_BasePcbFrame * frame, int pas_route ); +bool ComputeMatriceSize( PCB_BASE_FRAME * frame, int pas_route ); int Build_Work( BOARD * Pcb ); void PlaceCells( BOARD * Pcb, int net_code, int flag = 0 ); diff --git a/pcbnew/attribut.cpp b/pcbnew/attribut.cpp index e0e671542b..26286b9263 100644 --- a/pcbnew/attribut.cpp +++ b/pcbnew/attribut.cpp @@ -16,7 +16,7 @@ * TRACK_LOCKED protection against global delete * TRACK_AR AutoRouted segment */ -void WinEDA_PcbFrame::Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On ) +void PCB_EDIT_FRAME::Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On ) { if( track == NULL ) return; @@ -31,7 +31,7 @@ void WinEDA_PcbFrame::Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On ) /* Attribute change for an entire track */ -void WinEDA_PcbFrame::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On ) +void PCB_EDIT_FRAME::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On ) { TRACK* Track; int nb_segm; @@ -60,7 +60,7 @@ void WinEDA_PcbFrame::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On ) * for all the segments related to net_code. * if net_code < 0 all the segments are modified. */ -void WinEDA_PcbFrame::Attribut_net( wxDC* DC, int net_code, bool Flag_On ) +void PCB_EDIT_FRAME::Attribut_net( wxDC* DC, int net_code, bool Flag_On ) { TRACK* Track = GetBoard()->m_Track; diff --git a/pcbnew/automove.cpp b/pcbnew/automove.cpp index bc812fcf88..05e9efe450 100644 --- a/pcbnew/automove.cpp +++ b/pcbnew/automove.cpp @@ -35,7 +35,7 @@ wxString ModulesMaskSelection = wxT( "*" ); /* Called on events (popup menus) relative to automove and autoplace footprints */ -void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event ) +void PCB_EDIT_FRAME::AutoPlace( wxCommandEvent& event ) { int id = event.GetId(); bool on_state; @@ -167,7 +167,7 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event ) * starting from the mouse cursor * The components with the FIXED status set are not moved */ -void WinEDA_PcbFrame::AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb ) +void PCB_EDIT_FRAME::AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb ) { std::vector moduleList; wxPoint start, current; @@ -271,7 +271,7 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb ) /* Update (TRUE or FALSE) FIXED attribute on the module Module * or all the modules if Module == NULL */ -void WinEDA_PcbFrame::FixeModule( MODULE* Module, bool Fixe ) +void PCB_EDIT_FRAME::FixeModule( MODULE* Module, bool Fixe ) { if( Module ) { diff --git a/pcbnew/autoplac.cpp b/pcbnew/autoplac.cpp index 4d15ceec79..7aff34f39f 100644 --- a/pcbnew/autoplac.cpp +++ b/pcbnew/autoplac.cpp @@ -60,16 +60,14 @@ static void TracePenaliteRectangle( BOARD* Pcb, int marge, int Penalite, int masque_layer ); -static MODULE* PickModule( WinEDA_PcbFrame* pcbframe, wxDC* DC ); +static MODULE* PickModule( PCB_EDIT_FRAME* pcbframe, wxDC* DC ); /* Routine to automatically place components in the contour of the PCB * The components with the FIXED status are not moved. If the menu is * calling the placement of 1 module, it will be replaced. */ -void WinEDA_PcbFrame::AutoPlaceModule( MODULE* Module, - int place_mode, - wxDC* DC ) +void PCB_EDIT_FRAME::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC ) { int ii, activ; MODULE* ThisModule = NULL; @@ -311,7 +309,7 @@ end_of_tst: } -void WinEDA_PcbFrame::DrawInfoPlace( wxDC* DC ) +void PCB_EDIT_FRAME::DrawInfoPlace( wxDC* DC ) { int color, ii, jj; int ox, oy; @@ -373,7 +371,7 @@ void WinEDA_PcbFrame::DrawInfoPlace( wxDC* DC ) * Bitmap of the penalty is set to 0 * Occupation cell is a 0 leaves */ -int WinEDA_PcbFrame::GenPlaceBoard() +int PCB_EDIT_FRAME::GenPlaceBoard() { int jj, ii; int NbCells; @@ -489,7 +487,7 @@ int WinEDA_PcbFrame::GenPlaceBoard() /* Place module on board. */ -void WinEDA_PcbFrame::GenModuleOnBoard( MODULE* Module ) +void PCB_EDIT_FRAME::GenModuleOnBoard( MODULE* Module ) { int ox, oy, fx, fy, Penalite; int marge = g_GridRoutingSize / 2; @@ -558,7 +556,7 @@ void WinEDA_PcbFrame::GenModuleOnBoard( MODULE* Module ) * 1 if placement impossible, 0 if OK * = MinCout and external variable = cost of best placement */ -int WinEDA_PcbFrame::RecherchePlacementModule( MODULE* Module, wxDC* DC ) +int PCB_EDIT_FRAME::RecherchePlacementModule( MODULE* Module, wxDC* DC ) { int cx, cy; int ox, oy, fx, fy; /* occupying part of the module focuses on the @@ -842,7 +840,7 @@ int TstModuleOnBoard( BOARD* Pcb, MODULE* Module, bool TstOtherSide ) * The cost is the longest ratsnest distance with penalty for connections * approaching 45 degrees. */ -float WinEDA_PcbFrame::Compute_Ratsnest_PlaceModule( wxDC* DC ) +float PCB_EDIT_FRAME::Compute_Ratsnest_PlaceModule( wxDC* DC ) { double cout, icout; int ox, oy; @@ -1024,7 +1022,7 @@ static bool Tri_RatsModules( MODULE* ref, MODULE* compare ) * - Maximum ratsnet with modules already placed * - Max size, and number of pads max */ -static MODULE* PickModule( WinEDA_PcbFrame* pcbframe, wxDC* DC ) +static MODULE* PickModule( PCB_EDIT_FRAME* pcbframe, wxDC* DC ) { MODULE* Module; std::vector moduleList; @@ -1087,7 +1085,7 @@ static MODULE* PickModule( WinEDA_PcbFrame* pcbframe, wxDC* DC ) /********************************************/ -int Propagation( WinEDA_PcbFrame* frame ) +int Propagation( PCB_EDIT_FRAME* frame ) /********************************************/ /** diff --git a/pcbnew/autorout.cpp b/pcbnew/autorout.cpp index defaed906c..fa2873acc1 100644 --- a/pcbnew/autorout.cpp +++ b/pcbnew/autorout.cpp @@ -31,7 +31,7 @@ BOARDHEAD Board; /* 2-sided board */ /* init board, route traces*/ -void WinEDA_PcbFrame::Autoroute( wxDC* DC, int mode ) +void PCB_EDIT_FRAME::Autoroute( wxDC* DC, int mode ) { int start, stop; MODULE* Module = NULL; @@ -185,7 +185,7 @@ void WinEDA_PcbFrame::Autoroute( wxDC* DC, int mode ) * When a ratsnets has not been routed. * If this flag is 1 it is not reroute */ -void WinEDA_PcbFrame::Reset_Noroutable( wxDC* DC ) +void PCB_EDIT_FRAME::Reset_Noroutable( wxDC* DC ) { if( ( GetBoard()->m_Status_Pcb & LISTE_RATSNEST_ITEM_OK )== 0 ) Compile_Ratsnest( DC, TRUE ); diff --git a/pcbnew/basepcbframe.cpp b/pcbnew/basepcbframe.cpp index 9579d326b5..4d7d2ddede 100644 --- a/pcbnew/basepcbframe.cpp +++ b/pcbnew/basepcbframe.cpp @@ -34,34 +34,32 @@ static const wxString DisplayModuleEdgeEntry( wxT( "DiModEd" ) ); static const wxString DisplayModuleTextEntry( wxT( "DiModTx" ) ); -/*****************************/ -/* class WinEDA_BasePcbFrame */ -/*****************************/ +/****************************/ +/* class PCB_BASE_FRAME */ +/****************************/ -BEGIN_EVENT_TABLE( WinEDA_BasePcbFrame, EDA_DRAW_FRAME ) +BEGIN_EVENT_TABLE( PCB_BASE_FRAME, EDA_DRAW_FRAME ) EVT_MENU_RANGE( ID_POPUP_PCB_ITEM_SELECTION_START, ID_POPUP_PCB_ITEM_SELECTION_END, - WinEDA_BasePcbFrame::ProcessItemSelection ) + PCB_BASE_FRAME::ProcessItemSelection ) - EVT_TOOL( ID_TB_OPTIONS_SHOW_POLAR_COORD, WinEDA_BasePcbFrame::OnTogglePolarCoords ) - EVT_TOOL( ID_TB_OPTIONS_SHOW_PADS_SKETCH, WinEDA_BasePcbFrame::OnTogglePadDrawMode ) + EVT_TOOL( ID_TB_OPTIONS_SHOW_POLAR_COORD, PCB_BASE_FRAME::OnTogglePolarCoords ) + EVT_TOOL( ID_TB_OPTIONS_SHOW_PADS_SKETCH, PCB_BASE_FRAME::OnTogglePadDrawMode ) - EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_POLAR_COORD, WinEDA_BasePcbFrame::OnUpdateCoordType ) - EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_PADS_SKETCH, WinEDA_BasePcbFrame::OnUpdatePadDrawMode ) - EVT_UPDATE_UI_RANGE( ID_POPUP_GRID_LEVEL_1000, ID_POPUP_GRID_USER, - WinEDA_BasePcbFrame::OnUpdateSelectGrid ) - EVT_UPDATE_UI_RANGE( ID_POPUP_ZOOM_START_RANGE, ID_POPUP_ZOOM_END_RANGE, - WinEDA_BasePcbFrame::OnUpdateSelectZoom ) - EVT_UPDATE_UI_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, - WinEDA_BasePcbFrame::OnUpdateSelectZoom ) + EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_POLAR_COORD, PCB_BASE_FRAME::OnUpdateCoordType ) + EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_PADS_SKETCH, PCB_BASE_FRAME::OnUpdatePadDrawMode ) + EVT_UPDATE_UI( ID_ON_GRID_SELECT, PCB_BASE_FRAME::OnUpdateSelectGrid ) + EVT_UPDATE_UI( ID_ON_ZOOM_SELECT, PCB_BASE_FRAME::OnUpdateSelectZoom ) + + EVT_UPDATE_UI_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, PCB_BASE_FRAME::OnUpdateSelectZoom ) END_EVENT_TABLE() -WinEDA_BasePcbFrame::WinEDA_BasePcbFrame( wxWindow* father, - int idtype, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) : +PCB_BASE_FRAME::PCB_BASE_FRAME( wxWindow* father, + int idtype, + const wxString& title, + const wxPoint& pos, + const wxSize& size, + long style) : EDA_DRAW_FRAME( father, idtype, title, pos, size, style ) { m_InternalUnits = PCB_INTERNAL_UNIT; // Internal unit = 1/10000 inch @@ -83,13 +81,13 @@ WinEDA_BasePcbFrame::WinEDA_BasePcbFrame( wxWindow* father, } -WinEDA_BasePcbFrame::~WinEDA_BasePcbFrame() +PCB_BASE_FRAME::~PCB_BASE_FRAME() { delete m_Collector; } -void WinEDA_BasePcbFrame::SetBoard( BOARD* aBoard ) +void PCB_BASE_FRAME::SetBoard( BOARD* aBoard ) { if( m_Pcb != g_ModuleEditor_Pcb ) delete m_Pcb; @@ -101,7 +99,7 @@ void WinEDA_BasePcbFrame::SetBoard( BOARD* aBoard ) /** * Return the "best" zoom, i.e. the zoom which shows the entire board on screen */ -int WinEDA_BasePcbFrame::BestZoom( void ) +int PCB_BASE_FRAME::BestZoom( void ) { int dx, dy, ii, jj; int bestzoom; @@ -117,12 +115,12 @@ int WinEDA_BasePcbFrame::BestZoom( void ) size = DrawPanel->GetClientSize(); if( size.x ) - ii = ( dx + (size.x / 2) ) / size.x; + ii = wxRound( ( (double) dx + ((double) size.x / 2.0) ) / (double) size.x ); else ii = 31; if ( size.y ) - jj = ( dy + (size.y / 2) ) / size.y; + jj = wxRound( ( (double) dy + ((double) size.y / 2.0) ) / (double) size.y ); else jj = 31; @@ -133,7 +131,7 @@ int WinEDA_BasePcbFrame::BestZoom( void ) } -void WinEDA_BasePcbFrame::CursorGoto( const wxPoint& aPos ) +void PCB_BASE_FRAME::CursorGoto( const wxPoint& aPos ) { // factored out of pcbnew/find.cpp @@ -159,19 +157,19 @@ void WinEDA_BasePcbFrame::CursorGoto( const wxPoint& aPos ) // Virtual function -void WinEDA_BasePcbFrame::ReCreateMenuBar( void ) +void PCB_BASE_FRAME::ReCreateMenuBar( void ) { } -/* Virtual functions: Do nothing for WinEDA_BasePcbFrame window */ -void WinEDA_BasePcbFrame::Show3D_Frame( wxCommandEvent& event ) +/* Virtual functions: Do nothing for PCB_BASE_FRAME window */ +void PCB_BASE_FRAME::Show3D_Frame( wxCommandEvent& event ) { } -// Note: virtual, overridden in WinEDA_PcbFrame; -void WinEDA_BasePcbFrame::SwitchLayer( wxDC* DC, int layer ) +// Note: virtual, overridden in PCB_EDIT_FRAME; +void PCB_BASE_FRAME::SwitchLayer( wxDC* DC, int layer ) { int preslayer = ((PCB_SCREEN*)GetScreen())->m_Active_Layer; @@ -220,7 +218,7 @@ void WinEDA_BasePcbFrame::SwitchLayer( wxDC* DC, int layer ) } -void WinEDA_BasePcbFrame::OnTogglePolarCoords( wxCommandEvent& aEvent ) +void PCB_BASE_FRAME::OnTogglePolarCoords( wxCommandEvent& aEvent ) { SetStatusText( wxEmptyString ); DisplayOpt.DisplayPolarCood = !DisplayOpt.DisplayPolarCood; @@ -228,14 +226,14 @@ void WinEDA_BasePcbFrame::OnTogglePolarCoords( wxCommandEvent& aEvent ) } -void WinEDA_BasePcbFrame::OnTogglePadDrawMode( wxCommandEvent& aEvent ) +void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent ) { m_DisplayPadFill = DisplayOpt.DisplayPadFill = !m_DisplayPadFill; DrawPanel->Refresh(); } -void WinEDA_BasePcbFrame::OnUpdateCoordType( wxUpdateUIEvent& aEvent ) +void PCB_BASE_FRAME::OnUpdateCoordType( wxUpdateUIEvent& aEvent ) { aEvent.Check( DisplayOpt.DisplayPolarCood ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_POLAR_COORD, @@ -245,7 +243,7 @@ void WinEDA_BasePcbFrame::OnUpdateCoordType( wxUpdateUIEvent& aEvent ) } -void WinEDA_BasePcbFrame::OnUpdatePadDrawMode( wxUpdateUIEvent& aEvent ) +void PCB_BASE_FRAME::OnUpdatePadDrawMode( wxUpdateUIEvent& aEvent ) { aEvent.Check( !m_DisplayPadFill ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_PADS_SKETCH, @@ -255,7 +253,7 @@ void WinEDA_BasePcbFrame::OnUpdatePadDrawMode( wxUpdateUIEvent& aEvent ) } -void WinEDA_BasePcbFrame::OnUpdateSelectGrid( wxUpdateUIEvent& aEvent ) +void PCB_BASE_FRAME::OnUpdateSelectGrid( wxUpdateUIEvent& aEvent ) { // No need to update the grid select box if it doesn't exist or the grid setting change // was made using the select box. @@ -264,27 +262,21 @@ void WinEDA_BasePcbFrame::OnUpdateSelectGrid( wxUpdateUIEvent& aEvent ) int select = wxNOT_FOUND; - if( aEvent.GetId() == ID_POPUP_GRID_USER ) + for( size_t i = 0; i < GetScreen()->GetGridCount(); i++ ) { - select = 0; - } - else - { - for( size_t i = 0; i < GetScreen()->GetGridCount(); i++ ) + if( GetScreen()->GetGridId() == GetScreen()->GetGrid( i ).m_Id ) { - if( aEvent.GetId() == GetScreen()->GetGrid( i ).m_Id ) - { - select = (int) i; - break; - } + select = (int) i; + break; } } - m_SelGridBox->SetSelection( select ); + if( select != m_SelGridBox->GetSelection() ) + m_SelGridBox->SetSelection( select ); } -void WinEDA_BasePcbFrame::OnUpdateSelectZoom( wxUpdateUIEvent& aEvent ) +void PCB_BASE_FRAME::OnUpdateSelectZoom( wxUpdateUIEvent& aEvent ) { if( m_SelZoomBox == NULL || m_AuxiliaryToolBar == NULL ) return; @@ -305,7 +297,7 @@ void WinEDA_BasePcbFrame::OnUpdateSelectZoom( wxUpdateUIEvent& aEvent ) } -void WinEDA_BasePcbFrame::ProcessItemSelection( wxCommandEvent& aEvent ) +void PCB_BASE_FRAME::ProcessItemSelection( wxCommandEvent& aEvent ) { int id = aEvent.GetId(); @@ -326,7 +318,7 @@ void WinEDA_BasePcbFrame::ProcessItemSelection( wxCommandEvent& aEvent ) } -void WinEDA_BasePcbFrame::SetCurItem( BOARD_ITEM* aItem, bool aDisplayInfo ) +void PCB_BASE_FRAME::SetCurItem( BOARD_ITEM* aItem, bool aDisplayInfo ) { GetScreen()->SetCurItem( aItem ); @@ -355,13 +347,13 @@ void WinEDA_BasePcbFrame::SetCurItem( BOARD_ITEM* aItem, bool aDisplayInfo ) } -BOARD_ITEM* WinEDA_BasePcbFrame::GetCurItem() +BOARD_ITEM* PCB_BASE_FRAME::GetCurItem() { return GetScreen()->GetCurItem(); } -GENERAL_COLLECTORS_GUIDE WinEDA_BasePcbFrame::GetCollectorsGuide() +GENERAL_COLLECTORS_GUIDE PCB_BASE_FRAME::GetCollectorsGuide() { GENERAL_COLLECTORS_GUIDE guide( m_Pcb->GetVisibleLayers(), ( (PCB_SCREEN*)GetScreen())->m_Active_Layer ); @@ -378,7 +370,7 @@ GENERAL_COLLECTORS_GUIDE WinEDA_BasePcbFrame::GetCollectorsGuide() return guide; } -void WinEDA_BasePcbFrame::SetToolID( int aId, int aCursor, const wxString& aToolMsg ) +void PCB_BASE_FRAME::SetToolID( int aId, int aCursor, const wxString& aToolMsg ) { bool redraw = false; @@ -405,7 +397,7 @@ void WinEDA_BasePcbFrame::SetToolID( int aId, int aCursor, const wxString& aTool /* * Update the status bar information. */ -void WinEDA_BasePcbFrame::UpdateStatusBar() +void PCB_BASE_FRAME::UpdateStatusBar() { EDA_DRAW_FRAME::UpdateStatusBar(); @@ -454,13 +446,21 @@ void WinEDA_BasePcbFrame::UpdateStatusBar() } +void PCB_BASE_FRAME::unitsChangeRefresh() +{ + EDA_DRAW_FRAME::unitsChangeRefresh(); // Update the status bar. + + updateGridSelectBox(); +} + + /** * Load PCB base frame specific configuration settings. * * Don't forget to call this base method from any derived classes or the * settings will not get loaded. */ -void WinEDA_BasePcbFrame::LoadSettings() +void PCB_BASE_FRAME::LoadSettings() { wxASSERT( wxGetApp().m_EDA_Config != NULL ); @@ -497,7 +497,7 @@ void WinEDA_BasePcbFrame::LoadSettings() * Don't forget to call this base method from any derived classes or the * settings will not get saved. */ -void WinEDA_BasePcbFrame::SaveSettings() +void PCB_BASE_FRAME::SaveSettings() { wxASSERT( wxGetApp().m_EDA_Config != NULL ); @@ -523,7 +523,7 @@ void WinEDA_BasePcbFrame::SaveSettings() * do not forget to call this basic OnModify function to update info * in derived OnModify functions */ -void WinEDA_BasePcbFrame::OnModify( ) +void PCB_BASE_FRAME::OnModify( ) { GetScreen()->SetModify( ); @@ -532,7 +532,7 @@ void WinEDA_BasePcbFrame::OnModify( ) } -void WinEDA_BasePcbFrame::updateGridSelectBox() +void PCB_BASE_FRAME::updateGridSelectBox() { UpdateStatusBar(); DisplayUnitsMsg(); @@ -591,7 +591,7 @@ void WinEDA_BasePcbFrame::updateGridSelectBox() } -void WinEDA_BasePcbFrame::updateZoomSelectBox() +void PCB_BASE_FRAME::updateZoomSelectBox() { if( m_SelZoomBox == NULL ) return; diff --git a/pcbnew/block.cpp b/pcbnew/block.cpp index 8411d321d0..a2f88f1228 100644 --- a/pcbnew/block.cpp +++ b/pcbnew/block.cpp @@ -58,12 +58,11 @@ static bool blockDrawItems = true; class DIALOG_BLOCK_OPTIONS : public DIALOG_BLOCK_OPTIONS_BASE { private: - WinEDA_BasePcbFrame* m_Parent; + PCB_BASE_FRAME* m_Parent; public: - DIALOG_BLOCK_OPTIONS( WinEDA_BasePcbFrame* parent, - const wxString& title ); + DIALOG_BLOCK_OPTIONS( PCB_BASE_FRAME* parent, const wxString& title ); ~DIALOG_BLOCK_OPTIONS() { } @@ -82,7 +81,7 @@ private: }; -static bool InstallBlockCmdFrame( WinEDA_BasePcbFrame* parent, const wxString& title ) +static bool InstallBlockCmdFrame( PCB_BASE_FRAME* parent, const wxString& title ) { int nocmd; wxPoint oldpos = parent->GetScreen()->GetCrossHairPosition(); @@ -101,8 +100,7 @@ static bool InstallBlockCmdFrame( WinEDA_BasePcbFrame* parent, const wxString& t } -DIALOG_BLOCK_OPTIONS::DIALOG_BLOCK_OPTIONS( WinEDA_BasePcbFrame* aParent, - const wxString& aTitle ) : +DIALOG_BLOCK_OPTIONS::DIALOG_BLOCK_OPTIONS( PCB_BASE_FRAME* aParent, const wxString& aTitle ) : DIALOG_BLOCK_OPTIONS_BASE( aParent, -1, aTitle ) { m_Parent = aParent; @@ -151,7 +149,7 @@ void DIALOG_BLOCK_OPTIONS::ExecuteCommand( wxCommandEvent& event ) * @param aKey = the key modifiers (Alt, Shift ...) * @return the block command id (BLOCK_MOVE, BLOCK_COPY...) */ -int WinEDA_PcbFrame::ReturnBlockCommand( int aKey ) +int PCB_EDIT_FRAME::ReturnBlockCommand( int aKey ) { int cmd = 0; @@ -197,7 +195,7 @@ int WinEDA_PcbFrame::ReturnBlockCommand( int aKey ) * (bloc move, drag, copy .. ) * Parameters must be initialized in GetScreen()->m_BlockLocate */ -void WinEDA_PcbFrame::HandleBlockPlace( wxDC* DC ) +void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC ) { bool err = false; @@ -267,7 +265,7 @@ void WinEDA_PcbFrame::HandleBlockPlace( wxDC* DC ) * @return false if no item selected, or command finished, * true if some items found and HandleBlockPlace must be called later */ -bool WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC ) +bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) { bool nextcmd = false; // Will be set to true if a block place is needed bool cancelCmd = false; @@ -384,7 +382,7 @@ bool WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC ) * select items within the selected block. * selected items are put in the pick list */ -void WinEDA_PcbFrame::Block_SelectItems() +void PCB_EDIT_FRAME::Block_SelectItems() { int masque_layer; @@ -521,8 +519,8 @@ void WinEDA_PcbFrame::Block_SelectItems() static void drawPickedItems( EDA_DRAW_PANEL* aPanel, wxDC* aDC, wxPoint aOffset ) { - PICKED_ITEMS_LIST* itemsList = &aPanel->GetScreen()->m_BlockLocate.m_ItemsSelection; - WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) aPanel->GetParent(); + PICKED_ITEMS_LIST* itemsList = &aPanel->GetScreen()->m_BlockLocate.m_ItemsSelection; + PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) aPanel->GetParent(); g_Offset_Module = -aOffset; for( unsigned ii = 0; ii < itemsList->GetCount(); ii++ ) @@ -595,7 +593,7 @@ static void drawMovingBlock( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& a /* * Erase selected block. */ -void WinEDA_PcbFrame::Block_Delete() +void PCB_EDIT_FRAME::Block_Delete() { OnModify(); SetCurItem( NULL ); @@ -642,7 +640,7 @@ void WinEDA_PcbFrame::Block_Delete() break; default: - wxMessageBox( wxT( "WinEDA_PcbFrame::Block_Delete( ) error: unexpected type" ) ); + wxMessageBox( wxT( "PCB_EDIT_FRAME::Block_Delete( ) error: unexpected type" ) ); break; } } @@ -659,7 +657,7 @@ void WinEDA_PcbFrame::Block_Delete() * Rotate all items within the selected block. * The rotation center is the center of the block */ -void WinEDA_PcbFrame::Block_Rotate() +void PCB_EDIT_FRAME::Block_Rotate() { wxPoint oldpos; wxPoint centre; // rotation cent-re for the rotation transform @@ -706,7 +704,7 @@ void WinEDA_PcbFrame::Block_Rotate() break; default: - wxMessageBox( wxT( "WinEDA_PcbFrame::Block_Rotate( ) error: unexpected type" ) ); + wxMessageBox( wxT( "PCB_EDIT_FRAME::Block_Rotate( ) error: unexpected type" ) ); break; } } @@ -723,7 +721,7 @@ void WinEDA_PcbFrame::Block_Rotate() * flips items within the selected block. * The flip center is the center of the block */ -void WinEDA_PcbFrame::Block_Flip() +void PCB_EDIT_FRAME::Block_Flip() { #define INVERT( pos ) (pos) = center.y - ( (pos) - center.y ) wxPoint memo; @@ -772,7 +770,7 @@ void WinEDA_PcbFrame::Block_Flip() default: - wxMessageBox( wxT( "WinEDA_PcbFrame::Block_Flip( ) error: unexpected type" ) ); + wxMessageBox( wxT( "PCB_EDIT_FRAME::Block_Flip( ) error: unexpected type" ) ); break; } } @@ -789,7 +787,7 @@ void WinEDA_PcbFrame::Block_Flip() * New location is determined by the current offset from the selected block's * original location. */ -void WinEDA_PcbFrame::Block_Move() +void PCB_EDIT_FRAME::Block_Move() { OnModify(); @@ -831,7 +829,7 @@ void WinEDA_PcbFrame::Block_Move() break; default: - wxMessageBox( wxT( "WinEDA_PcbFrame::Block_Move( ) error: unexpected type" ) ); + wxMessageBox( wxT( "PCB_EDIT_FRAME::Block_Move( ) error: unexpected type" ) ); break; } } @@ -849,7 +847,7 @@ void WinEDA_PcbFrame::Block_Move() * New location is determined by the current offset from the selected block's * original location. */ -void WinEDA_PcbFrame::Block_Duplicate() +void PCB_EDIT_FRAME::Block_Duplicate() { wxPoint MoveVector = GetScreen()->m_BlockLocate.m_MoveVector; @@ -944,7 +942,7 @@ void WinEDA_PcbFrame::Block_Duplicate() break; default: - wxMessageBox( wxT( "WinEDA_PcbFrame::Block_Duplicate( ) error: unexpected type" ) ); + wxMessageBox( wxT( "PCB_EDIT_FRAME::Block_Duplicate( ) error: unexpected type" ) ); break; } diff --git a/pcbnew/block_module_editor.cpp b/pcbnew/block_module_editor.cpp index fdc8585d7c..78dba320f7 100644 --- a/pcbnew/block_module_editor.cpp +++ b/pcbnew/block_module_editor.cpp @@ -291,7 +291,7 @@ static void DrawMovingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wx BOARD_ITEM* item; wxPoint move_offset; MODULE* currentModule = - ( (WinEDA_BasePcbFrame*) wxGetApp().GetTopWindow() )->m_ModuleEditFrame->GetBoard()->m_Modules; + ( (PCB_BASE_FRAME*) wxGetApp().GetTopWindow() )->m_ModuleEditFrame->GetBoard()->m_Modules; PtBlock = &screen->m_BlockLocate; GRSetDrawMode( aDC, g_XorMode ); diff --git a/pcbnew/board.cpp b/pcbnew/board.cpp index b1b338d23d..bd56603bd0 100644 --- a/pcbnew/board.cpp +++ b/pcbnew/board.cpp @@ -32,7 +32,7 @@ void SetDir( int, int, int, int ); * Calculates nrows and ncols, dimensions of the matrix representation of BOARD * for routing and automatic calculation of area. */ -bool ComputeMatriceSize( WinEDA_BasePcbFrame* frame, int g_GridRoutingSize ) +bool ComputeMatriceSize( PCB_BASE_FRAME* frame, int g_GridRoutingSize ) { BOARD* pcb = frame->GetBoard(); diff --git a/pcbnew/board_undo_redo.cpp b/pcbnew/board_undo_redo.cpp index 152797eb0b..034df92198 100644 --- a/pcbnew/board_undo_redo.cpp +++ b/pcbnew/board_undo_redo.cpp @@ -338,9 +338,9 @@ BOARD_ITEM* DuplicateStruct( BOARD_ITEM* aItem ) * UR_FLIPPED * UR_ROTATED */ -void WinEDA_PcbFrame::SaveCopyInUndoList( BOARD_ITEM* aItem, - UndoRedoOpType aCommandType, - const wxPoint& aTransformPoint ) +void PCB_EDIT_FRAME::SaveCopyInUndoList( BOARD_ITEM* aItem, + UndoRedoOpType aCommandType, + const wxPoint& aTransformPoint ) { if( aItem == NULL ) // Nothing to save return; @@ -398,9 +398,9 @@ void WinEDA_PcbFrame::SaveCopyInUndoList( BOARD_ITEM* aItem, * @param aTypeCommand = type of comand ( UR_CHANGED, UR_NEW, UR_DELETED ... * @param aTransformPoint - Transform items around this point. */ -void WinEDA_PcbFrame::SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList, - UndoRedoOpType aTypeCommand, - const wxPoint& aTransformPoint ) +void PCB_EDIT_FRAME::SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList, + UndoRedoOpType aTypeCommand, + const wxPoint& aTransformPoint ) { PICKED_ITEMS_LIST* commandToUndo = new PICKED_ITEMS_LIST(); @@ -475,7 +475,8 @@ void WinEDA_PcbFrame::SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList, * @param aRebuildRatsnet = a bool: true to rebuid ratsnet (normal use, and default), false * to just retrieve las state (used in abort commands that do not need to rebuild ratsnest) */ -void WinEDA_PcbFrame::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRedoCommand, bool aRebuildRatsnet ) +void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRedoCommand, + bool aRebuildRatsnet ) { BOARD_ITEM* item; bool not_found = false; @@ -574,7 +575,7 @@ void WinEDA_PcbFrame::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRe /**********************************************************/ -void WinEDA_PcbFrame::GetBoardFromUndoList( wxCommandEvent& event ) +void PCB_EDIT_FRAME::GetBoardFromUndoList( wxCommandEvent& event ) /**********************************************************/ /** @@ -609,7 +610,7 @@ void WinEDA_PcbFrame::GetBoardFromUndoList( wxCommandEvent& event ) * - Get an old version of the board from Redo list * @return none */ -void WinEDA_PcbFrame::GetBoardFromRedoList( wxCommandEvent& event ) +void PCB_EDIT_FRAME::GetBoardFromRedoList( wxCommandEvent& event ) { if( GetScreen()->GetRedoCommandCount() == 0 ) return; diff --git a/pcbnew/build_BOM_from_board.cpp b/pcbnew/build_BOM_from_board.cpp index 017216fb8f..6bc7562271 100644 --- a/pcbnew/build_BOM_from_board.cpp +++ b/pcbnew/build_BOM_from_board.cpp @@ -46,7 +46,7 @@ WX_DECLARE_LIST( cmp, CmpList ); WX_DEFINE_LIST( CmpList ) -void WinEDA_PcbFrame::RecreateBOMFileFromBoard( wxCommandEvent& aEvent ) +void PCB_EDIT_FRAME::RecreateBOMFileFromBoard( wxCommandEvent& aEvent ) { wxFileName fn; FILE* FichBom; diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index b924ab5332..dcf318182c 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -23,7 +23,7 @@ BOARD_DESIGN_SETTINGS boardDesignSettings; /* Class BOARD: */ /*****************/ -BOARD::BOARD( EDA_ITEM* parent, WinEDA_BasePcbFrame* frame ) : +BOARD::BOARD( EDA_ITEM* parent, PCB_BASE_FRAME* frame ) : BOARD_ITEM( (BOARD_ITEM*)parent, TYPE_PCB ), m_NetClasses( this ) { diff --git a/pcbnew/class_board.h b/pcbnew/class_board.h index 889e034cdf..178607ccd2 100644 --- a/pcbnew/class_board.h +++ b/pcbnew/class_board.h @@ -99,7 +99,7 @@ public: #define HISTORY_MAX_COUNT 8 class BOARD : public BOARD_ITEM { - friend class WinEDA_PcbFrame; + friend class PCB_EDIT_FRAME; private: typedef std::vector MARKERS; // @todo: switch to boost:ptr_vector, and change ~BOARD() @@ -111,7 +111,7 @@ private: LAYER m_Layer[NB_COPPER_LAYERS]; public: - WinEDA_BasePcbFrame* m_PcbFrame; // Window of visualization + PCB_BASE_FRAME* m_PcbFrame; // Window of visualization EDA_Rect m_BoundaryBox; // Board size and position int m_Status_Pcb; // Flags used in ratsnet calculation and update int m_NbNodes; // Active pads (pads attached to a net ) count @@ -153,7 +153,7 @@ private: /**********************************/ public: - BOARD( EDA_ITEM* aParent, WinEDA_BasePcbFrame* frame ); + BOARD( EDA_ITEM* aParent, PCB_BASE_FRAME* frame ); ~BOARD(); /** diff --git a/pcbnew/class_drawsegment.h b/pcbnew/class_drawsegment.h index f91bd41a04..a252e63cd5 100644 --- a/pcbnew/class_drawsegment.h +++ b/pcbnew/class_drawsegment.h @@ -84,7 +84,7 @@ public: * has knowledge about the frame and how and where to put status information * about this object into the frame's message panel. * Is virtual from EDA_ITEM. - * @param frame A WinEDA_BasePcbFrame in which to print status information. + * @param frame A PCB_BASE_FRAME in which to print status information. */ virtual void DisplayInfo( EDA_DRAW_FRAME* frame ); diff --git a/pcbnew/class_edge_mod.cpp b/pcbnew/class_edge_mod.cpp index 227d4c76f5..4396a5f720 100644 --- a/pcbnew/class_edge_mod.cpp +++ b/pcbnew/class_edge_mod.cpp @@ -148,11 +148,11 @@ void EDGE_MODULE::SetDrawCoord() */ void EDGE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint& offset ) { - int ux0, uy0, dx, dy, rayon, StAngle, EndAngle; - int color, type_trace; - int typeaff; - PCB_SCREEN* screen; - WinEDA_BasePcbFrame* frame; + int ux0, uy0, dx, dy, rayon, StAngle, EndAngle; + int color, type_trace; + int typeaff; + PCB_SCREEN* screen; + PCB_BASE_FRAME* frame; MODULE* module = (MODULE*) m_Parent; if( module == NULL ) @@ -164,7 +164,7 @@ void EDGE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx color = brd->GetLayerColor(m_Layer); - frame = (WinEDA_BasePcbFrame*) panel->GetParent(); + frame = (PCB_BASE_FRAME*) panel->GetParent(); screen = frame->GetScreen(); diff --git a/pcbnew/class_netinfo_item.cpp b/pcbnew/class_netinfo_item.cpp index 21b73f820a..06911d3cc0 100644 --- a/pcbnew/class_netinfo_item.cpp +++ b/pcbnew/class_netinfo_item.cpp @@ -139,7 +139,7 @@ void NETINFO_ITEM::DisplayInfo( EDA_DRAW_FRAME* frame ) frame->AppendMsgPanel( _( "Net Code" ), txt, RED ); count = 0; - module = ( (WinEDA_BasePcbFrame*) frame )->GetBoard()->m_Modules; + module = ( (PCB_BASE_FRAME*) frame )->GetBoard()->m_Modules; for( ; module != 0; module = module->Next() ) { for( pad = module->m_Pads; pad != 0; pad = pad->Next() ) @@ -153,7 +153,7 @@ void NETINFO_ITEM::DisplayInfo( EDA_DRAW_FRAME* frame ) frame->AppendMsgPanel( _( "Pads" ), txt, DARKGREEN ); count = 0; - Struct = ( (WinEDA_BasePcbFrame*) frame )->GetBoard()->m_Track; + Struct = ( (PCB_BASE_FRAME*) frame )->GetBoard()->m_Track; for( ; Struct != NULL; Struct = Struct->Next() ) { if( Struct->Type() == TYPE_VIA ) diff --git a/pcbnew/class_pad_draw_functions.cpp b/pcbnew/class_pad_draw_functions.cpp index 2af4d0c9b8..4a95c9fc8e 100644 --- a/pcbnew/class_pad_draw_functions.cpp +++ b/pcbnew/class_pad_draw_functions.cpp @@ -102,8 +102,8 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDraw_mode, const wxPoi return; - WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) aPanel->GetParent(); - PCB_SCREEN* screen = frame->GetScreen(); + PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) aPanel->GetParent(); + PCB_SCREEN* screen = frame->GetScreen(); if( frame->m_DisplayPadFill == FILLED ) drawInfo.m_ShowPadFilled = true; else diff --git a/pcbnew/class_pcb_layer_widget.cpp b/pcbnew/class_pcb_layer_widget.cpp index 1a843fd3ba..d870c9505f 100644 --- a/pcbnew/class_pcb_layer_widget.cpp +++ b/pcbnew/class_pcb_layer_widget.cpp @@ -46,12 +46,12 @@ /** * Class PCB_LAYER_WIDGET * is here to implement the abtract functions of LAYER_WIDGET so they - * may be tied into the WinEDA_PcbFrame's data and so we can add a popup + * may be tied into the PCB_EDIT_FRAME's data and so we can add a popup * menu which is specific to PCBNEW's needs. */ -PCB_LAYER_WIDGET::PCB_LAYER_WIDGET( WinEDA_PcbFrame* aParent, wxWindow* aFocusOwner, int aPointSize ) : +PCB_LAYER_WIDGET::PCB_LAYER_WIDGET( PCB_EDIT_FRAME* aParent, wxWindow* aFocusOwner, int aPointSize ) : LAYER_WIDGET( aParent, aFocusOwner, aPointSize ), myframe( aParent ) { @@ -298,7 +298,7 @@ bool PCB_LAYER_WIDGET::OnLayerSelect( int aLayer ) // the layer change from the PCB_LAYER_WIDGET can be denied by returning // false from this function. myframe->setActiveLayer( aLayer, false ); - myframe->syncLayerBox(); + if(DisplayOpt.ContrastModeDisplay) myframe->DrawPanel->Refresh(); diff --git a/pcbnew/class_pcb_layer_widget.h b/pcbnew/class_pcb_layer_widget.h index 0d42ff1097..a6a29e5540 100644 --- a/pcbnew/class_pcb_layer_widget.h +++ b/pcbnew/class_pcb_layer_widget.h @@ -34,12 +34,12 @@ /** * Class PCB_LAYER_WIDGET * is here to implement the abtract functions of LAYER_WIDGET so they - * may be tied into the WinEDA_PcbFrame's data and so we can add a popup + * may be tied into the PCB_EDIT_FRAME's data and so we can add a popup * menu which is specific to PCBNEW's needs. */ class PCB_LAYER_WIDGET : public LAYER_WIDGET { - WinEDA_PcbFrame* myframe; + PCB_EDIT_FRAME* myframe; // popup menu ids. #define ID_SHOW_ALL_COPPERS wxID_HIGHEST @@ -67,7 +67,7 @@ public: * effectively sets the overal size of the widget via the row height and bitmap * button sizes. */ - PCB_LAYER_WIDGET( WinEDA_PcbFrame* aParent, wxWindow* aFocusOwner, int aPointSize = 10 ); + PCB_LAYER_WIDGET( PCB_EDIT_FRAME* aParent, wxWindow* aFocusOwner, int aPointSize = 10 ); void ReFill(); diff --git a/pcbnew/class_text_mod.cpp b/pcbnew/class_text_mod.cpp index c4430e47ee..0c9d69ebc6 100644 --- a/pcbnew/class_text_mod.cpp +++ b/pcbnew/class_text_mod.cpp @@ -328,21 +328,21 @@ EDA_Rect TEXTE_MODULE::GetBoundingBox() const */ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint& offset ) { - int width, color, orient; - wxSize size; - wxPoint pos; // Center of text - PCB_SCREEN* screen; - WinEDA_BasePcbFrame* frame; - MODULE* Module = (MODULE*) m_Parent; /* parent must *not* be null - * (a module text without a footprint parent has no sense) - */ + int width, color, orient; + wxSize size; + wxPoint pos; // Center of text + PCB_SCREEN* screen; + PCB_BASE_FRAME* frame; + MODULE* Module = (MODULE*) m_Parent; /* parent must *not* be null + * (a module text without a footprint + * parent has no sense) */ if( panel == NULL ) return; screen = (PCB_SCREEN*) panel->GetScreen(); - frame = (WinEDA_BasePcbFrame*) panel->GetParent(); + frame = (PCB_BASE_FRAME*) panel->GetParent(); pos.x = m_Pos.x - offset.x; pos.y = m_Pos.y - offset.y; diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index 455b7f1a7c..b6479c2449 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -727,8 +727,8 @@ void SEGVIA::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint int curr_layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer; int fillvia = 0; - WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) panel->GetParent(); - PCB_SCREEN* screen = frame->GetScreen(); + PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) panel->GetParent(); + PCB_SCREEN* screen = frame->GetScreen(); if( frame->m_DisplayViaFill == FILLED ) fillvia = 1; @@ -941,7 +941,7 @@ void SEGVIA::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint void TRACK::DisplayInfo( EDA_DRAW_FRAME* frame ) { wxString msg; - BOARD* board = ( (WinEDA_BasePcbFrame*) frame )->GetBoard(); + BOARD* board = ( (PCB_BASE_FRAME*) frame )->GetBoard(); // Display basic infos DisplayInfoBase( frame ); @@ -967,7 +967,7 @@ void TRACK::DisplayInfo( EDA_DRAW_FRAME* frame ) void TRACK::DisplayInfoBase( EDA_DRAW_FRAME* frame ) { wxString msg; - BOARD* board = ( (WinEDA_BasePcbFrame*) frame )->GetBoard(); + BOARD* board = ( (PCB_BASE_FRAME*) frame )->GetBoard(); frame->ClearMsgPanel(); diff --git a/pcbnew/class_zone.cpp b/pcbnew/class_zone.cpp index ca78fcbf14..cacaec52b9 100644 --- a/pcbnew/class_zone.cpp +++ b/pcbnew/class_zone.cpp @@ -981,7 +981,7 @@ void ZONE_CONTAINER::DisplayInfo( EDA_DRAW_FRAME* frame ) { if( GetNet() >= 0 ) { - NETINFO_ITEM* equipot = ( (WinEDA_BasePcbFrame*) frame )->GetBoard()->FindNet( GetNet() ); + NETINFO_ITEM* equipot = ( (PCB_BASE_FRAME*) frame )->GetBoard()->FindNet( GetNet() ); if( equipot ) msg = equipot->GetNetname(); diff --git a/pcbnew/class_zone.h b/pcbnew/class_zone.h index f98764b56f..407dcdc6c3 100644 --- a/pcbnew/class_zone.h +++ b/pcbnew/class_zone.h @@ -277,7 +277,7 @@ public: * @param verbose = true to show error messages * @return error level (0 = no error) */ - int Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose = TRUE ); + int Fill_Zone( PCB_EDIT_FRAME* frame, wxDC* DC, bool verbose = TRUE ); /** * Function Fill_Zone_Areas_With_Segments diff --git a/pcbnew/clean.cpp b/pcbnew/clean.cpp index c978140ff8..a3df1254e4 100644 --- a/pcbnew/clean.cpp +++ b/pcbnew/clean.cpp @@ -13,27 +13,27 @@ #include "protos.h" /* local functions : */ -static void clean_segments( WinEDA_PcbFrame* frame ); +static void clean_segments( PCB_EDIT_FRAME* frame ); static void clean_vias( BOARD* aPcb ); -static void DeleteUnconnectedTracks( WinEDA_PcbFrame* frame, wxDC* DC ); +static void DeleteUnconnectedTracks( PCB_EDIT_FRAME* frame, wxDC* DC ); static TRACK* AlignSegment( BOARD* Pcb, TRACK* pt_ref, TRACK* pt_segm, int extremite ); -static void Clean_Pcb_Items( WinEDA_PcbFrame* frame, wxDC* DC, - bool aCleanVias, bool aMergeSegments, - bool aDeleteUnconnectedSegm, bool aConnectToPads ); +static void Clean_Pcb_Items( PCB_EDIT_FRAME* frame, wxDC* DC, + bool aCleanVias, bool aMergeSegments, + bool aDeleteUnconnectedSegm, bool aConnectToPads ); #include "dialog_cleaning_options.h" #define CONN2PAD_ENBL #ifdef CONN2PAD_ENBL -static void ConnectDanglingEndToPad( WinEDA_PcbFrame* frame, wxDC* DC ); +static void ConnectDanglingEndToPad( PCB_EDIT_FRAME* frame, wxDC* DC ); static void ConnectDanglingEndToVia( BOARD* pcb ); -//static void Gen_Raccord_Track( WinEDA_PcbFrame* frame, wxDC* DC ); +//static void Gen_Raccord_Track( PCB_EDIT_FRAME* frame, wxDC* DC ); #endif /*****************************************/ -void WinEDA_PcbFrame::Clean_Pcb( wxDC* DC ) +void PCB_EDIT_FRAME::Clean_Pcb( wxDC* DC ) /*****************************************/ /* Install the track operation dialog frame */ @@ -56,7 +56,7 @@ void WinEDA_PcbFrame::Clean_Pcb( wxDC* DC ) * Create segments when track ends are incorrecty connected: * i.e. when a track end covers a pad or a via but is not exactly on the pad or the via center */ -void Clean_Pcb_Items( WinEDA_PcbFrame* frame, wxDC* DC, +void Clean_Pcb_Items( PCB_EDIT_FRAME* frame, wxDC* DC, bool aCleanVias, bool aMergeSegments, bool aDeleteUnconnectedSegm, bool aConnectToPads ) { @@ -162,7 +162,7 @@ void clean_vias( BOARD * aPcb ) /*****************************************************************************/ -static void DeleteUnconnectedTracks( WinEDA_PcbFrame* frame, wxDC* DC ) +static void DeleteUnconnectedTracks( PCB_EDIT_FRAME* frame, wxDC* DC ) /*****************************************************************************/ /* @@ -361,7 +361,7 @@ static void DeleteUnconnectedTracks( WinEDA_PcbFrame* frame, wxDC* DC ) /************************************************************/ -static void clean_segments( WinEDA_PcbFrame* frame ) +static void clean_segments( PCB_EDIT_FRAME* frame ) /************************************************************/ /* Delete null lenght segments, and intermediate points .. */ { @@ -631,7 +631,7 @@ static TRACK* AlignSegment( BOARD* Pcb, TRACK* pt_ref, TRACK* pt_segm, int extre * @param aDC = the current device context (can be NULL) * @return true if any change is made */ -bool WinEDA_PcbFrame::RemoveMisConnectedTracks( wxDC* aDC ) +bool PCB_EDIT_FRAME::RemoveMisConnectedTracks( wxDC* aDC ) { TRACK* segment; TRACK* other; @@ -708,7 +708,7 @@ bool WinEDA_PcbFrame::RemoveMisConnectedTracks( wxDC* aDC ) #if 0 /***************************************************************/ -static void Gen_Raccord_Track( WinEDA_PcbFrame* frame, wxDC* DC ) +static void Gen_Raccord_Track( PCB_EDIT_FRAME* frame, wxDC* DC ) /***************************************************************/ /** @@ -934,7 +934,7 @@ static void ConnectDanglingEndToVia( BOARD* pcb ) /***************************************************************/ -void ConnectDanglingEndToPad( WinEDA_PcbFrame* frame, wxDC* DC ) +void ConnectDanglingEndToPad( PCB_EDIT_FRAME* frame, wxDC* DC ) /**************************************************************/ /** diff --git a/pcbnew/collectors.cpp b/pcbnew/collectors.cpp index 47ab6c80d9..e4f49fe3b2 100644 --- a/pcbnew/collectors.cpp +++ b/pcbnew/collectors.cpp @@ -27,7 +27,7 @@ /* This module contains out of line member functions for classes given in - * collectors.h. Those classes augment the functionality of class WinEDA_PcbFrame. + * collectors.h. Those classes augment the functionality of class PCB_EDIT_FRAME. */ diff --git a/pcbnew/collectors.h b/pcbnew/collectors.h index e0bf69484b..9046e22c29 100644 --- a/pcbnew/collectors.h +++ b/pcbnew/collectors.h @@ -27,7 +27,7 @@ /* This module contains a number of COLLECTOR implementations which are used - to augment the functionality of class WinEDA_PcbFrame. + to augment the functionality of class PCB_EDIT_FRAME. */ @@ -182,7 +182,7 @@ public: * Class GENERAL_COLLECTOR * is intended for use when the right click button is pressed, or when the * plain "arrow" tool is in effect. This class can be used by window classes - * such as WinEDA_PcbFrame. + * such as PCB_EDIT_FRAME. * * Philosophy: this class knows nothing of the context in which a BOARD is used * and that means it knows nothing about which layers are visible or current, diff --git a/pcbnew/connect.cpp b/pcbnew/connect.cpp index 3942e29e57..b765964528 100644 --- a/pcbnew/connect.cpp +++ b/pcbnew/connect.cpp @@ -266,7 +266,7 @@ static void Propagate_SubNet( TRACK* pt_start_conn, TRACK* pt_end_conn ) /***************************************************/ -void WinEDA_BasePcbFrame::test_connexions( wxDC* DC ) +void PCB_BASE_FRAME::test_connexions( wxDC* DC ) /***************************************************/ /** @@ -310,7 +310,7 @@ void WinEDA_BasePcbFrame::test_connexions( wxDC* DC ) /*************************************************************************/ -void WinEDA_BasePcbFrame::test_1_net_connexion( wxDC* DC, int net_code ) +void PCB_BASE_FRAME::test_1_net_connexion( wxDC* DC, int net_code ) /*************************************************************************/ /** @@ -566,7 +566,7 @@ void CreateSortedPadListByXCoord( BOARD* aBoard, std::vector* aVector ) /********************************************************************/ -void WinEDA_BasePcbFrame::RecalculateAllTracksNetcode( ) +void PCB_BASE_FRAME::RecalculateAllTracksNetcode() /********************************************************************/ /* search connections between tracks and pads, and propagate pad net codes to the track segments diff --git a/pcbnew/controle.cpp b/pcbnew/controle.cpp index a8737597b3..30e85d5b09 100644 --- a/pcbnew/controle.cpp +++ b/pcbnew/controle.cpp @@ -15,7 +15,7 @@ #include "collectors.h" //external funtions used here: -extern bool Magnetize( BOARD* m_Pcb, WinEDA_PcbFrame* frame, +extern bool Magnetize( BOARD* m_Pcb, PCB_EDIT_FRAME* frame, int aCurrentTool, wxSize grid, wxPoint on_grid, wxPoint* curpos ); @@ -60,7 +60,7 @@ static BOARD_ITEM* AllAreModulesAndReturnSmallestIfSo( GENERAL_COLLECTOR* aColle } -BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode ) +BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode ) { BOARD_ITEM* item; @@ -209,7 +209,7 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode ) * DrawPanel->m_IgnoreMouseEvents = true; */ - // this menu's handler is void WinEDA_BasePcbFrame::ProcessItemSelection() + // this menu's handler is void PCB_BASE_FRAME::ProcessItemSelection() // and it calls SetCurItem() which in turn calls DisplayInfo() on the item. DrawPanel->m_AbortRequest = true; // changed in false if an item PopupMenu( &itemMenu ); // m_AbortRequest = false if an item is selected @@ -226,7 +226,7 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode ) } -void WinEDA_PcbFrame::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey ) +void PCB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey ) { wxRealPoint gridSize; wxPoint oldpos; diff --git a/pcbnew/cross-probing.cpp b/pcbnew/cross-probing.cpp index b672ea3e6c..595118db6a 100644 --- a/pcbnew/cross-probing.cpp +++ b/pcbnew/cross-probing.cpp @@ -34,14 +34,14 @@ void RemoteCommand( const char* cmdline ) * $PIN: "pin name" $PART: "reference" put cursor on the footprint pin */ { - char line[1024]; - wxString msg; - wxString modName; - char* idcmd; - char* text; - MODULE* module = 0; - WinEDA_PcbFrame* frame = (WinEDA_PcbFrame*)wxGetApp().GetTopWindow(); - wxPoint pos; + char line[1024]; + wxString msg; + wxString modName; + char* idcmd; + char* text; + MODULE* module = 0; + PCB_EDIT_FRAME* frame = (PCB_EDIT_FRAME*)wxGetApp().GetTopWindow(); + wxPoint pos; strncpy( line, cmdline, sizeof(line) - 1 ); @@ -131,7 +131,7 @@ void RemoteCommand( const char* cmdline ) // see wxstruct.h /**************************************************************************/ -void WinEDA_PcbFrame::SendMessageToEESCHEMA( BOARD_ITEM* objectToSync ) +void PCB_EDIT_FRAME::SendMessageToEESCHEMA( BOARD_ITEM* objectToSync ) /**************************************************************************/ /** Send a remote command to eeschema via a socket, diff --git a/pcbnew/deltrack.cpp b/pcbnew/deltrack.cpp index 31fc0a62ca..2d7b06be92 100644 --- a/pcbnew/deltrack.cpp +++ b/pcbnew/deltrack.cpp @@ -18,7 +18,7 @@ * If There is evidence of new track: delete new segment. * Otherwise, delete segment under the cursor. */ -TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) +TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack ) { int current_net_code; @@ -116,7 +116,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) } -void WinEDA_PcbFrame::Delete_Track( wxDC* DC, TRACK* aTrack ) +void PCB_EDIT_FRAME::Delete_Track( wxDC* DC, TRACK* aTrack ) { if( aTrack != NULL ) { @@ -128,7 +128,7 @@ void WinEDA_PcbFrame::Delete_Track( wxDC* DC, TRACK* aTrack ) } -void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* aTrack ) +void PCB_EDIT_FRAME::Delete_net( wxDC* DC, TRACK* aTrack ) { if( aTrack == NULL ) return; @@ -172,7 +172,7 @@ void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* aTrack ) * The leading segment is removed and all adjacent segments * until a pad or a junction point of more than 2 segments is found */ -void WinEDA_PcbFrame::Remove_One_Track( wxDC* DC, TRACK* pt_segm ) +void PCB_EDIT_FRAME::Remove_One_Track( wxDC* DC, TRACK* pt_segm ) { int segments_to_delete_count; diff --git a/pcbnew/dialogs/dialog_SVG_print.cpp b/pcbnew/dialogs/dialog_SVG_print.cpp index 395dc9986e..109dbfee45 100644 --- a/pcbnew/dialogs/dialog_SVG_print.cpp +++ b/pcbnew/dialogs/dialog_SVG_print.cpp @@ -42,7 +42,7 @@ static long s_SelectedLayers = LAYER_BACK | LAYER_FRONT | DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( EDA_DRAW_FRAME* parent ) : DIALOG_SVG_PRINT_base( parent ) { - m_Parent = (WinEDA_BasePcbFrame*) parent; + m_Parent = (PCB_BASE_FRAME*) parent; m_Config = wxGetApp().m_EDA_Config; initDialog( ); GetSizer()->SetSizeHints( this ); diff --git a/pcbnew/dialogs/dialog_SVG_print.h b/pcbnew/dialogs/dialog_SVG_print.h index bbd8eb66f3..f417a0ad3f 100644 --- a/pcbnew/dialogs/dialog_SVG_print.h +++ b/pcbnew/dialogs/dialog_SVG_print.h @@ -7,17 +7,17 @@ class BASE_SCREEN; -class WinEDA_BasePcbFrame; +class PCB_BASE_FRAME; class wxConfig; class DIALOG_SVG_PRINT : public DIALOG_SVG_PRINT_base { private: - WinEDA_BasePcbFrame* m_Parent; - wxConfig* m_Config; - long m_PrintMaskLayer; - wxCheckBox* m_BoxSelectLayer[32]; + PCB_BASE_FRAME* m_Parent; + wxConfig* m_Config; + long m_PrintMaskLayer; + wxCheckBox* m_BoxSelectLayer[32]; public: DIALOG_SVG_PRINT( EDA_DRAW_FRAME* parent ); diff --git a/pcbnew/dialogs/dialog_copper_zones.cpp b/pcbnew/dialogs/dialog_copper_zones.cpp index 0a1663f8f3..4ff7ad73db 100644 --- a/pcbnew/dialogs/dialog_copper_zones.cpp +++ b/pcbnew/dialogs/dialog_copper_zones.cpp @@ -33,7 +33,7 @@ wxPoint dialog_copper_zone::prevPosition( -1, -1 ); wxSize dialog_copper_zone::prevSize; -dialog_copper_zone::dialog_copper_zone( WinEDA_PcbFrame* parent, ZONE_SETTING* zone_setting ) : +dialog_copper_zone::dialog_copper_zone( PCB_EDIT_FRAME* parent, ZONE_SETTING* zone_setting ) : dialog_copper_zone_base( parent ) { m_Parent = parent; diff --git a/pcbnew/dialogs/dialog_copper_zones.h b/pcbnew/dialogs/dialog_copper_zones.h index a94757dc5c..18cfe05874 100644 --- a/pcbnew/dialogs/dialog_copper_zones.h +++ b/pcbnew/dialogs/dialog_copper_zones.h @@ -12,7 +12,7 @@ class dialog_copper_zone : public dialog_copper_zone_base { private: - WinEDA_PcbFrame* m_Parent; + PCB_EDIT_FRAME* m_Parent; wxConfig* m_Config; // Current config int m_OnExitCode; /* exit code: ZONE_ABORT if no change, * ZONE_OK if new values accepted @@ -35,7 +35,7 @@ private: static wxSize prevSize; public: - dialog_copper_zone( WinEDA_PcbFrame* parent, ZONE_SETTING* zone_setting ); + dialog_copper_zone( PCB_EDIT_FRAME* parent, ZONE_SETTING* zone_setting ); private: void initDialog(); void OnButtonOkClick( wxCommandEvent& event ); diff --git a/pcbnew/dialogs/dialog_design_rules.cpp b/pcbnew/dialogs/dialog_design_rules.cpp index 2246f87d85..b4fff093c5 100644 --- a/pcbnew/dialogs/dialog_design_rules.cpp +++ b/pcbnew/dialogs/dialog_design_rules.cpp @@ -143,7 +143,7 @@ void EnsureGridColumnWidths( wxGrid* aGrid ) /***********************************************************************************/ -DIALOG_DESIGN_RULES::DIALOG_DESIGN_RULES( WinEDA_PcbFrame* parent ) : +DIALOG_DESIGN_RULES::DIALOG_DESIGN_RULES( PCB_EDIT_FRAME* parent ) : DIALOG_DESIGN_RULES_BASE( parent ) /***********************************************************************************/ { diff --git a/pcbnew/dialogs/dialog_design_rules.h b/pcbnew/dialogs/dialog_design_rules.h index 178483473b..950d394cec 100644 --- a/pcbnew/dialogs/dialog_design_rules.h +++ b/pcbnew/dialogs/dialog_design_rules.h @@ -31,7 +31,7 @@ private: static const wxString wildCard; ///< the name of a ficticious netclass which includes all NETs - WinEDA_PcbFrame* m_Parent; + PCB_EDIT_FRAME* m_Parent; BOARD* m_Pcb; BOARD_DESIGN_SETTINGS* m_BrdSettings; @@ -100,7 +100,7 @@ private: public: - DIALOG_DESIGN_RULES( WinEDA_PcbFrame* parent ); + DIALOG_DESIGN_RULES( PCB_EDIT_FRAME* parent ); ~DIALOG_DESIGN_RULES( ) { }; }; diff --git a/pcbnew/dialogs/dialog_display_options.cpp b/pcbnew/dialogs/dialog_display_options.cpp index 9d15714ef9..5065ae2e83 100644 --- a/pcbnew/dialogs/dialog_display_options.cpp +++ b/pcbnew/dialogs/dialog_display_options.cpp @@ -18,7 +18,7 @@ #include "dialog_display_options_base.h" -void WinEDA_PcbFrame::InstallDisplayOptionsDialog( wxCommandEvent& aEvent ) +void PCB_EDIT_FRAME::InstallDisplayOptionsDialog( wxCommandEvent& aEvent ) { Dialog_Display_Options* DisplayOptionsDialog = new Dialog_Display_Options( this ); @@ -29,7 +29,7 @@ void WinEDA_PcbFrame::InstallDisplayOptionsDialog( wxCommandEvent& aEvent ) /*******************************************************************************/ -Dialog_Display_Options::Dialog_Display_Options( WinEDA_PcbFrame* parent ) : +Dialog_Display_Options::Dialog_Display_Options( PCB_EDIT_FRAME* parent ) : DialogDisplayOptions_base(parent) /*******************************************************************************/ { diff --git a/pcbnew/dialogs/dialog_display_options.h b/pcbnew/dialogs/dialog_display_options.h index 71c075fddb..20b82e5ee6 100644 --- a/pcbnew/dialogs/dialog_display_options.h +++ b/pcbnew/dialogs/dialog_display_options.h @@ -6,12 +6,12 @@ class Dialog_Display_Options : public DialogDisplayOptions_base { private: - WinEDA_PcbFrame* m_Parent; + PCB_EDIT_FRAME* m_Parent; void init(); public: - Dialog_Display_Options( WinEDA_PcbFrame* parent ); + Dialog_Display_Options( PCB_EDIT_FRAME* parent ); ~Dialog_Display_Options( ) { }; void OnOkClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event ); diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index 81290f2558..1b1c08878f 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -23,7 +23,7 @@ wxSize DIALOG_DRC_CONTROL::s_LastSize; * and run DRC tests */ -DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL( DRC* aTester, WinEDA_PcbFrame* parent ) : +DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* parent ) : DIALOG_DRC_CONTROL_BASE( parent ) { m_tester = aTester; diff --git a/pcbnew/dialogs/dialog_drc.h b/pcbnew/dialogs/dialog_drc.h index f307d87513..d2bdf74fcd 100644 --- a/pcbnew/dialogs/dialog_drc.h +++ b/pcbnew/dialogs/dialog_drc.h @@ -41,7 +41,7 @@ public: BOARD_DESIGN_SETTINGS* m_BrdSettings; /// Constructors - DIALOG_DRC_CONTROL( DRC* aTester, WinEDA_PcbFrame* parent ); + DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* parent ); ~DIALOG_DRC_CONTROL(){}; /** @@ -116,7 +116,7 @@ private: DRC* m_tester; - WinEDA_PcbFrame* m_Parent; + PCB_EDIT_FRAME* m_Parent; int m_UnconnectedCount; }; diff --git a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp index d630aa9790..3c0a882c9c 100644 --- a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp +++ b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp @@ -16,10 +16,9 @@ #include "dialog_edit_module_for_BoardEditor.h" -DIALOG_MODULE_BOARD_EDITOR::DIALOG_MODULE_BOARD_EDITOR( - WinEDA_PcbFrame* aParent, - MODULE* aModule, - wxDC* aDC ) : +DIALOG_MODULE_BOARD_EDITOR::DIALOG_MODULE_BOARD_EDITOR( PCB_EDIT_FRAME* aParent, + MODULE* aModule, + wxDC* aDC ) : DIALOG_MODULE_BOARD_EDITOR_BASE( aParent ) { m_Parent = aParent; diff --git a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.h b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.h index ed20ab6494..18a598b362 100644 --- a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.h +++ b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.h @@ -13,7 +13,7 @@ class DIALOG_MODULE_BOARD_EDITOR: public DIALOG_MODULE_BOARD_EDITOR_BASE { private: - WinEDA_PcbFrame * m_Parent; + PCB_EDIT_FRAME * m_Parent; wxDC * m_DC; MODULE* m_CurrentModule; TEXTE_MODULE* m_ReferenceCopy; @@ -27,7 +27,7 @@ private: public: // Constructor and destructor - DIALOG_MODULE_BOARD_EDITOR( WinEDA_PcbFrame* aParent, MODULE* aModule, wxDC* aDC ); + DIALOG_MODULE_BOARD_EDITOR( PCB_EDIT_FRAME* aParent, MODULE* aModule, wxDC* aDC ); ~DIALOG_MODULE_BOARD_EDITOR(); private: diff --git a/pcbnew/dialogs/dialog_edit_module_text.cpp b/pcbnew/dialogs/dialog_edit_module_text.cpp index 8d8c110bc5..692e46eca7 100644 --- a/pcbnew/dialogs/dialog_edit_module_text.cpp +++ b/pcbnew/dialogs/dialog_edit_module_text.cpp @@ -23,13 +23,13 @@ extern wxPoint MoveVector; // Move vector for move edge, imported from edtxtmod class DialogEditModuleText : public DialogEditModuleText_base { private: - WinEDA_BasePcbFrame* m_Parent; + PCB_BASE_FRAME* m_Parent; wxDC* m_DC; MODULE* m_Module; TEXTE_MODULE* m_CurrentTextMod; public: - DialogEditModuleText( WinEDA_BasePcbFrame* parent, TEXTE_MODULE* TextMod, wxDC* DC ); + DialogEditModuleText( PCB_BASE_FRAME* parent, TEXTE_MODULE* TextMod, wxDC* DC ); ~DialogEditModuleText() {}; private: @@ -39,7 +39,7 @@ private: }; /*************************************************************************************/ -void WinEDA_BasePcbFrame::InstallTextModOptionsFrame( TEXTE_MODULE* TextMod, wxDC* DC ) +void PCB_BASE_FRAME::InstallTextModOptionsFrame( TEXTE_MODULE* TextMod, wxDC* DC ) /**************************************************************************************/ { DrawPanel->m_IgnoreMouseEvents = TRUE; @@ -49,7 +49,8 @@ void WinEDA_BasePcbFrame::InstallTextModOptionsFrame( TEXTE_MODULE* TextMod, wxD } -DialogEditModuleText::DialogEditModuleText( WinEDA_BasePcbFrame* parent, TEXTE_MODULE* TextMod, wxDC* DC ) : +DialogEditModuleText::DialogEditModuleText( PCB_BASE_FRAME* parent, + TEXTE_MODULE* TextMod, wxDC* DC ) : DialogEditModuleText_base(parent) { diff --git a/pcbnew/dialogs/dialog_freeroute_exchange.cpp b/pcbnew/dialogs/dialog_freeroute_exchange.cpp index 43c3ecb929..be0240f073 100644 --- a/pcbnew/dialogs/dialog_freeroute_exchange.cpp +++ b/pcbnew/dialogs/dialog_freeroute_exchange.cpp @@ -19,7 +19,7 @@ /**********************************************************************/ -void WinEDA_PcbFrame::Access_to_External_Tool( wxCommandEvent& event ) +void PCB_EDIT_FRAME::Access_to_External_Tool( wxCommandEvent& event ) /**********************************************************************/ /* Run an external tool (currently, only freeroute) @@ -31,7 +31,7 @@ void WinEDA_PcbFrame::Access_to_External_Tool( wxCommandEvent& event ) -DIALOG_FREEROUTE::DIALOG_FREEROUTE( WinEDA_PcbFrame* parent ): +DIALOG_FREEROUTE::DIALOG_FREEROUTE( PCB_EDIT_FRAME* parent ): DIALOG_FREEROUTE_BASE( parent ) { m_Parent = parent; diff --git a/pcbnew/dialogs/dialog_freeroute_exchange.h b/pcbnew/dialogs/dialog_freeroute_exchange.h index a4850f98e6..451275b42e 100644 --- a/pcbnew/dialogs/dialog_freeroute_exchange.h +++ b/pcbnew/dialogs/dialog_freeroute_exchange.h @@ -14,7 +14,7 @@ class DIALOG_FREEROUTE : public DIALOG_FREEROUTE_BASE { private: - WinEDA_PcbFrame* m_Parent; + PCB_EDIT_FRAME* m_Parent; bool m_FreeRouteSetupChanged; private: @@ -31,7 +31,7 @@ private: public: - DIALOG_FREEROUTE( WinEDA_PcbFrame* parent ); + DIALOG_FREEROUTE( PCB_EDIT_FRAME* parent ); ~DIALOG_FREEROUTE() {}; }; diff --git a/pcbnew/dialogs/dialog_gendrill.cpp b/pcbnew/dialogs/dialog_gendrill.cpp index 5b74bb330c..27d64b03a9 100644 --- a/pcbnew/dialogs/dialog_gendrill.cpp +++ b/pcbnew/dialogs/dialog_gendrill.cpp @@ -56,7 +56,7 @@ static DRILL_PRECISION precisionListForMetric[] = }; -DIALOG_GENDRILL::DIALOG_GENDRILL( WinEDA_PcbFrame* parent ) : +DIALOG_GENDRILL::DIALOG_GENDRILL( PCB_EDIT_FRAME* parent ) : DIALOG_GENDRILL_BASE( parent ) { m_Parent = parent; diff --git a/pcbnew/dialogs/dialog_gendrill.h b/pcbnew/dialogs/dialog_gendrill.h index ad7456da36..b705037865 100644 --- a/pcbnew/dialogs/dialog_gendrill.h +++ b/pcbnew/dialogs/dialog_gendrill.h @@ -45,13 +45,13 @@ public: wxPoint m_FileDrillOffset; // Drill offset: 0,0 for absolute coordiantes, or auxialry axis origin private: - WinEDA_PcbFrame* m_Parent; + PCB_EDIT_FRAME* m_Parent; int m_PadsHoleCount; int m_ThroughViasCount; int m_MicroViasCount; int m_BlindOrBuriedViasCount; -public: DIALOG_GENDRILL( WinEDA_PcbFrame* parent ); +public: DIALOG_GENDRILL( PCB_EDIT_FRAME* parent ); ~DIALOG_GENDRILL(); private: diff --git a/pcbnew/dialogs/dialog_general_options.cpp b/pcbnew/dialogs/dialog_general_options.cpp index c2d5dee2f6..70c8b400a4 100644 --- a/pcbnew/dialogs/dialog_general_options.cpp +++ b/pcbnew/dialogs/dialog_general_options.cpp @@ -19,7 +19,7 @@ #include "pcbnew_id.h" -Dialog_GeneralOptions::Dialog_GeneralOptions( WinEDA_PcbFrame* parent ) : +Dialog_GeneralOptions::Dialog_GeneralOptions( PCB_EDIT_FRAME* parent ) : DialogGeneralOptionsBoardEditor_base( parent ) { m_Parent = parent; @@ -106,7 +106,7 @@ void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event ) /* Must be called on a click on the left toolbar (options toolbar * Update variables according to tools states */ -void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event ) +void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) { int id = event.GetId(); bool state = m_OptionsToolBar->GetToolState( id ); @@ -182,7 +182,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event ) default: DisplayError( this, - wxT( "WinEDA_PcbFrame::OnSelectOptionToolbar error \n (event not handled!)" ) ); + wxT( "PCB_EDIT_FRAME::OnSelectOptionToolbar error \n (event not handled!)" ) ); break; } } diff --git a/pcbnew/dialogs/dialog_general_options.h b/pcbnew/dialogs/dialog_general_options.h index 8bad664f8b..4538c0616b 100644 --- a/pcbnew/dialogs/dialog_general_options.h +++ b/pcbnew/dialogs/dialog_general_options.h @@ -8,13 +8,13 @@ class Dialog_GeneralOptions : public DialogGeneralOptionsBoardEditor_base /***********************************************************************/ { private: - WinEDA_PcbFrame* m_Parent; + PCB_EDIT_FRAME* m_Parent; BOARD * m_Board; void init(); public: - Dialog_GeneralOptions( WinEDA_PcbFrame* parent ); + Dialog_GeneralOptions( PCB_EDIT_FRAME* parent ); ~Dialog_GeneralOptions() {}; void OnOkClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event ); diff --git a/pcbnew/dialogs/dialog_global_deletion.cpp b/pcbnew/dialogs/dialog_global_deletion.cpp index dc5abe123e..05a91e3669 100644 --- a/pcbnew/dialogs/dialog_global_deletion.cpp +++ b/pcbnew/dialogs/dialog_global_deletion.cpp @@ -13,7 +13,7 @@ #include "dialog_global_deletion.h" -DIALOG_GLOBAL_DELETION::DIALOG_GLOBAL_DELETION( WinEDA_PcbFrame* parent ) +DIALOG_GLOBAL_DELETION::DIALOG_GLOBAL_DELETION( PCB_EDIT_FRAME* parent ) : DIALOG_GLOBAL_DELETION_BASE( parent ) { m_Parent = parent; @@ -25,7 +25,7 @@ DIALOG_GLOBAL_DELETION::DIALOG_GLOBAL_DELETION( WinEDA_PcbFrame* parent ) /********************************************************************/ -void WinEDA_PcbFrame::InstallPcbGlobalDeleteFrame( const wxPoint& pos ) +void PCB_EDIT_FRAME::InstallPcbGlobalDeleteFrame( const wxPoint& pos ) /********************************************************************/ { DIALOG_GLOBAL_DELETION dlg( this ); diff --git a/pcbnew/dialogs/dialog_global_deletion.h b/pcbnew/dialogs/dialog_global_deletion.h index 7890f65d67..f6c1a85187 100644 --- a/pcbnew/dialogs/dialog_global_deletion.h +++ b/pcbnew/dialogs/dialog_global_deletion.h @@ -10,10 +10,10 @@ class DIALOG_GLOBAL_DELETION: public DIALOG_GLOBAL_DELETION_BASE { private: - WinEDA_PcbFrame * m_Parent; + PCB_EDIT_FRAME * m_Parent; public: - DIALOG_GLOBAL_DELETION( WinEDA_PcbFrame* parent ); + DIALOG_GLOBAL_DELETION( PCB_EDIT_FRAME* parent ); private: void OnOkClick( wxCommandEvent& event ) diff --git a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp index ff69f13f7e..fda08ee743 100644 --- a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp +++ b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp @@ -21,8 +21,8 @@ * automatically created by wxFormBuilder */ -DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS( - WinEDA_PcbFrame* aParent, int aNetcode ) : +DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS( PCB_EDIT_FRAME* aParent, + int aNetcode ) : DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE( aParent ) { m_Parent = aParent; diff --git a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.h b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.h index 1fa48d76ba..0fa7f30c10 100644 --- a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.h +++ b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.h @@ -34,12 +34,12 @@ class DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS : public DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE { private: - WinEDA_PcbFrame* m_Parent; + PCB_EDIT_FRAME* m_Parent; int m_Netcode; int m_OptionID; public: - DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS( WinEDA_PcbFrame* aParent, int aNetcode ); + DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS( PCB_EDIT_FRAME* aParent, int aNetcode ); ~DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS() {}; // Virtual event handlers, overided here diff --git a/pcbnew/dialogs/dialog_graphic_item_properties.cpp b/pcbnew/dialogs/dialog_graphic_item_properties.cpp index 08daea0baf..6cd2b9c577 100644 --- a/pcbnew/dialogs/dialog_graphic_item_properties.cpp +++ b/pcbnew/dialogs/dialog_graphic_item_properties.cpp @@ -26,13 +26,13 @@ class DialogGraphicItemProperties: public DialogGraphicItemProperties_base { private: - WinEDA_PcbFrame* m_Parent; + PCB_EDIT_FRAME* m_Parent; wxDC* m_DC; DRAWSEGMENT* m_Item; BOARD_DESIGN_SETTINGS* m_BrdSettings; public: - DialogGraphicItemProperties( WinEDA_PcbFrame* aParent, DRAWSEGMENT * aItem, wxDC * aDC); + DialogGraphicItemProperties( PCB_EDIT_FRAME* aParent, DRAWSEGMENT * aItem, wxDC * aDC); ~DialogGraphicItemProperties() {}; private: @@ -42,7 +42,8 @@ private: void OnLayerChoice( wxCommandEvent& event ); }; -DialogGraphicItemProperties::DialogGraphicItemProperties( WinEDA_PcbFrame* aParent, DRAWSEGMENT * aItem, wxDC * aDC): +DialogGraphicItemProperties::DialogGraphicItemProperties( PCB_EDIT_FRAME* aParent, + DRAWSEGMENT * aItem, wxDC * aDC): DialogGraphicItemProperties_base( aParent ) { m_Parent = aParent; @@ -56,7 +57,7 @@ DialogGraphicItemProperties::DialogGraphicItemProperties( WinEDA_PcbFrame* aPare /*******************************************************************************************/ -void WinEDA_PcbFrame::InstallGraphicItemPropertiesDialog(DRAWSEGMENT * aItem, wxDC* aDC) +void PCB_EDIT_FRAME::InstallGraphicItemPropertiesDialog(DRAWSEGMENT * aItem, wxDC* aDC) /*******************************************************************************************/ { if ( aItem == NULL ) diff --git a/pcbnew/dialogs/dialog_graphic_items_options.cpp b/pcbnew/dialogs/dialog_graphic_items_options.cpp index 9d89aca496..3dac269ad7 100644 --- a/pcbnew/dialogs/dialog_graphic_items_options.cpp +++ b/pcbnew/dialogs/dialog_graphic_items_options.cpp @@ -17,7 +17,7 @@ extern int g_DrawDefaultLineThickness; -void WinEDA_PcbFrame::OnConfigurePcbOptions( wxCommandEvent& aEvent ) +void PCB_EDIT_FRAME::OnConfigurePcbOptions( wxCommandEvent& aEvent ) { DIALOG_GRAPHIC_ITEMS_OPTIONS dlg( this ); @@ -36,7 +36,7 @@ void WinEDA_ModuleEditFrame::InstallOptionsFrame( const wxPoint& pos ) * DIALOG_GRAPHIC_ITEMS_OPTIONS constructor */ -DIALOG_GRAPHIC_ITEMS_OPTIONS::DIALOG_GRAPHIC_ITEMS_OPTIONS( WinEDA_BasePcbFrame* parent ) +DIALOG_GRAPHIC_ITEMS_OPTIONS::DIALOG_GRAPHIC_ITEMS_OPTIONS( PCB_BASE_FRAME* parent ) : DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE( parent ) { m_Parent = parent; diff --git a/pcbnew/dialogs/dialog_graphic_items_options.h b/pcbnew/dialogs/dialog_graphic_items_options.h index 742677564e..7956086b5e 100644 --- a/pcbnew/dialogs/dialog_graphic_items_options.h +++ b/pcbnew/dialogs/dialog_graphic_items_options.h @@ -24,7 +24,7 @@ * or you may write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - + #ifndef _DIALOG_GRAPHIC_ITEMS_OPTIONS_H_ #define _DIALOG_GRAPHIC_ITEMS_OPTIONS_H_ @@ -38,11 +38,11 @@ class DIALOG_GRAPHIC_ITEMS_OPTIONS: public DIALOG_GRAPHIC_ITEMS_OPTIONS_BASE { public: BOARD_DESIGN_SETTINGS* m_BrdSettings; - WinEDA_BasePcbFrame * m_Parent; + PCB_BASE_FRAME * m_Parent; public: - DIALOG_GRAPHIC_ITEMS_OPTIONS( WinEDA_BasePcbFrame* parent ); - ~DIALOG_GRAPHIC_ITEMS_OPTIONS( ); + DIALOG_GRAPHIC_ITEMS_OPTIONS( PCB_BASE_FRAME* parent ); + ~DIALOG_GRAPHIC_ITEMS_OPTIONS(); private: void initValues( ); diff --git a/pcbnew/dialogs/dialog_layers_setup.cpp b/pcbnew/dialogs/dialog_layers_setup.cpp index 987e22a2e8..0e1a1dd3a2 100644 --- a/pcbnew/dialogs/dialog_layers_setup.cpp +++ b/pcbnew/dialogs/dialog_layers_setup.cpp @@ -75,7 +75,7 @@ private: static wxPoint s_LastPos; static wxSize s_LastSize; - WinEDA_PcbFrame* m_Parent; + PCB_EDIT_FRAME* m_Parent; int m_CopperLayerCount; int m_EnabledLayers; @@ -154,7 +154,7 @@ private: public: - DIALOG_LAYERS_SETUP( WinEDA_PcbFrame* parent ); + DIALOG_LAYERS_SETUP( PCB_EDIT_FRAME* parent ); ~DIALOG_LAYERS_SETUP( ) { }; bool Show( bool show ); // overload stock function @@ -271,7 +271,7 @@ CTLs DIALOG_LAYERS_SETUP::getCTLs( int aLayerNumber ) /***********************************************************************************/ -DIALOG_LAYERS_SETUP::DIALOG_LAYERS_SETUP( WinEDA_PcbFrame* parent ) : +DIALOG_LAYERS_SETUP::DIALOG_LAYERS_SETUP( PCB_EDIT_FRAME* parent ) : DIALOG_LAYERS_SETUP_BASE( parent ) /***********************************************************************************/ { @@ -560,7 +560,7 @@ void DIALOG_LAYERS_SETUP::OnCopperLayersChoice( wxCommandEvent& event ) void DIALOG_LAYERS_SETUP::OnCancelButtonClick( wxCommandEvent& event ) /*****************************************************************/ { - EndModal( 0 ); + EndModal( wxID_CANCEL ); } @@ -698,8 +698,36 @@ bool DIALOG_LAYERS_SETUP::testLayerNames() } -void WinEDA_PcbFrame::InstallDialogLayerSetup() +void PCB_EDIT_FRAME::InstallDialogLayerSetup() { DIALOG_LAYERS_SETUP dlg( this ); - dlg.ShowModal(); + + if( dlg.ShowModal() == wxID_CANCEL ) + return; + + wxLogDebug( wxT( "Current layer selected %d." ), getActiveLayer() ); + + // If the current active layer was removed, find the next avaiable layer to set as the + // active layer. + if( ( ( 1 << getActiveLayer() ) & GetBoard()->GetEnabledLayers() ) == 0 ) + { + for( int i = 0; i < LAYER_COUNT; i++ ) + { + int tmp = i; + + if( i >= LAYER_COUNT ) + tmp = i - LAYER_COUNT; + + if( ( 1 << tmp ) & GetBoard()->GetEnabledLayers() ) + { + wxLogDebug( wxT( "Setting current layer to %d." ), getActiveLayer() ); + setActiveLayer( tmp, true ); + break; + } + } + } + else + { + setActiveLayer( getActiveLayer(), true ); + } } diff --git a/pcbnew/dialogs/dialog_mask_clearance.cpp b/pcbnew/dialogs/dialog_mask_clearance.cpp index f1cc682ff7..548cd5b83f 100644 --- a/pcbnew/dialogs/dialog_mask_clearance.cpp +++ b/pcbnew/dialogs/dialog_mask_clearance.cpp @@ -22,7 +22,7 @@ * automatically created by wxFormBuilder */ -DIALOG_PADS_MASK_CLEARANCE::DIALOG_PADS_MASK_CLEARANCE( WinEDA_PcbFrame* parent ) : +DIALOG_PADS_MASK_CLEARANCE::DIALOG_PADS_MASK_CLEARANCE( PCB_EDIT_FRAME* parent ) : DIALOG_PADS_MASK_CLEARANCE_BASE( parent ) { m_Parent = parent; diff --git a/pcbnew/dialogs/dialog_mask_clearance.h b/pcbnew/dialogs/dialog_mask_clearance.h index 022aba3a7f..20e91ba978 100644 --- a/pcbnew/dialogs/dialog_mask_clearance.h +++ b/pcbnew/dialogs/dialog_mask_clearance.h @@ -19,11 +19,11 @@ class DIALOG_PADS_MASK_CLEARANCE : public DIALOG_PADS_MASK_CLEARANCE_BASE { private: - WinEDA_PcbFrame* m_Parent; + PCB_EDIT_FRAME* m_Parent; BOARD_DESIGN_SETTINGS* m_BrdSettings; public: - DIALOG_PADS_MASK_CLEARANCE( WinEDA_PcbFrame* parent ); + DIALOG_PADS_MASK_CLEARANCE( PCB_EDIT_FRAME* parent ); ~DIALOG_PADS_MASK_CLEARANCE() {}; private: void MyInit(); diff --git a/pcbnew/dialogs/dialog_netlist.cpp b/pcbnew/dialogs/dialog_netlist.cpp index 5c8485ac56..fbbc0741c1 100644 --- a/pcbnew/dialogs/dialog_netlist.cpp +++ b/pcbnew/dialogs/dialog_netlist.cpp @@ -18,7 +18,7 @@ extern void TestFor_Duplicate_Missing_And_Extra_Footprints( wxWindow* fram -void WinEDA_PcbFrame::InstallNetlistFrame( wxDC* DC, const wxPoint& pos ) +void PCB_EDIT_FRAME::InstallNetlistFrame( wxDC* DC, const wxPoint& pos ) { /* Setup the netlist file name to the last net list file read or the board file * name if no last file read is not set. @@ -37,7 +37,7 @@ void WinEDA_PcbFrame::InstallNetlistFrame( wxDC* DC, const wxPoint& pos ) } -DIALOG_NETLIST::DIALOG_NETLIST( WinEDA_PcbFrame* aParent, wxDC * aDC, +DIALOG_NETLIST::DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, wxDC * aDC, const wxString & aNetlistFull_Filename ) : DIALOG_NETLIST_FBP( aParent ) { diff --git a/pcbnew/dialogs/dialog_netlist.h b/pcbnew/dialogs/dialog_netlist.h index 133bf1adb7..3535e8c539 100644 --- a/pcbnew/dialogs/dialog_netlist.h +++ b/pcbnew/dialogs/dialog_netlist.h @@ -15,12 +15,13 @@ class DIALOG_NETLIST : public DIALOG_NETLIST_FBP { private: - WinEDA_PcbFrame * m_Parent; + PCB_EDIT_FRAME * m_Parent; wxDC * m_DC; public: - DIALOG_NETLIST( WinEDA_PcbFrame* aParent, wxDC * aDC, const wxString & aNetlistFull_Filename ); + DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, wxDC * aDC, + const wxString & aNetlistFull_Filename ); ~DIALOG_NETLIST() {}; void Init(); diff --git a/pcbnew/dialogs/dialog_orient_footprints.cpp b/pcbnew/dialogs/dialog_orient_footprints.cpp index e048bb8215..fc9be7b2c4 100644 --- a/pcbnew/dialogs/dialog_orient_footprints.cpp +++ b/pcbnew/dialogs/dialog_orient_footprints.cpp @@ -44,13 +44,13 @@ class DIALOG_ORIENT_FOOTPRINTS: public DIALOG_ORIENT_FOOTPRINTS_BASE { private: - WinEDA_PcbFrame * m_Parent; + PCB_EDIT_FRAME * m_Parent; static int newOrientation; public: - DIALOG_ORIENT_FOOTPRINTS( WinEDA_PcbFrame* parent ); + DIALOG_ORIENT_FOOTPRINTS( PCB_EDIT_FRAME* parent ); ~DIALOG_ORIENT_FOOTPRINTS() {} - + bool ApplyToLockedModules() { return m_ApplyToLocked->IsChecked(); @@ -73,7 +73,7 @@ private: int DIALOG_ORIENT_FOOTPRINTS::newOrientation = 0; -DIALOG_ORIENT_FOOTPRINTS::DIALOG_ORIENT_FOOTPRINTS( WinEDA_PcbFrame* parent ) +DIALOG_ORIENT_FOOTPRINTS::DIALOG_ORIENT_FOOTPRINTS( PCB_EDIT_FRAME* parent ) : DIALOG_ORIENT_FOOTPRINTS_BASE( parent ) { m_Parent = parent; @@ -87,7 +87,7 @@ DIALOG_ORIENT_FOOTPRINTS::DIALOG_ORIENT_FOOTPRINTS( WinEDA_PcbFrame* parent ) /****************************************************************/ -void WinEDA_PcbFrame::OnOrientFootprints( wxCommandEvent& event ) +void PCB_EDIT_FRAME::OnOrientFootprints( wxCommandEvent& event ) /****************************************************************/ /** * Function OnOrientFootprints @@ -108,8 +108,8 @@ void WinEDA_PcbFrame::OnOrientFootprints( wxCommandEvent& event ) /*******************************************************************/ -bool WinEDA_PcbFrame::ReOrientModules( const wxString& ModuleMask, - int Orient, bool include_fixe ) +bool PCB_EDIT_FRAME::ReOrientModules( const wxString& ModuleMask, + int Orient, bool include_fixe ) /*******************************************************************/ /** * Function ReOrientModules @@ -141,7 +141,7 @@ bool WinEDA_PcbFrame::ReOrientModules( const wxString& ModuleMask, if ( modified ) OnModify(); - + return modified; } diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index 277f8f1dc3..090ffe4ce1 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -53,7 +53,7 @@ extern int ChangeSideMaskLayer( int masque ); class DIALOG_PAD_PROPERTIES : public DIALOG_PAD_PROPERTIES_BASE { private: - WinEDA_BasePcbFrame* m_Parent; + PCB_BASE_FRAME* m_Parent; D_PAD* m_CurrentPad; // Pad currently edited D_PAD* m_dummyPad; // a working copy used to show changes BOARD* m_Board; @@ -63,7 +63,7 @@ private: bool m_canUpdate; public: - DIALOG_PAD_PROPERTIES( WinEDA_BasePcbFrame* parent, D_PAD* Pad ); + DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* parent, D_PAD* Pad ); ~DIALOG_PAD_PROPERTIES() { delete m_dummyPad; @@ -140,7 +140,7 @@ void DIALOG_PAD_PROPERTIES::OnPaintShowPanel( wxPaintEvent& event ) /*******************************************************************************************/ -DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( WinEDA_BasePcbFrame* parent, D_PAD* Pad ) : +DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* parent, D_PAD* Pad ) : DIALOG_PAD_PROPERTIES_BASE( parent ) /*******************************************************************************************/ { @@ -163,7 +163,7 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( WinEDA_BasePcbFrame* parent, D_PAD } -void WinEDA_BasePcbFrame::InstallPadOptionsFrame( D_PAD* Pad ) +void PCB_BASE_FRAME::InstallPadOptionsFrame( D_PAD* Pad ) { DIALOG_PAD_PROPERTIES dlg( this, Pad ); diff --git a/pcbnew/dialogs/dialog_pcb_text_properties.cpp b/pcbnew/dialogs/dialog_pcb_text_properties.cpp index e6686b3c85..135249065c 100644 --- a/pcbnew/dialogs/dialog_pcb_text_properties.cpp +++ b/pcbnew/dialogs/dialog_pcb_text_properties.cpp @@ -44,7 +44,8 @@ * wxFormBuilder. */ -DIALOG_PCB_TEXT_PROPERTIES::DIALOG_PCB_TEXT_PROPERTIES( WinEDA_PcbFrame* parent, TEXTE_PCB* passedTextPCB, wxDC* DC ) +DIALOG_PCB_TEXT_PROPERTIES::DIALOG_PCB_TEXT_PROPERTIES( PCB_EDIT_FRAME* parent, + TEXTE_PCB* passedTextPCB, wxDC* DC ) : DIALOG_PCB_TEXT_PROPERTIES_BASE( parent ) { m_Parent = parent; @@ -59,7 +60,7 @@ DIALOG_PCB_TEXT_PROPERTIES::DIALOG_PCB_TEXT_PROPERTIES( WinEDA_PcbFrame* parent, /** * Routine for main window class to launch text properties dialog. */ -void WinEDA_PcbFrame::InstallTextPCBOptionsFrame( TEXTE_PCB* TextPCB, wxDC* DC ) +void PCB_EDIT_FRAME::InstallTextPCBOptionsFrame( TEXTE_PCB* TextPCB, wxDC* DC ) { DrawPanel->m_IgnoreMouseEvents = TRUE; DIALOG_PCB_TEXT_PROPERTIES dlg( this, TextPCB, DC ); diff --git a/pcbnew/dialogs/dialog_pcb_text_properties.h b/pcbnew/dialogs/dialog_pcb_text_properties.h index 5362612e15..2e2cf739e3 100644 --- a/pcbnew/dialogs/dialog_pcb_text_properties.h +++ b/pcbnew/dialogs/dialog_pcb_text_properties.h @@ -10,7 +10,7 @@ Subclass of DIALOG_PCB_TEXT_PROPERTIES_BASE, which is generated by wxFormBuilder //// end generated include -class WinEDA_PcbFrame; +class PCB_EDIT_FRAME; class wxDC; class TEXTE_PCB; @@ -18,7 +18,7 @@ class TEXTE_PCB; class DIALOG_PCB_TEXT_PROPERTIES : public DIALOG_PCB_TEXT_PROPERTIES_BASE { private: - WinEDA_PcbFrame* m_Parent; + PCB_EDIT_FRAME* m_Parent; wxDC* m_DC; TEXTE_PCB* m_SelectedPCBText; @@ -30,7 +30,7 @@ protected: void OnOkClick( wxCommandEvent& event ); public: - DIALOG_PCB_TEXT_PROPERTIES( WinEDA_PcbFrame* parent, TEXTE_PCB* passedTextPCB, wxDC* DC ); + DIALOG_PCB_TEXT_PROPERTIES( PCB_EDIT_FRAME* parent, TEXTE_PCB* passedTextPCB, wxDC* DC ); //// end generated class members }; diff --git a/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.cpp b/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.cpp index 23d640470b..a9889ba58a 100644 --- a/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.cpp +++ b/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.cpp @@ -21,7 +21,7 @@ /*****************************************************************/ -void WinEDA_PcbFrame::InstallConfigFrame( const wxPoint& pos ) +void PCB_EDIT_FRAME::InstallConfigFrame( const wxPoint& pos ) /*****************************************************************/ { DIALOG_PCBNEW_CONFIG_LIBS dialog( this ); @@ -29,7 +29,7 @@ void WinEDA_PcbFrame::InstallConfigFrame( const wxPoint& pos ) } -DIALOG_PCBNEW_CONFIG_LIBS::DIALOG_PCBNEW_CONFIG_LIBS( WinEDA_PcbFrame* parent ): +DIALOG_PCBNEW_CONFIG_LIBS::DIALOG_PCBNEW_CONFIG_LIBS( PCB_EDIT_FRAME* parent ): DIALOG_PCBNEW_CONFIG_LIBS_FBP(parent) { m_Parent = parent; diff --git a/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.h b/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.h index e18e642b17..644ce60772 100644 --- a/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.h +++ b/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.h @@ -12,7 +12,7 @@ class DIALOG_PCBNEW_CONFIG_LIBS : public DIALOG_PCBNEW_CONFIG_LIBS_FBP { private: - WinEDA_PcbFrame* m_Parent; + PCB_EDIT_FRAME* m_Parent; wxConfig * m_Config; bool m_LibListChanged; bool m_LibPathChanged; @@ -36,7 +36,7 @@ private: public: - DIALOG_PCBNEW_CONFIG_LIBS( WinEDA_PcbFrame * parent ); + DIALOG_PCBNEW_CONFIG_LIBS( PCB_EDIT_FRAME * parent ); ~DIALOG_PCBNEW_CONFIG_LIBS() {}; }; diff --git a/pcbnew/dialogs/dialog_print_using_printer.cpp b/pcbnew/dialogs/dialog_print_using_printer.cpp index e89d2b55fd..719fde4b89 100644 --- a/pcbnew/dialogs/dialog_print_using_printer.cpp +++ b/pcbnew/dialogs/dialog_print_using_printer.cpp @@ -47,15 +47,15 @@ static PRINT_PARAMETERS s_Parameters; class DIALOG_PRINT_USING_PRINTER : public DIALOG_PRINT_USING_PRINTER_base { private: - WinEDA_PcbFrame* m_Parent; - wxConfig* m_Config; - wxCheckBox* m_BoxSelectLayer[32]; - static bool m_ExcludeEdgeLayer; - static wxPoint s_LastPos; - static wxSize s_LastSize; + PCB_EDIT_FRAME* m_Parent; + wxConfig* m_Config; + wxCheckBox* m_BoxSelectLayer[32]; + static bool m_ExcludeEdgeLayer; + static wxPoint s_LastPos; + static wxSize s_LastSize; public: - DIALOG_PRINT_USING_PRINTER( WinEDA_PcbFrame* parent ); + DIALOG_PRINT_USING_PRINTER( PCB_EDIT_FRAME* parent ); ~DIALOG_PRINT_USING_PRINTER() {}; private: @@ -88,7 +88,7 @@ wxSize DIALOG_PRINT_USING_PRINTER::s_LastSize; /*******************************************************/ -void WinEDA_PcbFrame::ToPrinter( wxCommandEvent& event ) +void PCB_EDIT_FRAME::ToPrinter( wxCommandEvent& event ) /*******************************************************/ /* Virtual function: @@ -114,7 +114,7 @@ void WinEDA_PcbFrame::ToPrinter( wxCommandEvent& event ) /*************************************************************************************/ -DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER( WinEDA_PcbFrame* parent ) : +DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER( PCB_EDIT_FRAME* parent ) : DIALOG_PRINT_USING_PRINTER_base( parent ) /*************************************************************************************/ { diff --git a/pcbnew/dimension.cpp b/pcbnew/dimension.cpp index 3d0a91dacc..cacd4e1b9d 100644 --- a/pcbnew/dimension.cpp +++ b/pcbnew/dimension.cpp @@ -42,7 +42,7 @@ class DIMENSION_EDITOR_DIALOG : public wxDialog { private: - WinEDA_PcbFrame* m_Parent; + PCB_EDIT_FRAME* m_Parent; wxDC* m_DC; DIMENSION* CurrentDimension; WinEDA_EnterText* m_Name; @@ -54,8 +54,7 @@ private: public: // Constructor and destructor - DIMENSION_EDITOR_DIALOG( WinEDA_PcbFrame* parent, - DIMENSION* Dimension, wxDC* DC ); + DIMENSION_EDITOR_DIALOG( PCB_EDIT_FRAME* parent, DIMENSION* Dimension, wxDC* DC ); ~DIMENSION_EDITOR_DIALOG() { } @@ -74,7 +73,7 @@ BEGIN_EVENT_TABLE( DIMENSION_EDITOR_DIALOG, wxDialog ) END_EVENT_TABLE() -DIMENSION_EDITOR_DIALOG::DIMENSION_EDITOR_DIALOG( WinEDA_PcbFrame* parent, +DIMENSION_EDITOR_DIALOG::DIMENSION_EDITOR_DIALOG( PCB_EDIT_FRAME* parent, DIMENSION* Dimension, wxDC* DC ) : wxDialog( parent, -1, wxString( _( "Dimension properties" ) ) ) @@ -211,12 +210,12 @@ static void Exit_EditDimension( EDA_DRAW_PANEL* Panel, wxDC* DC ) } status_dimension = 0; - ((WinEDA_PcbFrame*)Panel->GetParent())->SetCurItem( NULL ); + ((PCB_EDIT_FRAME*)Panel->GetParent())->SetCurItem( NULL ); } /*************************************************************************/ -DIMENSION* WinEDA_PcbFrame::Begin_Dimension( DIMENSION* Dimension, wxDC* DC ) +DIMENSION* PCB_EDIT_FRAME::Begin_Dimension( DIMENSION* Dimension, wxDC* DC ) /*************************************************************************/ { wxPoint pos; @@ -347,7 +346,7 @@ static void Montre_Position_New_Dimension( EDA_DRAW_PANEL* aPanel, wxDC* aDC, /***************************************************************/ -void WinEDA_PcbFrame::Install_Edit_Dimension( DIMENSION* Dimension, wxDC* DC ) +void PCB_EDIT_FRAME::Install_Edit_Dimension( DIMENSION* Dimension, wxDC* DC ) /***************************************************************/ { if( Dimension == NULL ) @@ -360,7 +359,7 @@ void WinEDA_PcbFrame::Install_Edit_Dimension( DIMENSION* Dimension, wxDC* DC ) /*******************************************************************/ -void WinEDA_PcbFrame::Delete_Dimension( DIMENSION* Dimension, wxDC* DC ) +void PCB_EDIT_FRAME::Delete_Dimension( DIMENSION* Dimension, wxDC* DC ) /*******************************************************************/ { if( Dimension == NULL ) diff --git a/pcbnew/dragsegm.cpp b/pcbnew/dragsegm.cpp index 012c7d02e1..37d74bd830 100644 --- a/pcbnew/dragsegm.cpp +++ b/pcbnew/dragsegm.cpp @@ -98,7 +98,7 @@ void Build_1_Pad_SegmentsToDrag( EDA_DRAW_PANEL* panel, wxDC* DC, D_PAD* PtPad ) int net_code = PtPad->GetNet(); int MasqueLayer; wxPoint pos; - BOARD* pcb = ( (WinEDA_BasePcbFrame*)( panel->GetParent() ) )->GetBoard(); + BOARD* pcb = ( (PCB_BASE_FRAME*)( panel->GetParent() ) )->GetBoard(); Track = pcb->m_Track->GetStartNetCode( net_code ); @@ -166,7 +166,7 @@ void Collect_TrackSegmentsToDrag( EDA_DRAW_PANEL* panel, wxDC* DC, * @param aRefPos = reference point of connection */ { - BOARD* pcb = ( (WinEDA_BasePcbFrame*)( panel->GetParent() ) )->GetBoard(); + BOARD* pcb = ( (PCB_BASE_FRAME*)( panel->GetParent() ) )->GetBoard(); TRACK* track = pcb->m_Track->GetStartNetCode( net_code ); diff --git a/pcbnew/drc.cpp b/pcbnew/drc.cpp index cef434dbeb..0c9109633c 100644 --- a/pcbnew/drc.cpp +++ b/pcbnew/drc.cpp @@ -87,7 +87,7 @@ void DRC::DestroyDialog( int aReason ) } -DRC::DRC( WinEDA_PcbFrame* aPcbWindow ) +DRC::DRC( PCB_EDIT_FRAME* aPcbWindow ) { m_mainWindow = aPcbWindow; m_pcb = aPcbWindow->GetBoard(); diff --git a/pcbnew/drc_stuff.h b/pcbnew/drc_stuff.h index ec256ee4c3..f929dd2646 100644 --- a/pcbnew/drc_stuff.h +++ b/pcbnew/drc_stuff.h @@ -178,7 +178,7 @@ private: int m_xcliphi; int m_ycliphi; - WinEDA_PcbFrame* m_mainWindow; + PCB_EDIT_FRAME* m_mainWindow; BOARD* m_pcb; DIALOG_DRC_CONTROL* m_ui; @@ -354,7 +354,7 @@ private: //-------------------------------------------------- public: - DRC( WinEDA_PcbFrame* aPcbWindow ); + DRC( PCB_EDIT_FRAME* aPcbWindow ); ~DRC(); diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index c5e71fc79c..b24edbdd41 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -25,11 +25,11 @@ // Uncomment following line to enable wxBell() command (which beeps speaker) // #include -static void Process_Move_Item( WinEDA_PcbFrame* frame, EDA_ITEM* DrawStruct, wxDC* DC ); +static void Process_Move_Item( PCB_EDIT_FRAME* frame, EDA_ITEM* DrawStruct, wxDC* DC ); /* Handles the selection of command events. */ -void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) +void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) { int id = event.GetId(); wxPoint pos; @@ -988,7 +988,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) default: wxString msg; msg.Printf( - wxT( "WinEDA_PcbFrame::Process_Special_Functions() id %d error" ), + wxT( "PCB_EDIT_FRAME::Process_Special_Functions() id %d error" ), DrawStruct->Type() ); DisplayError( this, msg ); @@ -1000,7 +1000,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) } -static void Process_Move_Item( WinEDA_PcbFrame* frame, EDA_ITEM* DrawStruct, wxDC* DC ) +static void Process_Move_Item( PCB_EDIT_FRAME* frame, EDA_ITEM* DrawStruct, wxDC* DC ) { if( DrawStruct == NULL ) return; @@ -1016,7 +1016,7 @@ static void Process_Move_Item( WinEDA_PcbFrame* frame, EDA_ITEM* DrawStruct, wxD default: wxString msg; msg.Printf( - wxT( "WinEDA_PcbFrame::Move_Item Error: Bad DrawType %d" ), + wxT( "PCB_EDIT_FRAME::Move_Item Error: Bad DrawType %d" ), DrawStruct->Type() ); DisplayError( frame, msg ); break; @@ -1024,7 +1024,7 @@ static void Process_Move_Item( WinEDA_PcbFrame* frame, EDA_ITEM* DrawStruct, wxD } -void WinEDA_PcbFrame::RemoveStruct( BOARD_ITEM* Item, wxDC* DC ) +void PCB_EDIT_FRAME::RemoveStruct( BOARD_ITEM* Item, wxDC* DC ) { if( Item == NULL ) return; @@ -1106,7 +1106,7 @@ void WinEDA_PcbFrame::RemoveStruct( BOARD_ITEM* Item, wxDC* DC ) } -void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer ) +void PCB_EDIT_FRAME::SwitchLayer( wxDC* DC, int layer ) { int curLayer = getActiveLayer(); @@ -1191,7 +1191,7 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer ) } -void WinEDA_PcbFrame::OnSelectTool( wxCommandEvent& aEvent ) +void PCB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent ) { int id = aEvent.GetId(); diff --git a/pcbnew/edit_pcb_text.cpp b/pcbnew/edit_pcb_text.cpp index f8f08a1f35..192a82e35c 100644 --- a/pcbnew/edit_pcb_text.cpp +++ b/pcbnew/edit_pcb_text.cpp @@ -33,7 +33,7 @@ static TEXTE_PCB s_TextCopy( (BOARD_ITEM*) NULL ); /* copy of the edited text void Abort_Edit_Pcb_Text( EDA_DRAW_PANEL* Panel, wxDC* DC ) { TEXTE_PCB* TextePcb = (TEXTE_PCB*) Panel->GetScreen()->GetCurItem(); - ( (WinEDA_PcbFrame*) Panel->GetParent() )->SetCurItem( NULL ); + ( (PCB_EDIT_FRAME*) Panel->GetParent() )->SetCurItem( NULL ); Panel->SetMouseCapture( NULL, NULL ); @@ -58,7 +58,7 @@ void Abort_Edit_Pcb_Text( EDA_DRAW_PANEL* Panel, wxDC* DC ) /* * Place the current text being moving */ -void WinEDA_PcbFrame::Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ) +void PCB_EDIT_FRAME::Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ) { DrawPanel->SetMouseCapture( NULL, NULL ); SetCurItem( NULL ); @@ -94,7 +94,7 @@ void WinEDA_PcbFrame::Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ) /* Initialize parameters to move a pcb text */ -void WinEDA_PcbFrame::StartMoveTextePcb( TEXTE_PCB* TextePcb, wxDC* DC ) +void PCB_EDIT_FRAME::StartMoveTextePcb( TEXTE_PCB* TextePcb, wxDC* DC ) { if( TextePcb == NULL ) return; @@ -130,7 +130,7 @@ static void Move_Texte_Pcb( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aP } -void WinEDA_PcbFrame::Delete_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ) +void PCB_EDIT_FRAME::Delete_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ) { if( TextePcb == NULL ) return; @@ -144,7 +144,7 @@ void WinEDA_PcbFrame::Delete_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ) } -TEXTE_PCB* WinEDA_PcbFrame::Create_Texte_Pcb( wxDC* DC ) +TEXTE_PCB* PCB_EDIT_FRAME::Create_Texte_Pcb( wxDC* DC ) { TEXTE_PCB* TextePcb; @@ -177,7 +177,7 @@ TEXTE_PCB* WinEDA_PcbFrame::Create_Texte_Pcb( wxDC* DC ) } -void WinEDA_PcbFrame::Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ) +void PCB_EDIT_FRAME::Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ) { int angle = 900; int drawmode = GR_XOR; diff --git a/pcbnew/edit_track_width.cpp b/pcbnew/edit_track_width.cpp index 5c8a39f9b6..95d4cad485 100644 --- a/pcbnew/edit_track_width.cpp +++ b/pcbnew/edit_track_width.cpp @@ -24,9 +24,9 @@ * @param aUseNetclassValue = true to use NetClass value, false to use g_DesignSettings value * @return true if done, false if no not change (because DRC error) */ -bool WinEDA_PcbFrame::SetTrackSegmentWidth( TRACK* aTrackItem, - PICKED_ITEMS_LIST* aItemsListPicker, - bool aUseNetclassValue ) +bool PCB_EDIT_FRAME::SetTrackSegmentWidth( TRACK* aTrackItem, + PICKED_ITEMS_LIST* aItemsListPicker, + bool aUseNetclassValue ) { int initial_width, new_width; int initial_drill = -1,new_drill = -1; @@ -113,7 +113,7 @@ bool WinEDA_PcbFrame::SetTrackSegmentWidth( TRACK* aTrackItem, * @param aDC = the curred device context (can be NULL) * @param aTrackItem = the track segment or via to modify */ -void WinEDA_PcbFrame::Edit_TrackSegm_Width( wxDC* aDC, TRACK* aTrackItem ) +void PCB_EDIT_FRAME::Edit_TrackSegm_Width( wxDC* aDC, TRACK* aTrackItem ) { PICKED_ITEMS_LIST itemsListPicker; bool change = SetTrackSegmentWidth( aTrackItem, &itemsListPicker, false ); @@ -142,7 +142,7 @@ void WinEDA_PcbFrame::Edit_TrackSegm_Width( wxDC* aDC, TRACK* aTrackItem ) * @param aDC = the curred device context (can be NULL) * @param aTrackSegment = a segment or via on the track to change */ -void WinEDA_PcbFrame::Edit_Track_Width( wxDC* aDC, TRACK* aTrackSegment ) +void PCB_EDIT_FRAME::Edit_Track_Width( wxDC* aDC, TRACK* aTrackSegment ) { TRACK* pt_track; int nb_segm; @@ -192,8 +192,7 @@ void WinEDA_PcbFrame::Edit_Track_Width( wxDC* aDC, TRACK* aTrackSegment ) * @param aUseNetclassValue : bool. True to use netclass values, false to use current values */ /***********************************************************/ -bool WinEDA_PcbFrame::Change_Net_Tracks_And_Vias_Sizes( - int aNetcode, bool aUseNetclassValue ) +bool PCB_EDIT_FRAME::Change_Net_Tracks_And_Vias_Sizes( int aNetcode, bool aUseNetclassValue ) /***********************************************************/ { TRACK* pt_segm; @@ -223,8 +222,7 @@ bool WinEDA_PcbFrame::Change_Net_Tracks_And_Vias_Sizes( /*************************************************************************/ -bool WinEDA_PcbFrame::Reset_All_Tracks_And_Vias_To_Netclass_Values( - bool aTrack, bool aVia ) +bool PCB_EDIT_FRAME::Reset_All_Tracks_And_Vias_To_Netclass_Values( bool aTrack, bool aVia ) /*************************************************************************/ { TRACK* pt_segm; diff --git a/pcbnew/editedge.cpp b/pcbnew/editedge.cpp index 28c5d353c4..93b6b044c4 100644 --- a/pcbnew/editedge.cpp +++ b/pcbnew/editedge.cpp @@ -26,7 +26,7 @@ static wxPoint s_LastPosition; // Current cursor position. /* Start move of a graphic element type DRAWSEGMENT */ -void WinEDA_PcbFrame::Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC ) +void PCB_EDIT_FRAME::Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC ) { if( drawitem == NULL ) return; @@ -43,7 +43,7 @@ void WinEDA_PcbFrame::Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC ) /* * Place graphic element of type DRAWSEGMENT. */ -void WinEDA_PcbFrame::Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC ) +void PCB_EDIT_FRAME::Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC ) { if( drawitem == NULL ) return; @@ -80,7 +80,7 @@ static void Move_Segment( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPos } -void WinEDA_PcbFrame::Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC ) +void PCB_EDIT_FRAME::Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC ) { EDA_ITEM* PtStruct; int track_fill_copy = DisplayOpt.DisplayDrawItems; @@ -112,7 +112,7 @@ void WinEDA_PcbFrame::Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC ) } -void WinEDA_PcbFrame::Delete_Drawings_All_Layer( int aLayer ) +void PCB_EDIT_FRAME::Delete_Drawings_All_Layer( int aLayer ) { if( aLayer <= LAST_COPPER_LAYER ) { @@ -192,13 +192,13 @@ static void Abort_EditEdge( EDA_DRAW_PANEL* Panel, wxDC* DC ) } Panel->SetMouseCapture( NULL, NULL ); - ( (WinEDA_PcbFrame*) Panel->GetParent() )->SetCurItem( NULL ); + ( (PCB_EDIT_FRAME*) Panel->GetParent() )->SetCurItem( NULL ); } /* Initialize the drawing of a segment of type other than trace. */ -DRAWSEGMENT* WinEDA_PcbFrame::Begin_DrawSegment( DRAWSEGMENT* Segment, +DRAWSEGMENT* PCB_EDIT_FRAME::Begin_DrawSegment( DRAWSEGMENT* Segment, int shape, wxDC* DC ) { int s_large; @@ -266,7 +266,7 @@ DRAWSEGMENT* WinEDA_PcbFrame::Begin_DrawSegment( DRAWSEGMENT* Segment, } -void WinEDA_PcbFrame::End_Edge( DRAWSEGMENT* Segment, wxDC* DC ) +void PCB_EDIT_FRAME::End_Edge( DRAWSEGMENT* Segment, wxDC* DC ) { if( Segment == NULL ) return; diff --git a/pcbnew/editmod.cpp b/pcbnew/editmod.cpp index bb8de1a7d5..c0034e61e5 100644 --- a/pcbnew/editmod.cpp +++ b/pcbnew/editmod.cpp @@ -19,7 +19,7 @@ /* * Show module property dialog. */ -void WinEDA_PcbFrame::InstallModuleOptionsFrame( MODULE* Module, wxDC* DC ) +void PCB_EDIT_FRAME::InstallModuleOptionsFrame( MODULE* Module, wxDC* DC ) { if( Module == NULL ) return; diff --git a/pcbnew/editrack-part2.cpp b/pcbnew/editrack-part2.cpp index cc6c53ddd6..92758660ff 100644 --- a/pcbnew/editrack-part2.cpp +++ b/pcbnew/editrack-part2.cpp @@ -21,7 +21,7 @@ * It is put on another layer of work, if possible * (Or DRC = Off). */ -void WinEDA_PcbFrame::ExChange_Track_Layer( TRACK* pt_segm, wxDC* DC ) +void PCB_EDIT_FRAME::ExChange_Track_Layer( TRACK* pt_segm, wxDC* DC ) { int ii; TRACK* pt_track; @@ -91,7 +91,7 @@ void WinEDA_PcbFrame::ExChange_Track_Layer( TRACK* pt_segm, wxDC* DC ) } -bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC ) +bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC ) { unsigned itmp; @@ -209,7 +209,7 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC ) // use the form of SetCurItem() which does not write to the msg panel, // SCREEN::SetCurItem(), so the DRC error remains on screen. - // WinEDA_PcbFrame::SetCurItem() calls DisplayInfo(). + // PCB_EDIT_FRAME::SetCurItem() calls DisplayInfo(). GetScreen()->SetCurItem( g_CurrentTrackSegment ); return false; @@ -265,7 +265,7 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC ) * The status of the net on top of the screen segment advanced by mouse. * PCB status or bottom of screen if no segment peak. */ -void WinEDA_PcbFrame::Affiche_Status_Net( wxDC* DC ) +void PCB_EDIT_FRAME::Affiche_Status_Net( wxDC* DC ) { TRACK* pt_segm; int masquelayer = (1 << getActiveLayer()); @@ -285,7 +285,7 @@ void WinEDA_PcbFrame::Affiche_Status_Net( wxDC* DC ) * The net edge pad with mouse or module locates the mouse. * Delete if the ratsnest if no module or pad is selected. */ -void WinEDA_PcbFrame::Show_1_Ratsnest( EDA_ITEM* item, wxDC* DC ) +void PCB_EDIT_FRAME::Show_1_Ratsnest( EDA_ITEM* item, wxDC* DC ) { D_PAD* pt_pad = NULL; MODULE* Module = NULL; @@ -378,7 +378,7 @@ void WinEDA_PcbFrame::Show_1_Ratsnest( EDA_ITEM* item, wxDC* DC ) /* High light the unconnected pads */ -void WinEDA_PcbFrame::Affiche_PadsNoConnect( wxDC* DC ) +void PCB_EDIT_FRAME::Affiche_PadsNoConnect( wxDC* DC ) { for( unsigned ii = 0; ii < GetBoard()->GetRatsnestsCount(); ii++ ) { diff --git a/pcbnew/editrack.cpp b/pcbnew/editrack.cpp index 0a8f2cddea..d645162263 100644 --- a/pcbnew/editrack.cpp +++ b/pcbnew/editrack.cpp @@ -36,8 +36,8 @@ static PICKED_ITEMS_LIST s_ItemsListPicker; */ static void Exit_Editrack( EDA_DRAW_PANEL* Panel, wxDC* DC ) { - WinEDA_PcbFrame* frame = (WinEDA_PcbFrame*) Panel->GetParent(); - TRACK* track = (TRACK*) frame->GetCurItem(); + PCB_EDIT_FRAME* frame = (PCB_EDIT_FRAME*) Panel->GetParent(); + TRACK* track = (TRACK*) frame->GetCurItem(); if( track && ( track->Type()==TYPE_VIA || track->Type()==TYPE_TRACK ) ) { @@ -77,7 +77,7 @@ static void Exit_Editrack( EDA_DRAW_PANEL* Panel, wxDC* DC ) * - Control DRC * - OK if DRC: adding a new track. */ -TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC ) +TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* DC ) { D_PAD* pt_pad = NULL; TRACK* TrackOnStartPoint = NULL; @@ -132,10 +132,9 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC ) else // no starting point, but a filled zone area can exist. This is // also a good starting point. { - ZONE_CONTAINER* zone = - GetBoard()->HitTestForAnyFilledArea( pos, - GetScreen()-> - m_Active_Layer ); + ZONE_CONTAINER* zone; + zone = GetBoard()->HitTestForAnyFilledArea( pos, GetScreen()-> m_Active_Layer ); + if( zone ) g_HighLight_NetCode = zone->GetNet(); } @@ -152,6 +151,7 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC ) g_CurrentTrackSegment->SetNet( g_HighLight_NetCode ); GetBoard()->SetCurrentNetClass( g_CurrentTrackSegment->GetNetClassName() ); m_TrackAndViasSizesList_Changed = true; + updateDesignRulesSelectBoxes(); g_CurrentTrackSegment->SetLayer( GetScreen()->m_Active_Layer ); g_CurrentTrackSegment->m_Width = GetBoard()->GetCurrentTrackWidth(); @@ -295,7 +295,7 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC ) * 1 if ok * 0 if not */ -bool WinEDA_PcbFrame::Add_45_degrees_Segment( wxDC* DC ) +bool PCB_EDIT_FRAME::Add_45_degrees_Segment( wxDC* DC ) { int pas_45; int dx0, dy0, dx1, dy1; @@ -416,7 +416,7 @@ bool WinEDA_PcbFrame::Add_45_degrees_Segment( wxDC* DC ) /* * End trace route in progress. */ -void WinEDA_PcbFrame::End_Route( TRACK* aTrack, wxDC* DC ) +void PCB_EDIT_FRAME::End_Route( TRACK* aTrack, wxDC* DC ) { int masquelayer = g_TabOneLayerMask[( (PCB_SCREEN*) GetScreen() )->m_Active_Layer]; @@ -605,8 +605,8 @@ TRACK* LocateIntrusion( TRACK* listStart, TRACK* aTrack, int aLayer, const wxPoi */ static void PushTrack( EDA_DRAW_PANEL* panel ) { - PCB_SCREEN* screen = ( (WinEDA_BasePcbFrame*) (panel->GetParent()) )->GetScreen(); - BOARD* pcb = ( (WinEDA_BasePcbFrame*) (panel->GetParent()) )->GetBoard(); + PCB_SCREEN* screen = ( (PCB_BASE_FRAME*) (panel->GetParent()) )->GetScreen(); + BOARD* pcb = ( (PCB_BASE_FRAME*) (panel->GetParent()) )->GetBoard(); wxPoint cursor = screen->GetCrossHairPosition(); wxPoint cv, vec, n; TRACK* track = g_CurrentTrackSegment; @@ -670,8 +670,8 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo { D( g_CurrentTrackList.VerifyListIntegrity(); ); - PCB_SCREEN* screen = (PCB_SCREEN*) aPanel->GetScreen(); - WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) aPanel->GetParent(); + PCB_SCREEN* screen = (PCB_SCREEN*) aPanel->GetScreen(); + PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) aPanel->GetParent(); bool Track_fill_copy = DisplayOpt.DisplayPcbTrackFill; DisplayOpt.DisplayPcbTrackFill = true; diff --git a/pcbnew/edtxtmod.cpp b/pcbnew/edtxtmod.cpp index b92a057c14..92425c1572 100644 --- a/pcbnew/edtxtmod.cpp +++ b/pcbnew/edtxtmod.cpp @@ -30,7 +30,7 @@ static int TextInitialOrientation; // module text initial orientation for * Note there always are 2 texts: reference and value. * New texts have the member TEXTE_MODULE.m_Type set to TEXT_is_DIVERS */ -TEXTE_MODULE* WinEDA_BasePcbFrame::CreateTextModule( MODULE* Module, wxDC* DC ) +TEXTE_MODULE* PCB_BASE_FRAME::CreateTextModule( MODULE* Module, wxDC* DC ) { TEXTE_MODULE* Text; @@ -67,7 +67,7 @@ TEXTE_MODULE* WinEDA_BasePcbFrame::CreateTextModule( MODULE* Module, wxDC* DC ) /* Rotate text 90 degrees. */ -void WinEDA_BasePcbFrame::RotateTextModule( TEXTE_MODULE* Text, wxDC* DC ) +void PCB_BASE_FRAME::RotateTextModule( TEXTE_MODULE* Text, wxDC* DC ) { if( Text == NULL ) return; @@ -100,7 +100,7 @@ void WinEDA_BasePcbFrame::RotateTextModule( TEXTE_MODULE* Text, wxDC* DC ) /* * Deletes text in module (if not the reference or value) */ -void WinEDA_BasePcbFrame::DeleteTextModule( TEXTE_MODULE* Text ) +void PCB_BASE_FRAME::DeleteTextModule( TEXTE_MODULE* Text ) { MODULE* Module; @@ -160,7 +160,7 @@ static void AbortMoveTextModule( EDA_DRAW_PANEL* Panel, wxDC* DC ) /* Start a text move. */ -void WinEDA_BasePcbFrame::StartMoveTexteModule( TEXTE_MODULE* Text, wxDC* DC ) +void PCB_BASE_FRAME::StartMoveTexteModule( TEXTE_MODULE* Text, wxDC* DC ) { MODULE* Module; @@ -194,7 +194,7 @@ void WinEDA_BasePcbFrame::StartMoveTexteModule( TEXTE_MODULE* Text, wxDC* DC ) /* Place the text a the cursor position when the left mouse button is clicked. */ -void WinEDA_BasePcbFrame::PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC ) +void PCB_BASE_FRAME::PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC ) { if( Text != NULL ) { @@ -263,7 +263,7 @@ static void Show_MoveTexte_Module( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo Text->Draw( aPanel, aDC, GR_XOR, MoveVector ); } -void WinEDA_BasePcbFrame::ResetTextSize( BOARD_ITEM* aItem, wxDC* aDC ) +void PCB_BASE_FRAME::ResetTextSize( BOARD_ITEM* aItem, wxDC* aDC ) { wxSize newSize; int newThickness; @@ -319,7 +319,7 @@ void WinEDA_BasePcbFrame::ResetTextSize( BOARD_ITEM* aItem, wxDC* aDC ) OnModify(); } -void WinEDA_BasePcbFrame::ResetModuleTextSizes( int aType, wxDC* aDC ) +void PCB_BASE_FRAME::ResetModuleTextSizes( int aType, wxDC* aDC ) { MODULE* module; BOARD_ITEM* boardItem; diff --git a/pcbnew/event_handlers_tracks_vias_sizes.cpp b/pcbnew/event_handlers_tracks_vias_sizes.cpp index 88ea48206f..96117343a5 100644 --- a/pcbnew/event_handlers_tracks_vias_sizes.cpp +++ b/pcbnew/event_handlers_tracks_vias_sizes.cpp @@ -22,7 +22,7 @@ * Event handler for tracks and vias size selection (and some options) * relative to toolbars and popup events */ -void WinEDA_PcbFrame::Tracks_and_Vias_Size_Event( wxCommandEvent& event ) +void PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event( wxCommandEvent& event ) { int ii; int id = event.GetId(); @@ -64,20 +64,19 @@ void WinEDA_PcbFrame::Tracks_and_Vias_Size_Event( wxCommandEvent& event ) GetBoard()->m_TrackWidthSelector = ii; break; - case ID_POPUP_PCB_SELECT_VIASIZE1: // this is the default Netclass selection - case ID_POPUP_PCB_SELECT_VIASIZE2: // this is a custom value selection + case ID_POPUP_PCB_SELECT_VIASIZE1: // this is the default Netclass selection + case ID_POPUP_PCB_SELECT_VIASIZE2: // this is a custom value selection case ID_POPUP_PCB_SELECT_VIASIZE3: case ID_POPUP_PCB_SELECT_VIASIZE4: case ID_POPUP_PCB_SELECT_VIASIZE5: case ID_POPUP_PCB_SELECT_VIASIZE6: case ID_POPUP_PCB_SELECT_VIASIZE7: - case ID_POPUP_PCB_SELECT_VIASIZE8: // select the new current value for via size (via diameter) + case ID_POPUP_PCB_SELECT_VIASIZE8: // select the new current value for via size (via diameter) DrawPanel->MoveCursorToCrossHair(); ii = id - ID_POPUP_PCB_SELECT_VIASIZE1; GetBoard()->m_ViaSizeSelector = ii; break; - case ID_AUX_TOOLBAR_PCB_TRACK_WIDTH: ii = m_SelTrackWidthBox->GetChoice(); GetBoard()->m_TrackWidthSelector = ii; @@ -85,11 +84,11 @@ void WinEDA_PcbFrame::Tracks_and_Vias_Size_Event( wxCommandEvent& event ) case ID_AUX_TOOLBAR_PCB_VIA_SIZE: ii = m_SelViaSizeBox->GetChoice(); - GetBoard()->m_ViaSizeSelector = ii; + GetBoard()->m_ViaSizeSelector = ii; break; default: - wxMessageBox( wxT( "WinEDA_PcbFrame::Tracks_and_Vias_Size_Event() error") ); + wxMessageBox( wxT( "PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event() error") ); break; } } diff --git a/pcbnew/export_gencad.cpp b/pcbnew/export_gencad.cpp index 298a83a199..625cbaf6ea 100644 --- a/pcbnew/export_gencad.cpp +++ b/pcbnew/export_gencad.cpp @@ -15,7 +15,7 @@ #include "build_version.h" -bool CreateHeaderInfoData( FILE* file, WinEDA_PcbFrame* frame ); +bool CreateHeaderInfoData( FILE* file, PCB_EDIT_FRAME* frame ); static void CreateTracksInfoData( FILE* file, BOARD* pcb ); static void CreateBoardSection( FILE* file, BOARD* pcb ); static void CreateComponentsSection( FILE* file, BOARD* pcb ); @@ -65,7 +65,7 @@ static int mapYto( int y ) /* * Creates an Export file (format GenCAD 1.4) from the current board. */ -void WinEDA_PcbFrame::ExportToGenCAD( wxCommandEvent& event ) +void PCB_EDIT_FRAME::ExportToGenCAD( wxCommandEvent& event ) { wxFileName fn = GetScreen()->GetFileName(); wxString msg, ext, wildcard; @@ -530,7 +530,7 @@ void CreateSignalsSection( FILE* file, BOARD* pcb ) /* Creates the section $HEADER ... $ENDHEADER */ -bool CreateHeaderInfoData( FILE* file, WinEDA_PcbFrame* frame ) +bool CreateHeaderInfoData( FILE* file, PCB_EDIT_FRAME* frame ) { wxString msg; PCB_SCREEN* screen = (PCB_SCREEN*) ( frame->GetScreen() ); diff --git a/pcbnew/export_vrml.cpp b/pcbnew/export_vrml.cpp index c263d915b0..37a87133de 100644 --- a/pcbnew/export_vrml.cpp +++ b/pcbnew/export_vrml.cpp @@ -26,7 +26,7 @@ class DIALOG_EXPORT_3DFILE : public DIALOG_EXPORT_3DFILE_BASE { private: - WinEDA_PcbFrame* m_parent; + PCB_EDIT_FRAME* m_parent; wxConfig* m_config; int m_unitsOpt; // to remember last option int m_3DFilesOpt; // to remember last option @@ -34,7 +34,7 @@ private: virtual void OnOkClick( wxCommandEvent& event ){ EndModal( wxID_OK ); } public: - DIALOG_EXPORT_3DFILE( WinEDA_PcbFrame* parent ) : + DIALOG_EXPORT_3DFILE( PCB_EDIT_FRAME* parent ) : DIALOG_EXPORT_3DFILE_BASE( parent ) { m_parent = parent; @@ -1126,7 +1126,7 @@ static void write_and_empty_triangle_bag( FILE* output_file, * Function OnExportVRML * will export the current BOARD to a VRML file. */ -void WinEDA_PcbFrame::OnExportVRML( wxCommandEvent& event ) +void PCB_EDIT_FRAME::OnExportVRML( wxCommandEvent& event ) { wxFileName fn; static wxString subDirFor3Dshapes = wxT("shapes3D"); @@ -1175,9 +1175,9 @@ wxBusyCursor dummy; * the full path name, changing the separators by underscore. * this is needed because files with the same shortname can exist in different directories */ -bool WinEDA_PcbFrame::ExportVRML_File( const wxString & aFullFileName, - double aScale, bool aExport3DFiles, - const wxString & a3D_Subdir ) +bool PCB_EDIT_FRAME::ExportVRML_File( const wxString & aFullFileName, + double aScale, bool aExport3DFiles, + const wxString & a3D_Subdir ) { wxString msg; FILE* output_file; diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index d94cb7adb1..b23507cf0d 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -19,7 +19,7 @@ #define BACKUP_FILE_EXT wxT( "000" ) -void WinEDA_PcbFrame::OnFileHistory( wxCommandEvent& event ) +void PCB_EDIT_FRAME::OnFileHistory( wxCommandEvent& event ) { wxString fn; @@ -36,7 +36,7 @@ void WinEDA_PcbFrame::OnFileHistory( wxCommandEvent& event ) /* Handle the read/write file commands */ -void WinEDA_PcbFrame::Files_io( wxCommandEvent& event ) +void PCB_EDIT_FRAME::Files_io( wxCommandEvent& event ) { int id = event.GetId(); wxString msg; @@ -129,8 +129,8 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event ) * * @return False if file load fails or is cancelled by the user, otherwise true. */ -bool WinEDA_PcbFrame::LoadOnePcbFile( const wxString& aFileName, bool aAppend, - bool aForceFileDialog ) +bool PCB_EDIT_FRAME::LoadOnePcbFile( const wxString& aFileName, bool aAppend, + bool aForceFileDialog ) { FILE* source; wxString msg; @@ -280,6 +280,10 @@ this file again." ) ); ReCreateLayerBox( NULL ); syncLayerWidget(); + updateDesignRulesSelectBoxes(); + updateTraceWidthSelectBox(); + updateViaSizeSelectBox(); + // Display the loaded board: Zoom_Automatique( false ); wxSafeYield(); // Needed if we want to see the board now. @@ -312,7 +316,7 @@ this file again." ) ); /* Write the board file */ -bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName ) +bool PCB_EDIT_FRAME::SavePcbFile( const wxString& FileName ) { wxFileName backupFileName; wxFileName pcbFileName; diff --git a/pcbnew/find.cpp b/pcbnew/find.cpp index 1aafdff3fe..4b9b81c971 100644 --- a/pcbnew/find.cpp +++ b/pcbnew/find.cpp @@ -23,7 +23,7 @@ static wxString s_OldStringFound; static int s_ItemCount, s_MarkerCount; -void WinEDA_PcbFrame::InstallFindFrame( const wxPoint& pos, wxDC* DC ) +void PCB_EDIT_FRAME::InstallFindFrame( const wxPoint& pos, wxDC* DC ) { WinEDA_PcbFindFrame* frame = new WinEDA_PcbFindFrame( this, DC, pos ); @@ -164,13 +164,13 @@ WinEDA_PcbFindFrame::WinEDA_PcbFindFrame() } -WinEDA_PcbFindFrame::WinEDA_PcbFindFrame( WinEDA_BasePcbFrame* parent, - wxDC* DC, - const wxPoint& pos, - wxWindowID id, - const wxString& caption, - const wxSize& size, - long style ) +WinEDA_PcbFindFrame::WinEDA_PcbFindFrame( PCB_BASE_FRAME* parent, + wxDC* DC, + const wxPoint& pos, + wxWindowID id, + const wxString& caption, + const wxSize& size, + long style ) { m_Parent = parent; m_DC = DC; diff --git a/pcbnew/find.h b/pcbnew/find.h index c12e531f57..c48e8c770c 100644 --- a/pcbnew/find.h +++ b/pcbnew/find.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// // Name: find.h -// Purpose: +// Purpose: // Author: jean-pierre Charras -// Modified by: +// Modified by: // Created: 04/03/2006 13:58:04 -// RCS-ID: +// RCS-ID: // Copyright: License GNU -// Licence: +// Licence: ///////////////////////////////////////////////////////////////////////////// // Generated by DialogBlocks (unregistered), 04/03/2006 13:58:04 @@ -59,21 +59,26 @@ */ class WinEDA_PcbFindFrame: public wxDialog -{ +{ DECLARE_DYNAMIC_CLASS( WinEDA_PcbFindFrame ) DECLARE_EVENT_TABLE() public: /// Constructors WinEDA_PcbFindFrame( ); - WinEDA_PcbFindFrame( WinEDA_BasePcbFrame* parent, - wxDC * DC, const wxPoint& pos = SYMBOL_WINEDA_PCBFINDFRAME_POSITION, - wxWindowID id = SYMBOL_WINEDA_PCBFINDFRAME_IDNAME, - const wxString& caption = SYMBOL_WINEDA_PCBFINDFRAME_TITLE, - const wxSize& size = SYMBOL_WINEDA_PCBFINDFRAME_SIZE, long style = SYMBOL_WINEDA_PCBFINDFRAME_STYLE ); + WinEDA_PcbFindFrame( PCB_BASE_FRAME* parent, + wxDC * DC, const wxPoint& pos = SYMBOL_WINEDA_PCBFINDFRAME_POSITION, + wxWindowID id = SYMBOL_WINEDA_PCBFINDFRAME_IDNAME, + const wxString& caption = SYMBOL_WINEDA_PCBFINDFRAME_TITLE, + const wxSize& size = SYMBOL_WINEDA_PCBFINDFRAME_SIZE, + long style = SYMBOL_WINEDA_PCBFINDFRAME_STYLE ); /// Creation - bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_PCBFINDFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_PCBFINDFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_PCBFINDFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_PCBFINDFRAME_SIZE, long style = SYMBOL_WINEDA_PCBFINDFRAME_STYLE ); + bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_PCBFINDFRAME_IDNAME, + const wxString& caption = SYMBOL_WINEDA_PCBFINDFRAME_TITLE, + const wxPoint& pos = SYMBOL_WINEDA_PCBFINDFRAME_POSITION, + const wxSize& size = SYMBOL_WINEDA_PCBFINDFRAME_SIZE, + long style = SYMBOL_WINEDA_PCBFINDFRAME_STYLE ); /// Creates the controls and sizers void CreateControls(); @@ -113,7 +118,7 @@ public: wxTextCtrl* m_NewText; ////@end WinEDA_PcbFindFrame member variables - WinEDA_BasePcbFrame * m_Parent; + PCB_BASE_FRAME * m_Parent; wxDC * m_DC; }; diff --git a/pcbnew/gen_modules_placefile.cpp b/pcbnew/gen_modules_placefile.cpp index b2de5fed38..ff79499c69 100644 --- a/pcbnew/gen_modules_placefile.cpp +++ b/pcbnew/gen_modules_placefile.cpp @@ -67,7 +67,7 @@ static bool HasNonSMDPins( MODULE* aModule ) /* Generate the module positions, used component placement. */ -void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event ) +void PCB_EDIT_FRAME::GenModulesPosition( wxCommandEvent& event ) { bool doBoardBack = false; MODULE* module; @@ -316,7 +316,7 @@ exit: // the only safe way out of here, no returns please. /* Print a module report. */ -void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event ) +void PCB_EDIT_FRAME::GenModuleReport( wxCommandEvent& event ) { double conv_unit; MODULE* Module; diff --git a/pcbnew/gendrill.cpp b/pcbnew/gendrill.cpp index fe34d5dba6..caef4b4fa5 100644 --- a/pcbnew/gendrill.cpp +++ b/pcbnew/gendrill.cpp @@ -84,7 +84,7 @@ static std::vector s_HoleListBuffer; /* This function displays the dialog frame for drill tools */ -void WinEDA_PcbFrame::InstallDrillFrame( wxCommandEvent& event ) +void PCB_EDIT_FRAME::InstallDrillFrame( wxCommandEvent& event ) { DIALOG_GENDRILL dlg( this ); dlg.ShowModal(); diff --git a/pcbnew/globaleditpad.cpp b/pcbnew/globaleditpad.cpp index 117cfc440f..8d8f7e56bd 100644 --- a/pcbnew/globaleditpad.cpp +++ b/pcbnew/globaleditpad.cpp @@ -18,7 +18,7 @@ class DIALOG_GLOBAL_PADS_EDITION : public DIALOG_GLOBAL_PADS_EDITION_BASE { private: - WinEDA_BasePcbFrame* m_Parent; + PCB_BASE_FRAME* m_Parent; D_PAD* m_CurrentPad; public: @@ -27,7 +27,7 @@ public: static bool m_Pad_Orient_Filter; public: - DIALOG_GLOBAL_PADS_EDITION( WinEDA_BasePcbFrame* parent, D_PAD* Pad ); + DIALOG_GLOBAL_PADS_EDITION( PCB_BASE_FRAME* parent, D_PAD* Pad ); ~DIALOG_GLOBAL_PADS_EDITION() { } private: @@ -37,9 +37,7 @@ private: }; -DIALOG_GLOBAL_PADS_EDITION::DIALOG_GLOBAL_PADS_EDITION( - WinEDA_BasePcbFrame* parent, - D_PAD* Pad ) : +DIALOG_GLOBAL_PADS_EDITION::DIALOG_GLOBAL_PADS_EDITION( PCB_BASE_FRAME* parent, D_PAD* Pad ) : DIALOG_GLOBAL_PADS_EDITION_BASE( parent ) { m_Parent = parent; @@ -110,7 +108,7 @@ void DIALOG_GLOBAL_PADS_EDITION::PadPropertiesAccept( wxCommandEvent& event ) * this pad * @param aDraw: if true: redraws the footprint */ -void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) +void PCB_BASE_FRAME::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) { MODULE* Module_Ref, * Module; int diag; diff --git a/pcbnew/hotkeys_board_editor.cpp b/pcbnew/hotkeys_board_editor.cpp index af19b22e8e..0b4729f6d0 100644 --- a/pcbnew/hotkeys_board_editor.cpp +++ b/pcbnew/hotkeys_board_editor.cpp @@ -28,8 +28,8 @@ * @param aPosition The current cursor position in logical (drawing) units. * @param aItem = NULL or pointer on a EDA_ITEM under the mouse cursor */ -void WinEDA_PcbFrame::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosition, - EDA_ITEM* aItem ) +void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosition, + EDA_ITEM* aItem ) { if( aHotkeyCode == 0 ) return; @@ -375,7 +375,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosi * @param aDC = current device context * @return true if an item was deleted */ -bool WinEDA_PcbFrame::OnHotkeyDeleteItem( wxDC* aDC ) +bool PCB_EDIT_FRAME::OnHotkeyDeleteItem( wxDC* aDC ) { BOARD_ITEM* item = GetCurItem(); bool ItemFree = (item == NULL) || (item->m_Flags == 0); @@ -440,7 +440,7 @@ bool WinEDA_PcbFrame::OnHotkeyDeleteItem( wxDC* aDC ) return true; } -bool WinEDA_PcbFrame::OnHotkeyEditItem( int aIdCommand ) +bool PCB_EDIT_FRAME::OnHotkeyEditItem( int aIdCommand ) { BOARD_ITEM* item = GetCurItem(); bool itemCurrentlyEdited = item && item->m_Flags; @@ -533,7 +533,7 @@ bool WinEDA_PcbFrame::OnHotkeyEditItem( int aIdCommand ) * @param aIdCommand = the hotkey command id * @return true if an item was moved */ -bool WinEDA_PcbFrame::OnHotkeyMoveItem( int aIdCommand ) +bool PCB_EDIT_FRAME::OnHotkeyMoveItem( int aIdCommand ) { BOARD_ITEM* item = GetCurItem(); bool itemCurrentlyEdited = item && item->m_Flags; @@ -633,7 +633,7 @@ bool WinEDA_PcbFrame::OnHotkeyMoveItem( int aIdCommand ) * @param aIdCommand = the hotkey command id * @return true if an item was moved */ -bool WinEDA_PcbFrame::OnHotkeyRotateItem( int aIdCommand ) +bool PCB_EDIT_FRAME::OnHotkeyRotateItem( int aIdCommand ) { BOARD_ITEM* item = GetCurItem(); bool itemCurrentlyEdited = item && item->m_Flags; diff --git a/pcbnew/initpcb.cpp b/pcbnew/initpcb.cpp index 39894221e4..1085bba05c 100644 --- a/pcbnew/initpcb.cpp +++ b/pcbnew/initpcb.cpp @@ -20,7 +20,7 @@ * delete all and reinitialize the current board * @param aQuery = true to prompt user for confirmation, false to initialize silently */ -bool WinEDA_PcbFrame::Clear_Pcb( bool aQuery ) +bool PCB_EDIT_FRAME::Clear_Pcb( bool aQuery ) { if( GetBoard() == NULL ) return FALSE; diff --git a/pcbnew/ioascii.cpp b/pcbnew/ioascii.cpp index 6f7785e568..2cc6fa8bf8 100644 --- a/pcbnew/ioascii.cpp +++ b/pcbnew/ioascii.cpp @@ -83,10 +83,10 @@ int NbDraw, NbTrack, NbZone, NbMod, NbNets; /** Read a list of segments (Tracks, zones) * @return items count or - count if no end block ($End...) found. */ -int WinEDA_BasePcbFrame::ReadListeSegmentDescr( LINE_READER* aReader, - TRACK* insertBeforeMe, - int StructType, - int NumSegm ) +int PCB_BASE_FRAME::ReadListeSegmentDescr( LINE_READER* aReader, + TRACK* insertBeforeMe, + int StructType, + int NumSegm ) { int shape, width, drill, layer, type, flags, net_code; int tempStartX, tempStartY; @@ -187,7 +187,7 @@ int WinEDA_BasePcbFrame::ReadListeSegmentDescr( LINE_READER* aReader, } -int WinEDA_BasePcbFrame::ReadGeneralDescrPcb( LINE_READER* aReader ) +int PCB_BASE_FRAME::ReadGeneralDescrPcb( LINE_READER* aReader ) { char* Line, * data; @@ -306,7 +306,7 @@ int WinEDA_BasePcbFrame::ReadGeneralDescrPcb( LINE_READER* aReader ) } -int WinEDA_BasePcbFrame::ReadSetup( LINE_READER* aReader ) +int PCB_BASE_FRAME::ReadSetup( LINE_READER* aReader ) { char* Line; char* data; @@ -639,7 +639,7 @@ int WinEDA_BasePcbFrame::ReadSetup( LINE_READER* aReader ) #ifdef PCBNEW -static int WriteSetup( FILE* aFile, WinEDA_BasePcbFrame* aFrame, BOARD* aBoard ) +static int WriteSetup( FILE* aFile, PCB_BASE_FRAME* aFrame, BOARD* aBoard ) { NETCLASS* netclass_default = aBoard->m_NetClasses.GetDefault(); char text[1024]; @@ -767,7 +767,7 @@ static int WriteSetup( FILE* aFile, WinEDA_BasePcbFrame* aFrame, BOARD* aBoard ) #endif -bool WinEDA_PcbFrame::WriteGeneralDescrPcb( FILE* File ) +bool PCB_EDIT_FRAME::WriteGeneralDescrPcb( FILE* File ) { EDA_ITEM* PtStruct = GetBoard()->m_Modules; int NbModules, NbDrawItem, NbLayers; @@ -943,7 +943,7 @@ static bool ReadSheetDescr( BASE_SCREEN* screen, LINE_READER* aReader ) } -int WinEDA_PcbFrame::ReadPcbFile( LINE_READER* aReader, bool Append ) +int PCB_EDIT_FRAME::ReadPcbFile( LINE_READER* aReader, bool Append ) { char* Line; @@ -1131,7 +1131,7 @@ int WinEDA_PcbFrame::ReadPcbFile( LINE_READER* aReader, bool Append ) * 1 if OK * 0 if error occurs saving file. */ -int WinEDA_PcbFrame::SavePcbFormatAscii( FILE* aFile ) +int PCB_EDIT_FRAME::SavePcbFormatAscii( FILE* aFile ) { bool rc; char line[256]; diff --git a/pcbnew/librairi.cpp b/pcbnew/librairi.cpp index d8e4900fb1..064e5bdd49 100644 --- a/pcbnew/librairi.cpp +++ b/pcbnew/librairi.cpp @@ -398,8 +398,7 @@ void WinEDA_ModuleEditFrame::Delete_Module_In_Library( const wxString& aLibname * All new modules (ie modules not found in this lib) (if NewModulesOnly == true) * all modules (if NewModulesOnly == false) */ -void WinEDA_BasePcbFrame::Archive_Modules( const wxString& LibName, - bool NewModulesOnly ) +void PCB_BASE_FRAME::Archive_Modules( const wxString& LibName, bool NewModulesOnly ) { int ii, NbModules = 0; float Pas; @@ -493,10 +492,10 @@ void WinEDA_BasePcbFrame::Archive_Modules( const wxString& LibName, * footprint name * @return : true if OK, false if abort */ -bool WinEDA_BasePcbFrame::Save_Module_In_Library( const wxString& aLibName, - MODULE* aModule, - bool aOverwrite, - bool aDisplayDialog ) +bool PCB_BASE_FRAME::Save_Module_In_Library( const wxString& aLibName, + MODULE* aModule, + bool aOverwrite, + bool aDisplayDialog ) { wxFileName oldFileName; wxFileName newFileName; @@ -724,7 +723,7 @@ bool WinEDA_BasePcbFrame::Save_Module_In_Library( const wxString& aLibName, * (will the component reference in board) * @return a pointer to the new module */ -MODULE* WinEDA_BasePcbFrame::Create_1_Module( const wxString& aModuleName ) +MODULE* PCB_BASE_FRAME::Create_1_Module( const wxString& aModuleName ) { MODULE* Module; wxString moduleName; diff --git a/pcbnew/loadcmp.cpp b/pcbnew/loadcmp.cpp index 9c331c0052..0caee0d5ce 100644 --- a/pcbnew/loadcmp.cpp +++ b/pcbnew/loadcmp.cpp @@ -35,7 +35,7 @@ static FOOTPRINT_LIST MList; bool WinEDA_ModuleEditFrame::Load_Module_From_BOARD( MODULE* Module ) { MODULE* NewModule; - WinEDA_BasePcbFrame* parent = (WinEDA_BasePcbFrame*) GetParent(); + PCB_BASE_FRAME* parent = (PCB_BASE_FRAME*) GetParent(); if( Module == NULL ) { @@ -79,8 +79,7 @@ bool WinEDA_ModuleEditFrame::Load_Module_From_BOARD( MODULE* Module ) } -MODULE* WinEDA_BasePcbFrame::Load_Module_From_Library( const wxString& library, - wxDC* DC ) +MODULE* PCB_BASE_FRAME::Load_Module_From_Library( const wxString& library, wxDC* DC ) { MODULE* module; wxPoint curspos = GetScreen()->GetCrossHairPosition(); @@ -194,10 +193,9 @@ MODULE* WinEDA_BasePcbFrame::Load_Module_From_Library( const wxString& library, * @return a MODULE * pointer to the new module, or NULL * */ -MODULE* WinEDA_BasePcbFrame::Get_Librairie_Module( - const wxString& aLibraryFullFilename, - const wxString& aModuleName, - bool aDisplayMessageError ) +MODULE* PCB_BASE_FRAME::Get_Librairie_Module( const wxString& aLibraryFullFilename, + const wxString& aModuleName, + bool aDisplayMessageError ) { int Found = 0; wxFileName fn; @@ -348,10 +346,10 @@ MODULE* WinEDA_BasePcbFrame::Get_Librairie_Module( * * @return wxEmptyString if abort or fails, or the selected module name if Ok */ -wxString WinEDA_BasePcbFrame::Select_1_Module_From_List( EDA_DRAW_FRAME* aWindow, - const wxString& aLibraryFullFilename, - const wxString& aMask, - const wxString& aKeyWord ) +wxString PCB_BASE_FRAME::Select_1_Module_From_List( EDA_DRAW_FRAME* aWindow, + const wxString& aLibraryFullFilename, + const wxString& aMask, + const wxString& aKeyWord ) { static wxString OldName; /* Save the name of the last module loaded. */ wxString CmpName; diff --git a/pcbnew/magnetic_tracks_functions.cpp b/pcbnew/magnetic_tracks_functions.cpp index e2919f5adb..69261e0974 100644 --- a/pcbnew/magnetic_tracks_functions.cpp +++ b/pcbnew/magnetic_tracks_functions.cpp @@ -100,7 +100,7 @@ bool Project( wxPoint* res, wxPoint on_grid, const TRACK* track ) * @param curpos The initial position, and what to adjust if a change is needed. * @return bool - true if the position was adjusted magnetically, else false. */ -bool Magnetize( BOARD* m_Pcb, WinEDA_PcbFrame* frame, int aCurrentTool, wxSize grid, +bool Magnetize( BOARD* m_Pcb, PCB_EDIT_FRAME* frame, int aCurrentTool, wxSize grid, wxPoint on_grid, wxPoint* curpos ) { bool doCheckNet = g_MagneticPadOption != capture_always && Drc_On; diff --git a/pcbnew/menubar_pcbframe.cpp b/pcbnew/menubar_pcbframe.cpp index 84c1f95966..82a1149e94 100644 --- a/pcbnew/menubar_pcbframe.cpp +++ b/pcbnew/menubar_pcbframe.cpp @@ -17,7 +17,7 @@ /** * PCBNew mainframe menubar */ -void WinEDA_PcbFrame::ReCreateMenuBar() +void PCB_EDIT_FRAME::ReCreateMenuBar() { wxString text; wxMenuItem* item; diff --git a/pcbnew/mirepcb.cpp b/pcbnew/mirepcb.cpp index a89a042eca..2c6cd61b3d 100644 --- a/pcbnew/mirepcb.cpp +++ b/pcbnew/mirepcb.cpp @@ -37,7 +37,7 @@ class TARGET_PROPERTIES_DIALOG_EDITOR : public wxDialog { private: - WinEDA_PcbFrame* m_Parent; + PCB_EDIT_FRAME* m_Parent; wxDC* m_DC; MIREPCB* m_MirePcb; WinEDA_ValueCtrl* m_MireWidthCtrl; @@ -45,7 +45,7 @@ private: wxRadioBox* m_MireShape; public: - TARGET_PROPERTIES_DIALOG_EDITOR( WinEDA_PcbFrame* parent, MIREPCB* Mire, wxDC* DC ); + TARGET_PROPERTIES_DIALOG_EDITOR( PCB_EDIT_FRAME* parent, MIREPCB* Mire, wxDC* DC ); ~TARGET_PROPERTIES_DIALOG_EDITOR() { } private: @@ -61,7 +61,7 @@ BEGIN_EVENT_TABLE( TARGET_PROPERTIES_DIALOG_EDITOR, wxDialog ) END_EVENT_TABLE() -void WinEDA_PcbFrame::InstallMireOptionsFrame( MIREPCB* MirePcb, wxDC* DC ) +void PCB_EDIT_FRAME::InstallMireOptionsFrame( MIREPCB* MirePcb, wxDC* DC ) { TARGET_PROPERTIES_DIALOG_EDITOR* frame = new TARGET_PROPERTIES_DIALOG_EDITOR( this, MirePcb, DC ); @@ -72,7 +72,7 @@ void WinEDA_PcbFrame::InstallMireOptionsFrame( MIREPCB* MirePcb, wxDC* DC ) TARGET_PROPERTIES_DIALOG_EDITOR::TARGET_PROPERTIES_DIALOG_EDITOR( - WinEDA_PcbFrame* parent, + PCB_EDIT_FRAME* parent, MIREPCB* Mire, wxDC* DC ) : wxDialog( parent, wxID_ANY, wxString( _( "Target Properties" ) ) ) { @@ -159,7 +159,7 @@ void TARGET_PROPERTIES_DIALOG_EDITOR::OnOkClick( wxCommandEvent& event ) } -void WinEDA_PcbFrame::Delete_Mire( MIREPCB* MirePcb, wxDC* DC ) +void PCB_EDIT_FRAME::Delete_Mire( MIREPCB* MirePcb, wxDC* DC ) { if( MirePcb == NULL ) return; @@ -175,7 +175,7 @@ static void AbortMoveAndEditTarget( EDA_DRAW_PANEL* Panel, wxDC* DC ) BASE_SCREEN* screen = Panel->GetScreen(); MIREPCB* MirePcb = (MIREPCB*) screen->GetCurItem(); - ( (WinEDA_PcbFrame*) Panel->GetParent() )->SetCurItem( NULL ); + ( (PCB_EDIT_FRAME*) Panel->GetParent() )->SetCurItem( NULL ); Panel->SetMouseCapture( NULL, NULL ); @@ -207,7 +207,7 @@ static void AbortMoveAndEditTarget( EDA_DRAW_PANEL* Panel, wxDC* DC ) /* Draw Symbol PCB type MIRE. */ -MIREPCB* WinEDA_PcbFrame::Create_Mire( wxDC* DC ) +MIREPCB* PCB_EDIT_FRAME::Create_Mire( wxDC* DC ) { MIREPCB* MirePcb = new MIREPCB( GetBoard() ); @@ -228,7 +228,7 @@ MIREPCB* WinEDA_PcbFrame::Create_Mire( wxDC* DC ) /* Routine to initialize the displacement of a focal */ -void WinEDA_PcbFrame::StartMove_Mire( MIREPCB* MirePcb, wxDC* DC ) +void PCB_EDIT_FRAME::StartMove_Mire( MIREPCB* MirePcb, wxDC* DC ) { if( MirePcb == NULL ) return; @@ -240,7 +240,7 @@ void WinEDA_PcbFrame::StartMove_Mire( MIREPCB* MirePcb, wxDC* DC ) } -void WinEDA_PcbFrame::Place_Mire( MIREPCB* MirePcb, wxDC* DC ) +void PCB_EDIT_FRAME::Place_Mire( MIREPCB* MirePcb, wxDC* DC ) { if( MirePcb == NULL ) return; diff --git a/pcbnew/modedit.cpp b/pcbnew/modedit.cpp index 6fba18fc78..246c43875b 100644 --- a/pcbnew/modedit.cpp +++ b/pcbnew/modedit.cpp @@ -109,7 +109,7 @@ BOARD_ITEM* WinEDA_ModuleEditFrame::ModeditLocateAndDisplay( int aHotKeyCode ) } // this menu's handler is void - // WinEDA_BasePcbFrame::ProcessItemSelection() + // PCB_BASE_FRAME::ProcessItemSelection() // and it calls SetCurItem() which in turn calls DisplayInfo() on the // item. DrawPanel->m_AbortRequest = true; // changed in false if an item @@ -274,10 +274,10 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event ) { // update module in the current board, // not just add it to the board with total disregard for the netlist... - WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) GetParent(); - BOARD* mainpcb = pcbframe->GetBoard(); - MODULE* source_module = NULL; - MODULE* module_in_edit = GetBoard()->m_Modules; + PCB_EDIT_FRAME* pcbframe = (PCB_EDIT_FRAME*) GetParent(); + BOARD* mainpcb = pcbframe->GetBoard(); + MODULE* source_module = NULL; + MODULE* module_in_edit = GetBoard()->m_Modules; // Search the old module (source) if exists // Because this source could be deleted when editing the main board... diff --git a/pcbnew/module_editor_frame.h b/pcbnew/module_editor_frame.h index 3ca4059d22..f00ee332f7 100644 --- a/pcbnew/module_editor_frame.h +++ b/pcbnew/module_editor_frame.h @@ -8,7 +8,7 @@ #define _MODULE_EDITOR_FRAME_H_ -class WinEDA_ModuleEditFrame : public WinEDA_BasePcbFrame +class WinEDA_ModuleEditFrame : public PCB_BASE_FRAME { public: MODULE* CurrentModule; diff --git a/pcbnew/moduleframe.cpp b/pcbnew/moduleframe.cpp index 7aa9483c3f..41e0945a8f 100644 --- a/pcbnew/moduleframe.cpp +++ b/pcbnew/moduleframe.cpp @@ -28,9 +28,9 @@ static BOARD_DESIGN_SETTINGS s_ModuleEditorDesignSetting; /********************************/ /* class WinEDA_ModuleEditFrame */ /********************************/ -BEGIN_EVENT_TABLE( WinEDA_ModuleEditFrame, WinEDA_BasePcbFrame ) +BEGIN_EVENT_TABLE( WinEDA_ModuleEditFrame, PCB_BASE_FRAME ) EVT_MENU_RANGE( ID_POPUP_PCB_ITEM_SELECTION_START, ID_POPUP_PCB_ITEM_SELECTION_END, - WinEDA_BasePcbFrame::ProcessItemSelection ) + PCB_BASE_FRAME::ProcessItemSelection ) EVT_CLOSE( WinEDA_ModuleEditFrame::OnCloseWindow ) EVT_MENU( wxID_EXIT, WinEDA_ModuleEditFrame::CloseModuleEditor ) @@ -82,7 +82,7 @@ BEGIN_EVENT_TABLE( WinEDA_ModuleEditFrame, WinEDA_BasePcbFrame ) EVT_MENU( ID_PCB_DRAWINGS_WIDTHS_SETUP, WinEDA_ModuleEditFrame::Process_Special_Functions ) EVT_MENU( ID_PCB_PAD_SETUP, WinEDA_ModuleEditFrame::Process_Special_Functions ) - EVT_MENU( ID_PCB_USER_GRID_SETUP, WinEDA_PcbFrame::Process_Special_Functions ) + EVT_MENU( ID_PCB_USER_GRID_SETUP, PCB_EDIT_FRAME::Process_Special_Functions ) // Menu 3D Frame EVT_MENU( ID_MENU_PCB_SHOW_3D_FRAME, WinEDA_ModuleEditFrame::Show3D_Frame ) @@ -112,7 +112,7 @@ WinEDA_ModuleEditFrame::WinEDA_ModuleEditFrame( wxWindow* father, const wxPoint& pos, const wxSize& size, long style ) : - WinEDA_BasePcbFrame( father, MODULE_EDITOR_FRAME, wxEmptyString, pos, size, style ) + PCB_BASE_FRAME( father, MODULE_EDITOR_FRAME, wxEmptyString, pos, size, style ) { m_FrameName = wxT( "ModEditFrame" ); m_Draw_Sheet_Ref = false; // true to show the frame references @@ -199,7 +199,7 @@ WinEDA_ModuleEditFrame::~WinEDA_ModuleEditFrame() * PCB_SCREEN handling g_ModuleEditor_Pcb */ - WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) GetParent(); + PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) GetParent(); frame->m_ModuleEditFrame = NULL; } @@ -254,7 +254,7 @@ void WinEDA_ModuleEditFrame::OnUpdateLibAndModuleSelected( wxUpdateUIEvent& aEve void WinEDA_ModuleEditFrame::OnUpdateLoadModuleFromBoard( wxUpdateUIEvent& aEvent ) { - WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) GetParent(); + PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) GetParent(); aEvent.Enable( frame->GetBoard()->m_Modules != NULL ); } @@ -262,7 +262,7 @@ void WinEDA_ModuleEditFrame::OnUpdateLoadModuleFromBoard( wxUpdateUIEvent& aEven void WinEDA_ModuleEditFrame::OnUpdateInsertModuleInBoard( wxUpdateUIEvent& aEvent ) { - WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) GetParent(); + PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) GetParent(); MODULE* module_in_edit = GetBoard()->m_Modules; bool canInsert = ( module_in_edit && !module_in_edit->m_Link ); @@ -289,7 +289,7 @@ void WinEDA_ModuleEditFrame::OnUpdateInsertModuleInBoard( wxUpdateUIEvent& aEven void WinEDA_ModuleEditFrame::OnUpdateReplaceModuleInBoard( wxUpdateUIEvent& aEvent ) { - WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) GetParent(); + PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) GetParent(); MODULE* module_in_edit = GetBoard()->m_Modules; bool canReplace = ( module_in_edit && module_in_edit->m_Link ); @@ -403,7 +403,7 @@ void WinEDA_ModuleEditFrame::GeneralControl( wxDC* aDC, const wxPoint& aPosition */ void WinEDA_ModuleEditFrame::OnModify() { - WinEDA_BasePcbFrame::OnModify(); + PCB_BASE_FRAME::OnModify(); if( m_Draw3DFrame ) m_Draw3DFrame->ReloadRequest(); diff --git a/pcbnew/modules.cpp b/pcbnew/modules.cpp index 5d5cfc080e..f824d35d68 100644 --- a/pcbnew/modules.cpp +++ b/pcbnew/modules.cpp @@ -30,7 +30,7 @@ static PICKED_ITEMS_LIST s_PickedList; /* a picked list to /* Get a module name from user and return a pointer to the corresponding module */ -MODULE* WinEDA_BasePcbFrame::GetModuleByName() +MODULE* PCB_BASE_FRAME::GetModuleByName() { wxString moduleName; MODULE* module = NULL; @@ -56,7 +56,7 @@ MODULE* WinEDA_BasePcbFrame::GetModuleByName() } -void WinEDA_PcbFrame::StartMove_Module( MODULE* module, wxDC* DC ) +void PCB_EDIT_FRAME::StartMove_Module( MODULE* module, wxDC* DC ) { if( module == NULL ) return; @@ -115,9 +115,9 @@ void WinEDA_PcbFrame::StartMove_Module( MODULE* module, wxDC* DC ) */ void Abort_MoveOrCopyModule( EDA_DRAW_PANEL* Panel, wxDC* DC ) { - TRACK* pt_segm; - MODULE* module; - WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) Panel->GetParent(); + TRACK* pt_segm; + MODULE* module; + PCB_EDIT_FRAME* pcbframe = (PCB_EDIT_FRAME*) Panel->GetParent(); module = (MODULE*) pcbframe->GetScreen()->GetCurItem(); pcbframe->GetBoard()->m_Status_Pcb &= ~RATSNEST_ITEM_LOCAL_OK; @@ -202,7 +202,7 @@ void Abort_MoveOrCopyModule( EDA_DRAW_PANEL* Panel, wxDC* DC ) * @param module = footprint to copy * @return a pointer on the new footprint (the copy of the existing footprint) */ -MODULE* WinEDA_BasePcbFrame::Copie_Module( MODULE* module ) +MODULE* PCB_BASE_FRAME::Copie_Module( MODULE* module ) { MODULE* newmodule; @@ -260,9 +260,7 @@ void Montre_Position_Empreinte( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint * @param aDC = currentDevice Context. if NULL: do not redraw new ratsnest * @param aAskBeforeDeleting : if true: ask for confirmation before deleting */ -bool WinEDA_PcbFrame::Delete_Module( MODULE* aModule, - wxDC* aDC, - bool aAskBeforeDeleting ) +bool PCB_EDIT_FRAME::Delete_Module( MODULE* aModule, wxDC* aDC, bool aAskBeforeDeleting ) { wxString msg; @@ -310,7 +308,7 @@ bool WinEDA_PcbFrame::Delete_Module( MODULE* aModule, * @param Module the footprint to flip * @param DC Current Device Context. if NULL, no redraw */ -void WinEDA_PcbFrame::Change_Side_Module( MODULE* Module, wxDC* DC ) +void PCB_EDIT_FRAME::Change_Side_Module( MODULE* Module, wxDC* DC ) { if( Module == NULL ) return; @@ -380,9 +378,7 @@ void WinEDA_PcbFrame::Change_Side_Module( MODULE* Module, wxDC* DC ) * DC (if NULL: no display screen has the output. * Update module coordinates with the new position. */ -void WinEDA_BasePcbFrame::Place_Module( MODULE* module, - wxDC* DC, - bool aDoNotRecreateRatsnest ) +void PCB_BASE_FRAME::Place_Module( MODULE* module, wxDC* DC, bool aDoNotRecreateRatsnest ) { TRACK* pt_segm; wxPoint newpos; @@ -466,8 +462,7 @@ void WinEDA_BasePcbFrame::Place_Module( MODULE* module, * If DC == NULL, the component does not redraw. * Otherwise, it erases and redraws turns */ -void WinEDA_BasePcbFrame::Rotate_Module( wxDC* DC, MODULE* module, - int angle, bool incremental ) +void PCB_BASE_FRAME::Rotate_Module( wxDC* DC, MODULE* module, int angle, bool incremental ) { if( module == NULL ) return; @@ -556,7 +551,7 @@ void DrawModuleOutlines( EDA_DRAW_PANEL* panel, wxDC* DC, MODULE* module ) if( g_Show_Module_Ratsnest && panel ) { - WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) panel->GetParent(); + PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) panel->GetParent(); frame->build_ratsnest_module( module ); frame->trace_ratsnest_module( DC ); } diff --git a/pcbnew/move-drag_pads.cpp b/pcbnew/move-drag_pads.cpp index f3b659fdb2..c4020da348 100644 --- a/pcbnew/move-drag_pads.cpp +++ b/pcbnew/move-drag_pads.cpp @@ -100,7 +100,7 @@ static void Show_Pad_Move( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPo /* Load list of features for default pad selection. */ -void WinEDA_BasePcbFrame::Export_Pad_Settings( D_PAD* pt_pad ) +void PCB_BASE_FRAME::Export_Pad_Settings( D_PAD* pt_pad ) { MODULE* Module; @@ -131,7 +131,7 @@ void WinEDA_BasePcbFrame::Export_Pad_Settings( D_PAD* pt_pad ) * - Measurements are modified * - The position, names, and keys are not. */ -void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* aPad, bool aDraw ) +void PCB_BASE_FRAME::Import_Pad_Settings( D_PAD* aPad, bool aDraw ) { if( aDraw ) { @@ -182,7 +182,7 @@ void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* aPad, bool aDraw ) /* Add a pad on the selected module. */ -void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw ) +void PCB_BASE_FRAME::AddPad( MODULE* Module, bool draw ) { D_PAD* Pad; int rX, rY; @@ -240,7 +240,7 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw ) * @param aPad = the pad to delete * @param aQuery = true to promt for confirmation, false to delete silently */ -void WinEDA_BasePcbFrame::DeletePad( D_PAD* aPad, bool aQuery ) +void PCB_BASE_FRAME::DeletePad( D_PAD* aPad, bool aQuery ) { MODULE* Module; @@ -270,7 +270,7 @@ void WinEDA_BasePcbFrame::DeletePad( D_PAD* aPad, bool aQuery ) /* Function to initialize the "move pad" command */ -void WinEDA_BasePcbFrame::StartMovePad( D_PAD* Pad, wxDC* DC ) +void PCB_BASE_FRAME::StartMovePad( D_PAD* Pad, wxDC* DC ) { MODULE* Module; @@ -298,7 +298,7 @@ void WinEDA_BasePcbFrame::StartMovePad( D_PAD* Pad, wxDC* DC ) /* Routine to place a moved pad. */ -void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC ) +void PCB_BASE_FRAME::PlacePad( D_PAD* Pad, wxDC* DC ) { int dX, dY; TRACK* Track; @@ -388,7 +388,7 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC ) /* Rotate selected pad 90 degrees. */ -void WinEDA_BasePcbFrame::RotatePad( D_PAD* Pad, wxDC* DC ) +void PCB_BASE_FRAME::RotatePad( D_PAD* Pad, wxDC* DC ) { MODULE* Module; diff --git a/pcbnew/move_or_drag_track.cpp b/pcbnew/move_or_drag_track.cpp index 511c80bf89..557c24fef7 100644 --- a/pcbnew/move_or_drag_track.cpp +++ b/pcbnew/move_or_drag_track.cpp @@ -65,9 +65,9 @@ static void Abort_MoveTrack( EDA_DRAW_PANEL* Panel, wxDC* DC ) Panel->GetScreen()->SetCrossHairPosition( oldpos ); g_HighLight_Status = false; - ( (WinEDA_PcbFrame*) Panel->GetParent() )->GetBoard()->DrawHighLight( Panel, - DC, - g_HighLight_NetCode ); + ( (PCB_EDIT_FRAME*) Panel->GetParent() )->GetBoard()->DrawHighLight( Panel, + DC, + g_HighLight_NetCode ); if( NewTrack ) { @@ -107,7 +107,7 @@ static void Abort_MoveTrack( EDA_DRAW_PANEL* Panel, wxDC* DC ) NewTrack = NULL; } - ( (WinEDA_PcbFrame*) Panel->GetParent() )->SetCurItem( NULL ); + ( (PCB_EDIT_FRAME*) Panel->GetParent() )->SetCurItem( NULL ); /* Undo move and redraw trace segments. */ for( unsigned jj=0 ; jj < g_DragSegmentList.size(); jj++ ) @@ -125,7 +125,7 @@ static void Abort_MoveTrack( EDA_DRAW_PANEL* Panel, wxDC* DC ) g_HighLight_NetCode = Old_HighLigth_NetCode; g_HighLight_Status = Old_HighLigt_Status; if( g_HighLight_Status ) - ( (WinEDA_PcbFrame*) Panel->GetParent() )->GetBoard()->DrawHighLight( + ( (PCB_EDIT_FRAME*) Panel->GetParent() )->GetBoard()->DrawHighLight( Panel, DC, g_HighLight_NetCode ); EraseDragList(); @@ -195,7 +195,7 @@ static void Show_MoveNode( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPo DisplayOpt.DisplayPcbTrackFill = track_fill_copy; // Display track length - WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) aPanel->GetParent(); + PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) aPanel->GetParent(); Track->DisplayInfo( frame ); } @@ -468,7 +468,7 @@ static void Show_Drag_Track_Segment_With_Cte_Slope( EDA_DRAW_PANEL* aPanel, wxDC tSegmentToEnd->Draw( aPanel, aDC, draw_mode ); // Display track length - WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) aPanel->GetParent(); + PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) aPanel->GetParent(); Track->DisplayInfo( frame ); } @@ -655,9 +655,7 @@ bool InitialiseDragParameters() * a via or/and a terminal point of a track segment * The terminal point of other connected segments (if any) are moved too. */ -void WinEDA_PcbFrame::Start_MoveOneNodeOrSegment( TRACK* track, - wxDC* DC, - int command ) +void PCB_EDIT_FRAME::Start_MoveOneNodeOrSegment( TRACK* track, wxDC* DC, int command ) { if( !track ) return; @@ -783,7 +781,7 @@ void SortTrackEndPoints( TRACK* track ) * and if they have the same width. See cleanup.cpp for merge functions, * and consider Marque_Une_Piste() to locate segments that can be merged */ -bool WinEDA_PcbFrame::MergeCollinearTracks( TRACK* track, wxDC* DC, int end ) +bool PCB_EDIT_FRAME::MergeCollinearTracks( TRACK* track, wxDC* DC, int end ) { testtrack = (TRACK*) Locate_Piste_Connectee( track, GetBoard()->m_Track, NULL, @@ -837,8 +835,7 @@ bool WinEDA_PcbFrame::MergeCollinearTracks( TRACK* track, wxDC* DC, int end ) #endif -void WinEDA_PcbFrame::Start_DragTrackSegmentAndKeepSlope( TRACK* track, - wxDC* DC ) +void PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC ) { TRACK* TrackToStartPoint = NULL; TRACK* TrackToEndPoint = NULL; @@ -969,7 +966,7 @@ void WinEDA_PcbFrame::Start_DragTrackSegmentAndKeepSlope( TRACK* track, /* Place a dragged (or moved) track segment or via */ -bool WinEDA_PcbFrame::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC ) +bool PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC ) { int errdrc; diff --git a/pcbnew/muonde.cpp b/pcbnew/muonde.cpp index 3413eccf70..085cca189e 100644 --- a/pcbnew/muonde.cpp +++ b/pcbnew/muonde.cpp @@ -118,7 +118,7 @@ void Exit_Self( EDA_DRAW_PANEL* Panel, wxDC* DC ) } -void WinEDA_PcbFrame::Begin_Self( wxDC* DC ) +void PCB_EDIT_FRAME::Begin_Self( wxDC* DC ) { if( Self_On ) { @@ -174,7 +174,7 @@ void WinEDA_PcbFrame::Begin_Self( wxDC* DC ) * (Radius decreases if necessary) * */ -MODULE* WinEDA_PcbFrame::Genere_Self( wxDC* DC ) +MODULE* PCB_EDIT_FRAME::Genere_Self( wxDC* DC ) { D_PAD* PtPad; int ll; @@ -516,8 +516,7 @@ int BuildCornersList_S_Shape( std::vector & aBuffer, * This footprint has pad_count pads: * PAD_SMD, rectangular, H size = V size = current track width. */ -MODULE* WinEDA_PcbFrame::Create_MuWaveBasicShape( const wxString& name, - int pad_count ) +MODULE* PCB_EDIT_FRAME::Create_MuWaveBasicShape( const wxString& name, int pad_count ) { MODULE* Module; int pad_num = 1; @@ -568,7 +567,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveBasicShape( const wxString& name, * PAD_SMD, rectangular, H size = V size = current track width. * the "gap" is isolation created between this 2 pads */ -MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( int shape_type ) +MODULE* PCB_EDIT_FRAME::Create_MuWaveComponent( int shape_type ) { int oX; D_PAD* pad; @@ -723,11 +722,11 @@ enum id_mw_cmd { class WinEDA_SetParamShapeFrame : public wxDialog { private: - WinEDA_PcbFrame* m_Parent; + PCB_EDIT_FRAME* m_Parent; wxRadioBox* m_ShapeOptionCtrl; WinEDA_SizeCtrl* m_SizeCtrl; -public: WinEDA_SetParamShapeFrame( WinEDA_PcbFrame* parent, const wxPoint& pos ); +public: WinEDA_SetParamShapeFrame( PCB_EDIT_FRAME* parent, const wxPoint& pos ); ~WinEDA_SetParamShapeFrame() { }; private: @@ -747,8 +746,8 @@ EVT_BUTTON( ID_READ_SHAPE_FILE, WinEDA_SetParamShapeFrame::ReadDataShapeDescr ) END_EVENT_TABLE() -WinEDA_SetParamShapeFrame::WinEDA_SetParamShapeFrame( WinEDA_PcbFrame* parent, - const wxPoint& framepos ) : +WinEDA_SetParamShapeFrame::WinEDA_SetParamShapeFrame( PCB_EDIT_FRAME* parent, + const wxPoint& framepos ) : wxDialog( parent, -1, _( "Complex shape" ), framepos, wxSize( 350, 280 ), DIALOG_STYLE ) { @@ -933,7 +932,7 @@ void WinEDA_SetParamShapeFrame::ReadDataShapeDescr( wxCommandEvent& event ) } -MODULE* WinEDA_PcbFrame::Create_MuWavePolygonShape() +MODULE* PCB_EDIT_FRAME::Create_MuWavePolygonShape() { D_PAD* pad1, * pad2; MODULE* Module; @@ -1059,7 +1058,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWavePolygonShape() * Edit the GAP module, if it has changed the position and/or size * Pads that form the gap to get a new value of the gap. */ -void WinEDA_PcbFrame::Edit_Gap( wxDC* DC, MODULE* Module ) +void PCB_EDIT_FRAME::Edit_Gap( wxDC* DC, MODULE* Module ) { int gap_size, oX; D_PAD* pad, * next_pad; diff --git a/pcbnew/muwave_command.cpp b/pcbnew/muwave_command.cpp index a35e1c3dc3..3d5e0e4492 100644 --- a/pcbnew/muwave_command.cpp +++ b/pcbnew/muwave_command.cpp @@ -17,7 +17,7 @@ /* Handle microwave commands. */ -void WinEDA_PcbFrame::ProcessMuWaveFunctions( wxCommandEvent& event ) +void PCB_EDIT_FRAME::ProcessMuWaveFunctions( wxCommandEvent& event ) { int id = event.GetId(); wxPoint pos; @@ -61,13 +61,13 @@ void WinEDA_PcbFrame::ProcessMuWaveFunctions( wxCommandEvent& event ) default: DisplayError( this, - wxT( "WinEDA_PcbFrame::ProcessMuWaveFunctions() id error" ) ); + wxT( "PCB_EDIT_FRAME::ProcessMuWaveFunctions() id error" ) ); break; } } -void WinEDA_PcbFrame::MuWaveCommand( wxDC* DC, const wxPoint& MousePos ) +void PCB_EDIT_FRAME::MuWaveCommand( wxDC* DC, const wxPoint& MousePos ) { MODULE* module = NULL; @@ -95,7 +95,7 @@ void WinEDA_PcbFrame::MuWaveCommand( wxDC* DC, const wxPoint& MousePos ) default: DrawPanel->SetCursor( wxCURSOR_ARROW ); - DisplayError( this, wxT( "WinEDA_PcbFrame::MuWaveCommand() id error" ) ); + DisplayError( this, wxT( "PCB_EDIT_FRAME::MuWaveCommand() id error" ) ); SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString ); break; } diff --git a/pcbnew/netlist.cpp b/pcbnew/netlist.cpp index 6f067988db..ade98f8c22 100644 --- a/pcbnew/netlist.cpp +++ b/pcbnew/netlist.cpp @@ -88,15 +88,15 @@ static int ReadListeModules( const wxString& CmpFullFileName, const wxString* RefCmp, const wxString* TimeStampPath, wxString& NameModule ); -static MODULE* ReadNetModule( WinEDA_PcbFrame* aFrame, - wxTextCtrl* aMessageWindow, - const wxString& CmpFullFileName, - char* Text, - int* UseFichCmp, - int TstOnly, - bool Select_By_Timestamp, - bool aChangeFootprint ); -static void LoadListeModules( WinEDA_PcbFrame* aPcbFrame ); +static MODULE* ReadNetModule( PCB_EDIT_FRAME* aFrame, + wxTextCtrl* aMessageWindow, + const wxString& CmpFullFileName, + char* Text, + int* UseFichCmp, + int TstOnly, + bool Select_By_Timestamp, + bool aChangeFootprint ); +static void LoadListeModules( PCB_EDIT_FRAME* aPcbFrame ); static int s_NbNewModules; @@ -155,13 +155,13 @@ FILE * OpenNetlistFile( const wxString& aFullFileName ) * } * \#End */ -bool WinEDA_PcbFrame::ReadPcbNetlist( const wxString& aNetlistFullFilename, - const wxString& aCmpFullFileName, - wxTextCtrl* aMessageWindow, - bool aChangeFootprint, - bool aDeleteBadTracks, - bool aDeleteExtraFootprints, - bool aSelect_By_Timestamp ) +bool PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFullFilename, + const wxString& aCmpFullFileName, + wxTextCtrl* aMessageWindow, + bool aChangeFootprint, + bool aDeleteBadTracks, + bool aDeleteExtraFootprints, + bool aSelect_By_Timestamp ) { int State, Comment; MODULE* Module = NULL; @@ -403,14 +403,14 @@ bool WinEDA_PcbFrame::ReadPcbNetlist( const wxString& aNetlistFullFilename, * (1 VCC) * (2 MODB_1) */ -MODULE* ReadNetModule( WinEDA_PcbFrame* aFrame, - wxTextCtrl* aMessageWindow, - const wxString& aCmpFullFileName, - char* Text, - int* UseFichCmp, - int TstOnly, - bool aSelect_By_Timestamp, - bool aChangeFootprint ) +MODULE* ReadNetModule( PCB_EDIT_FRAME* aFrame, + wxTextCtrl* aMessageWindow, + const wxString& aCmpFullFileName, + char* Text, + int* UseFichCmp, + int TstOnly, + bool aSelect_By_Timestamp, + bool aChangeFootprint ) { MODULE* Module; char* text; @@ -639,7 +639,7 @@ int SetPadNetName( char* Text, * The user can select a module from this list * @return a pointer to the selected module or NULL */ -MODULE* WinEDA_PcbFrame::ListAndSelectModuleName( void ) +MODULE* PCB_EDIT_FRAME::ListAndSelectModuleName( void ) { MODULE* Module; @@ -988,7 +988,7 @@ void AddToList( const wxString& NameLibCmp, const wxString& CmpName, const wxStr * If a module is being loaded it is duplicated, which avoids reading * unnecessary library. */ -void LoadListeModules( WinEDA_PcbFrame* aPcbFrame ) +void LoadListeModules( PCB_EDIT_FRAME* aPcbFrame ) { MODULEtoLOAD* ref, * cmp; int ii; diff --git a/pcbnew/onleftclick.cpp b/pcbnew/onleftclick.cpp index 435913cbc9..622b93c63f 100644 --- a/pcbnew/onleftclick.cpp +++ b/pcbnew/onleftclick.cpp @@ -16,7 +16,7 @@ /* Handle the left buttom mouse click, when a tool is active */ -void WinEDA_PcbFrame::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) +void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) { BOARD_ITEM* DrawStruct = GetCurItem(); bool exit = false; @@ -92,9 +92,8 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) default: DisplayError( this, - wxT( - "WinEDA_PcbFrame::OnLeftClick() err: DrawType %d m_Flags != 0" ), - DrawStruct->Type() ); + wxT( "PCB_EDIT_FRAME::OnLeftClick() err: DrawType %d m_Flags != 0" ), + DrawStruct->Type() ); exit = true; break; } @@ -109,6 +108,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) && !wxGetKeyState( WXK_CONTROL ) ) { DrawStruct = PcbGeneralLocateAndDisplay(); + if( DrawStruct ) SendMessageToEESCHEMA( DrawStruct ); } @@ -125,6 +125,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) GetBoard()->SetCurrentNetClass( ((BOARD_CONNECTED_ITEM*)DrawStruct)->GetNetClassName() ); m_TrackAndViasSizesList_Changed = true; + updateDesignRulesSelectBoxes(); break; default: @@ -286,7 +287,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) GetScreen()->SetCurItem( DrawStruct ); } else - DisplayError( this, wxT( "WinEDA_PcbFrame::OnLeftClick() zone internal error" ) ); + DisplayError( this, wxT( "PCB_EDIT_FRAME::OnLeftClick() zone internal error" ) ); break; case ID_PCB_ADD_TEXT_BUTT: @@ -344,7 +345,8 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) DrawPanel->m_AutoPAN_Request = true; } else - DisplayError( this, wxT( "WinEDA_PcbFrame::OnLeftClick() error item is not a DIMENSION" ) ); + DisplayError( this, + wxT( "PCB_EDIT_FRAME::OnLeftClick() error item is not a DIMENSION" ) ); break; case ID_PCB_DELETE_ITEM_BUTT: @@ -373,7 +375,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) break; default: - DisplayError( this, wxT( "WinEDA_PcbFrame::OnLeftClick() id error" ) ); + DisplayError( this, wxT( "PCB_EDIT_FRAME::OnLeftClick() id error" ) ); SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString ); break; } @@ -382,7 +384,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) /* handle the double click on the mouse left button */ -void WinEDA_PcbFrame::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition ) +void PCB_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition ) { BOARD_ITEM* DrawStruct = GetCurItem(); @@ -484,7 +486,7 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition ) } -void WinEDA_PcbFrame::OnEditItemRequest( wxDC* aDC, BOARD_ITEM* aItem ) +void PCB_EDIT_FRAME::OnEditItemRequest( wxDC* aDC, BOARD_ITEM* aItem ) { switch( aItem->Type() ) { diff --git a/pcbnew/onrightclick.cpp b/pcbnew/onrightclick.cpp index d4754ec65a..eeab3afa84 100644 --- a/pcbnew/onrightclick.cpp +++ b/pcbnew/onrightclick.cpp @@ -23,9 +23,7 @@ static wxMenu* Append_Track_Width_List( BOARD* aBoard ); -/******************************************************************************/ -bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) -/******************************************************************************/ +bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) { wxString msg; int flags = 0; @@ -62,6 +60,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ADD_MENUITEM( aPopMenu, ID_POPUP_CLOSE_CURRENT_TOOL, _( "End Tool" ), cancel_tool_xpm ); } + aPopMenu->AppendSeparator(); } else @@ -74,7 +73,6 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) } } - /* Select a proper item */ wxPoint cursorPos = GetScreen()->GetCrossHairPosition(); @@ -98,6 +96,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) { DrawPanel->m_AbortRequest = false; item = PcbGeneralLocateAndDisplay(); + if( DrawPanel->m_AbortRequest ) { DrawPanel->CrossHairOn( &dc ); @@ -125,8 +124,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) if( !( (MODULE*) item )->IsLocked() ) { - msg = AddHotkeyName( _( - "Lock Module" ), g_Board_Editor_Hokeys_Descr, + msg = AddHotkeyName( _("Lock Module" ), g_Board_Editor_Hokeys_Descr, HK_LOCK_UNLOCK_FOOTPRINT ); ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE, msg, locked_xpm ); @@ -165,14 +163,17 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_STOP_CURRENT_DRAWING, _( "End Drawing" ), apply_xpm ); } + if( !flags ) { - msg = AddHotkeyName( _( "Move Drawing" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM ); + msg = AddHotkeyName( _( "Move Drawing" ), g_Board_Editor_Hokeys_Descr, + HK_MOVE_ITEM ); ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_MOVE_DRAWING_REQUEST, msg, move_xpm ); ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_DRAWING, _( "Edit Drawing" ), edit_xpm ); ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_DRAWING, _( "Delete Drawing" ), delete_xpm ); + if( item->GetLayer() > LAST_COPPER_LAYER ) ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_DRAWING_LAYER, _( "Delete All Drawing on Layer" ), delete_body_xpm ); @@ -213,9 +214,9 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) case TYPE_DIMENSION: if( !flags ) { - msg = AddHotkeyName( _( "Edit Dimension" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); - ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_DIMENSION, - msg, edit_xpm ); + msg = AddHotkeyName( _( "Edit Dimension" ), g_Board_Editor_Hokeys_Descr, + HK_EDIT_ITEM ); + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_DIMENSION, msg, edit_xpm ); ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_DIMENSION, _( "Delete Dimension" ), delete_xpm ); } @@ -224,11 +225,12 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) case TYPE_MIRE: if( !flags ) { - msg = AddHotkeyName( _( "Move Target" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM ); + msg = AddHotkeyName( _( "Move Target" ), g_Board_Editor_Hokeys_Descr, + HK_MOVE_ITEM ); ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_MOVE_MIRE_REQUEST, msg, move_xpm ); - msg = AddHotkeyName( _( "Edit Target" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); - ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_MIRE, - msg, edit_xpm ); + msg = AddHotkeyName( _( "Edit Target" ), g_Board_Editor_Hokeys_Descr, + HK_EDIT_ITEM ); + ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_MIRE, msg, edit_xpm ); ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_MIRE, _( "Delete Target" ), delete_xpm ); } @@ -239,7 +241,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) case TYPE_NOT_INIT: case TYPE_PCB: msg.Printf( - wxT( "WinEDA_PcbFrame::OnRightClick() Error: unexpected DrawType %d" ), + wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unexpected DrawType %d" ), item->Type() ); DisplayError( this, msg ); SetCurItem( NULL ); @@ -247,7 +249,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) default: msg.Printf( - wxT( "WinEDA_PcbFrame::OnRightClick() Error: unknown DrawType %d" ), + wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unknown DrawType %d" ), item->Type() ); DisplayError( this, msg ); @@ -367,44 +369,32 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) } -/*********************************************************/ -void WinEDA_PcbFrame::createPopUpBlockMenu( wxMenu* menu ) -/*********************************************************/ - /* Create Pop sub menu for block commands */ +void PCB_EDIT_FRAME::createPopUpBlockMenu( wxMenu* menu ) { - ADD_MENUITEM( menu, ID_POPUP_CANCEL_CURRENT_COMMAND, - _( "Cancel Block" ), cancel_xpm ); - ADD_MENUITEM( menu, ID_POPUP_ZOOM_BLOCK, - _( "Zoom Block" ), zoom_selected_xpm ); + ADD_MENUITEM( menu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel Block" ), cancel_xpm ); + ADD_MENUITEM( menu, ID_POPUP_ZOOM_BLOCK, _( "Zoom Block" ), zoom_selected_xpm ); menu->AppendSeparator(); - ADD_MENUITEM( menu, ID_POPUP_PLACE_BLOCK, - _( "Place Block" ), apply_xpm ); - ADD_MENUITEM( menu, ID_POPUP_COPY_BLOCK, - _( "Copy Block" ), copyblock_xpm ); - ADD_MENUITEM( menu, ID_POPUP_FLIP_BLOCK, - _( "Flip Block" ), invert_module_xpm ); - ADD_MENUITEM( menu, ID_POPUP_ROTATE_BLOCK, - _( "Rotate Block" ), rotate_pos_xpm ); - ADD_MENUITEM( menu, ID_POPUP_DELETE_BLOCK, - _( "Delete Block" ), delete_xpm ); + ADD_MENUITEM( menu, ID_POPUP_PLACE_BLOCK, _( "Place Block" ), apply_xpm ); + ADD_MENUITEM( menu, ID_POPUP_COPY_BLOCK, _( "Copy Block" ), copyblock_xpm ); + ADD_MENUITEM( menu, ID_POPUP_FLIP_BLOCK, _( "Flip Block" ), invert_module_xpm ); + ADD_MENUITEM( menu, ID_POPUP_ROTATE_BLOCK, _( "Rotate Block" ), rotate_pos_xpm ); + ADD_MENUITEM( menu, ID_POPUP_DELETE_BLOCK, _( "Delete Block" ), delete_xpm ); } -/******************************************************************************/ -void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu ) -/******************************************************************************/ - /* Create command lines for a popup menu, for track and via editing * also update Netclass selection */ +void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu ) { wxPoint cursorPosition = GetScreen()->GetCrossHairPosition(); wxString msg; GetBoard()->SetCurrentNetClass( Track->GetNetClassName() ); m_TrackAndViasSizesList_Changed = true; + updateDesignRulesSelectBoxes(); int flags = Track->m_Flags; @@ -426,7 +416,8 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu ) { ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DRAG_TRACK_SEGMENT_KEEP_SLOPE, _( "Drag Segments, Keep Slope" ), drag_segment_withslope_xpm ); - msg = AddHotkeyName( _( "Drag Segment" ), g_Board_Editor_Hokeys_Descr, HK_DRAG_ITEM ); + msg = AddHotkeyName( _( "Drag Segment" ), g_Board_Editor_Hokeys_Descr, + HK_DRAG_ITEM ); ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DRAG_TRACK_SEGMENT, msg, drag_track_segment_xpm ); ADD_MENUITEM( PopMenu, ID_POPUP_PCB_BREAK_TRACK, @@ -450,14 +441,14 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu ) msg = AddHotkeyName( _( "Place Via" ), g_Board_Editor_Hokeys_Descr, HK_ADD_VIA ); PopMenu->Append( ID_POPUP_PCB_PLACE_VIA, msg ); - msg = AddHotkeyName( _( "Switch Track Posture" ), g_Board_Editor_Hokeys_Descr, HK_SWITCH_TRACK_POSTURE ); + msg = AddHotkeyName( _( "Switch Track Posture" ), g_Board_Editor_Hokeys_Descr, + HK_SWITCH_TRACK_POSTURE ); PopMenu->Append( ID_POPUP_PCB_SWITCH_TRACK_POSTURE, msg ); // See if we can place a Micro Via (4 or more layers, and start from an external layer): if( IsMicroViaAcceptable() ) { - msg = AddHotkeyName( _( - "Place Micro Via" ), g_Board_Editor_Hokeys_Descr, + msg = AddHotkeyName( _( "Place Micro Via" ), g_Board_Editor_Hokeys_Descr, HK_ADD_MICROVIA ); PopMenu->Append( ID_POPUP_PCB_PLACE_MICROVIA, msg ); } @@ -468,12 +459,14 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu ) { if( Track->Type() == TYPE_VIA ) { - msg = AddHotkeyName( _( "Change Via Size and Drill" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); + msg = AddHotkeyName( _( "Change Via Size and Drill" ), g_Board_Editor_Hokeys_Descr, + HK_EDIT_ITEM ); ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_TRACKSEG, msg, width_segment_xpm ); } else { - msg = AddHotkeyName( _( "Change Segment Width" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); + msg = AddHotkeyName( _( "Change Segment Width" ), g_Board_Editor_Hokeys_Descr, + HK_EDIT_ITEM ); ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_TRACKSEG, msg, width_segment_xpm ); ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_TRACK, _( "Change Track Width" ), width_track_xpm ); @@ -488,22 +481,20 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu ) // Delete control: PopMenu->AppendSeparator(); wxMenu* track_mnu = new wxMenu; - ADD_MENUITEM_WITH_SUBMENU( PopMenu, track_mnu, - ID_POPUP_PCB_DELETE_TRACK_MNU, _( "Delete" ), delete_xpm ); + ADD_MENUITEM_WITH_SUBMENU( PopMenu, track_mnu, ID_POPUP_PCB_DELETE_TRACK_MNU, + _( "Delete" ), delete_xpm ); msg = AddHotkeyName( Track->Type()==TYPE_VIA ? _( "Delete Via" ) : _( "Delete Segment" ), g_Board_Editor_Hokeys_Descr, HK_BACK_SPACE ); - ADD_MENUITEM( track_mnu, ID_POPUP_PCB_DELETE_TRACKSEG, - msg, delete_line_xpm ); + ADD_MENUITEM( track_mnu, ID_POPUP_PCB_DELETE_TRACKSEG, msg, delete_line_xpm ); + if( !flags ) { msg = AddHotkeyName( _( "Delete Track" ), g_Board_Editor_Hokeys_Descr, HK_DELETE ); - ADD_MENUITEM( track_mnu, ID_POPUP_PCB_DELETE_TRACK, - msg, delete_track_xpm ); - ADD_MENUITEM( track_mnu, ID_POPUP_PCB_DELETE_TRACKNET, - _( "Delete Net" ), delete_net_xpm ); + ADD_MENUITEM( track_mnu, ID_POPUP_PCB_DELETE_TRACK, msg, delete_track_xpm ); + ADD_MENUITEM( track_mnu, ID_POPUP_PCB_DELETE_TRACKNET, _( "Delete Net" ), delete_net_xpm ); } // Add global edition command @@ -538,12 +529,9 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu ) } -/********************************************************************************************/ -void WinEDA_PcbFrame::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu ) -/********************************************************************************************/ - /* Create the wxMenuitem list for zone outlines editing and zone filling */ +void PCB_EDIT_FRAME::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu ) { wxString msg; @@ -578,7 +566,8 @@ void WinEDA_PcbFrame::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu { ADD_MENUITEM( zones_menu, ID_POPUP_PCB_ADD_ZONE_CORNER, _( "Create Corner" ), add_corner_xpm ); - msg = AddHotkeyName( _( "Drag Outline Segment" ), g_Board_Editor_Hokeys_Descr, HK_DRAG_ITEM ); + msg = AddHotkeyName( _( "Drag Outline Segment" ), g_Board_Editor_Hokeys_Descr, + HK_DRAG_ITEM ); ADD_MENUITEM( zones_menu, ID_POPUP_PCB_DRAG_ZONE_OUTLINE_SEGMENT, msg, drag_outline_segment_xpm ); } @@ -591,8 +580,7 @@ void WinEDA_PcbFrame::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu _( "Add Cutout Area" ), add_zone_cutout ); zones_menu->AppendSeparator(); - ADD_MENUITEM( zones_menu, ID_POPUP_PCB_FILL_ZONE, - _( "Fill Zone" ), fill_zone_xpm ); + ADD_MENUITEM( zones_menu, ID_POPUP_PCB_FILL_ZONE, _( "Fill Zone" ), fill_zone_xpm ); if( edge_zone->m_FilledPolysList.size() > 0 ) { @@ -601,8 +589,7 @@ void WinEDA_PcbFrame::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu } msg = AddHotkeyName( _( "Move Zone" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM ); - ADD_MENUITEM( zones_menu, ID_POPUP_PCB_MOVE_ZONE_OUTLINES, - msg, move_xpm ); + ADD_MENUITEM( zones_menu, ID_POPUP_PCB_MOVE_ZONE_OUTLINES, msg, move_xpm ); msg = AddHotkeyName( _( "Edit Zone Params" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); ADD_MENUITEM( zones_menu, ID_POPUP_PCB_EDIT_ZONE_PARAMS, @@ -620,12 +607,9 @@ void WinEDA_PcbFrame::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu } -/*********************************************************************************/ -void WinEDA_PcbFrame::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* menu ) -/*********************************************************************************/ - /* Create the wxMenuitem list for footprint editing */ +void PCB_EDIT_FRAME::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* menu ) { wxMenu* sub_menu_footprint; int flags = aModule->m_Flags; @@ -635,6 +619,7 @@ void WinEDA_PcbFrame::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* men msg = aModule->MenuText( GetBoard() ); ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_footprint, -1, msg, module_xpm ); + if( !flags ) { msg = AddHotkeyName( _( "Move" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM ); @@ -644,6 +629,7 @@ void WinEDA_PcbFrame::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* men ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_DRAG_MODULE_REQUEST, msg, drag_module_xpm ); } + msg = AddHotkeyName( _( "Rotate +" ), g_Board_Editor_Hokeys_Descr, HK_ROTATE_ITEM ); ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE, msg, rotate_module_pos_xpm ); @@ -656,8 +642,7 @@ void WinEDA_PcbFrame::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* men if( !flags ) { msg = AddHotkeyName( _( "Edit" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); - ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_EDIT_MODULE, - msg, edit_module_xpm ); + ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_EDIT_MODULE, msg, edit_module_xpm ); sub_menu_footprint->AppendSeparator(); ADD_MENUITEM( sub_menu_footprint, ID_POPUP_PCB_DELETE_MODULE, _( "Delete Module" ), delete_module_xpm ); @@ -665,12 +650,9 @@ void WinEDA_PcbFrame::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* men } -/********************************************************************/ -void WinEDA_PcbFrame::createPopUpMenuForFpTexts( TEXTE_MODULE* FpText, wxMenu* menu ) -/********************************************************************/ - /* Create the wxMenuitem list for editing texts on footprints */ +void PCB_EDIT_FRAME::createPopUpMenuForFpTexts( TEXTE_MODULE* FpText, wxMenu* menu ) { wxMenu* sub_menu_Fp_text; int flags = FpText->m_Flags; @@ -700,7 +682,8 @@ void WinEDA_PcbFrame::createPopUpMenuForFpTexts( TEXTE_MODULE* FpText, wxMenu* m _( "Reset Size" ), reset_text_xpm ); } - if( !flags && FpText->m_Type == TEXT_is_DIVERS ) // Graphic texts can be deleted only if are not currently edited + // Graphic texts can be deleted only if are not currently edited. + if( !flags && FpText->m_Type == TEXT_is_DIVERS ) { ADD_MENUITEM( sub_menu_Fp_text, ID_POPUP_PCB_DELETE_TEXTMODULE, _( "Delete" ), delete_xpm ); @@ -709,6 +692,7 @@ void WinEDA_PcbFrame::createPopUpMenuForFpTexts( TEXTE_MODULE* FpText, wxMenu* m if( !flags ) { MODULE* module = (MODULE*) FpText->GetParent(); + if( module ) { menu->AppendSeparator(); @@ -718,13 +702,10 @@ void WinEDA_PcbFrame::createPopUpMenuForFpTexts( TEXTE_MODULE* FpText, wxMenu* m } -/************************************************************************/ -void WinEDA_PcbFrame::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu ) -/************************************************************************/ - /* Create pop menu for pads * also update Netclass selection */ +void PCB_EDIT_FRAME::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu ) { wxMenu* sub_menu_Pad; int flags = Pad->m_Flags; @@ -734,19 +715,17 @@ void WinEDA_PcbFrame::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu ) GetBoard()->SetCurrentNetClass( Pad->GetNetClassName() ); m_TrackAndViasSizesList_Changed = true; + updateDesignRulesSelectBoxes(); wxString msg = Pad->MenuText( GetBoard() ); sub_menu_Pad = new wxMenu; ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_Pad, -1, msg, pad_xpm ); - ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_MOVE_PAD_REQUEST, - _( "Move" ), move_pad_xpm ); - ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_DRAG_PAD_REQUEST, - _( "Drag" ), drag_pad_xpm ); + ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_MOVE_PAD_REQUEST, _( "Move" ), move_pad_xpm ); + ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_DRAG_PAD_REQUEST, _( "Drag" ), drag_pad_xpm ); - ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_EDIT_PAD, - _( "Edit" ), options_pad_xpm ); + ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_EDIT_PAD, _( "Edit" ), options_pad_xpm ); sub_menu_Pad->AppendSeparator(); ADD_MENUITEM_WITH_HELP( sub_menu_Pad, ID_POPUP_PCB_IMPORT_PAD_SETTINGS, @@ -764,15 +743,16 @@ void WinEDA_PcbFrame::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu ) global_options_pad_xpm ); sub_menu_Pad->AppendSeparator(); - ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_DELETE_PAD, - _( "Delete" ), delete_pad_xpm ); + ADD_MENUITEM( sub_menu_Pad, ID_POPUP_PCB_DELETE_PAD, _( "Delete" ), delete_pad_xpm ); if( m_HTOOL_current_state == ID_TOOLBARH_PCB_MODE_TRACKS ) { menu->Append( ID_POPUP_PCB_AUTOROUTE_PAD, _( "Autoroute Pad" ) ); menu->Append( ID_POPUP_PCB_AUTOROUTE_NET, _( "Autoroute Net" ) ); } + MODULE* module = (MODULE*) Pad->GetParent(); + if( module ) { menu->AppendSeparator(); @@ -781,10 +761,8 @@ void WinEDA_PcbFrame::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu ) } -/*****************************************************************************/ -void WinEDA_PcbFrame::createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu ) -/*****************************************************************************/ /* Create pop menu for pcb texts */ +void PCB_EDIT_FRAME::createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu ) { wxMenu* sub_menu_Text; int flags = Text->m_Flags; @@ -802,38 +780,30 @@ void WinEDA_PcbFrame::createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu ) msg, move_text_xpm ); } msg = AddHotkeyName( _( "Rotate" ), g_Board_Editor_Hokeys_Descr, HK_ROTATE_ITEM ); - ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_ROTATE_TEXTEPCB, - msg, rotate_pos_xpm ); + ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_ROTATE_TEXTEPCB, msg, rotate_pos_xpm ); msg = AddHotkeyName( _( "Edit" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); - ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_EDIT_TEXTEPCB, - msg, edit_text_xpm ); + ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_EDIT_TEXTEPCB, msg, edit_text_xpm ); ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_RESET_TEXT_SIZE, _( "Reset Size" ), reset_text_xpm ); sub_menu_Text->AppendSeparator(); - ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_DELETE_TEXTEPCB, - _( "Delete" ), delete_text_xpm ); + ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_DELETE_TEXTEPCB, _( "Delete" ), delete_text_xpm ); } -/**********************************************************************/ -void WinEDA_PcbFrame::createPopUpMenuForMarkers( MARKER_PCB* aMarker, wxMenu* aPopMenu ) -/**********************************************************************/ +void PCB_EDIT_FRAME::createPopUpMenuForMarkers( MARKER_PCB* aMarker, wxMenu* aPopMenu ) { ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_MARKER, _( "Delete Marker" ), delete_xpm ); ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_GETINFO_MARKER, _( "Marker Error Info" ), info_xpm ); } -/*******************************************************/ -static wxMenu* Append_Track_Width_List( BOARD* aBoard ) -/*******************************************************/ - /** * Function Append_Track_Width_List * creates a wxMenu * which shows the last used track widths and via diameters * @return a pointeur to the menu */ +static wxMenu* Append_Track_Width_List( BOARD* aBoard ) { wxString msg; wxMenu* trackwidth_menu; @@ -841,10 +811,8 @@ static wxMenu* Append_Track_Width_List( BOARD* aBoard ) trackwidth_menu = new wxMenu; - trackwidth_menu->Append( ID_POPUP_PCB_SELECT_AUTO_WIDTH, - _( "Auto Width" ), - _( - "Use the track width when starting on a track, otherwise the current track width" ), + trackwidth_menu->Append( ID_POPUP_PCB_SELECT_AUTO_WIDTH, _( "Auto Width" ), + _( "Use the track width when starting on a track, otherwise the current track width" ), true ); if( aBoard->GetBoardDesignSettings()->m_UseConnectedTrackWidth ) @@ -863,21 +831,15 @@ static wxMenu* Append_Track_Width_List( BOARD* aBoard ) value = ReturnStringFromValue( g_UserUnit, aBoard->m_TrackWidthList[ii], PCB_INTERNAL_UNIT, true ); msg.Printf( _( "Track %s" ), GetChars( value ) ); + if( ii == 0 ) msg << _( " (use NetClass)" ); + trackwidth_menu->Append( ID_POPUP_PCB_SELECT_WIDTH1 + ii, msg, wxEmptyString, true ); } - if( aBoard->GetBoardDesignSettings()->m_UseConnectedTrackWidth ) - trackwidth_menu->Check( ID_POPUP_PCB_SELECT_AUTO_WIDTH, true ); - else - { - if( aBoard->m_TrackWidthSelector < aBoard->m_TrackWidthList.size() ) - trackwidth_menu->Check( ID_POPUP_PCB_SELECT_WIDTH1 + aBoard->m_TrackWidthSelector, - true ); - } - trackwidth_menu->AppendSeparator(); + for( unsigned ii = 0; ii < aBoard->m_ViasDimensionsList.size(); ii++ ) { value = ReturnStringFromValue( g_UserUnit, aBoard->m_ViasDimensionsList[ii].m_Diameter, @@ -885,6 +847,7 @@ static wxMenu* Append_Track_Width_List( BOARD* aBoard ) wxString drill = ReturnStringFromValue( g_UserUnit, aBoard->m_ViasDimensionsList[ii].m_Drill, PCB_INTERNAL_UNIT, true ); + if( aBoard->m_ViasDimensionsList[ii].m_Drill <= 0 ) msg.Printf( _( "Via %s" ), GetChars( value ) ); else @@ -893,11 +856,9 @@ static wxMenu* Append_Track_Width_List( BOARD* aBoard ) } if( ii == 0 ) msg << _( " (use NetClass)" ); + trackwidth_menu->Append( ID_POPUP_PCB_SELECT_VIASIZE1 + ii, msg, wxEmptyString, true ); } - if( aBoard->m_ViaSizeSelector < aBoard->m_ViasDimensionsList.size() ) - trackwidth_menu->Check( ID_POPUP_PCB_SELECT_VIASIZE1 + aBoard->m_ViaSizeSelector, true ); - return trackwidth_menu; } diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 84649bd690..24a1838e69 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -64,178 +64,186 @@ extern int g_DrawDefaultLineThickness; #define SHOW_LAYER_MANAGER_TOOLS wxT( "ShowLayerManagerTools" ) -BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame ) - EVT_SOCKET( ID_EDA_SOCKET_EVENT_SERV, WinEDA_PcbFrame::OnSockRequestServer ) - EVT_SOCKET( ID_EDA_SOCKET_EVENT, WinEDA_PcbFrame::OnSockRequest ) +BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME ) + EVT_SOCKET( ID_EDA_SOCKET_EVENT_SERV, PCB_EDIT_FRAME::OnSockRequestServer ) + EVT_SOCKET( ID_EDA_SOCKET_EVENT, PCB_EDIT_FRAME::OnSockRequest ) - EVT_KICAD_CHOICEBOX( ID_ON_ZOOM_SELECT, WinEDA_PcbFrame::OnSelectZoom ) - EVT_KICAD_CHOICEBOX( ID_ON_GRID_SELECT, WinEDA_PcbFrame::OnSelectGrid ) + EVT_KICAD_CHOICEBOX( ID_ON_ZOOM_SELECT, PCB_EDIT_FRAME::OnSelectZoom ) + EVT_KICAD_CHOICEBOX( ID_ON_GRID_SELECT, PCB_EDIT_FRAME::OnSelectGrid ) - EVT_CLOSE( WinEDA_PcbFrame::OnCloseWindow ) - EVT_SIZE( WinEDA_PcbFrame::OnSize ) + EVT_CLOSE( PCB_EDIT_FRAME::OnCloseWindow ) + EVT_SIZE( PCB_EDIT_FRAME::OnSize ) - EVT_TOOL( ID_LOAD_FILE, WinEDA_PcbFrame::Files_io ) - EVT_TOOL( ID_MENU_READ_LAST_SAVED_VERSION_BOARD, WinEDA_PcbFrame::Files_io ) - EVT_TOOL( ID_MENU_RECOVER_BOARD, WinEDA_PcbFrame::Files_io ) - EVT_TOOL( ID_NEW_BOARD, WinEDA_PcbFrame::Files_io ) - EVT_TOOL( ID_SAVE_BOARD, WinEDA_PcbFrame::Files_io ) - EVT_TOOL( ID_OPEN_MODULE_EDITOR, WinEDA_PcbFrame::Process_Special_Functions ) + EVT_TOOL( ID_LOAD_FILE, PCB_EDIT_FRAME::Files_io ) + EVT_TOOL( ID_MENU_READ_LAST_SAVED_VERSION_BOARD, PCB_EDIT_FRAME::Files_io ) + EVT_TOOL( ID_MENU_RECOVER_BOARD, PCB_EDIT_FRAME::Files_io ) + EVT_TOOL( ID_NEW_BOARD, PCB_EDIT_FRAME::Files_io ) + EVT_TOOL( ID_SAVE_BOARD, PCB_EDIT_FRAME::Files_io ) + EVT_TOOL( ID_OPEN_MODULE_EDITOR, PCB_EDIT_FRAME::Process_Special_Functions ) // Menu Files: - EVT_MENU( ID_MAIN_MENUBAR, WinEDA_PcbFrame::Process_Special_Functions ) + EVT_MENU( ID_MAIN_MENUBAR, PCB_EDIT_FRAME::Process_Special_Functions ) - EVT_MENU( ID_APPEND_FILE, WinEDA_PcbFrame::Files_io ) - EVT_MENU( ID_SAVE_BOARD_AS, WinEDA_PcbFrame::Files_io ) - EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, WinEDA_PcbFrame::OnFileHistory ) + EVT_MENU( ID_APPEND_FILE, PCB_EDIT_FRAME::Files_io ) + EVT_MENU( ID_SAVE_BOARD_AS, PCB_EDIT_FRAME::Files_io ) + EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, PCB_EDIT_FRAME::OnFileHistory ) - EVT_MENU( ID_GEN_PLOT, WinEDA_PcbFrame::ToPlotter ) + EVT_MENU( ID_GEN_PLOT, PCB_EDIT_FRAME::ToPlotter ) - EVT_MENU( ID_GEN_EXPORT_SPECCTRA, WinEDA_PcbFrame::ExportToSpecctra ) - EVT_MENU( ID_GEN_EXPORT_FILE_GENCADFORMAT, WinEDA_PcbFrame::ExportToGenCAD ) - EVT_MENU( ID_GEN_EXPORT_FILE_MODULE_REPORT, WinEDA_PcbFrame::GenModuleReport ) - EVT_MENU( ID_GEN_EXPORT_FILE_VRML, WinEDA_PcbFrame::OnExportVRML ) + EVT_MENU( ID_GEN_EXPORT_SPECCTRA, PCB_EDIT_FRAME::ExportToSpecctra ) + EVT_MENU( ID_GEN_EXPORT_FILE_GENCADFORMAT, PCB_EDIT_FRAME::ExportToGenCAD ) + EVT_MENU( ID_GEN_EXPORT_FILE_MODULE_REPORT, PCB_EDIT_FRAME::GenModuleReport ) + EVT_MENU( ID_GEN_EXPORT_FILE_VRML, PCB_EDIT_FRAME::OnExportVRML ) - EVT_MENU( ID_GEN_IMPORT_SPECCTRA_SESSION,WinEDA_PcbFrame::ImportSpecctraSession ) - EVT_MENU( ID_GEN_IMPORT_SPECCTRA_DESIGN, WinEDA_PcbFrame::ImportSpecctraDesign ) + EVT_MENU( ID_GEN_IMPORT_SPECCTRA_SESSION,PCB_EDIT_FRAME::ImportSpecctraSession ) + EVT_MENU( ID_GEN_IMPORT_SPECCTRA_DESIGN, PCB_EDIT_FRAME::ImportSpecctraDesign ) - EVT_MENU( ID_MENU_ARCHIVE_NEW_MODULES, WinEDA_PcbFrame::Process_Special_Functions ) - EVT_MENU( ID_MENU_ARCHIVE_ALL_MODULES, WinEDA_PcbFrame::Process_Special_Functions ) + EVT_MENU( ID_MENU_ARCHIVE_NEW_MODULES, PCB_EDIT_FRAME::Process_Special_Functions ) + EVT_MENU( ID_MENU_ARCHIVE_ALL_MODULES, PCB_EDIT_FRAME::Process_Special_Functions ) - EVT_MENU( wxID_EXIT, WinEDA_PcbFrame::OnQuit ) + EVT_MENU( wxID_EXIT, PCB_EDIT_FRAME::OnQuit ) // menu Config - EVT_MENU( ID_PCB_DRAWINGS_WIDTHS_SETUP, WinEDA_PcbFrame::OnConfigurePcbOptions ) - EVT_MENU( ID_CONFIG_REQ, WinEDA_PcbFrame::Process_Config ) - EVT_MENU( ID_CONFIG_SAVE, WinEDA_PcbFrame::Process_Config ) - EVT_MENU( ID_CONFIG_READ, WinEDA_PcbFrame::Process_Config ) - EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, - ID_PREFERENCES_HOTKEY_END, - WinEDA_PcbFrame::Process_Config ) - EVT_MENU( ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER_DIALOG, WinEDA_PcbFrame::Process_Config ) - EVT_MENU( ID_OPTIONS_SETUP, WinEDA_PcbFrame::Process_Config ) - EVT_MENU( ID_PCB_LAYERS_SETUP, WinEDA_PcbFrame::Process_Config ) - EVT_MENU( ID_PCB_MASK_CLEARANCE, WinEDA_PcbFrame::Process_Config ) - EVT_MENU( ID_PCB_PAD_SETUP, WinEDA_PcbFrame::Process_Config ) - EVT_MENU( ID_CONFIG_SAVE, WinEDA_PcbFrame::Process_Config ) - EVT_MENU( ID_CONFIG_READ, WinEDA_PcbFrame::Process_Config ) - EVT_MENU( ID_PCB_DISPLAY_OPTIONS_SETUP, WinEDA_PcbFrame::InstallDisplayOptionsDialog ) - EVT_MENU( ID_PCB_USER_GRID_SETUP, WinEDA_PcbFrame::Process_Special_Functions ) + EVT_MENU( ID_PCB_DRAWINGS_WIDTHS_SETUP, PCB_EDIT_FRAME::OnConfigurePcbOptions ) + EVT_MENU( ID_CONFIG_REQ, PCB_EDIT_FRAME::Process_Config ) + EVT_MENU( ID_CONFIG_SAVE, PCB_EDIT_FRAME::Process_Config ) + EVT_MENU( ID_CONFIG_READ, PCB_EDIT_FRAME::Process_Config ) + EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END, + PCB_EDIT_FRAME::Process_Config ) + EVT_MENU( ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER_DIALOG, PCB_EDIT_FRAME::Process_Config ) + EVT_MENU( ID_OPTIONS_SETUP, PCB_EDIT_FRAME::Process_Config ) + EVT_MENU( ID_PCB_LAYERS_SETUP, PCB_EDIT_FRAME::Process_Config ) + EVT_MENU( ID_PCB_MASK_CLEARANCE, PCB_EDIT_FRAME::Process_Config ) + EVT_MENU( ID_PCB_PAD_SETUP, PCB_EDIT_FRAME::Process_Config ) + EVT_MENU( ID_CONFIG_SAVE, PCB_EDIT_FRAME::Process_Config ) + EVT_MENU( ID_CONFIG_READ, PCB_EDIT_FRAME::Process_Config ) + EVT_MENU( ID_PCB_DISPLAY_OPTIONS_SETUP, PCB_EDIT_FRAME::InstallDisplayOptionsDialog ) + EVT_MENU( ID_PCB_USER_GRID_SETUP, PCB_EDIT_FRAME::Process_Special_Functions ) - EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, WinEDA_PcbFrame::SetLanguage ) + EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, PCB_EDIT_FRAME::SetLanguage ) // menu Postprocess - EVT_MENU( ID_PCB_GEN_POS_MODULES_FILE, WinEDA_PcbFrame::GenModulesPosition ) - EVT_MENU( ID_PCB_GEN_DRILL_FILE, WinEDA_PcbFrame::InstallDrillFrame ) - EVT_MENU( ID_PCB_GEN_CMP_FILE, WinEDA_PcbFrame::RecreateCmpFileFromBoard ) - EVT_MENU( ID_PCB_GEN_BOM_FILE_FROM_BOARD, WinEDA_PcbFrame::RecreateBOMFileFromBoard ) + EVT_MENU( ID_PCB_GEN_POS_MODULES_FILE, PCB_EDIT_FRAME::GenModulesPosition ) + EVT_MENU( ID_PCB_GEN_DRILL_FILE, PCB_EDIT_FRAME::InstallDrillFrame ) + EVT_MENU( ID_PCB_GEN_CMP_FILE, PCB_EDIT_FRAME::RecreateCmpFileFromBoard ) + EVT_MENU( ID_PCB_GEN_BOM_FILE_FROM_BOARD, PCB_EDIT_FRAME::RecreateBOMFileFromBoard ) // menu Miscellaneous - EVT_MENU( ID_MENU_LIST_NETS, WinEDA_PcbFrame::ListNetsAndSelect ) - EVT_MENU( ID_PCB_GLOBAL_DELETE, WinEDA_PcbFrame::Process_Special_Functions ) - EVT_MENU( ID_MENU_PCB_CLEAN, WinEDA_PcbFrame::Process_Special_Functions ) - EVT_MENU( ID_MENU_PCB_SWAP_LAYERS, WinEDA_PcbFrame::Process_Special_Functions ) + EVT_MENU( ID_MENU_LIST_NETS, PCB_EDIT_FRAME::ListNetsAndSelect ) + EVT_MENU( ID_PCB_GLOBAL_DELETE, PCB_EDIT_FRAME::Process_Special_Functions ) + EVT_MENU( ID_MENU_PCB_CLEAN, PCB_EDIT_FRAME::Process_Special_Functions ) + EVT_MENU( ID_MENU_PCB_SWAP_LAYERS, PCB_EDIT_FRAME::Process_Special_Functions ) EVT_MENU( ID_MENU_PCB_RESET_TEXTMODULE_REFERENCE_SIZES, - WinEDA_PcbFrame::Process_Special_Functions ) + PCB_EDIT_FRAME::Process_Special_Functions ) EVT_MENU( ID_MENU_PCB_RESET_TEXTMODULE_VALUE_SIZES, - WinEDA_PcbFrame::Process_Special_Functions ) + PCB_EDIT_FRAME::Process_Special_Functions ) // Menu Help EVT_MENU( ID_GENERAL_HELP, EDA_DRAW_FRAME::GetKicadHelp ) EVT_MENU( ID_KICAD_ABOUT, EDA_BASE_FRAME::GetKicadAbout ) // Menu 3D Frame - EVT_MENU( ID_MENU_PCB_SHOW_3D_FRAME, WinEDA_PcbFrame::Show3D_Frame ) + EVT_MENU( ID_MENU_PCB_SHOW_3D_FRAME, PCB_EDIT_FRAME::Show3D_Frame ) // Menu Get Design Rules Editor - EVT_MENU( ID_MENU_PCB_SHOW_DESIGN_RULES_DIALOG, WinEDA_PcbFrame::ShowDesignRulesEditor ) + EVT_MENU( ID_MENU_PCB_SHOW_DESIGN_RULES_DIALOG, PCB_EDIT_FRAME::ShowDesignRulesEditor ) // Horizontal toolbar - EVT_TOOL( ID_TO_LIBRARY, WinEDA_PcbFrame::Process_Special_Functions ) + EVT_TOOL( ID_TO_LIBRARY, PCB_EDIT_FRAME::Process_Special_Functions ) EVT_TOOL( ID_SHEET_SET, EDA_DRAW_FRAME::Process_PageSettings ) - EVT_TOOL( wxID_CUT, WinEDA_PcbFrame::Process_Special_Functions ) - EVT_TOOL( wxID_COPY, WinEDA_PcbFrame::Process_Special_Functions ) - EVT_TOOL( wxID_PASTE, WinEDA_PcbFrame::Process_Special_Functions ) - EVT_TOOL( wxID_UNDO, WinEDA_PcbFrame::GetBoardFromUndoList ) - EVT_TOOL( wxID_REDO, WinEDA_PcbFrame::GetBoardFromRedoList ) - EVT_TOOL( wxID_PRINT, WinEDA_PcbFrame::ToPrinter ) - EVT_TOOL( ID_GEN_PLOT_SVG, WinEDA_PcbFrame::SVG_Print ) - EVT_TOOL( ID_GEN_PLOT, WinEDA_PcbFrame::Process_Special_Functions ) - EVT_TOOL( ID_FIND_ITEMS, WinEDA_PcbFrame::Process_Special_Functions ) - EVT_TOOL( ID_GET_NETLIST, WinEDA_PcbFrame::Process_Special_Functions ) - EVT_TOOL( ID_DRC_CONTROL, WinEDA_PcbFrame::Process_Special_Functions ) - EVT_TOOL( ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, WinEDA_PcbFrame::Process_Special_Functions ) - EVT_TOOL( ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH, WinEDA_PcbFrame::Tracks_and_Vias_Size_Event ) - EVT_KICAD_CHOICEBOX( ID_TOOLBARH_PCB_SELECT_LAYER, WinEDA_PcbFrame::Process_Special_Functions ) + EVT_TOOL( wxID_CUT, PCB_EDIT_FRAME::Process_Special_Functions ) + EVT_TOOL( wxID_COPY, PCB_EDIT_FRAME::Process_Special_Functions ) + EVT_TOOL( wxID_PASTE, PCB_EDIT_FRAME::Process_Special_Functions ) + EVT_TOOL( wxID_UNDO, PCB_EDIT_FRAME::GetBoardFromUndoList ) + EVT_TOOL( wxID_REDO, PCB_EDIT_FRAME::GetBoardFromRedoList ) + EVT_TOOL( wxID_PRINT, PCB_EDIT_FRAME::ToPrinter ) + EVT_TOOL( ID_GEN_PLOT_SVG, PCB_EDIT_FRAME::SVG_Print ) + EVT_TOOL( ID_GEN_PLOT, PCB_EDIT_FRAME::Process_Special_Functions ) + EVT_TOOL( ID_FIND_ITEMS, PCB_EDIT_FRAME::Process_Special_Functions ) + EVT_TOOL( ID_GET_NETLIST, PCB_EDIT_FRAME::Process_Special_Functions ) + EVT_TOOL( ID_DRC_CONTROL, PCB_EDIT_FRAME::Process_Special_Functions ) + EVT_TOOL( ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, PCB_EDIT_FRAME::Process_Special_Functions ) + EVT_TOOL( ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event ) + EVT_KICAD_CHOICEBOX( ID_TOOLBARH_PCB_SELECT_LAYER, PCB_EDIT_FRAME::Process_Special_Functions ) EVT_KICAD_CHOICEBOX( ID_AUX_TOOLBAR_PCB_TRACK_WIDTH, - WinEDA_PcbFrame::Tracks_and_Vias_Size_Event ) - EVT_KICAD_CHOICEBOX( ID_AUX_TOOLBAR_PCB_VIA_SIZE, WinEDA_PcbFrame::Tracks_and_Vias_Size_Event ) - EVT_TOOL( ID_TOOLBARH_PCB_MODE_MODULE, WinEDA_PcbFrame::AutoPlace ) - EVT_TOOL( ID_TOOLBARH_PCB_MODE_TRACKS, WinEDA_PcbFrame::AutoPlace ) - EVT_TOOL( ID_TOOLBARH_PCB_FREEROUTE_ACCESS, WinEDA_PcbFrame::Access_to_External_Tool ) + PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event ) + EVT_KICAD_CHOICEBOX( ID_AUX_TOOLBAR_PCB_VIA_SIZE, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event ) + EVT_TOOL( ID_TOOLBARH_PCB_MODE_MODULE, PCB_EDIT_FRAME::AutoPlace ) + EVT_TOOL( ID_TOOLBARH_PCB_MODE_TRACKS, PCB_EDIT_FRAME::AutoPlace ) + EVT_TOOL( ID_TOOLBARH_PCB_FREEROUTE_ACCESS, PCB_EDIT_FRAME::Access_to_External_Tool ) // Option toolbar EVT_TOOL_RANGE( ID_TB_OPTIONS_START, ID_TB_OPTIONS_END, - WinEDA_PcbFrame::OnSelectOptionToolbar ) + PCB_EDIT_FRAME::OnSelectOptionToolbar ) EVT_TOOL_RANGE( ID_TB_OPTIONS_SHOW_ZONES, ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY, - WinEDA_PcbFrame::OnSelectOptionToolbar ) + PCB_EDIT_FRAME::OnSelectOptionToolbar ) EVT_TOOL( ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR, - WinEDA_PcbFrame::OnSelectOptionToolbar ) + PCB_EDIT_FRAME::OnSelectOptionToolbar ) // Vertical toolbar: - EVT_TOOL( ID_NO_TOOL_SELECTED, WinEDA_PcbFrame::OnSelectTool ) + EVT_TOOL( ID_NO_TOOL_SELECTED, PCB_EDIT_FRAME::OnSelectTool ) EVT_TOOL_RANGE( ID_PCB_HIGHLIGHT_BUTT, ID_PCB_PLACE_GRID_COORD_BUTT, - WinEDA_PcbFrame::OnSelectTool ) + PCB_EDIT_FRAME::OnSelectTool ) EVT_TOOL_RANGE( ID_PCB_MUWAVE_START_CMD, ID_PCB_MUWAVE_END_CMD, - WinEDA_PcbFrame::ProcessMuWaveFunctions ) + PCB_EDIT_FRAME::ProcessMuWaveFunctions ) EVT_MENU_RANGE( ID_POPUP_PCB_AUTOPLACE_START_RANGE, ID_POPUP_PCB_AUTOPLACE_END_RANGE, - WinEDA_PcbFrame::AutoPlace ) + PCB_EDIT_FRAME::AutoPlace ) - EVT_MENU( ID_POPUP_PCB_REORIENT_ALL_MODULES, WinEDA_PcbFrame::OnOrientFootprints ) + EVT_MENU( ID_POPUP_PCB_REORIENT_ALL_MODULES, PCB_EDIT_FRAME::OnOrientFootprints ) EVT_MENU_RANGE( ID_POPUP_PCB_START_RANGE, ID_POPUP_PCB_END_RANGE, - WinEDA_PcbFrame::Process_Special_Functions ) + PCB_EDIT_FRAME::Process_Special_Functions ) // Tracks and vias sizes general options EVT_MENU_RANGE( ID_POPUP_PCB_SELECT_WIDTH_START_RANGE, ID_POPUP_PCB_SELECT_WIDTH_END_RANGE, - WinEDA_PcbFrame::Tracks_and_Vias_Size_Event ) + PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event ) // popup menus - EVT_MENU( ID_POPUP_PCB_DELETE_TRACKSEG, WinEDA_PcbFrame::Process_Special_Functions ) + EVT_MENU( ID_POPUP_PCB_DELETE_TRACKSEG, PCB_EDIT_FRAME::Process_Special_Functions ) EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE, - WinEDA_PcbFrame::Process_Special_Functions ) + PCB_EDIT_FRAME::Process_Special_Functions ) // User interface update event handlers. - EVT_UPDATE_UI( ID_SAVE_BOARD, WinEDA_PcbFrame::OnUpdateSave ) - EVT_UPDATE_UI( ID_TB_OPTIONS_DRC_OFF, WinEDA_PcbFrame::OnUpdateDrcEnable ) - EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_RATSNEST, WinEDA_PcbFrame::OnUpdateShowBoardRatsnest ) - EVT_UPDATE_UI( ID_TB_OPTIONS_AUTO_DEL_TRACK, WinEDA_PcbFrame::OnUpdateAutoDeleteTrack ) - EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_VIAS_SKETCH, WinEDA_PcbFrame::OnUpdateViaDrawMode ) - EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, WinEDA_PcbFrame::OnUpdateTraceDrawMode ) + EVT_UPDATE_UI( ID_SAVE_BOARD, PCB_EDIT_FRAME::OnUpdateSave ) + EVT_UPDATE_UI( ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, PCB_EDIT_FRAME::OnUpdateLayerPair ) + EVT_UPDATE_UI( ID_TOOLBARH_PCB_SELECT_LAYER, PCB_EDIT_FRAME::OnUpdateLayerSelectBox ) + EVT_UPDATE_UI( ID_TB_OPTIONS_DRC_OFF, PCB_EDIT_FRAME::OnUpdateDrcEnable ) + EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_RATSNEST, PCB_EDIT_FRAME::OnUpdateShowBoardRatsnest ) + EVT_UPDATE_UI( ID_TB_OPTIONS_AUTO_DEL_TRACK, PCB_EDIT_FRAME::OnUpdateAutoDeleteTrack ) + EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_VIAS_SKETCH, PCB_EDIT_FRAME::OnUpdateViaDrawMode ) + EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, PCB_EDIT_FRAME::OnUpdateTraceDrawMode ) EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE, - WinEDA_PcbFrame::OnUpdateHighContrastDisplayMode ) + PCB_EDIT_FRAME::OnUpdateHighContrastDisplayMode ) EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1, - WinEDA_PcbFrame::OnUpdateShowLayerManager ) - EVT_UPDATE_UI( ID_NO_TOOL_SELECTED, WinEDA_PcbFrame::OnUpdateVerticalToolbar ) + PCB_EDIT_FRAME::OnUpdateShowLayerManager ) + EVT_UPDATE_UI( ID_NO_TOOL_SELECTED, PCB_EDIT_FRAME::OnUpdateVerticalToolbar ) + EVT_UPDATE_UI( ID_AUX_TOOLBAR_PCB_TRACK_WIDTH, PCB_EDIT_FRAME::OnUpdateSelectTrackWidth ) + EVT_UPDATE_UI( ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH, + PCB_EDIT_FRAME::OnUpdateSelectAutoTrackWidth ) + EVT_UPDATE_UI( ID_POPUP_PCB_SELECT_AUTO_WIDTH, PCB_EDIT_FRAME::OnUpdateSelectAutoTrackWidth ) + EVT_UPDATE_UI( ID_AUX_TOOLBAR_PCB_VIA_SIZE, PCB_EDIT_FRAME::OnUpdateSelectViaSize ) + EVT_UPDATE_UI_RANGE( ID_POPUP_PCB_SELECT_WIDTH1, ID_POPUP_PCB_SELECT_WIDTH8, + PCB_EDIT_FRAME::OnUpdateSelectTrackWidth ) + EVT_UPDATE_UI_RANGE( ID_POPUP_PCB_SELECT_VIASIZE1, ID_POPUP_PCB_SELECT_VIASIZE8, + PCB_EDIT_FRAME::OnUpdateSelectViaSize ) EVT_UPDATE_UI_RANGE( ID_PCB_HIGHLIGHT_BUTT, ID_PCB_PLACE_GRID_COORD_BUTT, - WinEDA_PcbFrame::OnUpdateVerticalToolbar ) - EVT_UPDATE_UI_RANGE( ID_AUX_TOOLBAR_PCB_VIA_SIZE, ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH, - WinEDA_PcbFrame::OnUpdateAuxilaryToolbar ) + PCB_EDIT_FRAME::OnUpdateVerticalToolbar ) EVT_UPDATE_UI_RANGE( ID_TB_OPTIONS_SHOW_ZONES, ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY, - WinEDA_PcbFrame::OnUpdateZoneDisplayStyle ) + PCB_EDIT_FRAME::OnUpdateZoneDisplayStyle ) END_EVENT_TABLE() ///////****************************///////////: -WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* parent, const wxString& title, - const wxPoint& pos, const wxSize& size, - long style ) : - WinEDA_BasePcbFrame( parent, PCB_FRAME, title, pos, size, style ) +PCB_EDIT_FRAME::PCB_EDIT_FRAME( wxWindow* parent, const wxString& title, + const wxPoint& pos, const wxSize& size, + long style ) : + PCB_BASE_FRAME( parent, PCB_FRAME, title, pos, size, style ) { m_FrameName = wxT( "PcbFrame" ); m_Draw_Sheet_Ref = true; // true to display sheet references @@ -364,11 +372,7 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* parent, const wxString& title, wxAuiPaneInfo( vert ).Name( wxT( "m_OptionsToolBar" ) ).Left() .ToolbarPane().Gripper( false ) ); - m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR, - m_show_layer_manager_tools ); m_auimgr.GetPane( wxT( "m_LayersManagerToolBar" ) ).Show( m_show_layer_manager_tools ); - m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1, - m_show_microwave_tools ); m_auimgr.GetPane( wxT( "m_AuxVToolBar" ) ).Show( m_show_microwave_tools ); } @@ -387,13 +391,13 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* parent, const wxString& title, } -WinEDA_PcbFrame::~WinEDA_PcbFrame() +PCB_EDIT_FRAME::~PCB_EDIT_FRAME() { delete m_drc; } -void WinEDA_PcbFrame::ReFillLayerWidget() +void PCB_EDIT_FRAME::ReFillLayerWidget() { m_Layers->ReFill(); @@ -412,13 +416,13 @@ void WinEDA_PcbFrame::ReFillLayerWidget() } -void WinEDA_PcbFrame::OnQuit( wxCommandEvent& event ) +void PCB_EDIT_FRAME::OnQuit( wxCommandEvent& event ) { Close( true ); } -void WinEDA_PcbFrame::OnCloseWindow( wxCloseEvent& Event ) +void PCB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event ) { DrawPanel->m_AbortRequest = true; @@ -466,7 +470,7 @@ void WinEDA_PcbFrame::OnCloseWindow( wxCloseEvent& Event ) /** * Display 3D frame of current printed circuit board. */ -void WinEDA_PcbFrame::Show3D_Frame( wxCommandEvent& event ) +void PCB_EDIT_FRAME::Show3D_Frame( wxCommandEvent& event ) { if( m_Draw3DFrame ) { @@ -482,7 +486,7 @@ void WinEDA_PcbFrame::Show3D_Frame( wxCommandEvent& event ) /** * Display the Design Rules Editor. */ -void WinEDA_PcbFrame::ShowDesignRulesEditor( wxCommandEvent& event ) +void PCB_EDIT_FRAME::ShowDesignRulesEditor( wxCommandEvent& event ) { DIALOG_DESIGN_RULES dR_editor( this ); int returncode = dR_editor.ShowModal(); @@ -490,12 +494,15 @@ void WinEDA_PcbFrame::ShowDesignRulesEditor( wxCommandEvent& event ) if( returncode == wxID_OK ) // New rules, or others changes. { ReCreateLayerBox( NULL ); + updateDesignRulesSelectBoxes(); + updateTraceWidthSelectBox(); + updateViaSizeSelectBox(); OnModify(); } } -void WinEDA_PcbFrame::LoadSettings() +void PCB_EDIT_FRAME::LoadSettings() { wxConfig* config = wxGetApp().m_EDA_Config; @@ -507,7 +514,7 @@ void WinEDA_PcbFrame::LoadSettings() */ wxGetApp().ReadCurrentSetupValues( GetConfigurationSettings() ); - WinEDA_BasePcbFrame::LoadSettings(); + PCB_BASE_FRAME::LoadSettings(); long tmp; config->Read( OPTKEY_DEFAULT_LINEWIDTH_VALUE, &g_DrawDefaultLineThickness ); @@ -520,7 +527,7 @@ void WinEDA_PcbFrame::LoadSettings() } -void WinEDA_PcbFrame::SaveSettings() +void PCB_EDIT_FRAME::SaveSettings() { wxConfig* config = wxGetApp().m_EDA_Config; @@ -532,7 +539,7 @@ void WinEDA_PcbFrame::SaveSettings() */ wxGetApp().SaveCurrentSetupValues( GetConfigurationSettings() ); - WinEDA_BasePcbFrame::SaveSettings(); + PCB_BASE_FRAME::SaveSettings(); wxRealPoint GridSize = GetScreen()->GetGridSize(); @@ -550,7 +557,7 @@ void WinEDA_PcbFrame::SaveSettings() * Function IsGridVisible() , virtual * @return true if the grid must be shown */ -bool WinEDA_PcbFrame::IsGridVisible() +bool PCB_EDIT_FRAME::IsGridVisible() { return IsElementVisible( GRID_VISIBLE ); } @@ -562,7 +569,7 @@ bool WinEDA_PcbFrame::IsGridVisible() * if you want to store/retrieve the grid visibility in configuration. * @param aVisible = true if the grid must be shown */ -void WinEDA_PcbFrame::SetGridVisibility(bool aVisible) +void PCB_EDIT_FRAME::SetGridVisibility(bool aVisible) { SetElementVisibility( GRID_VISIBLE, aVisible ); } @@ -572,7 +579,7 @@ void WinEDA_PcbFrame::SetGridVisibility(bool aVisible) * Function GetGridColor() , virtual * @return the color of the grid */ -int WinEDA_PcbFrame::GetGridColor() +int PCB_EDIT_FRAME::GetGridColor() { return GetBoard()->GetVisibleElementColor( GRID_VISIBLE ); } @@ -582,7 +589,7 @@ int WinEDA_PcbFrame::GetGridColor() * Function SetGridColor() , virtual * @param aColor = the new color of the grid */ -void WinEDA_PcbFrame::SetGridColor(int aColor) +void PCB_EDIT_FRAME::SetGridColor(int aColor) { GetBoard()->SetVisibleElementColor( GRID_VISIBLE, aColor ); } @@ -594,7 +601,7 @@ void WinEDA_PcbFrame::SetGridColor(int aColor) * It is mainly used to connect BGA to the first inner layer * And it is allowed from an external layer to the first inner layer */ -bool WinEDA_PcbFrame::IsMicroViaAcceptable( void ) +bool PCB_EDIT_FRAME::IsMicroViaAcceptable( void ) { int copperlayercnt = GetBoard()->GetCopperLayerCount( ); int currLayer = getActiveLayer(); @@ -615,12 +622,22 @@ bool WinEDA_PcbFrame::IsMicroViaAcceptable( void ) } -void WinEDA_PcbFrame::syncLayerWidget( ) +void PCB_EDIT_FRAME::syncLayerWidget( ) { m_Layers->SelectLayer( getActiveLayer() ); } +void PCB_EDIT_FRAME::unitsChangeRefresh() +{ + PCB_BASE_FRAME::unitsChangeRefresh(); // Update the grid size select box. + + updateTraceWidthSelectBox(); + updateViaSizeSelectBox(); + updateDesignRulesSelectBoxes(); +} + + /** * Function SetElementVisibility * changes the visibility of an element category @@ -628,7 +645,7 @@ void WinEDA_PcbFrame::syncLayerWidget( ) * @param aNewState = The new visibility state of the element category * @see enum PCB_VISIBLE */ -void WinEDA_PcbFrame::SetElementVisibility( int aPCB_VISIBLE, bool aNewState ) +void PCB_EDIT_FRAME::SetElementVisibility( int aPCB_VISIBLE, bool aNewState ) { GetBoard()->SetElementVisibility( aPCB_VISIBLE, aNewState ); m_Layers->SetRenderState( aPCB_VISIBLE, aNewState ); @@ -639,7 +656,7 @@ void WinEDA_PcbFrame::SetElementVisibility( int aPCB_VISIBLE, bool aNewState ) * Function SetVisibleAlls * Set the status of all visible element categories and layers to VISIBLE */ -void WinEDA_PcbFrame::SetVisibleAlls( ) +void PCB_EDIT_FRAME::SetVisibleAlls( ) { GetBoard()->SetVisibleAlls( ); @@ -652,7 +669,7 @@ void WinEDA_PcbFrame::SetVisibleAlls( ) * Function SetLanguage * called on a language menu selection */ -void WinEDA_PcbFrame::SetLanguage( wxCommandEvent& event ) +void PCB_EDIT_FRAME::SetLanguage( wxCommandEvent& event ) { EDA_DRAW_FRAME::SetLanguage( event ); m_Layers->SetLayersManagerTabsText(); @@ -666,7 +683,7 @@ void WinEDA_PcbFrame::SetLanguage( wxCommandEvent& event ) } -wxString WinEDA_PcbFrame::GetLastNetListRead() +wxString PCB_EDIT_FRAME::GetLastNetListRead() { wxFileName absoluteFileName = m_lastNetListRead; wxFileName pcbFileName = GetScreen()->GetFileName(); @@ -681,7 +698,7 @@ wxString WinEDA_PcbFrame::GetLastNetListRead() } -void WinEDA_PcbFrame::SetLastNetListRead( const wxString& aLastNetListRead ) +void PCB_EDIT_FRAME::SetLastNetListRead( const wxString& aLastNetListRead ) { wxFileName relativeFileName = aLastNetListRead; wxFileName pcbFileName = GetScreen()->GetFileName(); @@ -701,9 +718,9 @@ void WinEDA_PcbFrame::SetLastNetListRead( const wxString& aLastNetListRead ) * and prepare, if needed the refresh of the 3D frame showing the footprint * do not forget to call the basic OnModify function to update auxiliary info */ -void WinEDA_PcbFrame::OnModify( ) +void PCB_EDIT_FRAME::OnModify( ) { - WinEDA_BasePcbFrame::OnModify(); + PCB_BASE_FRAME::OnModify(); if( m_Draw3DFrame ) m_Draw3DFrame->ReloadRequest(); @@ -713,7 +730,7 @@ void WinEDA_PcbFrame::OnModify( ) /* Prepare the data structures of print management * And displays the dialog window management of printing sheets */ -void WinEDA_PcbFrame::SVG_Print( wxCommandEvent& event ) +void PCB_EDIT_FRAME::SVG_Print( wxCommandEvent& event ) { DIALOG_SVG_PRINT frame( this ); diff --git a/pcbnew/pcbnew.cpp b/pcbnew/pcbnew.cpp index 9805ca4da7..7a575c0cd7 100644 --- a/pcbnew/pcbnew.cpp +++ b/pcbnew/pcbnew.cpp @@ -80,8 +80,8 @@ IMPLEMENT_APP( WinEDA_App ) */ void WinEDA_App::MacOpenFile( const wxString& fileName ) { - wxFileName filename = fileName; - WinEDA_PcbFrame* frame = ( (WinEDA_PcbFrame*) GetTopWindow() ); + wxFileName filename = fileName; + PCB_EDIT_FRAME* frame = ( (PCB_EDIT_FRAME*) GetTopWindow() ); if( !filename.FileExists() ) return; @@ -100,8 +100,8 @@ bool WinEDA_App::OnInit() #endif /* __WXMAC__ */ - wxFileName fn; - WinEDA_PcbFrame* frame = NULL; + wxFileName fn; + PCB_EDIT_FRAME* frame = NULL; InitEDA_Appl( wxT( "PCBnew" ), APP_TYPE_PCBNEW ); @@ -138,7 +138,7 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) ); * display the real hotkeys in menus or tool tips */ ReadHotkeyConfig( wxT("PcbFrame"), g_Board_Editor_Hokeys_Descr ); - frame = new WinEDA_PcbFrame( NULL, wxT( "PcbNew" ), wxPoint( 0, 0 ), wxSize( 600, 400 ) ); + frame = new PCB_EDIT_FRAME( NULL, wxT( "PcbNew" ), wxPoint( 0, 0 ), wxSize( 600, 400 ) ); frame->SetTitle( GetTitle() + wxT( " " ) + GetBuildVersion() ); SetTopWindow( frame ); diff --git a/pcbnew/pcbnew_config.cpp b/pcbnew/pcbnew_config.cpp index 38f9309348..1f262e0daf 100644 --- a/pcbnew/pcbnew_config.cpp +++ b/pcbnew/pcbnew_config.cpp @@ -27,7 +27,7 @@ #define HOTKEY_FILENAME wxT( "pcbnew" ) -void WinEDA_PcbFrame::Process_Config( wxCommandEvent& event ) +void PCB_EDIT_FRAME::Process_Config( wxCommandEvent& event ) { int id = event.GetId(); wxPoint pos; @@ -127,7 +127,7 @@ void WinEDA_PcbFrame::Process_Config( wxCommandEvent& event ) break; default: - DisplayError( this, wxT( "WinEDA_PcbFrame::Process_Config internal error" ) ); + DisplayError( this, wxT( "PCB_EDIT_FRAME::Process_Config internal error" ) ); } } @@ -140,7 +140,7 @@ void WinEDA_PcbFrame::Process_Config( wxCommandEvent& event ) * and initialize setting to their default value. * @return Always returns true. */ -bool WinEDA_PcbFrame::LoadProjectSettings( const wxString& aProjectFileName ) +bool PCB_EDIT_FRAME::LoadProjectSettings( const wxString& aProjectFileName ) { wxFileName fn = aProjectFileName; @@ -171,7 +171,7 @@ bool WinEDA_PcbFrame::LoadProjectSettings( const wxString& aProjectFileName ) } -void WinEDA_PcbFrame::SaveProjectSettings() +void PCB_EDIT_FRAME::SaveProjectSettings() { wxFileName fn; @@ -197,7 +197,7 @@ void WinEDA_PcbFrame::SaveProjectSettings() * to define local variables. The old method of statically building the array * at compile time requiring global variable definitions by design. */ -PARAM_CFG_ARRAY& WinEDA_PcbFrame::GetProjectFileParameters() +PARAM_CFG_ARRAY& PCB_EDIT_FRAME::GetProjectFileParameters() { if( !m_projectFileParams.empty() ) return m_projectFileParams; @@ -266,7 +266,7 @@ PARAM_CFG_ARRAY& WinEDA_PcbFrame::GetProjectFileParameters() * global variables or move them to the object class where they are * used. */ -PARAM_CFG_ARRAY& WinEDA_PcbFrame::GetConfigurationSettings() +PARAM_CFG_ARRAY& PCB_EDIT_FRAME::GetConfigurationSettings() { if( !m_configSettings.empty() ) return m_configSettings; diff --git a/pcbnew/pcbplot.cpp b/pcbnew/pcbplot.cpp index 455b468a6d..84b2810d2b 100644 --- a/pcbnew/pcbplot.cpp +++ b/pcbnew/pcbplot.cpp @@ -55,14 +55,14 @@ static bool setDouble( double* aDouble, double aValue, double aMin, double aMax class DIALOG_PLOT : public DIALOG_PLOT_BASE { public: - WinEDA_PcbFrame* m_Parent; + PCB_EDIT_FRAME* m_Parent; wxConfig* m_Config; std::vector layerList; // List to hold CheckListBox layer numbers wxCheckListBox* layerCheckListBox; double m_XScaleAdjust; double m_YScaleAdjust; -public: DIALOG_PLOT( WinEDA_PcbFrame* parent ); +public: DIALOG_PLOT( PCB_EDIT_FRAME* parent ); private: void Init_Dialog(); void Plot( wxCommandEvent& event ); @@ -78,7 +78,7 @@ private: const int UNITS_MILS = 1000; -DIALOG_PLOT::DIALOG_PLOT( WinEDA_PcbFrame* parent ) : +DIALOG_PLOT::DIALOG_PLOT( PCB_EDIT_FRAME* parent ) : DIALOG_PLOT_BASE( parent ) { m_Parent = parent; @@ -234,7 +234,7 @@ void DIALOG_PLOT::OnClose( wxCloseEvent& event ) void DIALOG_PLOT::CreateDrillFile( wxCommandEvent& event ) { - ( (WinEDA_PcbFrame*) m_Parent )->InstallDrillFrame( event ); + ( (PCB_EDIT_FRAME*) m_Parent )->InstallDrillFrame( event ); } @@ -774,7 +774,7 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event ) } -void WinEDA_PcbFrame::ToPlotter( wxCommandEvent& event ) +void PCB_EDIT_FRAME::ToPlotter( wxCommandEvent& event ) { DIALOG_PLOT dlg( this ); dlg.ShowModal(); diff --git a/pcbnew/plot_rtn.cpp b/pcbnew/plot_rtn.cpp index 2effb57483..e5940436dd 100644 --- a/pcbnew/plot_rtn.cpp +++ b/pcbnew/plot_rtn.cpp @@ -22,9 +22,9 @@ static void PlotTextModule( PLOTTER* plotter, TEXTE_MODULE* pt_texte, /* Creates the plot for silkscreen layers */ -void WinEDA_BasePcbFrame::Plot_Serigraphie( PLOTTER* plotter, - int masque_layer, - GRTraceMode trace_mode ) +void PCB_BASE_FRAME::Plot_Serigraphie( PLOTTER* plotter, + int masque_layer, + GRTraceMode trace_mode ) { bool trace_val, trace_ref; TEXTE_MODULE* pt_texte; @@ -690,8 +690,7 @@ void PlotDrawSegment( PLOTTER* plotter, DRAWSEGMENT* pt_segm, int masque_layer, } -void WinEDA_BasePcbFrame::Plot_Layer( PLOTTER* plotter, int Layer, - GRTraceMode trace_mode ) +void PCB_BASE_FRAME::Plot_Layer( PLOTTER* plotter, int Layer, GRTraceMode trace_mode ) { // Specify that the contents of the "Edges Pcb" layer are to be plotted // in addition to the contents of the currently specified layer. @@ -772,10 +771,10 @@ void WinEDA_BasePcbFrame::Plot_Layer( PLOTTER* plotter, int Layer, /* Plot a copper layer or mask in HPGL format. * HPGL unit = 0.98 mils (1 mil = 1.02041 unit HPGL). */ -void WinEDA_BasePcbFrame::Plot_Standard_Layer( PLOTTER* aPlotter, - int aLayerMask, - bool aPlotVia, - GRTraceMode aPlotMode ) +void PCB_BASE_FRAME::Plot_Standard_Layer( PLOTTER* aPlotter, + int aLayerMask, + bool aPlotVia, + GRTraceMode aPlotMode ) { wxPoint pos; wxSize size; @@ -991,9 +990,9 @@ void WinEDA_BasePcbFrame::Plot_Standard_Layer( PLOTTER* aPlotter, * @param aSmallDrillShape = true to plot a small drill shape, false to plot * the actual drill shape */ -void WinEDA_BasePcbFrame::PlotDrillMark( PLOTTER* aPlotter, - GRTraceMode aTraceMode, - bool aSmallDrillShape ) +void PCB_BASE_FRAME::PlotDrillMark( PLOTTER* aPlotter, + GRTraceMode aTraceMode, + bool aSmallDrillShape ) { wxPoint pos; wxSize diam; diff --git a/pcbnew/plotdxf.cpp b/pcbnew/plotdxf.cpp index b855d30f9a..e5531d8985 100644 --- a/pcbnew/plotdxf.cpp +++ b/pcbnew/plotdxf.cpp @@ -12,8 +12,7 @@ #include "protos.h" -bool WinEDA_BasePcbFrame::Genere_DXF( const wxString& FullFileName, int Layer, - GRTraceMode trace_mode ) +bool PCB_BASE_FRAME::Genere_DXF( const wxString& FullFileName, int Layer, GRTraceMode trace_mode ) { Ki_PageDescr* currentsheet = GetScreen()->m_CurrentSheetDesc; diff --git a/pcbnew/plotgerb.cpp b/pcbnew/plotgerb.cpp index 1691c4643d..905de31379 100644 --- a/pcbnew/plotgerb.cpp +++ b/pcbnew/plotgerb.cpp @@ -21,9 +21,8 @@ #include "protos.h" /********************************************************************************/ -bool WinEDA_BasePcbFrame::Genere_GERBER( const wxString& FullFileName, int Layer, - bool PlotOriginIsAuxAxis, - GRTraceMode trace_mode ) +bool PCB_BASE_FRAME::Genere_GERBER( const wxString& FullFileName, int Layer, + bool PlotOriginIsAuxAxis, GRTraceMode trace_mode ) /********************************************************************************/ /* Creates the output files, one per board layer: diff --git a/pcbnew/plothpgl.cpp b/pcbnew/plothpgl.cpp index 15cb0d806e..eaa7f3d899 100644 --- a/pcbnew/plothpgl.cpp +++ b/pcbnew/plothpgl.cpp @@ -13,8 +13,7 @@ #include "protos.h" -bool WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer, - GRTraceMode trace_mode ) +bool PCB_BASE_FRAME::Genere_HPGL( const wxString& FullFileName, int Layer, GRTraceMode trace_mode ) { wxSize SheetSize; wxSize BoardSize; diff --git a/pcbnew/plotps.cpp b/pcbnew/plotps.cpp index 22b6ce23ff..5068eb45b6 100644 --- a/pcbnew/plotps.cpp +++ b/pcbnew/plotps.cpp @@ -16,8 +16,8 @@ /* Generate a PostScript file (*. ps) of the circuit layer. * If layer < 0: all layers are plotted. */ -bool WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer, - bool useA4, GRTraceMode trace_mode ) +bool PCB_BASE_FRAME::Genere_PS( const wxString& FullFileName, int Layer, + bool useA4, GRTraceMode trace_mode ) { wxSize SheetSize; wxSize PaperSize; diff --git a/pcbnew/print_board_functions.cpp b/pcbnew/print_board_functions.cpp index cd18f8677a..978e0a901d 100644 --- a/pcbnew/print_board_functions.cpp +++ b/pcbnew/print_board_functions.cpp @@ -114,10 +114,10 @@ void WinEDA_ModuleEditFrame::PrintPage( wxDC* aDC, * @param aPrintMirrorMode = true to plot mirrored * @param aData = a pointer to an optional data (NULL if not used) */ -void WinEDA_PcbFrame::PrintPage( wxDC* aDC, - int aPrintMaskLayer, - bool aPrintMirrorMode, - void * aData) +void PCB_EDIT_FRAME::PrintPage( wxDC* aDC, + int aPrintMaskLayer, + bool aPrintMirrorMode, + void* aData) { MODULE* Module; int drawmode = GR_COPY; diff --git a/pcbnew/printout_controler.cpp b/pcbnew/printout_controler.cpp index 49d6a5a044..4fbc31ad35 100644 --- a/pcbnew/printout_controler.cpp +++ b/pcbnew/printout_controler.cpp @@ -137,7 +137,7 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage() SheetSize.x *= m_Parent->m_InternalUnits / 1000; SheetSize.y *= m_Parent->m_InternalUnits / 1000; // size in internal units - WinEDA_BasePcbFrame* pcbframe = (WinEDA_BasePcbFrame*) m_Parent; + PCB_BASE_FRAME* pcbframe = (PCB_BASE_FRAME*) m_Parent; pcbframe->GetBoard()->ComputeBoundingBox(); EDA_Rect brd_BBox = pcbframe->GetBoard()->m_BoundaryBox; diff --git a/pcbnew/protos.h b/pcbnew/protos.h index 11b60becd3..ee47dd3f54 100644 --- a/pcbnew/protos.h +++ b/pcbnew/protos.h @@ -252,7 +252,7 @@ void ListSetState( EDA_ITEM* Start, int Nbitem, int State, int onoff ); /************/ /* ZONES.CPP */ /************/ -int Propagation( WinEDA_PcbFrame* frame ); +int Propagation( PCB_EDIT_FRAME* frame ); /***************/ diff --git a/pcbnew/ratsnest.cpp b/pcbnew/ratsnest.cpp index 581e3df49e..50b97f66f8 100644 --- a/pcbnew/ratsnest.cpp +++ b/pcbnew/ratsnest.cpp @@ -112,7 +112,7 @@ static bool DisplayRastnestInProgress; // Enable the display of the * @param aDC = the current device context (can be NULL) * @param aDisplayStatus : if true, display the computation results */ -void WinEDA_BasePcbFrame::Compile_Ratsnest( wxDC* aDC, bool aDisplayStatus ) +void PCB_BASE_FRAME::Compile_Ratsnest( wxDC* aDC, bool aDisplayStatus ) { wxString msg; @@ -415,7 +415,7 @@ static int gen_rats_pad_to_pad( vector& aRatsnestBuffer, * (there are n-1 links for an equipotent which have n active pads) . * */ -void WinEDA_BasePcbFrame::Build_Board_Ratsnest( wxDC* DC ) +void PCB_BASE_FRAME::Build_Board_Ratsnest( wxDC* DC ) { D_PAD* pad; int noconn; @@ -522,7 +522,7 @@ void WinEDA_BasePcbFrame::Build_Board_Ratsnest( wxDC* DC ) * @param aNetcode if > 0, Display only the ratsnest relative to the * corresponding net_code */ -void WinEDA_BasePcbFrame::DrawGeneralRatsnest( wxDC* aDC, int aNetcode ) +void PCB_BASE_FRAME::DrawGeneralRatsnest( wxDC* aDC, int aNetcode ) { if( ( m_Pcb->m_Status_Pcb & LISTE_RATSNEST_ITEM_OK ) == 0 ) return; @@ -676,7 +676,7 @@ static int tst_rats_pad_to_pad( int current_num_block, * Compute the ACTIVE ratsnest in the general ratsnest list * if ref_netcode == 0, test all nets, else test only ref_netcode */ -void WinEDA_BasePcbFrame::Tst_Ratsnest( wxDC* DC, int ref_netcode ) +void PCB_BASE_FRAME::Tst_Ratsnest( wxDC* DC, int ref_netcode ) { RATSNEST_ITEM* rats; D_PAD* pad; @@ -745,7 +745,7 @@ void WinEDA_BasePcbFrame::Tst_Ratsnest( wxDC* DC, int ref_netcode ) * @param aDC - Device context to draw on. * @param aNetcode = netcode used to compute the ratsnest. */ -int WinEDA_BasePcbFrame::Test_1_Net_Ratsnest( wxDC* aDC, int aNetcode ) +int PCB_BASE_FRAME::Test_1_Net_Ratsnest( wxDC* aDC, int aNetcode ) { DisplayRastnestInProgress = FALSE; DrawGeneralRatsnest( aDC, aNetcode ); @@ -771,7 +771,7 @@ int WinEDA_BasePcbFrame::Test_1_Net_Ratsnest( wxDC* aDC, int aNetcode ) * pad (in an other footprint) * The ratsnest section must be computed for each new position */ -void WinEDA_BasePcbFrame::build_ratsnest_module( MODULE* aModule ) +void PCB_BASE_FRAME::build_ratsnest_module( MODULE* aModule ) { static unsigned pads_module_count; // node count (node = pad with a net // code) for the footprint being moved @@ -993,7 +993,7 @@ CalculateExternalRatsnest: * Display the ratsnest of a moving footprint, computed by * build_ratsnest_module() */ -void WinEDA_BasePcbFrame::trace_ratsnest_module( wxDC* DC ) +void PCB_BASE_FRAME::trace_ratsnest_module( wxDC* DC ) { if( DC == NULL ) return; @@ -1063,8 +1063,7 @@ static bool sort_by_localnetlength( const wxPoint& ref, const wxPoint& compare ) } -void WinEDA_BasePcbFrame::build_ratsnest_pad( BOARD_ITEM* ref, - const wxPoint& refpos, bool init ) +void PCB_BASE_FRAME::build_ratsnest_pad( BOARD_ITEM* ref, const wxPoint& refpos, bool init ) { int current_net_code = 0, conn_number = 0; D_PAD* pad_ref = NULL; @@ -1139,7 +1138,7 @@ void WinEDA_BasePcbFrame::build_ratsnest_pad( BOARD_ITEM* ref, /* * Displays a "ratsnest" during track creation */ -void WinEDA_BasePcbFrame::trace_ratsnest_pad( wxDC* DC ) +void PCB_BASE_FRAME::trace_ratsnest_pad( wxDC* DC ) { if( DC == NULL ) return; diff --git a/pcbnew/sel_layer.cpp b/pcbnew/sel_layer.cpp index 5c8ff2044e..666440a6da 100644 --- a/pcbnew/sel_layer.cpp +++ b/pcbnew/sel_layer.cpp @@ -21,14 +21,14 @@ enum layer_sel_id { class WinEDA_SelLayerFrame : public wxDialog { private: - WinEDA_BasePcbFrame* m_Parent; - wxRadioBox* m_LayerList; + PCB_BASE_FRAME* m_Parent; + wxRadioBox* m_LayerList; int m_LayerId[NB_LAYERS + 1]; // One extra element for "(Deselect)" // radiobutton public: // Constructor and destructor - WinEDA_SelLayerFrame( WinEDA_BasePcbFrame* parent, int default_layer, + WinEDA_SelLayerFrame( PCB_BASE_FRAME* parent, int default_layer, int min_layer, int max_layer, bool null_layer ); ~WinEDA_SelLayerFrame() { }; @@ -64,10 +64,10 @@ END_EVENT_TABLE() * "Deselect" * button provided within the "Swap Layers:" or "Layer selection:" dialog box). */ -int WinEDA_BasePcbFrame::SelectLayer( int default_layer, - int min_layer, - int max_layer, - bool null_layer ) +int PCB_BASE_FRAME::SelectLayer( int default_layer, + int min_layer, + int max_layer, + bool null_layer ) { int layer; WinEDA_SelLayerFrame* frame = new WinEDA_SelLayerFrame( this, @@ -88,7 +88,7 @@ int WinEDA_BasePcbFrame::SelectLayer( int default_layer, * radiobuttons, in which case they are positioned (in a vertical line) * to the right of that radiobox. */ -WinEDA_SelLayerFrame::WinEDA_SelLayerFrame( WinEDA_BasePcbFrame* parent, +WinEDA_SelLayerFrame::WinEDA_SelLayerFrame( PCB_BASE_FRAME* parent, int default_layer, int min_layer, int max_layer, bool null_layer ) : wxDialog( parent, -1, _( "Select Layer:" ), wxPoint( -1, -1 ), @@ -190,12 +190,12 @@ void WinEDA_SelLayerFrame::OnCancelClick( wxCommandEvent& event ) class WinEDA_SelLayerPairFrame : public wxDialog { private: - WinEDA_BasePcbFrame* m_Parent; - wxRadioBox* m_LayerListTOP; - wxRadioBox* m_LayerListBOTTOM; + PCB_BASE_FRAME* m_Parent; + wxRadioBox* m_LayerListTOP; + wxRadioBox* m_LayerListBOTTOM; int m_LayerId[NB_COPPER_LAYERS]; -public: WinEDA_SelLayerPairFrame( WinEDA_BasePcbFrame* parent ); +public: WinEDA_SelLayerPairFrame( PCB_BASE_FRAME* parent ); ~WinEDA_SelLayerPairFrame() { }; private: @@ -215,7 +215,7 @@ END_EVENT_TABLE() /* Display a list of two copper layers for selection of a pair of layers * for auto-routing, vias ... */ -void WinEDA_BasePcbFrame::SelectLayerPair() +void PCB_BASE_FRAME::SelectLayerPair() { // Check whether more than one copper layer has been enabled for the // current PCB file, as Layer Pairs can only meaningfully be defined @@ -245,7 +245,7 @@ void WinEDA_BasePcbFrame::SelectLayerPair() } -WinEDA_SelLayerPairFrame::WinEDA_SelLayerPairFrame( WinEDA_BasePcbFrame* parent ) : +WinEDA_SelLayerPairFrame::WinEDA_SelLayerPairFrame( PCB_BASE_FRAME* parent ) : wxDialog( parent, -1, _( "Select Layer Pair:" ), wxPoint( -1, -1 ), wxSize( 470, 250 ), DIALOG_STYLE ) { diff --git a/pcbnew/set_grid.cpp b/pcbnew/set_grid.cpp index 23d6180514..e56a64ecd0 100644 --- a/pcbnew/set_grid.cpp +++ b/pcbnew/set_grid.cpp @@ -35,7 +35,7 @@ private: void OnOkClick( wxCommandEvent& event ); }; -void WinEDA_BasePcbFrame::InstallGridFrame( const wxPoint& pos ) +void PCB_BASE_FRAME::InstallGridFrame( const wxPoint& pos ) { DIALOG_SET_GRID dlg( this, pos ); diff --git a/pcbnew/solve.cpp b/pcbnew/solve.cpp index eca62177d0..10fbe5f7d1 100644 --- a/pcbnew/solve.cpp +++ b/pcbnew/solve.cpp @@ -18,16 +18,16 @@ #include "cell.h" -static int Autoroute_One_Track( WinEDA_PcbFrame* pcbframe, - wxDC* DC, - int two_sides, - int row_source, - int col_source, - int row_target, - int col_target, - RATSNEST_ITEM* pt_chevelu ); -static int Retrace( WinEDA_PcbFrame* pcbframe, - wxDC* DC, +static int Autoroute_One_Track( PCB_EDIT_FRAME* pcbframe, + wxDC* DC, + int two_sides, + int row_source, + int col_source, + int row_target, + int col_target, + RATSNEST_ITEM* pt_chevelu ); +static int Retrace( PCB_EDIT_FRAME* pcbframe, + wxDC* DC, int, int, int, @@ -40,7 +40,7 @@ static void OrCell_Trace( BOARD* pcb, int side, int orient, int current_net_code ); -static void Place_Piste_en_Buffer( WinEDA_PcbFrame* pcbframe, wxDC* DC ); +static void Place_Piste_en_Buffer( PCB_EDIT_FRAME* pcbframe, wxDC* DC ); static int segm_oX, segm_oY; @@ -227,7 +227,7 @@ static long newmask[8] = * -1 if escape (stop being routed) request * -2 if default memory allocation */ -int WinEDA_PcbFrame::Solve( wxDC* DC, int two_sides ) +int PCB_EDIT_FRAME::Solve( wxDC* DC, int two_sides ) { int current_net_code; int row_source, col_source, row_target, col_target; @@ -367,14 +367,14 @@ int WinEDA_PcbFrame::Solve( wxDC* DC, int two_sides ) * Escape STOP_FROM_ESC if demand * ERR_MEMORY if memory allocation failed. */ -static int Autoroute_One_Track( WinEDA_PcbFrame* pcbframe, - wxDC* DC, - int two_sides, - int row_source, - int col_source, - int row_target, - int col_target, - RATSNEST_ITEM* pt_chevelu ) +static int Autoroute_One_Track( PCB_EDIT_FRAME* pcbframe, + wxDC* DC, + int two_sides, + int row_source, + int col_source, + int row_target, + int col_target, + RATSNEST_ITEM* pt_chevelu ) { int r, c, side, d, apx_dist, nr, nc; int result, skip; @@ -890,7 +890,7 @@ static long bit[8][9] = * 0 if error * > 0 if Ok */ -static int Retrace( WinEDA_PcbFrame* pcbframe, wxDC* DC, +static int Retrace( PCB_EDIT_FRAME* pcbframe, wxDC* DC, int row_source, int col_source, int row_target, int col_target, int target_side, int current_net_code ) @@ -1222,7 +1222,7 @@ static void OrCell_Trace( BOARD* pcb, int col, int row, * connected * Center on pads even if they are off grid. */ -static void Place_Piste_en_Buffer( WinEDA_PcbFrame* pcbframe, wxDC* DC ) +static void Place_Piste_en_Buffer( PCB_EDIT_FRAME* pcbframe, wxDC* DC ) { if( g_FirstTrackSegment == NULL ) return; diff --git a/pcbnew/specctra.h b/pcbnew/specctra.h index 3f8b5ccefb..d2766fca0a 100644 --- a/pcbnew/specctra.h +++ b/pcbnew/specctra.h @@ -3885,7 +3885,7 @@ public: * the BOARD given to this function must have all the MODULEs on the component * side of the BOARD. * - * See void WinEDA_PcbFrame::ExportToSpecctra( wxCommandEvent& event ) + * See void PCB_EDIT_FRAME::ExportToSpecctra( wxCommandEvent& event ) * for how this can be done before calling this function. * * @param aBoard The BOARD to convert to a PCB. diff --git a/pcbnew/specctra_export.cpp b/pcbnew/specctra_export.cpp index 1ac793017c..2eb0c4856c 100644 --- a/pcbnew/specctra_export.cpp +++ b/pcbnew/specctra_export.cpp @@ -61,7 +61,7 @@ static const double safetyMargin = 0.1; // see wxPcbStruct.h -void WinEDA_PcbFrame::ExportToSpecctra( wxCommandEvent& event ) +void PCB_EDIT_FRAME::ExportToSpecctra( wxCommandEvent& event ) { wxString fullFileName = GetScreen()->GetFileName(); wxString path; diff --git a/pcbnew/specctra_import.cpp b/pcbnew/specctra_import.cpp index 56aa9859c5..896915ef46 100644 --- a/pcbnew/specctra_import.cpp +++ b/pcbnew/specctra_import.cpp @@ -43,7 +43,7 @@ using namespace DSN; -void WinEDA_PcbFrame::ImportSpecctraDesign( wxCommandEvent& event ) +void PCB_EDIT_FRAME::ImportSpecctraDesign( wxCommandEvent& event ) { /* @todo write this someday @@ -53,7 +53,7 @@ void WinEDA_PcbFrame::ImportSpecctraDesign( wxCommandEvent& event ) } -void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event ) +void PCB_EDIT_FRAME::ImportSpecctraSession( wxCommandEvent& event ) { /* if( GetScreen()->IsModify() ) @@ -350,7 +350,7 @@ SEGVIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNet // no UI code in this function, throw exception to report problems to the -// UI handler: void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event ) +// UI handler: void PCB_EDIT_FRAME::ImportSpecctraSession( wxCommandEvent& event ) void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) throw( IO_ERROR ) { diff --git a/pcbnew/surbrill.cpp b/pcbnew/surbrill.cpp index ec3903b6cf..626f7464bb 100644 --- a/pcbnew/surbrill.cpp +++ b/pcbnew/surbrill.cpp @@ -24,7 +24,7 @@ * displays the sorted list of nets in a dialog frame * If a net is selected, it is highlighted */ -void WinEDA_PcbFrame::ListNetsAndSelect( wxCommandEvent& event ) +void PCB_EDIT_FRAME::ListNetsAndSelect( wxCommandEvent& event ) { NETINFO_ITEM* net; wxString netFilter; @@ -92,7 +92,7 @@ void WinEDA_PcbFrame::ListNetsAndSelect( wxCommandEvent& event ) /* Locate track or pad and highlight the corresponding net * Returns the Netcode, or -1 if no net located. */ -int WinEDA_PcbFrame::Select_High_Light( wxDC* DC ) +int PCB_EDIT_FRAME::Select_High_Light( wxDC* DC ) { if( g_HighLight_Status ) High_Light( DC ); @@ -150,7 +150,7 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC ) * * Show or removes the net at the current cursor position. */ -void WinEDA_PcbFrame::High_Light( wxDC* DC ) +void PCB_EDIT_FRAME::High_Light( wxDC* DC ) { g_HighLight_Status = !g_HighLight_Status; diff --git a/pcbnew/swap_layers.cpp b/pcbnew/swap_layers.cpp index fcd0931001..362fa66882 100644 --- a/pcbnew/swap_layers.cpp +++ b/pcbnew/swap_layers.cpp @@ -33,7 +33,7 @@ enum swap_layer_id { class WinEDA_SwapLayerFrame : public wxDialog { private: - WinEDA_BasePcbFrame* m_Parent; + PCB_BASE_FRAME* m_Parent; wxBoxSizer* OuterBoxSizer; wxBoxSizer* MainBoxSizer; wxFlexGridSizer* FlexColumnBoxSizer; @@ -45,7 +45,7 @@ private: public: - WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ); + WinEDA_SwapLayerFrame( PCB_BASE_FRAME* parent ); ~WinEDA_SwapLayerFrame() { }; private: @@ -66,7 +66,7 @@ BEGIN_EVENT_TABLE( WinEDA_SwapLayerFrame, wxDialog ) END_EVENT_TABLE() -WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) : +WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( PCB_BASE_FRAME* parent ) : wxDialog( parent, -1, _( "Swap Layers:" ), wxPoint( -1, -1 ), wxDefaultSize, wxDEFAULT_DIALOG_STYLE | MAYBE_RESIZE_BORDER ) { @@ -335,7 +335,7 @@ void WinEDA_SwapLayerFrame::OnOkClick( wxCommandEvent& event ) } -void WinEDA_PcbFrame::Swap_Layers( wxCommandEvent& event ) +void PCB_EDIT_FRAME::Swap_Layers( wxCommandEvent& event ) { int ii, jj; TRACK* pt_segm; diff --git a/pcbnew/tool_onrightclick.cpp b/pcbnew/tool_onrightclick.cpp index 7c57e7a101..fc0172649a 100644 --- a/pcbnew/tool_onrightclick.cpp +++ b/pcbnew/tool_onrightclick.cpp @@ -13,7 +13,7 @@ #include "pcbnew_id.h" -void WinEDA_PcbFrame::ToolOnRightClick( wxCommandEvent& event ) +void PCB_EDIT_FRAME::ToolOnRightClick( wxCommandEvent& event ) { wxPoint pos; int id = event.GetSelection(); @@ -25,7 +25,13 @@ void WinEDA_PcbFrame::ToolOnRightClick( wxCommandEvent& event ) case ID_TRACK_BUTT: { DIALOG_DESIGN_RULES dlg( this ); - dlg.ShowModal(); + if( dlg.ShowModal() == wxID_OK ) + { + updateDesignRulesSelectBoxes(); + updateTraceWidthSelectBox(); + updateViaSizeSelectBox(); + } + break; } diff --git a/pcbnew/tool_pcb.cpp b/pcbnew/tool_pcb.cpp index 9efe31459e..7ec3999846 100644 --- a/pcbnew/tool_pcb.cpp +++ b/pcbnew/tool_pcb.cpp @@ -61,7 +61,7 @@ static const char s_BitmapLayerIcon[16][16] = { /* Draw the icon for the "Select layer pair" bitmap tool */ -void WinEDA_PcbFrame::PrepareLayerIndicator() +void PCB_EDIT_FRAME::PrepareLayerIndicator() { int ii, jj; int active_layer_color, Route_Layer_TOP_color, @@ -80,7 +80,8 @@ void WinEDA_PcbFrame::PrepareLayerIndicator() change = true; } - Route_Layer_TOP_color = g_ColorsSettings.GetLayerColor(((PCB_SCREEN*)GetScreen())->m_Route_Layer_TOP); + Route_Layer_TOP_color = + g_ColorsSettings.GetLayerColor( ( ( PCB_SCREEN* ) GetScreen() )->m_Route_Layer_TOP ); if( previous_Route_Layer_TOP_color != Route_Layer_TOP_color ) { @@ -88,7 +89,8 @@ void WinEDA_PcbFrame::PrepareLayerIndicator() change = true; } - Route_Layer_BOTTOM_color = g_ColorsSettings.GetLayerColor(((PCB_SCREEN*)GetScreen())->m_Route_Layer_BOTTOM); + Route_Layer_BOTTOM_color = + g_ColorsSettings.GetLayerColor( ( (PCB_SCREEN*) GetScreen() )->m_Route_Layer_BOTTOM ); if( previous_Route_Layer_BOTTOM_color != Route_Layer_BOTTOM_color ) { @@ -121,6 +123,7 @@ void WinEDA_PcbFrame::PrepareLayerIndicator() iconDC.SelectObject( *LayerPairBitmap ); int buttcolor = -1; wxPen pen; + for( ii = 0; ii < 16; ii++ ) { for( jj = 0; jj < 16; jj++ ) @@ -156,6 +159,7 @@ void WinEDA_PcbFrame::PrepareLayerIndicator() ColorRefs[color].m_Blue ); iconDC.SetPen( pen ); } + iconDC.DrawPoint( jj, ii ); } } @@ -174,7 +178,7 @@ void WinEDA_PcbFrame::PrepareLayerIndicator() /* Creates or updates the main horizontal toolbar for the board editor */ -void WinEDA_PcbFrame::ReCreateHToolbar() +void PCB_EDIT_FRAME::ReCreateHToolbar() { wxString msg; @@ -282,7 +286,7 @@ void WinEDA_PcbFrame::ReCreateHToolbar() } -void WinEDA_PcbFrame::ReCreateOptToolbar() +void PCB_EDIT_FRAME::ReCreateOptToolbar() { if( m_OptionsToolBar ) return; @@ -374,7 +378,7 @@ void WinEDA_PcbFrame::ReCreateOptToolbar() /* Create the main vertical right toolbar, showing usual tools */ -void WinEDA_PcbFrame::ReCreateVToolbar() +void PCB_EDIT_FRAME::ReCreateVToolbar() { if( m_VToolBar ) return; @@ -445,7 +449,7 @@ void WinEDA_PcbFrame::ReCreateVToolbar() /* Create the auxiliary vertical right toolbar, showing tools for * microwave applications */ -void WinEDA_PcbFrame::ReCreateMicrowaveVToolbar() +void PCB_EDIT_FRAME::ReCreateMicrowaveVToolbar() { if( m_AuxVToolBar ) return; @@ -491,7 +495,7 @@ void WinEDA_PcbFrame::ReCreateMicrowaveVToolbar() * grid size choice * zoom level choice */ -void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar() +void PCB_EDIT_FRAME::ReCreateAuxiliaryToolbar() { wxString msg; @@ -606,7 +610,7 @@ static wxString ReturnStringValue( int aValue ) } -void WinEDA_PcbFrame::updateTraceWidthSelectBox() +void PCB_EDIT_FRAME::updateTraceWidthSelectBox() { if( m_SelTrackWidthBox == NULL ) return; @@ -624,10 +628,13 @@ void WinEDA_PcbFrame::updateTraceWidthSelectBox() m_SelTrackWidthBox->Append( msg ); } + + if( GetBoard()->m_TrackWidthSelector >= GetBoard()->m_TrackWidthList.size() ) + GetBoard()->m_TrackWidthSelector = 0; } -void WinEDA_PcbFrame::updateViaSizeSelectBox() +void PCB_EDIT_FRAME::updateViaSizeSelectBox() { if( m_SelViaSizeBox == NULL ) return; @@ -649,6 +656,9 @@ void WinEDA_PcbFrame::updateViaSizeSelectBox() m_SelViaSizeBox->Append( msg ); } + + if( GetBoard()->m_ViaSizeSelector >= GetBoard()->m_ViasDimensionsList.size() ) + GetBoard()->m_ViaSizeSelector = 0; } @@ -657,7 +667,7 @@ void WinEDA_PcbFrame::updateViaSizeSelectBox() * update the displayed values: track widths, via sizes, clearance, Netclass name * used when a netclass is selected */ -void WinEDA_PcbFrame::updateDesignRulesSelectBoxes() +void PCB_EDIT_FRAME::updateDesignRulesSelectBoxes() { wxString nclname = GetBoard()->m_CurrentNetClassName; wxString msg = _( "NetClass: " ) + nclname; @@ -679,16 +689,7 @@ void WinEDA_PcbFrame::updateDesignRulesSelectBoxes() } -void WinEDA_PcbFrame::syncLayerBox() -{ - wxASSERT( m_SelLayerBox ); - - int layer = getActiveLayer(); - m_SelLayerBox->SetLayerSelection(layer); -} - - -WinEDALayerChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent ) +WinEDALayerChoiceBox* PCB_EDIT_FRAME::ReCreateLayerBox( WinEDA_Toolbar* parent ) { if( m_SelLayerBox == NULL ) return NULL; @@ -697,7 +698,5 @@ WinEDALayerChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent m_SelLayerBox->Resync(); m_SelLayerBox->SetToolTip( _( "+/- to switch" ) ); - syncLayerBox(); - return m_SelLayerBox; } diff --git a/pcbnew/toolbars_update_user_interface.cpp b/pcbnew/toolbars_update_user_interface.cpp index 066d8bd8f7..979a0238d2 100644 --- a/pcbnew/toolbars_update_user_interface.cpp +++ b/pcbnew/toolbars_update_user_interface.cpp @@ -20,39 +20,62 @@ #include "dialog_helpers.h" -/** - * Function OnUpdateAuxilaryToolbar - * update the displayed values on auxiliary horizontal toolbar - * (track width, via sizes, clearance ... - * Display format for track and via lists - * first item = current selected class value - * next items (if any) = ordered list of sizes (extra sizes). - * So the current selected class value can be same as an other extra value - */ -void WinEDA_PcbFrame::OnUpdateAuxilaryToolbar( wxUpdateUIEvent& aEvent ) +void PCB_EDIT_FRAME::OnUpdateLayerPair( wxUpdateUIEvent& aEvent ) { - wxString msg; - - if( m_AuxiliaryToolBar == NULL ) - return; - - aEvent.Check( GetBoard()->GetBoardDesignSettings()->m_UseConnectedTrackWidth ); - - if( GetBoard()->m_TrackWidthSelector >= GetBoard()->m_TrackWidthList.size() ) - GetBoard()->m_TrackWidthSelector = 0; - - if( m_SelTrackWidthBox->GetSelection() != (int) GetBoard()->m_TrackWidthSelector ) - m_SelTrackWidthBox->SetSelection( GetBoard()->m_TrackWidthSelector ); - - if( GetBoard()->m_ViaSizeSelector >= GetBoard()->m_ViasDimensionsList.size() ) - GetBoard()->m_ViaSizeSelector = 0; - - if( m_SelViaSizeBox->GetSelection() != (int) GetBoard()->m_ViaSizeSelector ) - m_SelViaSizeBox->SetSelection( GetBoard()->m_ViaSizeSelector ); + PrepareLayerIndicator(); } -void WinEDA_PcbFrame::OnUpdateZoneDisplayStyle( wxUpdateUIEvent& aEvent ) +void PCB_EDIT_FRAME::OnUpdateSelectTrackWidth( wxUpdateUIEvent& aEvent ) +{ + if( aEvent.GetId() == ID_AUX_TOOLBAR_PCB_TRACK_WIDTH ) + { + if( m_SelTrackWidthBox->GetSelection() != (int) GetBoard()->m_TrackWidthSelector ) + m_SelTrackWidthBox->SetSelection( GetBoard()->m_TrackWidthSelector ); + } + else + { + bool check = ( ( ( ID_POPUP_PCB_SELECT_WIDTH1 + + (int) GetBoard()->m_TrackWidthSelector ) == aEvent.GetId() ) && + !GetBoard()->GetBoardDesignSettings()->m_UseConnectedTrackWidth ); + aEvent.Check( check ); + } +} + + +void PCB_EDIT_FRAME::OnUpdateSelectAutoTrackWidth( wxUpdateUIEvent& aEvent ) +{ + aEvent.Check( GetBoard()->GetBoardDesignSettings()->m_UseConnectedTrackWidth ); +} + + +void PCB_EDIT_FRAME::OnUpdateSelectViaSize( wxUpdateUIEvent& aEvent ) +{ + wxString msg; + + if( aEvent.GetId() == ID_AUX_TOOLBAR_PCB_VIA_SIZE ) + { + if( m_SelViaSizeBox->GetSelection() != (int) GetBoard()->m_ViaSizeSelector ) + m_SelViaSizeBox->SetSelection( GetBoard()->m_ViaSizeSelector ); + } + else + { + bool check = ( ( ( ID_POPUP_PCB_SELECT_VIASIZE1 + + (int) GetBoard()->m_ViaSizeSelector ) == aEvent.GetId() ) && + !GetBoard()->GetBoardDesignSettings()->m_UseConnectedTrackWidth ); + + aEvent.Check( check ); + } +} + + +void PCB_EDIT_FRAME::OnUpdateLayerSelectBox( wxUpdateUIEvent& aEvent ) +{ + m_SelLayerBox->SetLayerSelection( getActiveLayer() ); +} + + +void PCB_EDIT_FRAME::OnUpdateZoneDisplayStyle( wxUpdateUIEvent& aEvent ) { int selected = aEvent.GetId() - ID_TB_OPTIONS_SHOW_ZONES; @@ -63,7 +86,7 @@ void WinEDA_PcbFrame::OnUpdateZoneDisplayStyle( wxUpdateUIEvent& aEvent ) } -void WinEDA_PcbFrame::OnUpdateDrcEnable( wxUpdateUIEvent& aEvent ) +void PCB_EDIT_FRAME::OnUpdateDrcEnable( wxUpdateUIEvent& aEvent ) { aEvent.Check( !Drc_On ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_DRC_OFF, @@ -72,7 +95,7 @@ void WinEDA_PcbFrame::OnUpdateDrcEnable( wxUpdateUIEvent& aEvent ) _( "Enable design rule checking" ) ); } -void WinEDA_PcbFrame::OnUpdateShowBoardRatsnest( wxUpdateUIEvent& aEvent ) +void PCB_EDIT_FRAME::OnUpdateShowBoardRatsnest( wxUpdateUIEvent& aEvent ) { aEvent.Check( GetBoard()->IsElementVisible( RATSNEST_VISIBLE ) ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_RATSNEST, @@ -82,7 +105,7 @@ void WinEDA_PcbFrame::OnUpdateShowBoardRatsnest( wxUpdateUIEvent& aEvent ) } -void WinEDA_PcbFrame::OnUpdateShowModuleRatsnest( wxUpdateUIEvent& aEvent ) +void PCB_EDIT_FRAME::OnUpdateShowModuleRatsnest( wxUpdateUIEvent& aEvent ) { aEvent.Check( g_Show_Module_Ratsnest ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_MODULE_RATSNEST, @@ -92,7 +115,7 @@ void WinEDA_PcbFrame::OnUpdateShowModuleRatsnest( wxUpdateUIEvent& aEvent ) } -void WinEDA_PcbFrame::OnUpdateAutoDeleteTrack( wxUpdateUIEvent& aEvent ) +void PCB_EDIT_FRAME::OnUpdateAutoDeleteTrack( wxUpdateUIEvent& aEvent ) { aEvent.Check( g_AutoDeleteOldTrack ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_AUTO_DEL_TRACK, @@ -102,7 +125,7 @@ void WinEDA_PcbFrame::OnUpdateAutoDeleteTrack( wxUpdateUIEvent& aEvent ) } -void WinEDA_PcbFrame::OnUpdateViaDrawMode( wxUpdateUIEvent& aEvent ) +void PCB_EDIT_FRAME::OnUpdateViaDrawMode( wxUpdateUIEvent& aEvent ) { aEvent.Check( !m_DisplayViaFill ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_VIAS_SKETCH, @@ -112,7 +135,7 @@ void WinEDA_PcbFrame::OnUpdateViaDrawMode( wxUpdateUIEvent& aEvent ) } -void WinEDA_PcbFrame::OnUpdateTraceDrawMode( wxUpdateUIEvent& aEvent ) +void PCB_EDIT_FRAME::OnUpdateTraceDrawMode( wxUpdateUIEvent& aEvent ) { aEvent.Check( !m_DisplayPcbTrackFill ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, @@ -122,7 +145,7 @@ void WinEDA_PcbFrame::OnUpdateTraceDrawMode( wxUpdateUIEvent& aEvent ) } -void WinEDA_PcbFrame::OnUpdateHighContrastDisplayMode( wxUpdateUIEvent& aEvent ) +void PCB_EDIT_FRAME::OnUpdateHighContrastDisplayMode( wxUpdateUIEvent& aEvent ) { aEvent.Check( DisplayOpt.ContrastModeDisplay ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE, @@ -132,19 +155,19 @@ void WinEDA_PcbFrame::OnUpdateHighContrastDisplayMode( wxUpdateUIEvent& aEvent ) } -void WinEDA_PcbFrame::OnUpdateShowLayerManager( wxUpdateUIEvent& aEvent ) +void PCB_EDIT_FRAME::OnUpdateShowLayerManager( wxUpdateUIEvent& aEvent ) { aEvent.Check( m_auimgr.GetPane( wxT( "m_AuxVToolBar" ) ).IsShown() ); } -void WinEDA_PcbFrame::OnUpdateSave( wxUpdateUIEvent& aEvent ) +void PCB_EDIT_FRAME::OnUpdateSave( wxUpdateUIEvent& aEvent ) { aEvent.Enable( GetScreen()->IsModify() ); } -void WinEDA_PcbFrame::OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent ) +void PCB_EDIT_FRAME::OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent ) { if( aEvent.GetEventObject() == m_VToolBar ) aEvent.Check( GetToolId() == aEvent.GetId() ); diff --git a/pcbnew/tr_modif.cpp b/pcbnew/tr_modif.cpp index 222b3a9d39..557915f028 100644 --- a/pcbnew/tr_modif.cpp +++ b/pcbnew/tr_modif.cpp @@ -22,11 +22,10 @@ * @param aItemsListPicker = the list picker to use for an undo command (can * be NULL) */ -int WinEDA_PcbFrame::EraseRedundantTrack( - wxDC* aDC, - TRACK* aNewTrack, - int aNewTrackSegmentsCount, - PICKED_ITEMS_LIST* aItemsListPicker ) +int PCB_EDIT_FRAME::EraseRedundantTrack( wxDC* aDC, + TRACK* aNewTrack, + int aNewTrackSegmentsCount, + PICKED_ITEMS_LIST* aItemsListPicker ) { TRACK* StartTrack, * EndTrack; TRACK* pt_segm; diff --git a/pcbnew/tracepcb.cpp b/pcbnew/tracepcb.cpp index 9191ccc5c1..ad5be7bcd5 100644 --- a/pcbnew/tracepcb.cpp +++ b/pcbnew/tracepcb.cpp @@ -72,7 +72,7 @@ void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) /* Draw the BOARD, and others elements : axis, grid .. */ -void WinEDA_PcbFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) +void PCB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) { PCB_SCREEN* screen = GetScreen(); @@ -271,12 +271,12 @@ void BOARD::DrawHighLight( EDA_DRAW_PANEL* aDrawPanel, wxDC* DC, int aNetCode ) void Trace_Pads_Only( EDA_DRAW_PANEL* panel, wxDC* DC, MODULE* Module, int ox, int oy, int MasqueLayer, int draw_mode ) { - int tmp; - PCB_SCREEN* screen; - WinEDA_BasePcbFrame* frame; + int tmp; + PCB_SCREEN* screen; + PCB_BASE_FRAME* frame; screen = (PCB_SCREEN*) panel->GetScreen(); - frame = (WinEDA_BasePcbFrame*) panel->GetParent(); + frame = (PCB_BASE_FRAME*) panel->GetParent(); tmp = frame->m_DisplayPadFill; frame->m_DisplayPadFill = FALSE; diff --git a/pcbnew/xchgmod.cpp b/pcbnew/xchgmod.cpp index a33ea099b9..9a731c73b5 100644 --- a/pcbnew/xchgmod.cpp +++ b/pcbnew/xchgmod.cpp @@ -21,10 +21,10 @@ class DIALOG_EXCHANGE_MODULE : public DIALOG_EXCHANGE_MODULE_BASE { private: - WinEDA_PcbFrame* m_Parent; - MODULE* m_CurrentModule; + PCB_EDIT_FRAME* m_Parent; + MODULE* m_CurrentModule; -public: DIALOG_EXCHANGE_MODULE( WinEDA_PcbFrame* aParent, MODULE* aModule ); +public: DIALOG_EXCHANGE_MODULE( PCB_EDIT_FRAME* aParent, MODULE* aModule ); ~DIALOG_EXCHANGE_MODULE() { }; private: @@ -46,8 +46,7 @@ private: }; -DIALOG_EXCHANGE_MODULE::DIALOG_EXCHANGE_MODULE( WinEDA_PcbFrame* parent, - MODULE* Module ) : +DIALOG_EXCHANGE_MODULE::DIALOG_EXCHANGE_MODULE( PCB_EDIT_FRAME* parent, MODULE* Module ) : DIALOG_EXCHANGE_MODULE_BASE( parent ) { m_Parent = parent; @@ -58,7 +57,7 @@ DIALOG_EXCHANGE_MODULE::DIALOG_EXCHANGE_MODULE( WinEDA_PcbFrame* parent, } -void WinEDA_PcbFrame::InstallExchangeModuleFrame( MODULE* Module ) +void PCB_EDIT_FRAME::InstallExchangeModuleFrame( MODULE* Module ) { DIALOG_EXCHANGE_MODULE dialog( this, Module ); @@ -456,9 +455,9 @@ bool DIALOG_EXCHANGE_MODULE::Change_1_Module( MODULE* Module, * @param aUndoPickList = the undo list used to save OldModule. If null, * OldModule is deleted */ -void WinEDA_PcbFrame::Exchange_Module( MODULE* aOldModule, - MODULE* aNewModule, - PICKED_ITEMS_LIST* aUndoPickList ) +void PCB_EDIT_FRAME::Exchange_Module( MODULE* aOldModule, + MODULE* aNewModule, + PICKED_ITEMS_LIST* aUndoPickList ) { wxPoint oldpos; D_PAD* pad, * old_pad; @@ -466,7 +465,7 @@ void WinEDA_PcbFrame::Exchange_Module( MODULE* aOldModule, if( ( aOldModule->Type() != TYPE_MODULE ) || ( aNewModule->Type() != TYPE_MODULE ) ) { - wxMessageBox( wxT( "WinEDA_PcbFrame::Exchange_Module() StuctType error" ) ); + wxMessageBox( wxT( "PCB_EDIT_FRAME::Exchange_Module() StuctType error" ) ); return; } @@ -559,7 +558,7 @@ void DIALOG_EXCHANGE_MODULE::BrowseAndSelectFootprint( wxCommandEvent& event ) * this is the same as created by cvpcb. * can be used if this file is lost */ -void WinEDA_PcbFrame::RecreateCmpFileFromBoard( wxCommandEvent& aEvent ) +void PCB_EDIT_FRAME::RecreateCmpFileFromBoard( wxCommandEvent& aEvent ) { wxFileName fn; FILE* FichCmp; diff --git a/pcbnew/zones_by_polygon.cpp b/pcbnew/zones_by_polygon.cpp index f7393b5c02..efbde639a4 100644 --- a/pcbnew/zones_by_polygon.cpp +++ b/pcbnew/zones_by_polygon.cpp @@ -43,7 +43,7 @@ static PICKED_ITEMS_LIST _AuxiliaryList; // a picked list to store z #include "dialog_copper_zones.h" /**********************************************************************************/ -void WinEDA_PcbFrame::Add_Similar_Zone( wxDC* DC, ZONE_CONTAINER* zone_container ) +void PCB_EDIT_FRAME::Add_Similar_Zone( wxDC* DC, ZONE_CONTAINER* zone_container ) /**********************************************************************************/ /** @@ -70,7 +70,7 @@ void WinEDA_PcbFrame::Add_Similar_Zone( wxDC* DC, ZONE_CONTAINER* zone_container /**********************************************************************************/ -void WinEDA_PcbFrame::Add_Zone_Cutout( wxDC* DC, ZONE_CONTAINER* zone_container ) +void PCB_EDIT_FRAME::Add_Zone_Cutout( wxDC* DC, ZONE_CONTAINER* zone_container ) /**********************************************************************************/ /** @@ -96,7 +96,7 @@ void WinEDA_PcbFrame::Add_Zone_Cutout( wxDC* DC, ZONE_CONTAINER* zone_container /*******************************************************/ -int WinEDA_PcbFrame::Delete_LastCreatedCorner( wxDC* DC ) +int PCB_EDIT_FRAME::Delete_LastCreatedCorner( wxDC* DC ) /*******************************************************/ /** Used **only** while creating a new zone outline @@ -142,8 +142,8 @@ static void Abort_Zone_Create_Outline( EDA_DRAW_PANEL* Panel, wxDC* DC ) * cancels the Begin_Zone command if at least one EDGE_ZONE was created. */ { - WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) Panel->GetParent(); - ZONE_CONTAINER* zone = pcbframe->GetBoard()->m_CurrentZoneContour; + PCB_EDIT_FRAME* pcbframe = (PCB_EDIT_FRAME*) Panel->GetParent(); + ZONE_CONTAINER* zone = pcbframe->GetBoard()->m_CurrentZoneContour; if( zone ) { @@ -160,8 +160,8 @@ static void Abort_Zone_Create_Outline( EDA_DRAW_PANEL* Panel, wxDC* DC ) /*******************************************************************************************************/ -void WinEDA_PcbFrame::Start_Move_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_container, - int corner_id, bool IsNewCorner ) +void PCB_EDIT_FRAME::Start_Move_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_container, + int corner_id, bool IsNewCorner ) /*******************************************************************************************************/ /** @@ -209,9 +209,9 @@ void WinEDA_PcbFrame::Start_Move_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_con /**************************************************************************************/ -void WinEDA_PcbFrame::Start_Move_Zone_Drag_Outline_Edge( wxDC* DC, - ZONE_CONTAINER* zone_container, - int corner_id ) +void PCB_EDIT_FRAME::Start_Move_Zone_Drag_Outline_Edge( wxDC* DC, + ZONE_CONTAINER* zone_container, + int corner_id ) /**************************************************************************************/ /** @@ -235,7 +235,7 @@ void WinEDA_PcbFrame::Start_Move_Zone_Drag_Outline_Edge( wxDC* DC, /*******************************************************************************************************/ -void WinEDA_PcbFrame::Start_Move_Zone_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container ) +void PCB_EDIT_FRAME::Start_Move_Zone_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container ) /*******************************************************************************************************/ /** @@ -270,7 +270,7 @@ void WinEDA_PcbFrame::Start_Move_Zone_Outlines( wxDC* DC, ZONE_CONTAINER* zone_c /*************************************************************************************************/ -void WinEDA_PcbFrame::End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container ) +void PCB_EDIT_FRAME::End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container ) /*************************************************************************************************/ /** @@ -315,7 +315,7 @@ void WinEDA_PcbFrame::End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER /*************************************************************************************/ -void WinEDA_PcbFrame::Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_container ) +void PCB_EDIT_FRAME::Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_container ) /*************************************************************************************/ /** @@ -386,7 +386,7 @@ void Abort_Zone_Move_Corner_Or_Outlines( EDA_DRAW_PANEL* Panel, wxDC* DC ) * cancels the Begin_Zone state if at least one EDGE_ZONE has been created. */ { - WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) Panel->GetParent(); + PCB_EDIT_FRAME* pcbframe = (PCB_EDIT_FRAME*) Panel->GetParent(); ZONE_CONTAINER* zone_container = (ZONE_CONTAINER*) pcbframe->GetCurItem(); if( zone_container->m_Flags == IS_MOVED ) @@ -431,8 +431,8 @@ void Abort_Zone_Move_Corner_Or_Outlines( EDA_DRAW_PANEL* Panel, wxDC* DC ) void Show_Zone_Corner_Or_Outline_While_Move_Mouse( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition, bool aErase ) { - WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) aPanel->GetParent(); - ZONE_CONTAINER* zone = (ZONE_CONTAINER*) pcbframe->GetCurItem(); + PCB_EDIT_FRAME* pcbframe = (PCB_EDIT_FRAME*) aPanel->GetParent(); + ZONE_CONTAINER* zone = (ZONE_CONTAINER*) pcbframe->GetCurItem(); if( aErase ) /* Undraw edge in old position*/ { @@ -463,7 +463,7 @@ void Show_Zone_Corner_Or_Outline_While_Move_Mouse( EDA_DRAW_PANEL* aPanel, wxDC* /*************************************************/ -int WinEDA_PcbFrame::Begin_Zone( wxDC* DC ) +int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC ) /*************************************************/ /** @@ -580,7 +580,7 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC ) // use the form of SetCurItem() which does not write to the msg panel, // SCREEN::SetCurItem(), so the DRC error remains on screen. - // WinEDA_PcbFrame::SetCurItem() calls DisplayInfo(). + // PCB_EDIT_FRAME::SetCurItem() calls DisplayInfo(). GetScreen()->SetCurItem( NULL ); DisplayError( this, _( "DRC error: this start point is inside or too close an other area" ) ); @@ -614,7 +614,7 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC ) /*********************************************/ -bool WinEDA_PcbFrame::End_Zone( wxDC* DC ) +bool PCB_EDIT_FRAME::End_Zone( wxDC* DC ) /*********************************************/ /** @@ -727,9 +727,9 @@ bool WinEDA_PcbFrame::End_Zone( wxDC* DC ) static void Show_New_Edge_While_Move_Mouse( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition, bool aErase ) { - WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) aPanel->GetParent(); - wxPoint c_pos = pcbframe->GetScreen()->GetCrossHairPosition(); - ZONE_CONTAINER* zone = pcbframe->GetBoard()->m_CurrentZoneContour; + PCB_EDIT_FRAME* pcbframe = (PCB_EDIT_FRAME*) aPanel->GetParent(); + wxPoint c_pos = pcbframe->GetScreen()->GetCrossHairPosition(); + ZONE_CONTAINER* zone = pcbframe->GetBoard()->m_CurrentZoneContour; if( zone == NULL ) return; @@ -759,7 +759,7 @@ static void Show_New_Edge_While_Move_Mouse( EDA_DRAW_PANEL* aPanel, wxDC* aDC, /***********************************************************************************/ -void WinEDA_PcbFrame::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container ) +void PCB_EDIT_FRAME::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container ) /***********************************************************************************/ /** @@ -831,7 +831,7 @@ void WinEDA_PcbFrame::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container /************************************************************************************/ -void WinEDA_PcbFrame::Delete_Zone_Contour( wxDC* DC, ZONE_CONTAINER* zone_container ) +void PCB_EDIT_FRAME::Delete_Zone_Contour( wxDC* DC, ZONE_CONTAINER* zone_container ) /************************************************************************************/ /** diff --git a/pcbnew/zones_by_polygon_fill_functions.cpp b/pcbnew/zones_by_polygon_fill_functions.cpp index 8b4c5cfd7c..4af8336367 100644 --- a/pcbnew/zones_by_polygon_fill_functions.cpp +++ b/pcbnew/zones_by_polygon_fill_functions.cpp @@ -42,7 +42,7 @@ * @param aZone = zone segment within the zone to delete. Can be NULL * @param aTimestamp = Timestamp for the zone to delete, used if aZone == NULL */ -void WinEDA_PcbFrame::Delete_Zone_Fill( SEGZONE* aZone, long aTimestamp ) +void PCB_EDIT_FRAME::Delete_Zone_Fill( SEGZONE* aZone, long aTimestamp ) { bool modify = false; unsigned long TimeStamp; @@ -86,7 +86,7 @@ void WinEDA_PcbFrame::Delete_Zone_Fill( SEGZONE* aZone, long aTimestamp ) /***************************************************************************************/ -int WinEDA_PcbFrame::Fill_Zone( ZONE_CONTAINER* zone_container, bool verbose ) +int PCB_EDIT_FRAME::Fill_Zone( ZONE_CONTAINER* zone_container, bool verbose ) /***************************************************************************************/ /** @@ -131,7 +131,7 @@ int WinEDA_PcbFrame::Fill_Zone( ZONE_CONTAINER* zone_container, bool verbose ) } -int WinEDA_PcbFrame::Fill_All_Zones( bool verbose ) +int PCB_EDIT_FRAME::Fill_All_Zones( bool verbose ) /** * Function Fill_All_Zones * Fill all zones on the board diff --git a/pcbnew/zones_non_copper_type_functions.cpp b/pcbnew/zones_non_copper_type_functions.cpp index 5a9845a969..2d3fd3d73f 100644 --- a/pcbnew/zones_non_copper_type_functions.cpp +++ b/pcbnew/zones_non_copper_type_functions.cpp @@ -22,8 +22,8 @@ class DialogNonCopperZonesEditor : public DialogNonCopperZonesPropertiesBase { private: - WinEDA_PcbFrame* m_Parent; - ZONE_CONTAINER* m_Zone_Container; + PCB_EDIT_FRAME* m_Parent; + ZONE_CONTAINER* m_Zone_Container; ZONE_SETTING* m_Zone_Setting; private: @@ -32,17 +32,17 @@ private: void Init(); public: - DialogNonCopperZonesEditor( WinEDA_PcbFrame* parent, - ZONE_CONTAINER* zone_container, - ZONE_SETTING* zone_setting ); + DialogNonCopperZonesEditor( PCB_EDIT_FRAME* parent, + ZONE_CONTAINER* zone_container, + ZONE_SETTING* zone_setting ); ~DialogNonCopperZonesEditor(); }; /*******************************************************************************************/ -DialogNonCopperZonesEditor::DialogNonCopperZonesEditor( WinEDA_PcbFrame* parent, - ZONE_CONTAINER* zone_container, - ZONE_SETTING* zone_setting ) : +DialogNonCopperZonesEditor::DialogNonCopperZonesEditor( PCB_EDIT_FRAME* parent, + ZONE_CONTAINER* zone_container, + ZONE_SETTING* zone_setting ) : DialogNonCopperZonesPropertiesBase( parent ) /*******************************************************************************************/ { @@ -62,7 +62,7 @@ DialogNonCopperZonesEditor::~DialogNonCopperZonesEditor() } -bool WinEDA_PcbFrame::InstallDialogNonCopperZonesEditor( ZONE_CONTAINER* aZone ) +bool PCB_EDIT_FRAME::InstallDialogNonCopperZonesEditor( ZONE_CONTAINER* aZone ) { DialogNonCopperZonesEditor frame( this, aZone, &g_Zone_Default_Setting ); bool diag = frame.ShowModal();