Let's try a new layout for kicad manager
This commit is contained in:
parent
02c7fcdc84
commit
1bb3135888
|
@ -17,6 +17,8 @@ include_directories(
|
|||
set( KICAD_SRCS
|
||||
dialogs/dialog_template_selector_base.cpp
|
||||
dialogs/dialog_template_selector.cpp
|
||||
dialogs/panel_kicad_launcher_base.cpp
|
||||
dialogs/panel_kicad_launcher.cpp
|
||||
files-io.cpp
|
||||
import_project.cpp
|
||||
kicad.cpp
|
||||
|
|
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <bitmaps.h>
|
||||
#include <kicad_manager_frame.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <tools/kicad_manager_actions.h>
|
||||
#include <widgets/bitmap_button.h>
|
||||
|
||||
#include "panel_kicad_launcher.h"
|
||||
|
||||
|
||||
PANEL_KICAD_LAUNCHER::PANEL_KICAD_LAUNCHER( wxWindow* aParent ) :
|
||||
PANEL_KICAD_LAUNCHER_BASE( aParent )
|
||||
{
|
||||
m_toolManager = static_cast<KICAD_MANAGER_FRAME*>( aParent )->GetToolManager();
|
||||
CreateLaunchers();
|
||||
}
|
||||
|
||||
|
||||
void PANEL_KICAD_LAUNCHER::CreateLaunchers()
|
||||
{
|
||||
if( m_toolsSizer->GetRows() > 0 )
|
||||
{
|
||||
m_toolsSizer->Clear( true );
|
||||
m_toolsSizer->SetRows( 0 );
|
||||
}
|
||||
|
||||
auto addLauncher =
|
||||
[&]( const TOOL_ACTION& aAction, const wxBitmap& aBitmap,
|
||||
const wxString& aHelpText = wxEmptyString )
|
||||
{
|
||||
BITMAP_BUTTON* btn = new BITMAP_BUTTON( this, wxID_ANY );
|
||||
btn->SetBitmap( aBitmap );
|
||||
btn->SetPadding( 5 );
|
||||
btn->SetToolTip( aAction.GetDescription() );
|
||||
|
||||
auto handler =
|
||||
[&]( wxEvent& aEvent )
|
||||
{
|
||||
OPT_TOOL_EVENT evt = aAction.MakeEvent();
|
||||
evt->SetHasPosition( false );
|
||||
m_toolManager->ProcessEvent( *evt );
|
||||
};
|
||||
|
||||
bool createHelp = !aHelpText.IsEmpty();
|
||||
|
||||
wxStaticText* label = new wxStaticText( this, wxID_ANY, aAction.GetLabel() );
|
||||
wxStaticText* help;
|
||||
|
||||
label->SetToolTip( aAction.GetDescription() );
|
||||
|
||||
if( createHelp )
|
||||
{
|
||||
help = new wxStaticText( this, wxID_ANY, aHelpText );
|
||||
help->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
|
||||
}
|
||||
|
||||
btn->Bind( wxEVT_BUTTON, handler );
|
||||
label->Bind( wxEVT_LEFT_UP, handler );
|
||||
|
||||
int row = m_toolsSizer->GetRows();
|
||||
int rowSpan = createHelp ? 2 : 1;
|
||||
int flags = createHelp ? wxALIGN_BOTTOM : wxALIGN_CENTER_VERTICAL;
|
||||
|
||||
m_toolsSizer->Add( btn, wxGBPosition( row, 0 ), wxGBSpan( rowSpan, 1 ), 0, 0 );
|
||||
m_toolsSizer->Add( label, wxGBPosition( row, 1 ), wxGBSpan( 1, 1 ), flags, 0 );
|
||||
|
||||
if( createHelp )
|
||||
{
|
||||
m_toolsSizer->Add( help, wxGBPosition( row + 1, 1 ), wxGBSpan( 1, 1 ),
|
||||
wxALIGN_TOP, 0 );
|
||||
}
|
||||
};
|
||||
|
||||
addLauncher( KICAD_MANAGER_ACTIONS::editSchematic, KiScaledBitmap( icon_eeschema_xpm, this ) );
|
||||
|
||||
addLauncher( KICAD_MANAGER_ACTIONS::editSymbols, KiScaledBitmap( icon_libedit_xpm, this ) );
|
||||
|
||||
addLauncher( KICAD_MANAGER_ACTIONS::editPCB, KiScaledBitmap( icon_pcbnew_xpm, this ) );
|
||||
|
||||
addLauncher( KICAD_MANAGER_ACTIONS::editFootprints, KiScaledBitmap( icon_modedit_xpm, this ) );
|
||||
|
||||
addLauncher( KICAD_MANAGER_ACTIONS::viewGerbers, KiScaledBitmap( icon_gerbview_xpm, this ) );
|
||||
|
||||
addLauncher( KICAD_MANAGER_ACTIONS::convertImage,
|
||||
KiScaledBitmap( icon_bitmap2component_xpm, this ) );
|
||||
|
||||
addLauncher( KICAD_MANAGER_ACTIONS::showCalculator,
|
||||
KiScaledBitmap( icon_pcbcalculator_xpm, this ) );
|
||||
|
||||
addLauncher( KICAD_MANAGER_ACTIONS::editWorksheet,
|
||||
KiScaledBitmap( icon_pagelayout_editor_xpm, this ) );
|
||||
|
||||
if( m_toolsSizer->IsColGrowable( 1 ) )
|
||||
m_toolsSizer->RemoveGrowableCol( 1 );
|
||||
|
||||
m_toolsSizer->AddGrowableCol( 1 );
|
||||
Layout();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef KICAD_PANEL_KICAD_LAUNCHER_H
|
||||
#define KICAD_PANEL_KICAD_LAUNCHER_H
|
||||
|
||||
#include "panel_kicad_launcher_base.h"
|
||||
|
||||
class TOOL_MANAGER;
|
||||
|
||||
class PANEL_KICAD_LAUNCHER : public PANEL_KICAD_LAUNCHER_BASE
|
||||
{
|
||||
public:
|
||||
PANEL_KICAD_LAUNCHER( wxWindow* aParent );
|
||||
|
||||
virtual ~PANEL_KICAD_LAUNCHER() = default;
|
||||
|
||||
void CreateLaunchers();
|
||||
|
||||
wxTextCtrl* GetMessagesBox() const { return m_messagesBox; }
|
||||
|
||||
private:
|
||||
|
||||
TOOL_MANAGER* m_toolManager;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // KICAD_PANEL_KICAD_LAUNCHER_H
|
|
@ -0,0 +1,45 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Oct 26 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "panel_kicad_launcher_base.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
PANEL_KICAD_LAUNCHER_BASE::PANEL_KICAD_LAUNCHER_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
|
||||
{
|
||||
m_mainSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_toolsSizer = new wxGridBagSizer( 5, 20 );
|
||||
m_toolsSizer->SetFlexibleDirection( wxBOTH );
|
||||
m_toolsSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_NONE );
|
||||
|
||||
|
||||
m_mainSizer->Add( m_toolsSizer, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_mainSizer->Add( 0, 20, 0, wxEXPAND, 5 );
|
||||
|
||||
wxStaticBoxSizer* sbSizerMessages;
|
||||
sbSizerMessages = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Messages") ), wxVERTICAL );
|
||||
|
||||
m_messagesBox = new wxTextCtrl( sbSizerMessages->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
|
||||
m_messagesBox->SetMinSize( wxSize( -1,60 ) );
|
||||
|
||||
sbSizerMessages->Add( m_messagesBox, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_mainSizer->Add( sbSizerMessages, 1, wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
|
||||
this->SetSizer( m_mainSizer );
|
||||
this->Layout();
|
||||
m_mainSizer->Fit( this );
|
||||
}
|
||||
|
||||
PANEL_KICAD_LAUNCHER_BASE::~PANEL_KICAD_LAUNCHER_BASE()
|
||||
{
|
||||
}
|
|
@ -0,0 +1,165 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="15" />
|
||||
<object class="Project" expanded="1">
|
||||
<property name="class_decoration">; </property>
|
||||
<property name="code_generation">C++</property>
|
||||
<property name="disconnect_events">1</property>
|
||||
<property name="disconnect_mode">source_name</property>
|
||||
<property name="disconnect_php_events">0</property>
|
||||
<property name="disconnect_python_events">0</property>
|
||||
<property name="embedded_files_path">res</property>
|
||||
<property name="encoding">UTF-8</property>
|
||||
<property name="event_generation">connect</property>
|
||||
<property name="file">panel_kicad_launcher_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">panel_kicad_launcher_base</property>
|
||||
<property name="namespace"></property>
|
||||
<property name="path">.</property>
|
||||
<property name="precompiled_header"></property>
|
||||
<property name="relative_path">1</property>
|
||||
<property name="skip_lua_events">1</property>
|
||||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_enum">0</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Panel" expanded="1">
|
||||
<property name="aui_managed">0</property>
|
||||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||
<property name="bg"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="event_handler">impl_virtual</property>
|
||||
<property name="fg"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">PANEL_KICAD_LAUNCHER_BASE</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size">-1,-1</property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_mainSizer</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">protected</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxGridBagSizer" expanded="1">
|
||||
<property name="empty_cell_size"></property>
|
||||
<property name="flexible_direction">wxBOTH</property>
|
||||
<property name="growablecols"></property>
|
||||
<property name="growablerows"></property>
|
||||
<property name="hgap">20</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_toolsSizer</property>
|
||||
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_NONE</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="vgap">5</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="spacer" expanded="1">
|
||||
<property name="height">20</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxStaticBoxSizer" expanded="1">
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Messages</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">sbSizerMessages</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="parent">1</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxTextCtrl" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,60</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_messagesBox</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxTE_MULTILINE|wxTE_READONLY</property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="value"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</wxFormBuilder_Project>
|
|
@ -0,0 +1,45 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Oct 26 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/gbsizer.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/statbox.h>
|
||||
#include <wx/panel.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class PANEL_KICAD_LAUNCHER_BASE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class PANEL_KICAD_LAUNCHER_BASE : public wxPanel
|
||||
{
|
||||
private:
|
||||
|
||||
protected:
|
||||
wxBoxSizer* m_mainSizer;
|
||||
wxGridBagSizer* m_toolsSizer;
|
||||
wxTextCtrl* m_messagesBox;
|
||||
|
||||
public:
|
||||
|
||||
PANEL_KICAD_LAUNCHER_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
|
||||
~PANEL_KICAD_LAUNCHER_BASE();
|
||||
|
||||
};
|
||||
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
|
||||
#include <confirm.h>
|
||||
#include <dialogs/panel_kicad_launcher.h>
|
||||
#include <kiway.h>
|
||||
#include <pgm_kicad.h>
|
||||
#include <project/project_archiver.h>
|
||||
|
@ -84,7 +85,7 @@ void KICAD_MANAGER_FRAME::OnUnarchiveFiles( wxCommandEvent& event )
|
|||
return;
|
||||
}
|
||||
|
||||
WX_TEXT_CTRL_REPORTER reporter( m_messagesBox );
|
||||
WX_TEXT_CTRL_REPORTER reporter( m_launcher->GetMessagesBox() );
|
||||
|
||||
PROJECT_ARCHIVER archiver;
|
||||
|
||||
|
@ -125,7 +126,7 @@ void KICAD_MANAGER_FRAME::OnArchiveFiles( wxCommandEvent& event )
|
|||
if( !dir.IsOpened() ) // wxWidgets display a error message on issue.
|
||||
return;
|
||||
|
||||
WX_TEXT_CTRL_REPORTER reporter( m_messagesBox );
|
||||
WX_TEXT_CTRL_REPORTER reporter( m_launcher->GetMessagesBox() );
|
||||
|
||||
PROJECT_ARCHIVER archiver;
|
||||
|
||||
|
|
|
@ -28,18 +28,17 @@
|
|||
#include "project_tree_pane.h"
|
||||
#include <bitmaps.h>
|
||||
#include <build_version.h>
|
||||
#include <dialogs/panel_kicad_launcher.h>
|
||||
#include <eda_base_frame.h>
|
||||
#include <filehistory.h>
|
||||
#include <kiplatform/app.h>
|
||||
#include <kiway.h>
|
||||
#include <kiway_express.h>
|
||||
#include <kiway_player.h>
|
||||
#include <launch_ext.h>
|
||||
#include <panel_hotkeys_editor.h>
|
||||
#include <reporter.h>
|
||||
#include <project/project_local_settings.h>
|
||||
#include <sch_file_versions.h>
|
||||
#include <settings/common_settings.h>
|
||||
#include <settings/settings_manager.h>
|
||||
#include <tool/action_manager.h>
|
||||
#include <tool/action_toolbar.h>
|
||||
|
@ -100,7 +99,6 @@ KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME( wxWindow* parent, const wxString& titl
|
|||
KICAD_DEFAULT_DRAWFRAME_STYLE, KICAD_MANAGER_FRAME_NAME, &::Kiway ),
|
||||
m_leftWin( nullptr ),
|
||||
m_launcher( nullptr ),
|
||||
m_messagesBox( nullptr ),
|
||||
m_mainToolBar( nullptr )
|
||||
{
|
||||
m_active_project = false;
|
||||
|
@ -132,16 +130,12 @@ KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME( wxWindow* parent, const wxString& titl
|
|||
// Left window: is the box which display tree project
|
||||
m_leftWin = new PROJECT_TREE_PANE( this );
|
||||
|
||||
// Add the wxTextCtrl showing all messages from KiCad:
|
||||
m_messagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString,
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxTE_MULTILINE | wxTE_READONLY | wxBORDER_NONE );
|
||||
|
||||
setupTools();
|
||||
setupUIConditions();
|
||||
|
||||
m_launcher = new PANEL_KICAD_LAUNCHER( this );
|
||||
|
||||
RecreateBaseHToolbar();
|
||||
RecreateLauncher();
|
||||
ReCreateMenuBar();
|
||||
|
||||
m_auimgr.SetManagedWindow( this );
|
||||
|
@ -157,9 +151,8 @@ KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME( wxWindow* parent, const wxString& titl
|
|||
.CaptionVisible( false ).PaneBorder( false )
|
||||
.MinSize( m_leftWinWidth, -1 ).BestSize( m_leftWinWidth, -1 ) );
|
||||
|
||||
m_auimgr.AddPane( m_launcher, EDA_PANE().HToolbar().Name( "Launcher" ).Top().Layer(1) );
|
||||
|
||||
m_auimgr.AddPane( m_messagesBox, EDA_PANE().Messages().Name( "MsgPanel" ).Center() );
|
||||
m_auimgr.AddPane( m_launcher,
|
||||
EDA_PANE().Canvas().PaneBorder( false ).Name( "Launcher" ).Center() );
|
||||
|
||||
m_auimgr.Update();
|
||||
|
||||
|
@ -320,7 +313,7 @@ wxString KICAD_MANAGER_FRAME::help_name()
|
|||
|
||||
void KICAD_MANAGER_FRAME::PrintMsg( const wxString& aText )
|
||||
{
|
||||
m_messagesBox->AppendText( aText );
|
||||
m_launcher->GetMessagesBox()->AppendText( aText );
|
||||
}
|
||||
|
||||
|
||||
|
@ -590,7 +583,7 @@ void KICAD_MANAGER_FRAME::ShowChangedLanguage()
|
|||
|
||||
// tooltips in toolbars
|
||||
RecreateBaseHToolbar();
|
||||
RecreateLauncher();
|
||||
m_launcher->CreateLaunchers();
|
||||
|
||||
PrintPrjInfo();
|
||||
}
|
||||
|
@ -628,7 +621,7 @@ void KICAD_MANAGER_FRAME::ProjectChanged()
|
|||
|
||||
void KICAD_MANAGER_FRAME::ClearMsg()
|
||||
{
|
||||
m_messagesBox->Clear();
|
||||
m_launcher->GetMessagesBox()->Clear();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ class PROJECT_TREE_PANE;
|
|||
class ACTION_TOOLBAR;
|
||||
class KICAD_SETTINGS;
|
||||
class EDA_BASE_FRAME;
|
||||
class PANEL_KICAD_LAUNCHER;
|
||||
|
||||
/**
|
||||
* The main KiCad project manager frame. It is not a KIWAY_PLAYER.
|
||||
|
@ -64,7 +65,6 @@ public:
|
|||
|
||||
void ReCreateMenuBar() override;
|
||||
void RecreateBaseHToolbar();
|
||||
void RecreateLauncher();
|
||||
|
||||
wxString GetCurrentFileName() const override
|
||||
{
|
||||
|
@ -185,10 +185,9 @@ private:
|
|||
bool m_openSavedWindows;
|
||||
|
||||
private:
|
||||
PROJECT_TREE_PANE* m_leftWin;
|
||||
ACTION_TOOLBAR* m_launcher;
|
||||
wxTextCtrl* m_messagesBox;
|
||||
ACTION_TOOLBAR* m_mainToolBar;
|
||||
PROJECT_TREE_PANE* m_leftWin;
|
||||
PANEL_KICAD_LAUNCHER* m_launcher;
|
||||
ACTION_TOOLBAR* m_mainToolBar;
|
||||
|
||||
int m_leftWinWidth;
|
||||
bool m_active_project;
|
||||
|
|
|
@ -229,54 +229,3 @@ void KICAD_MANAGER_FRAME::RecreateBaseHToolbar()
|
|||
// Create m_mainToolBar
|
||||
m_mainToolBar->Realize();
|
||||
}
|
||||
|
||||
|
||||
void KICAD_MANAGER_FRAME::RecreateLauncher()
|
||||
{
|
||||
if( m_launcher )
|
||||
{
|
||||
m_launcher->Clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_launcher = new ACTION_TOOLBAR( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
|
||||
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
|
||||
m_launcher->SetAuiManager( &m_auimgr );
|
||||
}
|
||||
|
||||
// Add tools. Note these KICAD_MANAGER_ACTIONS are defined with a bitmap
|
||||
// suitable for menus. The icans will be changed later.
|
||||
m_launcher->Add( KICAD_MANAGER_ACTIONS::editSchematic );
|
||||
m_launcher->Add( KICAD_MANAGER_ACTIONS::editSymbols );
|
||||
|
||||
m_launcher->AddScaledSeparator( this );
|
||||
m_launcher->Add( KICAD_MANAGER_ACTIONS::editPCB );
|
||||
m_launcher->Add( KICAD_MANAGER_ACTIONS::editFootprints );
|
||||
|
||||
m_launcher->AddScaledSeparator( this );
|
||||
m_launcher->Add( KICAD_MANAGER_ACTIONS::viewGerbers );
|
||||
m_launcher->Add( KICAD_MANAGER_ACTIONS::convertImage );
|
||||
m_launcher->Add( KICAD_MANAGER_ACTIONS::showCalculator );
|
||||
m_launcher->Add( KICAD_MANAGER_ACTIONS::editWorksheet );
|
||||
|
||||
// Now set big icons for these tools:
|
||||
m_launcher->SetToolBitmap( KICAD_MANAGER_ACTIONS::editSchematic,
|
||||
KiScaledBitmap( icon_eeschema_xpm, this ) );
|
||||
m_launcher->SetToolBitmap( KICAD_MANAGER_ACTIONS::editSymbols,
|
||||
KiScaledBitmap( icon_libedit_xpm, this ) );
|
||||
m_launcher->SetToolBitmap( KICAD_MANAGER_ACTIONS::editPCB,
|
||||
KiScaledBitmap( icon_pcbnew_xpm, this ) );
|
||||
m_launcher->SetToolBitmap( KICAD_MANAGER_ACTIONS::editFootprints,
|
||||
KiScaledBitmap( icon_modedit_xpm, this ) );
|
||||
m_launcher->SetToolBitmap( KICAD_MANAGER_ACTIONS::viewGerbers,
|
||||
KiScaledBitmap( icon_gerbview_xpm, this ) );
|
||||
m_launcher->SetToolBitmap( KICAD_MANAGER_ACTIONS::convertImage,
|
||||
KiScaledBitmap( icon_bitmap2component_xpm, this ) );
|
||||
m_launcher->SetToolBitmap( KICAD_MANAGER_ACTIONS::showCalculator,
|
||||
KiScaledBitmap( icon_pcbcalculator_xpm, this ) );
|
||||
m_launcher->SetToolBitmap( KICAD_MANAGER_ACTIONS::editWorksheet,
|
||||
KiScaledBitmap( icon_pagelayout_editor_xpm, this ) );
|
||||
|
||||
// Create mlauncher
|
||||
m_launcher->Realize();
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ TOOL_ACTION KICAD_MANAGER_ACTIONS::showCalculator( "kicad.Control.showCalculator
|
|||
TOOL_ACTION KICAD_MANAGER_ACTIONS::editWorksheet( "kicad.Control.editWorksheet",
|
||||
AS_GLOBAL,
|
||||
MD_CTRL + 'Y', LEGACY_HK_NAME( "Run PlEditor" ),
|
||||
_( "Edit Worksheet" ), _( "Edit worksheet graphics and text" ),
|
||||
_( "Edit Worksheets" ), _( "Edit worksheet graphics and text" ),
|
||||
icon_pagelayout_editor_24_xpm );
|
||||
|
||||
TOOL_ACTION KICAD_MANAGER_ACTIONS::openTextEditor( "kicad.Control.openTextEditor",
|
||||
|
|
Loading…
Reference in New Issue