KiCad PCB EDA Suite
LAUNCHER_PANEL Class Reference

class LAUNCHER_PANEL More...

#include <kicad.h>

Inheritance diagram for LAUNCHER_PANEL:

Public Member Functions

 LAUNCHER_PANEL (wxWindow *parent)
 
 ~LAUNCHER_PANEL ()
 
int GetPanelHeight () const
 
int GetPanelWidth () const
 

Private Member Functions

void CreateCommandToolbar (void)
 Function CreateCommandToolbar creates the main tool bar buttons (fast launch buttons) More...
 
void AddButton (wxWindowID aId, const wxBitmap &aBitmap, const wxString &aToolTip)
 Add a single button to the toolbar. More...
 

Private Attributes

wxBoxSizer * m_buttonSizer
 
int m_height = 0
 
int m_width = 0
 

Detailed Description

class LAUNCHER_PANEL

Definition at line 310 of file kicad.h.

Constructor & Destructor Documentation

LAUNCHER_PANEL::LAUNCHER_PANEL ( wxWindow *  parent)

Definition at line 42 of file commandframe.cpp.

References CreateCommandToolbar().

42  :
43  wxPanel( parent, wxID_ANY )
44 {
45 
46  // Add bitmap buttons to launch KiCad utilities:
48 }
void CreateCommandToolbar(void)
Function CreateCommandToolbar creates the main tool bar buttons (fast launch buttons) ...
LAUNCHER_PANEL::~LAUNCHER_PANEL ( )
inline

Definition at line 319 of file kicad.h.

References KIWAY_HOLDER::Prj().

319 { };

Member Function Documentation

void LAUNCHER_PANEL::AddButton ( wxWindowID  aId,
const wxBitmap &  aBitmap,
const wxString &  aToolTip 
)
private

Add a single button to the toolbar.

Parameters
aIdis the ID of the button
aBitmapis the image to be used
aToolTipis the button mouse-over tool tip

Definition at line 123 of file commandframe.cpp.

References BUTTON_EXPANSION, BUTTON_SEPARATION, m_buttonSizer, m_height, and m_width.

Referenced by CreateCommandToolbar().

124 {
125  wxSize buttSize( aBitmap.GetWidth() + 2 * BUTTON_EXPANSION,
126  aBitmap.GetHeight() + 2 * BUTTON_EXPANSION );
127 
128  if( m_height < buttSize.y )
129  m_height = buttSize.y;
130 
131  m_width += buttSize.x + BUTTON_SEPARATION;
132 
133  auto btn = new wxBitmapButton( this, aId, aBitmap, wxDefaultPosition, buttSize );
134 
135  btn->SetToolTip( aToolTip );
136 
137  m_buttonSizer->Add( btn,
138  0,
139  wxALL | wxEXPAND,
141 }
int m_width
Definition: kicad.h:316
int m_height
Definition: kicad.h:315
const int BUTTON_SEPARATION
const int BUTTON_EXPANSION
wxBoxSizer * m_buttonSizer
Definition: kicad.h:313
void LAUNCHER_PANEL::CreateCommandToolbar ( void  )
private

Function CreateCommandToolbar creates the main tool bar buttons (fast launch buttons)

Add application launcher buttons e.g.

Eeschema, CvPcb, Pcbnew, GerbView

Definition at line 64 of file commandframe.cpp.

References AddButton(), ID_TO_BITMAP_CONVERTER, ID_TO_GERBVIEW, ID_TO_PCB, ID_TO_PCB_CALCULATOR, ID_TO_PCB_FP_EDITOR, ID_TO_PL_EDITOR, ID_TO_SCH, ID_TO_SCH_LIB_EDITOR, KiBitmap(), and m_buttonSizer.

Referenced by LAUNCHER_PANEL().

65 {
66  wxStaticLine* separator;
67 
68  m_buttonSizer = new wxBoxSizer( wxHORIZONTAL );
69 
71  KiBitmap( icon_eeschema_xpm ),
72  _( "Schematic Layout Editor" ) );
73 
75  KiBitmap( icon_libedit_xpm ),
76  _( "Symbol Editor" ) );
77 
78  separator = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
79  m_buttonSizer->Add( separator, 0, wxEXPAND | wxALL, 8 );
80 
82  KiBitmap( icon_pcbnew_xpm ),
83  _( "PCB Layout Editor" ) );
84 
86  KiBitmap( icon_modedit_xpm ),
87  _( "Footprint Editor" ) );
88 
89  separator = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
90  m_buttonSizer->Add( separator, 0, wxEXPAND | wxALL, 8 );
91 
93  KiBitmap( icon_gerbview_xpm ),
94  _( "Gerber Viewer" ) );
95 
97  KiBitmap( icon_bitmap2component_xpm ),
98  _( "Bitmap to Component Converter\n"
99  "Convert bitmap images to schematic or PCB components" ) );
100 
102  KiBitmap( icon_pcbcalculator_xpm ),
103  _( "PCB Calculator\n"
104  "Run component calculations, track width calculations, etc." ) );
105 
107  KiBitmap( icon_pagelayout_editor_xpm ),
108  _( "Page Layout Editor\n"
109  "Edit worksheet graphics and text" ) );
110 
111  // Add a stretchy spacer to make button bar fill the entire screen
112  m_buttonSizer->AddStretchSpacer();
113 
114  SetSizer( m_buttonSizer );
115 }
void AddButton(wxWindowID aId, const wxBitmap &aBitmap, const wxString &aToolTip)
Add a single button to the toolbar.
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
wxBoxSizer * m_buttonSizer
Definition: kicad.h:313
int LAUNCHER_PANEL::GetPanelHeight ( ) const

Definition at line 50 of file commandframe.cpp.

References BUTTON_SEPARATION, and m_height.

Referenced by KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME().

51 {
52  return m_height + 2 * BUTTON_SEPARATION;
53 }
int m_height
Definition: kicad.h:315
const int BUTTON_SEPARATION
int LAUNCHER_PANEL::GetPanelWidth ( ) const

Definition at line 55 of file commandframe.cpp.

References BUTTON_SEPARATION, and m_width.

Referenced by KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME().

56 {
57  return m_width + BUTTON_SEPARATION;
58 }
int m_width
Definition: kicad.h:316
const int BUTTON_SEPARATION

Member Data Documentation

wxBoxSizer* LAUNCHER_PANEL::m_buttonSizer
private

Definition at line 313 of file kicad.h.

Referenced by AddButton(), and CreateCommandToolbar().

int LAUNCHER_PANEL::m_height = 0
private

Definition at line 315 of file kicad.h.

Referenced by AddButton(), and GetPanelHeight().

int LAUNCHER_PANEL::m_width = 0
private

Definition at line 316 of file kicad.h.

Referenced by AddButton(), and GetPanelWidth().


The documentation for this class was generated from the following files: