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 <gestfich.h>
#include <kiway.h>
#include <kiway_express.h>
#include <kiway_player.h>
#include <panel_hotkeys_editor.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"

Go to the source code of this file.

Macros

#define TREE_FRAME_WIDTH_ENTRY   wxT( "LeftWinWidth" )
 
#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

PARAM_CFG_ARRAY s_KicadManagerParams
 

Macro Definition Documentation

◆ GeneralGroupName

#define GeneralGroupName   wxT( "/general" )

Definition at line 60 of file kicad_manager_frame.cpp.

◆ SEP

#define SEP ( )    wxFileName::GetPathSeparator()

Definition at line 54 of file kicad_manager_frame.cpp.

◆ TREE_FRAME_WIDTH_ENTRY

#define TREE_FRAME_WIDTH_ENTRY   wxT( "LeftWinWidth" )

Definition at line 52 of file kicad_manager_frame.cpp.

Function Documentation

◆ EVT_MENU_RANGE()

Definition at line 80 of file kicad_manager_frame.cpp.

91  :
92  EDA_BASE_FRAME( parent, KICAD_MAIN_FRAME_T, title, pos, size,
94  m_leftWin( nullptr ),
95  m_launcher( nullptr ),
96  m_messagesBox( nullptr ),
97  m_mainToolBar( nullptr )
98 {
99  m_active_project = false;
100  m_leftWinWidth = 250; // Default value
101  m_AboutTitle = "KiCad";
102 
103  // Create the status line (bottom of the frame)
104  static const int dims[3] = { -1, -1, 100 };
105 
106  CreateStatusBar( 3 );
107  SetStatusWidths( 3, dims );
108 
109  // Give an icon
110  wxIcon icon;
111  icon.CopyFromBitmap( KiBitmap( icon_kicad_xpm ) );
112  SetIcon( icon );
113 
114  // Give the last size and pos to main window
115  LoadSettings( config() );
116  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
117 
118  // Left window: is the box which display tree project
119  m_leftWin = new TREE_PROJECT_FRAME( this );
120 
121  // Add the wxTextCtrl showing all messages from KiCad:
122  m_messagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString,
123  wxDefaultPosition, wxDefaultSize,
124  wxTE_MULTILINE | wxTE_READONLY | wxBORDER_NONE );
125 
126  // Create the manager
127  m_toolManager = new TOOL_MANAGER;
128  m_toolManager->SetEnvironment( nullptr, nullptr, nullptr, this );
129  m_actions = new KICAD_MANAGER_ACTIONS();
130 
131  // Register tools
132  m_toolManager->RegisterTool( new COMMON_CONTROL );
133  m_toolManager->RegisterTool( new KICAD_MANAGER_CONTROL );
134  m_toolManager->InitTools();
135 
136  RecreateBaseHToolbar();
137  RecreateLauncher();
138  ReCreateMenuBar();
139 
140  m_auimgr.SetManagedWindow( this );
141 
142  m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );
143 
144  // BestSize() does not always set the actual pane size of m_leftWin to the required value.
145  // It happens when m_leftWin is too large (roughly > 1/3 of the kicad manager frame width.
146  // (Well, BestSize() sets the best size... not the window size)
147  // A trick is to use MinSize() to set the required pane width,
148  // and after give a reasonable MinSize value
149  m_auimgr.AddPane( m_leftWin, EDA_PANE().Palette().Name( "ProjectTree" ).Left().Layer(3)
150  .CaptionVisible( false ).PaneBorder( false )
151  .MinSize( m_leftWinWidth, -1 ).BestSize( m_leftWinWidth, -1 ) );
152 
153  m_auimgr.AddPane( m_launcher, EDA_PANE().HToolbar().Name( "Launcher" ).Top().Layer(1) );
154 
155  m_auimgr.AddPane( m_messagesBox, EDA_PANE().Messages().Name( "MsgPanel" ).Center() );
156 
157  m_auimgr.Update();
158 
159  // Now the actual m_leftWin size is set, give it a reasonable min width
160  m_auimgr.GetPane( m_leftWin ).MinSize( 200, -1 );
161 
162  SetTitle( wxString( "KiCad " ) + GetBuildVersion() );
163 }
Class KICAD_MANAGER_CONTROL.
Class 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:79
wxString GetBuildVersion()
Function GetBuildVersion Return the build version string.
class TREE_PROJECT_FRAME Window to display the tree files
#define KICAD_DEFAULT_DRAWFRAME_STYLE
Class 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).
Class KICAD_MANAGER_ACTIONS.
KIWAY Kiway

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

Variable Documentation

◆ s_KicadManagerParams