From 809149d7477cae929f764584d3793bee48e10d9d Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Tue, 8 Dec 2020 20:50:03 -0500 Subject: [PATCH] Add opt toolbar to pl editor --- pagelayout_editor/pl_editor_frame.cpp | 3 +++ pagelayout_editor/toolbars_pl_editor.cpp | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/pagelayout_editor/pl_editor_frame.cpp b/pagelayout_editor/pl_editor_frame.cpp index c2e9cf7a5b..7ed7fee62e 100644 --- a/pagelayout_editor/pl_editor_frame.cpp +++ b/pagelayout_editor/pl_editor_frame.cpp @@ -116,6 +116,7 @@ PL_EDITOR_FRAME::PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) : ReCreateMenuBar(); ReCreateHToolbar(); ReCreateVToolbar(); + ReCreateOptToolbar(); // Create the infobar m_infoBar = new WX_INFOBAR( this, &m_auimgr ); @@ -157,6 +158,8 @@ PL_EDITOR_FRAME::PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) : // Horizontal items; layers 4 - 6 m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) ); + m_auimgr.AddPane( m_optionsToolBar, + EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) ); m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) ); m_auimgr.AddPane( m_infoBar, diff --git a/pagelayout_editor/toolbars_pl_editor.cpp b/pagelayout_editor/toolbars_pl_editor.cpp index e352ee16aa..bb383477f3 100644 --- a/pagelayout_editor/toolbars_pl_editor.cpp +++ b/pagelayout_editor/toolbars_pl_editor.cpp @@ -153,4 +153,22 @@ void PL_EDITOR_FRAME::ReCreateVToolbar() void PL_EDITOR_FRAME::ReCreateOptToolbar() { + if( m_optionsToolBar ) + { + m_optionsToolBar->ClearToolbar(); + } + else + { + m_optionsToolBar = new ACTION_TOOLBAR( this, ID_OPT_TOOLBAR, + wxDefaultPosition, wxDefaultSize, + KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL ); + m_optionsToolBar->SetAuiManager( &m_auimgr ); + } + + m_optionsToolBar->Add( ACTIONS::toggleGrid, ACTION_TOOLBAR::TOGGLE ); + m_optionsToolBar->Add( ACTIONS::inchesUnits, ACTION_TOOLBAR::TOGGLE ); + m_optionsToolBar->Add( ACTIONS::milsUnits, ACTION_TOOLBAR::TOGGLE ); + m_optionsToolBar->Add( ACTIONS::millimetersUnits, ACTION_TOOLBAR::TOGGLE ); + + m_optionsToolBar->KiRealize(); }