Commit bd174ebf authored by jean-pierre charras's avatar jean-pierre charras

Page layout editor: fix bad initialization on startup, which can crash...

Page layout editor: fix bad initialization on startup, which can crash pl_editor when trying to edit an item.
Minor other fixes.
parent e7aa9630
...@@ -76,7 +76,7 @@ static EDA_HOTKEY HkMoveStartPoint( wxT( "Move Start Point" ), HK_MOVE_START_ ...@@ -76,7 +76,7 @@ static EDA_HOTKEY HkMoveStartPoint( wxT( "Move Start Point" ), HK_MOVE_START_
ID_POPUP_ITEM_MOVE_START_POINT ); ID_POPUP_ITEM_MOVE_START_POINT );
static EDA_HOTKEY HkMoveEndPoint( wxT( "Move End Point" ), HK_MOVE_END_POINT, 'E', static EDA_HOTKEY HkMoveEndPoint( wxT( "Move End Point" ), HK_MOVE_END_POINT, 'E',
ID_POPUP_ITEM_MOVE_END_POINT ); 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 ); ID_POPUP_ITEM_DELETE );
// Undo Redo // Undo Redo
......
...@@ -65,13 +65,6 @@ static struct IFACE : public KIFACE_I ...@@ -65,13 +65,6 @@ static struct IFACE : public KIFACE_I
case FRAME_PL_EDITOR: case FRAME_PL_EDITOR:
{ {
PL_EDITOR_FRAME* frame = new PL_EDITOR_FRAME( aKiway, aParent ); 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; return frame;
} }
break; break;
......
...@@ -171,6 +171,16 @@ PL_EDITOR_FRAME::PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) : ...@@ -171,6 +171,16 @@ PL_EDITOR_FRAME::PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
wxAuiPaneInfo( mesg ).Name( wxT( "MsgPanel" ) ).Bottom().Layer( 10 ) ); wxAuiPaneInfo( mesg ).Name( wxT( "MsgPanel" ) ).Bottom().Layer( 10 ) );
m_auimgr.Update(); 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() ...@@ -744,5 +754,6 @@ void PL_EDITOR_FRAME::OnNewPageLayout()
GetScreen()->ClrModify(); GetScreen()->ClrModify();
m_propertiesPagelayout->CopyPrmsFromGeneralToPanel(); m_propertiesPagelayout->CopyPrmsFromGeneralToPanel();
RebuildDesignTree(); RebuildDesignTree();
Zoom_Automatique( true );
m_canvas->Refresh(); m_canvas->Refresh();
} }
...@@ -67,7 +67,7 @@ const LAYER_WIDGET::ROW PCB_LAYER_WIDGET::s_render_rows[] = { ...@@ -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 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( _( "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( _( "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" ) ), RR( _( "Hidden Text" ), MOD_TEXT_INVISIBLE, WHITE, _( "Show footprint text marked as invisible" ) ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment