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
 

Private Member Functions

void CreateCommandToolbar (void)
 Function CreateCommandToolbar creates the main tool bar buttons (fast launch buttons) More...
 
wxBitmapButton * AddBitmapButton (wxWindowID aId, const wxBitmap &aBitmap)
 Function AddBitmapButton add a Bitmap Button (fast launch button) to the buttons panel. More...
 

Private Attributes

int m_buttonSeparation
 
wxPoint m_buttonsListPosition
 
wxPoint m_buttonLastPosition
 
int m_bitmapButtons_maxHeight
 

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

References CreateCommandToolbar(), m_bitmapButtons_maxHeight, m_buttonLastPosition, m_buttonSeparation, m_buttonsListPosition, wxPoint::x, and wxPoint::y.

36  :
37  wxPanel( parent, wxID_ANY )
38 {
40  m_buttonSeparation = 10; // control of command buttons position
44 
45  // Add bitmap buttons to launch KiCad utilities:
47 }
int m_bitmapButtons_maxHeight
Definition: kicad.h:318
void CreateCommandToolbar(void)
Function CreateCommandToolbar creates the main tool bar buttons (fast launch buttons) ...
int m_buttonSeparation
Definition: kicad.h:313
wxPoint m_buttonsListPosition
Definition: kicad.h:314
wxPoint m_buttonLastPosition
Definition: kicad.h:317
LAUNCHER_PANEL::~LAUNCHER_PANEL ( )
inline

Definition at line 322 of file kicad.h.

322 { };

Member Function Documentation

wxBitmapButton * LAUNCHER_PANEL::AddBitmapButton ( wxWindowID  aId,
const wxBitmap &  aBitmap 
)
private

Function AddBitmapButton add a Bitmap Button (fast launch button) to the buttons panel.

Parameters
aId= the button id
aBitmap= the wxBitmap used to create the button

Definition at line 98 of file commandframe.cpp.

References m_bitmapButtons_maxHeight, m_buttonLastPosition, m_buttonSeparation, and wxPoint::x.

Referenced by CreateCommandToolbar().

99 {
100  wxPoint buttPos = m_buttonLastPosition;
101  wxSize buttSize;
102  int btn_margin = 10; // extra margin around the bitmap.
103 
104  buttSize.x = aBitmap.GetWidth() + btn_margin;
105  buttSize.y = aBitmap.GetHeight() + btn_margin;
106 
107  if( m_bitmapButtons_maxHeight < buttSize.y )
108  m_bitmapButtons_maxHeight = buttSize.y;
109 
110  wxBitmapButton* btn = new wxBitmapButton( this, aId, aBitmap, buttPos, buttSize );
111  m_buttonLastPosition.x += buttSize.x + m_buttonSeparation;
112 
113  return btn;
114 }
int m_bitmapButtons_maxHeight
Definition: kicad.h:318
int m_buttonSeparation
Definition: kicad.h:313
wxPoint m_buttonLastPosition
Definition: kicad.h:317
void LAUNCHER_PANEL::CreateCommandToolbar ( void  )
private

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

Function CreateCommandToolbar create the buttons to call Eeschema CvPcb, Pcbnew and GerbView.

Definition at line 60 of file commandframe.cpp.

References AddBitmapButton(), 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, and KiBitmap().

Referenced by LAUNCHER_PANEL().

61 {
62  wxBitmapButton* btn;
63 
64  btn = AddBitmapButton( ID_TO_SCH, KiBitmap( icon_eeschema_xpm ) );
65  btn->SetToolTip( _( "Eeschema - Electronic schematic editor" ) );
66 
67  btn = AddBitmapButton( ID_TO_SCH_LIB_EDITOR, KiBitmap( icon_libedit_xpm ) );
68  btn->SetToolTip( _( "Schematic library editor" ) );
69 
70  btn = AddBitmapButton( ID_TO_PCB, KiBitmap( icon_pcbnew_xpm ) );
71  btn->SetToolTip( _( "Pcbnew - Printed circuit board editor" ) );
72 
73  btn = AddBitmapButton( ID_TO_PCB_FP_EDITOR, KiBitmap( icon_modedit_xpm ) );
74  btn->SetToolTip( _( "PCB footprint editor" ) );
75 
76  btn = AddBitmapButton( ID_TO_GERBVIEW, KiBitmap( icon_gerbview_xpm ) );
77  btn->SetToolTip( _( "GerbView - Gerber viewer" ) );
78 
79  btn = AddBitmapButton( ID_TO_BITMAP_CONVERTER, KiBitmap( icon_bitmap2component_xpm ) );
80  btn->SetToolTip( _(
81  "Bitmap2Component - Convert bitmap images to Eeschema\n"
82  "or Pcbnew elements" ) );
83 
84  btn = AddBitmapButton( ID_TO_PCB_CALCULATOR, KiBitmap( icon_pcbcalculator_xpm ) );
85  btn->SetToolTip( _( "Pcb calculator - Calculator for components, track width, etc." ) );
86 
87  btn = AddBitmapButton( ID_TO_PL_EDITOR, KiBitmap( icon_pagelayout_editor_xpm ) );
88  btn->SetToolTip( _( "Pl editor - Worksheet layout editor" ) );
89 }
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
wxBitmapButton * AddBitmapButton(wxWindowID aId, const wxBitmap &aBitmap)
Function AddBitmapButton add a Bitmap Button (fast launch button) to the buttons panel.
int LAUNCHER_PANEL::GetPanelHeight ( ) const

Definition at line 49 of file commandframe.cpp.

References m_bitmapButtons_maxHeight, m_buttonSeparation, m_buttonsListPosition, and wxPoint::y.

Referenced by KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME().

50 {
53  return height;
54 }
int m_bitmapButtons_maxHeight
Definition: kicad.h:318
int m_buttonSeparation
Definition: kicad.h:313
wxPoint m_buttonsListPosition
Definition: kicad.h:314

Member Data Documentation

int LAUNCHER_PANEL::m_bitmapButtons_maxHeight
private

Definition at line 318 of file kicad.h.

Referenced by AddBitmapButton(), GetPanelHeight(), and LAUNCHER_PANEL().

wxPoint LAUNCHER_PANEL::m_buttonLastPosition
private

Definition at line 317 of file kicad.h.

Referenced by AddBitmapButton(), and LAUNCHER_PANEL().

int LAUNCHER_PANEL::m_buttonSeparation
private

Definition at line 313 of file kicad.h.

Referenced by AddBitmapButton(), GetPanelHeight(), and LAUNCHER_PANEL().

wxPoint LAUNCHER_PANEL::m_buttonsListPosition
private

Definition at line 314 of file kicad.h.

Referenced by GetPanelHeight(), and LAUNCHER_PANEL().


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