KiCad PCB EDA Suite
kicad_manager_frame.cpp File Reference
#include "kicad_id.h"
#include "pgm_kicad.h"
#include "tree_project_frame.h"
#include <bitmaps.h>
#include <build_version.h>
#include <executable_names.h>
#include <filehistory.h>
#include <gestfich.h>
#include <kiway.h>
#include <kiway_express.h>
#include <kiway_player.h>
#include <launch_ext.h>
#include <panel_hotkeys_editor.h>
#include <settings/common_settings.h>
#include <tool/action_toolbar.h>
#include <tool/common_control.h>
#include <tool/tool_manager.h>
#include <tools/kicad_manager_actions.h>
#include <tools/kicad_manager_control.h>
#include <wildcards_and_files_ext.h>
#include "kicad_manager_frame.h"
#include "kicad_settings.h"

Go to the source code of this file.

Macros

#define SEP()   wxFileName::GetPathSeparator()
 
#define GeneralGroupName   wxT( "/general" )
 

Functions

 EVT_MENU_RANGE (ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, KICAD_MANAGER_FRAME::language_change) KICAD_MANAGER_FRAME
 

Variables

std::vector< PARAM_CFG * > s_KicadManagerParams
 

Macro Definition Documentation

◆ GeneralGroupName

#define GeneralGroupName   wxT( "/general" )

Definition at line 62 of file kicad_manager_frame.cpp.

◆ SEP

#define SEP ( )    wxFileName::GetPathSeparator()

Definition at line 56 of file kicad_manager_frame.cpp.

Function Documentation

◆ EVT_MENU_RANGE()

Definition at line 82 of file kicad_manager_frame.cpp.

94  :
95  EDA_BASE_FRAME( parent, KICAD_MAIN_FRAME_T, title, pos, size,
97  m_leftWin( nullptr ),
98  m_launcher( nullptr ),
99  m_messagesBox( nullptr ),
100  m_mainToolBar( nullptr )
101 {
102  m_active_project = false;
103  m_leftWinWidth = 250; // Default value
104  m_AboutTitle = "KiCad";
105 
106  // Create the status line (bottom of the frame)
107  static const int dims[3] = { -1, -1, 100 };
108 
109  CreateStatusBar( 3 );
110  SetStatusWidths( 3, dims );
111 
112  // Give an icon
113  wxIcon icon;
114  icon.CopyFromBitmap( KiBitmap( icon_kicad_xpm ) );
115  SetIcon( icon );
116 
117  // Load the settings
118  LoadSettings( config() );
119 
120  // Left window: is the box which display tree project
121  m_leftWin = new TREE_PROJECT_FRAME( this );
122 
123  // Add the wxTextCtrl showing all messages from KiCad:
124  m_messagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString,
125  wxDefaultPosition, wxDefaultSize,
126  wxTE_MULTILINE | wxTE_READONLY | wxBORDER_NONE );
127 
128  // Create the manager
129  m_toolManager = new TOOL_MANAGER;
130  m_toolManager->SetEnvironment( nullptr, nullptr, nullptr, this );
131  m_actions = new KICAD_MANAGER_ACTIONS();
132 
133  // Register tools
134  m_toolManager->RegisterTool( new COMMON_CONTROL );
135  m_toolManager->RegisterTool( new KICAD_MANAGER_CONTROL );
136  m_toolManager->InitTools();
137 
138  RecreateBaseHToolbar();
139  RecreateLauncher();
140  ReCreateMenuBar();
141 
142  m_auimgr.SetManagedWindow( this );
143 
144  m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );
145 
146  // BestSize() does not always set the actual pane size of m_leftWin to the required value.
147  // It happens when m_leftWin is too large (roughly > 1/3 of the kicad manager frame width.
148  // (Well, BestSize() sets the best size... not the window size)
149  // A trick is to use MinSize() to set the required pane width,
150  // and after give a reasonable MinSize value
151  m_auimgr.AddPane( m_leftWin, EDA_PANE().Palette().Name( "ProjectTree" ).Left().Layer(3)
152  .CaptionVisible( false ).PaneBorder( false )
153  .MinSize( m_leftWinWidth, -1 ).BestSize( m_leftWinWidth, -1 ) );
154 
155  m_auimgr.AddPane( m_launcher, EDA_PANE().HToolbar().Name( "Launcher" ).Top().Layer(1) );
156 
157  m_auimgr.AddPane( m_messagesBox, EDA_PANE().Messages().Name( "MsgPanel" ).Center() );
158 
159  m_auimgr.Update();
160 
161  // Now the actual m_leftWin size is set, give it a reasonable min width
162  m_auimgr.GetPane( m_leftWin ).MinSize( 200, -1 );
163 
164  SetTitle( wxString( "KiCad " ) + GetBuildVersion() );
165 
166  // Ensure the window is on top
167  Raise();
168 }
const BITMAP_OPAQUE icon_kicad_xpm[1]
Definition: icon_kicad.cpp:153
void SetEnvironment(EDA_ITEM *aModel, KIGFX::VIEW *aView, KIGFX::VIEW_CONTROLS *aViewControls, TOOLS_HOLDER *aFrame)
Sets the work environment (model, view, view controls and the parent window).
KICAD_MANAGER_CONTROL.
TOOL_MANAGER.
Definition: tool_manager.h:50
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:80
wxString GetBuildVersion()
Get the full KiCad version string.
TREE_PROJECT_FRAME Window to display the tree files.
#define KICAD_DEFAULT_DRAWFRAME_STYLE
COMMON_CONTROL.
Specialization of the wxAuiPaneInfo class for KiCad panels.
#define KICAD_MANAGER_FRAME_NAME
The base frame for deriving all KiCad main window classes.
KICAD_MANAGER_ACTIONS.
KIWAY Kiway

References PCAD2KICAD::Center, GetBuildVersion(), icon_kicad_xpm, KiBitmap(), PCAD2KICAD::Left, and TOOL_MANAGER::SetEnvironment().

Variable Documentation

◆ s_KicadManagerParams

std::vector<PARAM_CFG*> s_KicadManagerParams