diff --git a/common/block_commande.cpp b/common/block_commande.cpp index cd01e79799..1d20fd18ca 100644 --- a/common/block_commande.cpp +++ b/common/block_commande.cpp @@ -287,8 +287,8 @@ void AbortBlockCurrentCommand( WinEDA_DrawPanel* Panel, wxDC* DC ) screen->m_BlockLocate.m_State = STATE_NO_BLOCK; screen->m_BlockLocate.m_Command = BLOCK_ABORT; - Panel->m_Parent->HandleBlockEnd( DC ); + Panel->GetParent()->HandleBlockEnd( DC ); screen->m_BlockLocate.m_Command = BLOCK_IDLE; - Panel->m_Parent->DisplayToolMsg( wxEmptyString ); + Panel->GetParent()->DisplayToolMsg( wxEmptyString ); } diff --git a/common/copy_to_clipboard.cpp b/common/copy_to_clipboard.cpp index fdbba58bb3..6fbde75102 100644 --- a/common/copy_to_clipboard.cpp +++ b/common/copy_to_clipboard.cpp @@ -61,7 +61,7 @@ bool DrawPage( WinEDA_DrawPanel* panel ) BASE_SCREEN* screen = panel->GetScreen(); /* scale is the ratio resolution/internal units */ - float scale = 82.0 / panel->m_Parent->m_InternalUnits; + float scale = 82.0 / panel->GetParent()->m_InternalUnits; if( ActiveScreen->m_BlockLocate.m_Command != BLOCK_IDLE ) { diff --git a/common/drawpanel.cpp b/common/drawpanel.cpp index 5fa0a8152e..2aec9bccf3 100644 --- a/common/drawpanel.cpp +++ b/common/drawpanel.cpp @@ -103,8 +103,6 @@ WinEDA_DrawPanel::WinEDA_DrawPanel( WinEDA_DrawFrame* parent, int id, WinEDA_DrawPanel::~WinEDA_DrawPanel() { - wxASSERT( wxGetApp().m_EDA_Config != NULL ); - wxGetApp().m_EDA_Config->Write( wxT( "AutoPAN" ), m_AutoPAN_Enable ); } @@ -112,9 +110,6 @@ WinEDA_DrawPanel::~WinEDA_DrawPanel() BASE_SCREEN* WinEDA_DrawPanel::GetScreen() { WinEDA_DrawFrame* parentFrame = m_Parent; - - wxASSERT( parentFrame ); - return parentFrame->GetBaseScreen(); } diff --git a/eeschema/class_sch_component.cpp b/eeschema/class_sch_component.cpp index 939fb0f038..93078f5b81 100644 --- a/eeschema/class_sch_component.cpp +++ b/eeschema/class_sch_component.cpp @@ -578,7 +578,7 @@ EDA_Rect SCH_COMPONENT::GetBoundaryBox() const } -/* Used if undo / redo command: +/* Used in undo / redo command: * swap data between this and copyitem */ void SCH_COMPONENT::SwapData( SCH_COMPONENT* copyitem ) diff --git a/eeschema/libeditfrm.h b/eeschema/libeditfrm.h index be5eebc0f3..0a8a9a0d9e 100644 --- a/eeschema/libeditfrm.h +++ b/eeschema/libeditfrm.h @@ -102,7 +102,7 @@ public: void SetConvert( int convert ) { - wxASSERT( convert >= 1 ); + wxASSERT( convert >= 0 ); m_convert = convert; } diff --git a/eeschema/libviewfrm.h b/eeschema/libviewfrm.h index c54a5a04cb..5f27d3ace5 100644 --- a/eeschema/libviewfrm.h +++ b/eeschema/libviewfrm.h @@ -29,6 +29,13 @@ private: wxSemaphore* m_Semaphore; // != NULL if the frame must emulate a modal dialog wxString m_ConfigPath; // subpath for configuration +protected: + static wxString m_libraryName; + static wxString m_entryName; + static int m_unit; + static int m_convert; + static wxSize m_clientSize; + public: WinEDA_ViewlibFrame( wxWindow* father, CMP_LIBRARY* Library = NULL, @@ -71,13 +78,6 @@ private: void ViewOneLibraryContent( CMP_LIBRARY* Lib, int Flag ); bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); -protected: - static wxString m_libraryName; - static wxString m_entryName; - static int m_unit; - static int m_convert; - static wxSize m_clientSize; - DECLARE_EVENT_TABLE() }; diff --git a/eeschema/operations_on_items_lists.cpp b/eeschema/operations_on_items_lists.cpp index 1ffffcd1fc..a925f2a298 100644 --- a/eeschema/operations_on_items_lists.cpp +++ b/eeschema/operations_on_items_lists.cpp @@ -56,7 +56,7 @@ void MoveItemsInList( PICKED_ITEMS_LIST& aItemsList, const wxPoint aMoveVector ) void DeleteItemsInList( WinEDA_DrawPanel* panel, PICKED_ITEMS_LIST& aItemsList ) { SCH_SCREEN* screen = (SCH_SCREEN*) panel->GetScreen(); - WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) panel->m_Parent; + WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) panel->GetParent(); PICKED_ITEMS_LIST itemsList; ITEM_PICKER itemWrapper; @@ -99,7 +99,7 @@ DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE" ) ); void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, SCH_ITEM* DrawStruct ) { SCH_SCREEN* screen = (SCH_SCREEN*) panel->GetScreen(); - WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) panel->m_Parent; + WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) panel->GetParent(); if( !DrawStruct ) return; diff --git a/eeschema/symbdraw.cpp b/eeschema/symbdraw.cpp index 0409935126..0e9c2f483d 100644 --- a/eeschema/symbdraw.cpp +++ b/eeschema/symbdraw.cpp @@ -113,7 +113,7 @@ static void AbortSymbolTraceOn( WinEDA_DrawPanel* Panel, wxDC* DC ) if( item->m_Flags & IS_NEW ) { if( item->Type() == COMPONENT_ARC_DRAW_TYPE ) - Panel->m_Parent->RedrawActiveWindow( DC, TRUE ); + Panel->GetParent()->RedrawActiveWindow( DC, TRUE ); else item->Draw( Panel, DC, wxPoint( 0, 0 ), -1, g_XorMode, NULL, DefaultTransformMatrix ); diff --git a/eeschema/viewlibs.cpp b/eeschema/viewlibs.cpp index d694d768cf..d6f3be1a11 100644 --- a/eeschema/viewlibs.cpp +++ b/eeschema/viewlibs.cpp @@ -204,8 +204,7 @@ void WinEDA_ViewlibFrame::ViewOneLibraryContent( CMP_LIBRARY* Lib, int Flag ) if( Flag == NEW_PART ) { - DisplayComponentsNamesInLib( this, Lib, CmpName, - m_entryName ); + DisplayComponentsNamesInLib( this, Lib, CmpName, m_entryName ); } if( Flag == NEXT_PART ) diff --git a/include/class_board_design_settings.h b/include/class_board_design_settings.h index 5d25720516..0983a0f524 100644 --- a/include/class_board_design_settings.h +++ b/include/class_board_design_settings.h @@ -148,14 +148,7 @@ public: * changes the bit-mask of enabled layers * @param aMask = The new bit-mask of enabled layers */ - void SetEnabledLayers( int aMask ) - { - // TODO; ensure consistency with m_CopperLayerCount - m_EnabledLayers = aMask; - - // A disabled layer cannot be visible - m_VisibleLayers &= aMask; - } + void SetEnabledLayers( int aMask ); /** diff --git a/include/class_drawpanel.h b/include/class_drawpanel.h index 5d8a04a376..a3e05cce41 100644 --- a/include/class_drawpanel.h +++ b/include/class_drawpanel.h @@ -16,8 +16,10 @@ class PCB_SCREEN; class WinEDA_DrawPanel : public wxScrolledWindow { -public: +private: WinEDA_DrawFrame* m_Parent; + +public: EDA_Rect m_ClipBox; // the clipbox used in screen // redraw (usually gives the // visible area in internal units) @@ -74,12 +76,13 @@ public: BASE_SCREEN* GetScreen(); + WinEDA_DrawFrame* GetParent() + { + return m_Parent; + } - bool IsPointOnDisplay( wxPoint ref_pos ); void OnPaint( wxPaintEvent& event ); void OnSize( wxSizeEvent& event ); - void SetBoundaryBox(); - void ReDraw( wxDC* DC, bool erasebg = TRUE ); void PrintPage( wxDC* DC, bool Print_Sheet_Ref, int PrintMask, @@ -110,6 +113,10 @@ public: bool OnRightClick( wxMouseEvent& event ); void Process_Special_Functions( wxCommandEvent& event ); + bool IsPointOnDisplay( wxPoint ref_pos ); + void SetBoundaryBox(); + void ReDraw( wxDC* DC, bool erasebg = TRUE ); + /** Function CursorRealPosition * @return the position in user units of location ScreenPos * @param ScreenPos = the screen (in pixel) position to convert @@ -157,16 +164,12 @@ public: void MouseTo( const wxPoint& Mouse ); /* Cursor functions */ - void Trace_Curseur( wxDC* DC, int color = WHITE ); // Draw the - // user cursor - // (grid - // cursor) - void CursorOff( wxDC* DC ); // remove the - // grid cursor - // from the - // display - void CursorOn( wxDC* DC ); // display the - // grid cursor + // Draw the user cursor (grid cursor) + void Trace_Curseur( wxDC* DC, int color = WHITE ); + // remove the grid cursor from the display + void CursorOff( wxDC* DC ); + // display the grid cursor + void CursorOn( wxDC* DC ); /** * Release managed cursor. diff --git a/include/pcbstruct.h b/include/pcbstruct.h index eb6bae3bd2..e5f0ffef45 100644 --- a/include/pcbstruct.h +++ b/include/pcbstruct.h @@ -74,6 +74,7 @@ #define LAYER_COUNT 32 +#define LAYER_BACK (1 << LAYER_N_BACK) ///< bit mask for copper layer #define CUIVRE_LAYER (1 << LAYER_N_BACK) ///< bit mask for copper layer #define LAYER_2 (1 << LAYER_N_2) ///< bit mask for layer 2 #define LAYER_3 (1 << LAYER_N_3) ///< bit mask for layer 3 @@ -90,6 +91,7 @@ #define LAYER_14 (1 << LAYER_N_14) ///< bit mask for layer 14 #define LAYER_15 (1 << LAYER_N_15) ///< bit mask for layer 15 #define CMP_LAYER (1 << LAYER_N_FRONT) ///< bit mask for component layer +#define LAYER_FRONT (1 << LAYER_N_FRONT) ///< bit mask for component layer #define ADHESIVE_LAYER_CU (1 << ADHESIVE_N_CU) #define ADHESIVE_LAYER_CMP (1 << ADHESIVE_N_CMP) #define SOLDERPASTE_LAYER_CU (1 << SOLDERPASTE_N_CU) diff --git a/pcbnew/class_board_design_settings.cpp b/pcbnew/class_board_design_settings.cpp index cff03bfe2f..bd64f93a04 100644 --- a/pcbnew/class_board_design_settings.cpp +++ b/pcbnew/class_board_design_settings.cpp @@ -119,12 +119,39 @@ void EDA_BoardDesignSettings::SetCopperLayerCount( int aNewLayerCount ) // ensure consistency with the m_EnabledLayers member m_EnabledLayers &= ~ALL_CU_LAYERS; - m_EnabledLayers |= CUIVRE_LAYER; + m_EnabledLayers |= LAYER_BACK; if( m_CopperLayerCount > 1 ) - m_EnabledLayers |= CMP_LAYER; + m_EnabledLayers |= LAYER_FRONT; for( int ii = 1; ii < aNewLayerCount - 1; ii++ ) m_EnabledLayers |= 1 << ii; } +/** + * Function SetEnabledLayers + * changes the bit-mask of enabled layers + * @param aMask = The new bit-mask of enabled layers + */ +void EDA_BoardDesignSettings::SetEnabledLayers( int aMask ) +{ + m_EnabledLayers = aMask; + + // Ensure consistency with m_CopperLayerCount + long enabledLayers = aMask & ~ALL_CU_LAYERS; + // Back and front layers are always existing (but not necessary enabled) + // so we must count them + enabledLayers |= LAYER_BACK|LAYER_FRONT; + + long mask = 1; + m_CopperLayerCount = 0; + for( int ii = 0; ii < NB_COPPER_LAYERS; ii++, mask <<= 1 ) + { + if( (aMask & mask) ) + m_CopperLayerCount ++; + } + + // A disabled layer cannot be visible + m_VisibleLayers &= aMask; +} + diff --git a/pcbnew/class_edge_mod.cpp b/pcbnew/class_edge_mod.cpp index 859e3eb859..7c9113f06e 100644 --- a/pcbnew/class_edge_mod.cpp +++ b/pcbnew/class_edge_mod.cpp @@ -169,7 +169,7 @@ void EDGE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, color = g_DesignSettings.m_LayerColor[m_Layer]; - frame = (WinEDA_BasePcbFrame*) panel->m_Parent; + frame = (WinEDA_BasePcbFrame*) panel->GetParent(); screen = frame->GetScreen(); @@ -189,7 +189,7 @@ void EDGE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, if( !typeaff ) typeaff = SKETCH; } - if( panel->GetScreen()->Scale( m_Width ) < L_MIN_DESSIN ) + if( screen->Scale( m_Width ) < L_MIN_DESSIN ) typeaff = FILAIRE; switch( type_trace ) diff --git a/pcbnew/class_pad_draw_functions.cpp b/pcbnew/class_pad_draw_functions.cpp index e50836bc16..e157884f0c 100644 --- a/pcbnew/class_pad_draw_functions.cpp +++ b/pcbnew/class_pad_draw_functions.cpp @@ -38,7 +38,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, if( m_Flags & DO_NOT_DRAW ) return; - WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) panel->m_Parent; + WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) panel->GetParent(); PCB_SCREEN* screen = frame->GetScreen(); if( frame->m_DisplayPadFill == FILLED ) fillpad = 1; diff --git a/pcbnew/class_text_mod.cpp b/pcbnew/class_text_mod.cpp index 7d0be11005..a8b578ac2b 100644 --- a/pcbnew/class_text_mod.cpp +++ b/pcbnew/class_text_mod.cpp @@ -345,7 +345,7 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, return; screen = (PCB_SCREEN*) panel->GetScreen(); - frame = (WinEDA_BasePcbFrame*) panel->m_Parent; + frame = (WinEDA_BasePcbFrame*) 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 456aecf1e2..2b64d4ce03 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -715,7 +715,7 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi int curr_layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer; int fillvia = 0; - WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) panel->m_Parent; + WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) panel->GetParent(); PCB_SCREEN* screen = frame->GetScreen(); if( frame->m_DisplayViaFill == FILLED ) diff --git a/pcbnew/cotation.cpp b/pcbnew/cotation.cpp index 1af425b0f6..5ef76231c9 100644 --- a/pcbnew/cotation.cpp +++ b/pcbnew/cotation.cpp @@ -208,7 +208,7 @@ static void Exit_EditCotation( WinEDA_DrawPanel* Panel, wxDC* DC ) status_cotation = 0; Panel->ManageCurseur = NULL; Panel->ForceCloseManageCurseur = NULL; - ((WinEDA_PcbFrame*)Panel->m_Parent)->SetCurItem(NULL); + ((WinEDA_PcbFrame*)Panel->GetParent())->SetCurItem(NULL); } diff --git a/pcbnew/dialog_layers_setup.cpp b/pcbnew/dialog_layers_setup.cpp index 0644f4599c..2680e03564 100644 --- a/pcbnew/dialog_layers_setup.cpp +++ b/pcbnew/dialog_layers_setup.cpp @@ -524,6 +524,11 @@ void DIALOG_LAYERS_SETUP::OnOkButtonClick( wxCommandEvent& event ) m_EnabledLayers = getUILayerMask(); m_Pcb->SetEnabledLayers( m_EnabledLayers ); + /* Ensure enabled layers are also visible + * This is mainly to avoid mistakes if some enabled + * layers are not visible when exiting this dialog + */ + m_Pcb->SetVisibleLayers( m_EnabledLayers ); for( int layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; ++layer ) diff --git a/pcbnew/dragsegm.cpp b/pcbnew/dragsegm.cpp index b6a231e757..366a4f37c4 100644 --- a/pcbnew/dragsegm.cpp +++ b/pcbnew/dragsegm.cpp @@ -124,7 +124,7 @@ void Build_1_Pad_SegmentsToDrag( WinEDA_DrawPanel* panel, wxDC* DC, D_PAD* PtPad int net_code = PtPad->GetNet(); int MasqueLayer; wxPoint pos; - BOARD* pcb = ( (WinEDA_BasePcbFrame*) (panel->m_Parent) )->GetBoard(); + BOARD* pcb = ( (WinEDA_BasePcbFrame*) (panel->GetParent()) )->GetBoard(); Track = pcb->m_Track->GetStartNetCode( net_code ); @@ -197,7 +197,7 @@ void Collect_TrackSegmentsToDrag( WinEDA_DrawPanel* panel, wxDC* DC, * Les net_codes sont supposes a jour. */ { - BOARD* pcb = ( (WinEDA_BasePcbFrame*) (panel->m_Parent) )->GetBoard(); + BOARD* pcb = ( (WinEDA_BasePcbFrame*) (panel->GetParent()) )->GetBoard(); TRACK* track = pcb->m_Track->GetStartNetCode( net_code ); for( ; track; track = track->Next() ) diff --git a/pcbnew/edit_pcb_text.cpp b/pcbnew/edit_pcb_text.cpp index 16a4dec34c..e87549ef32 100644 --- a/pcbnew/edit_pcb_text.cpp +++ b/pcbnew/edit_pcb_text.cpp @@ -33,7 +33,7 @@ void Abort_Edit_Pcb_Text( WinEDA_DrawPanel* Panel, wxDC* DC ) { Panel->ManageCurseur = NULL; Panel->ForceCloseManageCurseur = NULL; - ( (WinEDA_PcbFrame*) Panel->m_Parent )->SetCurItem( NULL ); + ( (WinEDA_PcbFrame*) Panel->GetParent() )->SetCurItem( NULL ); TEXTE_PCB* TextePcb = (TEXTE_PCB*) Panel->GetScreen()->GetCurItem(); diff --git a/pcbnew/editedge.cpp b/pcbnew/editedge.cpp index 9879008cce..d4b31ace02 100644 --- a/pcbnew/editedge.cpp +++ b/pcbnew/editedge.cpp @@ -192,7 +192,7 @@ static void Exit_EditEdge( WinEDA_DrawPanel* Panel, wxDC* DC ) } Panel->ManageCurseur = NULL; Panel->ForceCloseManageCurseur = NULL; - ( (WinEDA_PcbFrame*) Panel->m_Parent )->SetCurItem( NULL ); + ( (WinEDA_PcbFrame*) Panel->GetParent() )->SetCurItem( NULL ); } diff --git a/pcbnew/editrack.cpp b/pcbnew/editrack.cpp index 2ee47d5737..89cae14089 100644 --- a/pcbnew/editrack.cpp +++ b/pcbnew/editrack.cpp @@ -35,7 +35,7 @@ static PICKED_ITEMS_LIST s_ItemsListPicker; */ static void Exit_Editrack( WinEDA_DrawPanel* Panel, wxDC* DC ) { - WinEDA_PcbFrame* frame = (WinEDA_PcbFrame*) Panel->m_Parent; + WinEDA_PcbFrame* frame = (WinEDA_PcbFrame*) Panel->GetParent(); TRACK* track = (TRACK*) frame->GetCurItem(); if( track && ( track->Type()==TYPE_VIA || track->Type()==TYPE_TRACK ) ) @@ -616,7 +616,7 @@ TRACK* LocateIntrusion( TRACK* listStart, TRACK* aTrack ) */ static void PushTrack( WinEDA_DrawPanel* panel ) { - BOARD* pcb = ( (WinEDA_BasePcbFrame*) (panel->m_Parent) )->GetBoard(); + BOARD* pcb = ( (WinEDA_BasePcbFrame*) (panel->GetParent()) )->GetBoard(); wxPoint cursor = ActiveScreen->m_Curseur; wxPoint cv, vec, n; TRACK* track = g_CurrentTrackSegment; @@ -682,7 +682,7 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, D( g_CurrentTrackList.VerifyListIntegrity(); ); PCB_SCREEN* screen = (PCB_SCREEN*) panel->GetScreen(); - WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) panel->m_Parent; + WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) panel->GetParent(); bool Track_fill_copy = DisplayOpt.DisplayPcbTrackFill; DisplayOpt.DisplayPcbTrackFill = true; diff --git a/pcbnew/mirepcb.cpp b/pcbnew/mirepcb.cpp index 66fc6e628b..58dbea9c24 100644 --- a/pcbnew/mirepcb.cpp +++ b/pcbnew/mirepcb.cpp @@ -181,7 +181,7 @@ static void AbortMoveAndEditTarget( WinEDA_DrawPanel* Panel, wxDC* DC ) Panel->ManageCurseur = NULL; Panel->ForceCloseManageCurseur = NULL; - ( (WinEDA_PcbFrame*) Panel->m_Parent )->SetCurItem( NULL ); + ( (WinEDA_PcbFrame*) Panel->GetParent() )->SetCurItem( NULL ); if( MirePcb == NULL ) return; diff --git a/pcbnew/modules.cpp b/pcbnew/modules.cpp index da89948185..bb8613674a 100644 --- a/pcbnew/modules.cpp +++ b/pcbnew/modules.cpp @@ -53,7 +53,7 @@ void Show_Pads_On_Off( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* module ) */ void Rastnest_On_Off( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* module ) { - WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) panel->m_Parent; + WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) panel->GetParent(); frame->build_ratsnest_module( DC, module ); frame->trace_ratsnest_module( DC ); @@ -153,7 +153,7 @@ void Abort_MoveOrCopyModule( WinEDA_DrawPanel* Panel, wxDC* DC ) DRAG_SEGM* pt_drag; TRACK* pt_segm; MODULE* module; - WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) Panel->m_Parent; + WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) Panel->GetParent(); module = (MODULE*) pcbframe->GetScreen()->GetCurItem(); pcbframe->GetBoard()->m_Status_Pcb &= ~RATSNEST_ITEM_LOCAL_OK; @@ -594,7 +594,7 @@ void DrawModuleOutlines( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* module ) if( g_Show_Module_Ratsnest && panel ) { - WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) panel->m_Parent; + WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) panel->GetParent(); frame->build_ratsnest_module( DC, module ); frame->trace_ratsnest_module( DC ); } diff --git a/pcbnew/move_or_drag_track.cpp b/pcbnew/move_or_drag_track.cpp index 62b07fbc31..b18b1581c8 100644 --- a/pcbnew/move_or_drag_track.cpp +++ b/pcbnew/move_or_drag_track.cpp @@ -62,7 +62,7 @@ static void Abort_MoveTrack( WinEDA_DrawPanel* Panel, wxDC* DC ) Panel->GetScreen()->m_Curseur = oldpos; g_HightLigt_Status = FALSE; - ( (WinEDA_PcbFrame*) Panel->m_Parent )->GetBoard()->DrawHighLight( + ( (WinEDA_PcbFrame*) Panel->GetParent() )->GetBoard()->DrawHighLight( Panel, DC, g_HightLigth_NetCode ); @@ -107,7 +107,7 @@ static void Abort_MoveTrack( WinEDA_DrawPanel* Panel, wxDC* DC ) Panel->ManageCurseur = NULL; Panel->ForceCloseManageCurseur = NULL; - ( (WinEDA_PcbFrame*) Panel->m_Parent )->SetCurItem( NULL ); + ( (WinEDA_PcbFrame*) Panel->GetParent() )->SetCurItem( NULL ); /* Undo move and redraw trace segments. */ DRAG_SEGM* pt_drag = g_DragSegmentList; @@ -126,7 +126,7 @@ static void Abort_MoveTrack( WinEDA_DrawPanel* Panel, wxDC* DC ) g_HightLigth_NetCode = Old_HightLigth_NetCode; g_HightLigt_Status = Old_HightLigt_Status; if( g_HightLigt_Status ) - ( (WinEDA_PcbFrame*) Panel->m_Parent )->GetBoard()->DrawHighLight( + ( (WinEDA_PcbFrame*) Panel->GetParent() )->GetBoard()->DrawHighLight( Panel, DC, g_HightLigth_NetCode ); @@ -194,7 +194,7 @@ static void Show_MoveNode( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) DisplayOpt.DisplayPcbTrackFill = track_fill_copy; // Display track length - WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) panel->m_Parent; + WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) panel->GetParent(); Track->DisplayInfo( frame ); } @@ -454,7 +454,7 @@ static void Show_Drag_Track_Segment_With_Cte_Slope( WinEDA_DrawPanel* panel, tSegmentToEnd->Draw( panel, DC, draw_mode ); // Display track length - WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) panel->m_Parent; + WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) panel->GetParent(); Track->DisplayInfo( frame ); } diff --git a/pcbnew/print_board_functions.cpp b/pcbnew/print_board_functions.cpp index f30e25b073..f33a8d3ffd 100644 --- a/pcbnew/print_board_functions.cpp +++ b/pcbnew/print_board_functions.cpp @@ -200,12 +200,12 @@ static void Print_Module( WinEDA_DrawPanel* panel, wxDC* DC, if( (masklayer & ALL_CU_LAYERS) == 0 ) { int tmp_fill = - ( (WinEDA_BasePcbFrame*) panel->m_Parent )->m_DisplayPadFill; + ( (WinEDA_BasePcbFrame*) panel->GetParent() )->m_DisplayPadFill; // Switch in sketch mode - ( (WinEDA_BasePcbFrame*) panel->m_Parent )->m_DisplayPadFill = 0; + ( (WinEDA_BasePcbFrame*) panel->GetParent() )->m_DisplayPadFill = 0; pt_pad->Draw( panel, DC, draw_mode ); - ( (WinEDA_BasePcbFrame*) panel->m_Parent )->m_DisplayPadFill = + ( (WinEDA_BasePcbFrame*) panel->GetParent() )->m_DisplayPadFill = tmp_fill; } else // on copper layer, draw pads according to current options diff --git a/pcbnew/tracemod.cpp b/pcbnew/tracemod.cpp index 92ae5843a9..7c69666360 100644 --- a/pcbnew/tracemod.cpp +++ b/pcbnew/tracemod.cpp @@ -33,7 +33,7 @@ void Trace_Pads_Only( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* Module, WinEDA_BasePcbFrame* frame; screen = (PCB_SCREEN*) panel->GetScreen(); - frame = (WinEDA_BasePcbFrame*) panel->m_Parent; + frame = (WinEDA_BasePcbFrame*) panel->GetParent(); tmp = frame->m_DisplayPadFill; frame->m_DisplayPadFill = FALSE; diff --git a/pcbnew/zones_by_polygon.cpp b/pcbnew/zones_by_polygon.cpp index d7183dd67b..d0033833c9 100644 --- a/pcbnew/zones_by_polygon.cpp +++ b/pcbnew/zones_by_polygon.cpp @@ -139,7 +139,7 @@ static void Abort_Zone_Create_Outline( WinEDA_DrawPanel* Panel, wxDC* DC ) * cancels the Begin_Zone command if at least one EDGE_ZONE was created. */ { - WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) Panel->m_Parent; + WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) Panel->GetParent(); ZONE_CONTAINER* zone = pcbframe->GetBoard()->m_CurrentZoneContour; if( zone ) @@ -383,7 +383,7 @@ void Abort_Zone_Move_Corner_Or_Outlines( WinEDA_DrawPanel* Panel, wxDC* DC ) * cancels the Begin_Zone state if at least one EDGE_ZONE has been created. */ { - WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) Panel->m_Parent; + WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) Panel->GetParent(); ZONE_CONTAINER* zone_container = (ZONE_CONTAINER*) pcbframe->GetCurItem(); if( zone_container->m_Flags == IS_MOVED ) @@ -431,7 +431,7 @@ void Show_Zone_Corner_Or_Outline_While_Move_Mouse( WinEDA_DrawPanel* Panel, wxDC /* Redraws the zone outline when moving a corner according to the cursor position */ { - WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) Panel->m_Parent; + WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) Panel->GetParent(); ZONE_CONTAINER* zone = (ZONE_CONTAINER*) pcbframe->GetCurItem(); if( erase ) /* Undraw edge in old position*/ @@ -727,7 +727,7 @@ static void Show_New_Edge_While_Move_Mouse( WinEDA_DrawPanel* panel, wxDC* DC, b /* Redraws the zone outlines when moving mouse */ { - WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) panel->m_Parent; + WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) panel->GetParent(); wxPoint c_pos = pcbframe->GetScreen()->m_Curseur; ZONE_CONTAINER* zone = pcbframe->GetBoard()->m_CurrentZoneContour;