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 320 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 329 of file kicad.h.

References Prj().

329 { };

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 121 of file commandframe.cpp.

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

Referenced by CreateCommandToolbar().

122 {
123  wxSize buttSize( aBitmap.GetWidth() + 2 * BUTTON_EXPANSION,
124  aBitmap.GetHeight() + 2 * BUTTON_EXPANSION );
125 
126  if( m_height < buttSize.y )
127  m_height = buttSize.y;
128 
129  m_width += buttSize.x + BUTTON_SEPARATION;
130 
131  auto btn = new wxBitmapButton( this, aId, aBitmap, wxDefaultPosition, buttSize );
132 
133  btn->SetToolTip( aToolTip );
134 
135  m_buttonSizer->Add( btn,
136  0,
137  wxALL | wxEXPAND,
139 }
int m_width
Definition: kicad.h:326
int m_height
Definition: kicad.h:325
const int BUTTON_SEPARATION
const int BUTTON_EXPANSION
wxBoxSizer * m_buttonSizer
Definition: kicad.h:323
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 library 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 library 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  _( "Import bitmap\n"
99  "Convert bitmap images to schematic or PCB elements" ) );
100 
102  KiBitmap( icon_pcbcalculator_xpm ),
103  _( "Calculator tools" ) );
104 
106  KiBitmap( icon_pagelayout_editor_xpm ),
107  _( "Worksheet layout editor" ) );
108 
109  // Add a stretchy spacer to make button bar fill the entire screen
110  m_buttonSizer->AddStretchSpacer();
111 
112  SetSizer( m_buttonSizer );
113 }
void AddButton(wxWindowID aId, const wxBitmap &aBitmap, const wxString &aToolTip)
Add a single button to the toolbar.
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:78
wxBoxSizer * m_buttonSizer
Definition: kicad.h:323
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:325
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:326
const int BUTTON_SEPARATION

Member Data Documentation

wxBoxSizer* LAUNCHER_PANEL::m_buttonSizer
private

Definition at line 323 of file kicad.h.

Referenced by AddButton(), and CreateCommandToolbar().

int LAUNCHER_PANEL::m_height = 0
private

Definition at line 325 of file kicad.h.

Referenced by AddButton(), and GetPanelHeight().

int LAUNCHER_PANEL::m_width = 0
private

Definition at line 326 of file kicad.h.

Referenced by AddButton(), and GetPanelWidth().


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