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  // Give the last size and pos to main window
118  LoadSettings( config() );
119  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
120 
121  // Left window: is the box which display tree project
122  m_leftWin = new TREE_PROJECT_FRAME( this );
123 
124  // Add the wxTextCtrl showing all messages from KiCad:
125  m_messagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString,
126  wxDefaultPosition, wxDefaultSize,
127  wxTE_MULTILINE | wxTE_READONLY | wxBORDER_NONE );
128 
129  // Create the manager
130  m_toolManager = new TOOL_MANAGER;
131  m_toolManager->SetEnvironment( nullptr, nullptr, nullptr, this );
132  m_actions = new KICAD_MANAGER_ACTIONS();
133 
134  // Register tools
135  m_toolManager->RegisterTool( new COMMON_CONTROL );
136  m_toolManager->RegisterTool( new KICAD_MANAGER_CONTROL );
137  m_toolManager->InitTools();
138 
139  RecreateBaseHToolbar();
140  RecreateLauncher();
141  ReCreateMenuBar();
142 
143  m_auimgr.SetManagedWindow( this );
144 
145  m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );
146 
147  // BestSize() does not always set the actual pane size of m_leftWin to the required value.
148  // It happens when m_leftWin is too large (roughly > 1/3 of the kicad manager frame width.
149  // (Well, BestSize() sets the best size... not the window size)
150  // A trick is to use MinSize() to set the required pane width,
151  // and after give a reasonable MinSize value
152  m_auimgr.AddPane( m_leftWin, EDA_PANE().Palette().Name( "ProjectTree" ).Left().Layer(3)
153  .CaptionVisible( false ).PaneBorder( false )
154  .MinSize( m_leftWinWidth, -1 ).BestSize( m_leftWinWidth, -1 ) );
155 
156  m_auimgr.AddPane( m_launcher, EDA_PANE().HToolbar().Name( "Launcher" ).Top().Layer(1) );
157 
158  m_auimgr.AddPane( m_messagesBox, EDA_PANE().Messages().Name( "MsgPanel" ).Center() );
159 
160  m_auimgr.Update();
161 
162  // Now the actual m_leftWin size is set, give it a reasonable min width
163  m_auimgr.GetPane( m_leftWin ).MinSize( 200, -1 );
164 
165  SetTitle( wxString( "KiCad " ) + GetBuildVersion() );
166 }
const BITMAP_OPAQUE icon_kicad_xpm[1]
Definition: icon_kicad.cpp:153
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.
void SetEnvironment(EDA_ITEM *aModel, KIGFX::VIEW *aView, KIGFX::VIEW_CONTROLS *aViewControls, EDA_BASE_FRAME *aFrame)
Sets the work environment (model, view, view controls and the parent window).
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