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, 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 314 of file kicad.h.

Constructor & Destructor Documentation

LAUNCHER_PANEL::LAUNCHER_PANEL ( wxWindow *  parent)

Definition at line 41 of file commandframe.cpp.

References CreateCommandToolbar().

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

Definition at line 323 of file kicad.h.

323 { };

Member Function Documentation

void LAUNCHER_PANEL::AddButton ( wxWindowID  aId,
const wxBitmap &  aBitmap,
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 112 of file commandframe.cpp.

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

Referenced by CreateCommandToolbar().

113 {
114  wxSize buttSize( aBitmap.GetWidth() + 2 * BUTTON_EXPANSION,
115  aBitmap.GetHeight() + 2 * BUTTON_EXPANSION );
116 
117  if( m_height < buttSize.y )
118  m_height = buttSize.y;
119 
120  m_width += buttSize.x + BUTTON_SEPARATION;
121 
122  auto btn = new wxBitmapButton( this, aId, aBitmap, wxDefaultPosition, buttSize );
123 
124  btn->SetToolTip( aToolTip );
125 
126  m_buttonSizer->Add( btn,
127  0,
128  wxALL | wxEXPAND,
130 }
int m_width
Definition: kicad.h:320
int m_height
Definition: kicad.h:319
const int BUTTON_SEPARATION
const int BUTTON_EXPANSION
wxBoxSizer * m_buttonSizer
Definition: kicad.h:317
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 63 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().

64 {
65  m_buttonSizer = new wxBoxSizer( wxHORIZONTAL );
66 
68  KiBitmap( icon_eeschema_xpm ),
69  _( "Schematic layout editor" ) );
70 
72  KiBitmap( icon_libedit_xpm ),
73  _( "Schematic library editor" ) );
74 
76  KiBitmap( icon_pcbnew_xpm ),
77  _( "PCB layout editor" ) );
78 
80  KiBitmap( icon_modedit_xpm ),
81  _( "PCB library editor" ) );
82 
84  KiBitmap( icon_gerbview_xpm ),
85  _( "Gerber viewer" ) );
86 
88  KiBitmap( icon_bitmap2component_xpm ),
89  _( "Import bitmap\n"
90  "Convert bitmap images to schematic or PCB elements" ) );
91 
93  KiBitmap( icon_pcbcalculator_xpm ),
94  _( "Calculator tools" ) );
95 
97  KiBitmap( icon_pagelayout_editor_xpm ),
98  _( "Worksheet layout editor" ) );
99 
100  // Add a stretchy spacer to make button bar fill the entire screen
101  m_buttonSizer->AddStretchSpacer();
102 
103  SetSizer( m_buttonSizer );
104 }
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
void AddButton(wxWindowID aId, const wxBitmap &aBitmap, wxString aToolTip)
Add a single button to the toolbar.
wxBoxSizer * m_buttonSizer
Definition: kicad.h:317
int LAUNCHER_PANEL::GetPanelHeight ( ) const

Definition at line 49 of file commandframe.cpp.

References BUTTON_SEPARATION, and m_height.

Referenced by KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME().

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

Definition at line 54 of file commandframe.cpp.

References BUTTON_SEPARATION, and m_width.

Referenced by KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME().

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

Member Data Documentation

wxBoxSizer* LAUNCHER_PANEL::m_buttonSizer
private

Definition at line 317 of file kicad.h.

Referenced by AddButton(), and CreateCommandToolbar().

int LAUNCHER_PANEL::m_height = 0
private

Definition at line 319 of file kicad.h.

Referenced by AddButton(), and GetPanelHeight().

int LAUNCHER_PANEL::m_width = 0
private

Definition at line 320 of file kicad.h.

Referenced by AddButton(), and GetPanelWidth().


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