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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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
+0 −7
Original line number Original line Diff line number Diff line
@@ -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;
+11 −0
Original line number Original line Diff line number Diff line
@@ -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()
    GetScreen()->ClrModify();
    GetScreen()->ClrModify();
    m_propertiesPagelayout->CopyPrmsFromGeneralToPanel();
    m_propertiesPagelayout->CopyPrmsFromGeneralToPanel();
    RebuildDesignTree();
    RebuildDesignTree();
    Zoom_Automatique( true );
    m_canvas->Refresh();
    m_canvas->Refresh();
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -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" ) ),