2011-12-16 13:32:23 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2013-02-11 18:50:55 +00:00
|
|
|
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
2018-03-16 12:38:36 +00:00
|
|
|
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
|
2019-05-13 21:49:05 +00:00
|
|
|
* Copyright (C) 2004-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
2019-08-14 08:28:07 +00:00
|
|
|
* Copyright (C) 2019 CERN
|
2011-12-16 13:32:23 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2022-01-17 11:55:55 +00:00
|
|
|
#include <advanced_config.h>
|
2018-08-03 12:18:26 +00:00
|
|
|
#include <sch_draw_panel.h>
|
2018-01-30 10:49:51 +00:00
|
|
|
#include <sch_edit_frame.h>
|
2021-09-14 22:45:14 +00:00
|
|
|
#include <kiface_base.h>
|
2017-02-20 12:20:39 +00:00
|
|
|
#include <bitmaps.h>
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <eeschema_id.h>
|
2021-03-18 13:28:04 +00:00
|
|
|
#include <python_scripting.h>
|
2019-05-13 20:42:40 +00:00
|
|
|
#include <tool/tool_manager.h>
|
2019-05-14 19:21:10 +00:00
|
|
|
#include <tool/action_toolbar.h>
|
2019-05-13 20:42:40 +00:00
|
|
|
#include <tools/ee_actions.h>
|
2020-09-27 17:27:25 +00:00
|
|
|
#include <tools/ee_selection_tool.h>
|
2022-12-12 11:46:20 +00:00
|
|
|
#include <widgets/hierarchy_pane.h>
|
2022-06-02 21:56:17 +00:00
|
|
|
#include <widgets/wx_aui_utils.h>
|
2023-06-21 01:57:20 +00:00
|
|
|
#include <widgets/sch_properties_panel.h>
|
2023-05-15 01:35:39 +00:00
|
|
|
#include <widgets/sch_search_pane.h>
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
/* Create the main Horizontal Toolbar for the schematic editor
|
|
|
|
*/
|
2010-12-08 20:12:46 +00:00
|
|
|
void SCH_EDIT_FRAME::ReCreateHToolbar()
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2018-01-08 04:05:03 +00:00
|
|
|
if( m_mainToolBar )
|
2020-09-26 23:55:59 +00:00
|
|
|
{
|
2020-06-23 10:42:23 +00:00
|
|
|
m_mainToolBar->ClearToolbar();
|
2020-09-26 23:55:59 +00:00
|
|
|
}
|
2018-01-08 04:05:03 +00:00
|
|
|
else
|
2020-09-26 23:55:59 +00:00
|
|
|
{
|
2019-05-14 19:21:10 +00:00
|
|
|
m_mainToolBar = new ACTION_TOOLBAR( this, ID_H_TOOLBAR,
|
|
|
|
wxDefaultPosition, wxDefaultSize,
|
2020-11-06 01:56:02 +00:00
|
|
|
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT | wxAUI_TB_HORIZONTAL );
|
2020-09-26 23:55:59 +00:00
|
|
|
m_mainToolBar->SetAuiManager( &m_auimgr );
|
|
|
|
}
|
2009-11-04 20:46:53 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
// Set up toolbar
|
2015-06-01 18:02:32 +00:00
|
|
|
if( Kiface().IsSingle() ) // not when under a project mgr
|
|
|
|
{
|
2019-05-24 23:36:31 +00:00
|
|
|
m_mainToolBar->Add( ACTIONS::doNew );
|
|
|
|
m_mainToolBar->Add( ACTIONS::open );
|
2015-06-01 18:02:32 +00:00
|
|
|
}
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2019-08-28 03:19:20 +00:00
|
|
|
m_mainToolBar->Add( ACTIONS::save );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2020-06-17 11:03:25 +00:00
|
|
|
m_mainToolBar->AddScaledSeparator( this );
|
2020-04-23 11:24:40 +00:00
|
|
|
m_mainToolBar->Add( EE_ACTIONS::schematicSetup );
|
|
|
|
|
2020-06-17 11:03:25 +00:00
|
|
|
m_mainToolBar->AddScaledSeparator( this );
|
2019-05-26 15:36:40 +00:00
|
|
|
m_mainToolBar->Add( ACTIONS::pageSettings );
|
2019-05-24 23:36:31 +00:00
|
|
|
m_mainToolBar->Add( ACTIONS::print );
|
|
|
|
m_mainToolBar->Add( ACTIONS::plot );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2020-06-17 11:03:25 +00:00
|
|
|
m_mainToolBar->AddScaledSeparator( this );
|
2019-05-14 19:21:10 +00:00
|
|
|
m_mainToolBar->Add( ACTIONS::paste );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2020-06-17 11:03:25 +00:00
|
|
|
m_mainToolBar->AddScaledSeparator( this );
|
2019-05-14 19:21:10 +00:00
|
|
|
m_mainToolBar->Add( ACTIONS::undo );
|
|
|
|
m_mainToolBar->Add( ACTIONS::redo );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2020-06-17 11:03:25 +00:00
|
|
|
m_mainToolBar->AddScaledSeparator( this );
|
2019-05-15 22:49:48 +00:00
|
|
|
m_mainToolBar->Add( ACTIONS::find );
|
2019-05-19 21:04:04 +00:00
|
|
|
m_mainToolBar->Add( ACTIONS::findAndReplace );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2020-06-17 11:03:25 +00:00
|
|
|
m_mainToolBar->AddScaledSeparator( this );
|
2019-05-14 19:21:10 +00:00
|
|
|
m_mainToolBar->Add( ACTIONS::zoomRedraw );
|
|
|
|
m_mainToolBar->Add( ACTIONS::zoomInCenter );
|
|
|
|
m_mainToolBar->Add( ACTIONS::zoomOutCenter );
|
|
|
|
m_mainToolBar->Add( ACTIONS::zoomFitScreen );
|
2020-09-11 07:51:00 +00:00
|
|
|
m_mainToolBar->Add( ACTIONS::zoomFitObjects );
|
2020-09-05 00:48:22 +00:00
|
|
|
m_mainToolBar->Add( ACTIONS::zoomTool, ACTION_TOOLBAR::TOGGLE, ACTION_TOOLBAR::CANCEL );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2020-06-17 11:03:25 +00:00
|
|
|
m_mainToolBar->AddScaledSeparator( this );
|
2022-06-02 21:56:17 +00:00
|
|
|
m_mainToolBar->Add( EE_ACTIONS::navigateBack );
|
|
|
|
m_mainToolBar->Add( EE_ACTIONS::navigateUp );
|
|
|
|
m_mainToolBar->Add( EE_ACTIONS::navigateForward );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2021-02-16 20:45:25 +00:00
|
|
|
m_mainToolBar->AddScaledSeparator( this );
|
|
|
|
m_mainToolBar->Add( EE_ACTIONS::rotateCCW );
|
|
|
|
m_mainToolBar->Add( EE_ACTIONS::rotateCW );
|
|
|
|
m_mainToolBar->Add( EE_ACTIONS::mirrorV );
|
|
|
|
m_mainToolBar->Add( EE_ACTIONS::mirrorH );
|
|
|
|
|
2020-06-17 11:03:25 +00:00
|
|
|
m_mainToolBar->AddScaledSeparator( this );
|
2019-06-06 11:45:28 +00:00
|
|
|
m_mainToolBar->Add( ACTIONS::showSymbolEditor );
|
2019-06-04 18:46:52 +00:00
|
|
|
m_mainToolBar->Add( ACTIONS::showSymbolBrowser );
|
2019-06-06 11:45:28 +00:00
|
|
|
m_mainToolBar->Add( ACTIONS::showFootprintEditor );
|
2015-06-01 18:02:32 +00:00
|
|
|
|
2020-06-17 11:03:25 +00:00
|
|
|
m_mainToolBar->AddScaledSeparator( this );
|
2019-06-01 15:28:39 +00:00
|
|
|
m_mainToolBar->Add( EE_ACTIONS::annotate );
|
|
|
|
m_mainToolBar->Add( EE_ACTIONS::runERC );
|
2023-01-01 23:37:24 +00:00
|
|
|
m_mainToolBar->Add( EE_ACTIONS::showSimulator );
|
2019-06-01 15:28:39 +00:00
|
|
|
m_mainToolBar->Add( EE_ACTIONS::assignFootprints );
|
|
|
|
m_mainToolBar->Add( EE_ACTIONS::editSymbolFields );
|
|
|
|
m_mainToolBar->Add( EE_ACTIONS::generateBOM );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2020-06-17 11:03:25 +00:00
|
|
|
m_mainToolBar->AddScaledSeparator( this );
|
2019-06-01 15:28:39 +00:00
|
|
|
m_mainToolBar->Add( EE_ACTIONS::showPcbNew );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2021-03-18 13:28:04 +00:00
|
|
|
// Access to the scripting console
|
|
|
|
if( SCRIPTING::IsWxAvailable() )
|
|
|
|
{
|
|
|
|
m_mainToolBar->AddScaledSeparator( this );
|
|
|
|
m_mainToolBar->Add( EE_ACTIONS::showPythonConsole, ACTION_TOOLBAR::TOGGLE );
|
|
|
|
}
|
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
// after adding the tools to the toolbar, must call Realize() to reflect the changes
|
2020-11-06 01:56:02 +00:00
|
|
|
m_mainToolBar->KiRealize();
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
/* Create Vertical Right Toolbar
|
2007-08-30 08:15:05 +00:00
|
|
|
*/
|
2010-12-08 20:12:46 +00:00
|
|
|
void SCH_EDIT_FRAME::ReCreateVToolbar()
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2011-12-14 20:03:15 +00:00
|
|
|
if( m_drawToolBar )
|
2020-09-26 23:55:59 +00:00
|
|
|
{
|
2020-06-23 10:42:23 +00:00
|
|
|
m_drawToolBar->ClearToolbar();
|
2020-09-26 23:55:59 +00:00
|
|
|
}
|
2018-01-08 04:05:03 +00:00
|
|
|
else
|
2020-09-26 23:55:59 +00:00
|
|
|
{
|
2019-05-14 19:21:10 +00:00
|
|
|
m_drawToolBar = new ACTION_TOOLBAR( this, ID_V_TOOLBAR, wxDefaultPosition, wxDefaultSize,
|
|
|
|
KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
|
2020-09-26 23:55:59 +00:00
|
|
|
m_drawToolBar->SetAuiManager( &m_auimgr );
|
|
|
|
}
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
// Set up toolbar
|
2019-06-24 15:27:05 +00:00
|
|
|
m_drawToolBar->Add( ACTIONS::selectionTool, ACTION_TOOLBAR::TOGGLE );
|
2020-07-07 10:17:30 +00:00
|
|
|
m_drawToolBar->Add( EE_ACTIONS::highlightNetTool, ACTION_TOOLBAR::TOGGLE );
|
2019-05-15 22:49:48 +00:00
|
|
|
|
2020-06-17 11:03:25 +00:00
|
|
|
m_drawToolBar->AddScaledSeparator( this );
|
2019-05-14 19:21:10 +00:00
|
|
|
m_drawToolBar->Add( EE_ACTIONS::placeSymbol, ACTION_TOOLBAR::TOGGLE );
|
|
|
|
m_drawToolBar->Add( EE_ACTIONS::placePower, ACTION_TOOLBAR::TOGGLE );
|
|
|
|
m_drawToolBar->Add( EE_ACTIONS::drawWire, ACTION_TOOLBAR::TOGGLE );
|
|
|
|
m_drawToolBar->Add( EE_ACTIONS::drawBus, ACTION_TOOLBAR::TOGGLE );
|
|
|
|
m_drawToolBar->Add( EE_ACTIONS::placeBusWireEntry, ACTION_TOOLBAR::TOGGLE );
|
|
|
|
m_drawToolBar->Add( EE_ACTIONS::placeNoConnect, ACTION_TOOLBAR::TOGGLE );
|
|
|
|
m_drawToolBar->Add( EE_ACTIONS::placeJunction, ACTION_TOOLBAR::TOGGLE );
|
|
|
|
m_drawToolBar->Add( EE_ACTIONS::placeLabel, ACTION_TOOLBAR::TOGGLE );
|
2021-10-12 20:05:37 +00:00
|
|
|
m_drawToolBar->Add( EE_ACTIONS::placeClassLabel, ACTION_TOOLBAR::TOGGLE );
|
2019-05-14 19:21:10 +00:00
|
|
|
m_drawToolBar->Add( EE_ACTIONS::placeGlobalLabel, ACTION_TOOLBAR::TOGGLE );
|
2020-07-29 23:50:25 +00:00
|
|
|
m_drawToolBar->Add( EE_ACTIONS::placeHierLabel, ACTION_TOOLBAR::TOGGLE );
|
2019-05-14 19:21:10 +00:00
|
|
|
m_drawToolBar->Add( EE_ACTIONS::drawSheet, ACTION_TOOLBAR::TOGGLE );
|
|
|
|
m_drawToolBar->Add( EE_ACTIONS::importSheetPin, ACTION_TOOLBAR::TOGGLE );
|
2019-05-15 22:49:48 +00:00
|
|
|
|
2020-06-17 11:03:25 +00:00
|
|
|
m_drawToolBar->AddScaledSeparator( this );
|
2019-05-14 19:21:10 +00:00
|
|
|
m_drawToolBar->Add( EE_ACTIONS::placeSchematicText, ACTION_TOOLBAR::TOGGLE );
|
2022-01-25 22:33:37 +00:00
|
|
|
m_drawToolBar->Add( EE_ACTIONS::drawTextBox, ACTION_TOOLBAR::TOGGLE );
|
2023-11-25 12:38:24 +00:00
|
|
|
m_drawToolBar->Add( EE_ACTIONS::drawTable, ACTION_TOOLBAR::TOGGLE );
|
2022-01-25 22:33:37 +00:00
|
|
|
m_drawToolBar->Add( EE_ACTIONS::drawRectangle, ACTION_TOOLBAR::TOGGLE );
|
|
|
|
m_drawToolBar->Add( EE_ACTIONS::drawCircle, ACTION_TOOLBAR::TOGGLE );
|
|
|
|
m_drawToolBar->Add( EE_ACTIONS::drawArc, ACTION_TOOLBAR::TOGGLE );
|
|
|
|
m_drawToolBar->Add( EE_ACTIONS::drawLines, ACTION_TOOLBAR::TOGGLE );
|
2019-05-14 19:21:10 +00:00
|
|
|
m_drawToolBar->Add( EE_ACTIONS::placeImage, ACTION_TOOLBAR::TOGGLE );
|
2019-07-31 12:10:13 +00:00
|
|
|
m_drawToolBar->Add( ACTIONS::deleteTool, ACTION_TOOLBAR::TOGGLE );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2020-11-06 01:56:02 +00:00
|
|
|
m_drawToolBar->KiRealize();
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Create Vertical Left Toolbar (Option Toolbar)
|
2007-08-30 08:15:05 +00:00
|
|
|
*/
|
2010-12-08 20:12:46 +00:00
|
|
|
void SCH_EDIT_FRAME::ReCreateOptToolbar()
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2011-12-14 20:03:15 +00:00
|
|
|
if( m_optionsToolBar )
|
2020-09-26 23:55:59 +00:00
|
|
|
{
|
2020-06-23 10:42:23 +00:00
|
|
|
m_optionsToolBar->ClearToolbar();
|
2020-09-26 23:55:59 +00:00
|
|
|
}
|
2018-01-08 04:05:03 +00:00
|
|
|
else
|
2020-09-26 23:55:59 +00:00
|
|
|
{
|
2019-05-14 19:21:10 +00:00
|
|
|
m_optionsToolBar = new ACTION_TOOLBAR( this, ID_OPT_TOOLBAR,
|
|
|
|
wxDefaultPosition, wxDefaultSize,
|
|
|
|
KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
|
2020-09-26 23:55:59 +00:00
|
|
|
m_optionsToolBar->SetAuiManager( &m_auimgr );
|
|
|
|
}
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2019-05-14 19:21:10 +00:00
|
|
|
m_optionsToolBar->Add( ACTIONS::toggleGrid, ACTION_TOOLBAR::TOGGLE );
|
2023-07-23 17:51:42 +00:00
|
|
|
m_optionsToolBar->Add( ACTIONS::toggleGridOverrides, ACTION_TOOLBAR::TOGGLE );
|
2020-10-03 23:34:23 +00:00
|
|
|
m_optionsToolBar->Add( ACTIONS::inchesUnits, ACTION_TOOLBAR::TOGGLE );
|
|
|
|
m_optionsToolBar->Add( ACTIONS::milsUnits, ACTION_TOOLBAR::TOGGLE );
|
|
|
|
m_optionsToolBar->Add( ACTIONS::millimetersUnits, ACTION_TOOLBAR::TOGGLE );
|
2019-05-14 19:21:10 +00:00
|
|
|
m_optionsToolBar->Add( ACTIONS::toggleCursorStyle, ACTION_TOOLBAR::TOGGLE );
|
2022-03-22 16:49:38 +00:00
|
|
|
|
|
|
|
m_optionsToolBar->AddScaledSeparator( this );
|
2019-05-14 19:21:10 +00:00
|
|
|
m_optionsToolBar->Add( EE_ACTIONS::toggleHiddenPins, ACTION_TOOLBAR::TOGGLE );
|
2022-03-22 16:49:38 +00:00
|
|
|
|
|
|
|
m_optionsToolBar->AddScaledSeparator( this );
|
|
|
|
m_optionsToolBar->Add( EE_ACTIONS::lineModeFree, ACTION_TOOLBAR::TOGGLE );
|
|
|
|
m_optionsToolBar->Add( EE_ACTIONS::lineMode90, ACTION_TOOLBAR::TOGGLE );
|
|
|
|
m_optionsToolBar->Add( EE_ACTIONS::lineMode45, ACTION_TOOLBAR::TOGGLE );
|
2011-12-22 13:28:11 +00:00
|
|
|
|
2022-04-21 17:06:28 +00:00
|
|
|
m_optionsToolBar->AddScaledSeparator( this );
|
2022-04-22 11:55:00 +00:00
|
|
|
m_optionsToolBar->Add( EE_ACTIONS::toggleAnnotateAuto, ACTION_TOOLBAR::TOGGLE );
|
2022-04-21 17:06:28 +00:00
|
|
|
|
2022-06-07 09:00:13 +00:00
|
|
|
m_optionsToolBar->AddScaledSeparator( this );
|
|
|
|
m_optionsToolBar->Add( EE_ACTIONS::showHierarchy, ACTION_TOOLBAR::TOGGLE );
|
2023-06-21 01:57:20 +00:00
|
|
|
m_optionsToolBar->Add( ACTIONS::showProperties, ACTION_TOOLBAR::TOGGLE );
|
2022-06-07 09:00:13 +00:00
|
|
|
|
2022-01-17 11:55:55 +00:00
|
|
|
if( ADVANCED_CFG::GetCfg().m_DrawBoundingBoxes )
|
|
|
|
m_optionsToolBar->Add( ACTIONS::toggleBoundingBoxes, ACTION_TOOLBAR::TOGGLE );
|
|
|
|
|
2020-09-27 17:27:25 +00:00
|
|
|
EE_SELECTION_TOOL* selTool = m_toolManager->GetTool<EE_SELECTION_TOOL>();
|
|
|
|
std::unique_ptr<ACTION_MENU> gridMenu = std::make_unique<ACTION_MENU>( false, selTool );
|
|
|
|
gridMenu->Add( ACTIONS::gridProperties );
|
|
|
|
m_optionsToolBar->AddToolContextMenu( ACTIONS::toggleGrid, std::move( gridMenu ) );
|
|
|
|
|
2020-11-06 01:56:02 +00:00
|
|
|
m_optionsToolBar->KiRealize();
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
2022-06-02 21:56:17 +00:00
|
|
|
|
|
|
|
|
2023-05-15 01:35:39 +00:00
|
|
|
void SCH_EDIT_FRAME::ToggleSearch()
|
|
|
|
{
|
|
|
|
EESCHEMA_SETTINGS* cfg = eeconfig();
|
|
|
|
|
|
|
|
// Ensure m_show_search is up to date (the pane can be closed outside the menu)
|
|
|
|
m_show_search = m_auimgr.GetPane( SearchPaneName() ).IsShown();
|
|
|
|
|
|
|
|
m_show_search = !m_show_search;
|
|
|
|
|
|
|
|
wxAuiPaneInfo& searchPaneInfo = m_auimgr.GetPane( SearchPaneName() );
|
|
|
|
searchPaneInfo.Show( m_show_search );
|
|
|
|
|
|
|
|
if( m_show_search )
|
|
|
|
{
|
2023-05-19 20:51:57 +00:00
|
|
|
searchPaneInfo.Direction( cfg->m_AuiPanels.search_panel_dock_direction );
|
|
|
|
|
|
|
|
if( cfg->m_AuiPanels.search_panel_dock_direction == wxAUI_DOCK_TOP
|
|
|
|
|| cfg->m_AuiPanels.search_panel_dock_direction == wxAUI_DOCK_BOTTOM )
|
|
|
|
{
|
|
|
|
SetAuiPaneSize( m_auimgr, searchPaneInfo, -1, cfg->m_AuiPanels.search_panel_height );
|
|
|
|
}
|
|
|
|
else if( cfg->m_AuiPanels.search_panel_dock_direction == wxAUI_DOCK_LEFT
|
|
|
|
|| cfg->m_AuiPanels.search_panel_dock_direction == wxAUI_DOCK_RIGHT )
|
|
|
|
{
|
|
|
|
SetAuiPaneSize( m_auimgr, searchPaneInfo, cfg->m_AuiPanels.search_panel_width, -1 );
|
|
|
|
}
|
|
|
|
|
2023-05-15 01:35:39 +00:00
|
|
|
m_searchPane->FocusSearch();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
cfg->m_AuiPanels.search_panel_height = m_searchPane->GetSize().y;
|
2023-05-19 20:51:57 +00:00
|
|
|
cfg->m_AuiPanels.search_panel_width = m_searchPane->GetSize().x;
|
|
|
|
cfg->m_AuiPanels.search_panel_dock_direction = searchPaneInfo.dock_direction;
|
2023-05-15 01:35:39 +00:00
|
|
|
m_auimgr.Update();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-06-21 01:57:20 +00:00
|
|
|
void SCH_EDIT_FRAME::ToggleProperties()
|
|
|
|
{
|
|
|
|
if( !m_propertiesPanel )
|
|
|
|
return;
|
|
|
|
|
|
|
|
bool show = !m_propertiesPanel->IsShownOnScreen();
|
|
|
|
|
|
|
|
wxAuiPaneInfo& propertiesPaneInfo = m_auimgr.GetPane( PropertiesPaneName() );
|
|
|
|
propertiesPaneInfo.Show( show );
|
|
|
|
|
|
|
|
EESCHEMA_SETTINGS* settings = eeconfig();
|
|
|
|
|
|
|
|
if( show )
|
|
|
|
{
|
|
|
|
SetAuiPaneSize( m_auimgr, propertiesPaneInfo,
|
|
|
|
settings->m_AuiPanels.properties_panel_width, -1 );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
settings->m_AuiPanels.properties_panel_width = m_propertiesPanel->GetSize().x;
|
|
|
|
m_auimgr.Update();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-06-02 21:56:17 +00:00
|
|
|
void SCH_EDIT_FRAME::ToggleSchematicHierarchy()
|
|
|
|
{
|
2022-07-26 11:13:16 +00:00
|
|
|
EESCHEMA_SETTINGS* cfg = eeconfig();
|
2023-05-20 17:47:12 +00:00
|
|
|
|
|
|
|
wxCHECK( cfg, /* void */ );
|
|
|
|
|
2022-06-08 16:09:25 +00:00
|
|
|
wxAuiPaneInfo& hierarchy_pane = m_auimgr.GetPane( SchematicHierarchyPaneName() );
|
2022-06-02 21:56:17 +00:00
|
|
|
|
2022-07-26 11:13:16 +00:00
|
|
|
hierarchy_pane.Show( !hierarchy_pane.IsShown() );
|
2022-06-02 21:56:17 +00:00
|
|
|
|
2022-07-26 11:13:16 +00:00
|
|
|
if( hierarchy_pane.IsShown() )
|
2022-06-08 16:09:25 +00:00
|
|
|
{
|
2022-07-26 11:13:16 +00:00
|
|
|
if( hierarchy_pane.IsFloating() )
|
2022-06-08 16:09:25 +00:00
|
|
|
{
|
2022-07-26 11:13:16 +00:00
|
|
|
hierarchy_pane.FloatingSize( cfg->m_AuiPanels.hierarchy_panel_float_width,
|
|
|
|
cfg->m_AuiPanels.hierarchy_panel_float_height );
|
2022-06-08 16:09:25 +00:00
|
|
|
m_auimgr.Update();
|
2022-07-26 11:13:16 +00:00
|
|
|
}
|
|
|
|
else if( cfg->m_AuiPanels.hierarchy_panel_docked_width > 0 )
|
|
|
|
{
|
|
|
|
// SetAuiPaneSize also updates m_auimgr
|
|
|
|
SetAuiPaneSize( m_auimgr, hierarchy_pane,
|
|
|
|
cfg->m_AuiPanels.hierarchy_panel_docked_width, -1 );
|
|
|
|
}
|
2022-06-08 16:09:25 +00:00
|
|
|
}
|
2022-06-02 21:56:17 +00:00
|
|
|
else
|
|
|
|
{
|
2022-07-26 11:13:16 +00:00
|
|
|
if( hierarchy_pane.IsFloating() )
|
|
|
|
{
|
|
|
|
cfg->m_AuiPanels.hierarchy_panel_float_width = hierarchy_pane.floating_size.x;
|
|
|
|
cfg->m_AuiPanels.hierarchy_panel_float_height = hierarchy_pane.floating_size.y;
|
|
|
|
}
|
|
|
|
else
|
2022-06-08 16:09:25 +00:00
|
|
|
{
|
2022-07-26 11:13:16 +00:00
|
|
|
cfg->m_AuiPanels.hierarchy_panel_docked_width = m_hierarchy->GetSize().x;
|
2022-06-08 16:09:25 +00:00
|
|
|
}
|
2022-06-03 17:05:19 +00:00
|
|
|
|
2022-06-02 21:56:17 +00:00
|
|
|
m_auimgr.Update();
|
|
|
|
}
|
|
|
|
}
|