From c4a0bf2b2dd50628850acf78d27857e54abd0c19 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 7 Jun 2014 18:20:23 +0200 Subject: [PATCH] Page layout editor: fix bad initialization on startup, which can crash pl_editor when trying to edit an item. Minor other fixes. --- pagelayout_editor/hotkeys.cpp | 2 +- pagelayout_editor/pl_editor.cpp | 7 ------- pagelayout_editor/pl_editor_frame.cpp | 11 +++++++++++ pcbnew/class_pcb_layer_widget.cpp | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/pagelayout_editor/hotkeys.cpp b/pagelayout_editor/hotkeys.cpp index 49a9d0e395..74473599b0 100644 --- a/pagelayout_editor/hotkeys.cpp +++ b/pagelayout_editor/hotkeys.cpp @@ -76,7 +76,7 @@ static EDA_HOTKEY HkMoveStartPoint( wxT( "Move Start Point" ), HK_MOVE_START_ ID_POPUP_ITEM_MOVE_START_POINT ); static EDA_HOTKEY HkMoveEndPoint( wxT( "Move End Point" ), HK_MOVE_END_POINT, 'E', ID_POPUP_ITEM_MOVE_END_POINT ); -static EDA_HOTKEY HkDeleteItem( wxT( "Move Item" ), HK_DELETE_ITEM, WXK_DELETE, +static EDA_HOTKEY HkDeleteItem( wxT( "Delete Item" ), HK_DELETE_ITEM, WXK_DELETE, ID_POPUP_ITEM_DELETE ); // Undo Redo diff --git a/pagelayout_editor/pl_editor.cpp b/pagelayout_editor/pl_editor.cpp index f15d34e8ab..012720abc9 100644 --- a/pagelayout_editor/pl_editor.cpp +++ b/pagelayout_editor/pl_editor.cpp @@ -65,13 +65,6 @@ static struct IFACE : public KIFACE_I case FRAME_PL_EDITOR: { PL_EDITOR_FRAME* frame = new PL_EDITOR_FRAME( aKiway, aParent ); - - /* Is this really needed since at this point there is no open file? - frame->Zoom_Automatique( true ); // Zoom fit in frame - - if so, why is the constructor not doing it? - */ - return frame; } break; diff --git a/pagelayout_editor/pl_editor_frame.cpp b/pagelayout_editor/pl_editor_frame.cpp index dd1162b9f3..ab91849c82 100644 --- a/pagelayout_editor/pl_editor_frame.cpp +++ b/pagelayout_editor/pl_editor_frame.cpp @@ -171,6 +171,16 @@ PL_EDITOR_FRAME::PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) : wxAuiPaneInfo( mesg ).Name( wxT( "MsgPanel" ) ).Bottom().Layer( 10 ) ); m_auimgr.Update(); + + // Initialize the current page layout + WORKSHEET_LAYOUT& pglayout = WORKSHEET_LAYOUT::GetTheInstance(); +#if 0 //start with empty layout + pglayout.AllowVoidList( true ); + pglayout.ClearList(); +#else // start with the default Kicad layout + pglayout.SetPageLayout(); +#endif + OnNewPageLayout(); } @@ -744,5 +754,6 @@ void PL_EDITOR_FRAME::OnNewPageLayout() GetScreen()->ClrModify(); m_propertiesPagelayout->CopyPrmsFromGeneralToPanel(); RebuildDesignTree(); + Zoom_Automatique( true ); m_canvas->Refresh(); } diff --git a/pcbnew/class_pcb_layer_widget.cpp b/pcbnew/class_pcb_layer_widget.cpp index ce7bc0f6e6..944019e286 100644 --- a/pcbnew/class_pcb_layer_widget.cpp +++ b/pcbnew/class_pcb_layer_widget.cpp @@ -67,7 +67,7 @@ const LAYER_WIDGET::ROW PCB_LAYER_WIDGET::s_render_rows[] = { RR( _( "Pads Front" ), PAD_FR_VISIBLE, WHITE, _( "Show footprint pads on board's front" ) ), RR( _( "Pads Back" ), PAD_BK_VISIBLE, WHITE, _( "Show footprint pads on board's back" ) ), - RR( _( "Text Front" ), MOD_TEXT_FR_VISIBLE, WHITE, _( "Show footprint text on board's back" ) ), + RR( _( "Text Front" ), MOD_TEXT_FR_VISIBLE, WHITE, _( "Show footprint text on board's front" ) ), RR( _( "Text Back" ), MOD_TEXT_BK_VISIBLE, WHITE, _( "Show footprint text on board's back" ) ), RR( _( "Hidden Text" ), MOD_TEXT_INVISIBLE, WHITE, _( "Show footprint text marked as invisible" ) ),