Commit 2a2bf469 authored by raburton's avatar raburton

set eol-style native on new file

parent b5781155
/*****************************************************/ /*****************************************************/
/* commandframe.cpp: window handling comman buttons */ /* commandframe.cpp: window handling comman buttons */
/*****************************************************/ /*****************************************************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "kicad.h" #include "kicad.h"
#include "macros.h" #include "macros.h"
#define BITMAP wxBitmap #define BITMAP wxBitmap
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// resources // resources
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// USE_XPM_BITMAPS // USE_XPM_BITMAPS
#include "bitmaps.h" #include "bitmaps.h"
#include "id.h" #include "id.h"
/************************************************************************************/ /************************************************************************************/
WinEDA_CommandFrame::WinEDA_CommandFrame( wxWindow* parent, int id, WinEDA_CommandFrame::WinEDA_CommandFrame( wxWindow* parent, int id,
wxPoint pos, wxSize size, long style ) : wxPoint pos, wxSize size, long style ) :
wxSashLayoutWindow( parent, id, pos, size, style ) wxSashLayoutWindow( parent, id, pos, size, style )
/************************************************************************************/ /************************************************************************************/
/** WinEDA_CommandFrame constructor /** WinEDA_CommandFrame constructor
* create the window which the buttons to call eeschema and others... * create the window which the buttons to call eeschema and others...
*/ */
{ {
SetDefaultSize( wxSize( size.x, 100 ) ); SetDefaultSize( wxSize( size.x, 100 ) );
SetOrientation( wxLAYOUT_HORIZONTAL ); SetOrientation( wxLAYOUT_HORIZONTAL );
SetAlignment( wxLAYOUT_TOP ); SetAlignment( wxLAYOUT_TOP );
SetSashVisible( wxSASH_BOTTOM, TRUE ); SetSashVisible( wxSASH_BOTTOM, TRUE );
SetSashVisible( wxSASH_LEFT, TRUE ); SetSashVisible( wxSASH_LEFT, TRUE );
SetExtraBorderSize( 2 ); SetExtraBorderSize( 2 );
SetFont( *g_StdFont ); SetFont( *g_StdFont );
CreateCommandToolbar(); CreateCommandToolbar();
} }
/*************************************************/ /*************************************************/
void WinEDA_CommandFrame::CreateCommandToolbar( void ) void WinEDA_CommandFrame::CreateCommandToolbar( void )
/*************************************************/ /*************************************************/
/** Function CreateCommandToolbar /** Function CreateCommandToolbar
* create the buttons to call eescheman cvpcb, pcbnew and gerbview * create the buttons to call eescheman cvpcb, pcbnew and gerbview
*/ */
{ {
wxBitmapButton* btn; wxBitmapButton* btn;
m_ButtonSeparation = 10; m_ButtonSeparation = 10;
m_ButtonLastPosition.x = 20; m_ButtonLastPosition.x = 20;
m_ButtonLastPosition.y = 20; m_ButtonLastPosition.y = 20;
btn = new wxBitmapButton( this, ID_TO_EESCHEMA, BITMAP( icon_eeschema_xpm ) ); btn = new wxBitmapButton( this, ID_TO_EESCHEMA, BITMAP( icon_eeschema_xpm ) );
btn->SetToolTip( _( "eeschema (Schematic editor)" ) ); btn->SetToolTip( _( "eeschema (Schematic editor)" ) );
AddFastLaunch( btn ); AddFastLaunch( btn );
btn = new wxBitmapButton( this, ID_TO_CVPCB, BITMAP( icon_cvpcb_xpm ) ); btn = new wxBitmapButton( this, ID_TO_CVPCB, BITMAP( icon_cvpcb_xpm ) );
btn->SetToolTip( _( "cvpcb (Components to modules)" ) ); btn->SetToolTip( _( "cvpcb (Components to modules)" ) );
AddFastLaunch( btn ); AddFastLaunch( btn );
btn = new wxBitmapButton( this, ID_TO_PCB, BITMAP( a_icon_pcbnew_xpm ) ); btn = new wxBitmapButton( this, ID_TO_PCB, BITMAP( a_icon_pcbnew_xpm ) );
btn->SetToolTip( _( "pcbnew (PCB editor)" ) ); btn->SetToolTip( _( "pcbnew (PCB editor)" ) );
AddFastLaunch( btn ); AddFastLaunch( btn );
btn = new wxBitmapButton( this, ID_TO_GERBVIEW, BITMAP( icon_gerbview_xpm ) ); btn = new wxBitmapButton( this, ID_TO_GERBVIEW, BITMAP( icon_gerbview_xpm ) );
btn->SetToolTip( _( "gerbview (Gerber viewer)" ) ); btn->SetToolTip( _( "gerbview (Gerber viewer)" ) );
AddFastLaunch( btn ); AddFastLaunch( btn );
// Set up toolbar // Set up toolbar
#ifdef KICAD_PYTHON #ifdef KICAD_PYTHON
btn = new wxBitmapButton( this, ID_RUN_PYTHON, BITMAP( icon_python_xpm ) ); btn = new wxBitmapButton( this, ID_RUN_PYTHON, BITMAP( icon_python_xpm ) );
btn->SetToolTip( _( "Run Python Script" ) ); btn->SetToolTip( _( "Run Python Script" ) );
AddFastLaunch( btn ); AddFastLaunch( btn );
#endif #endif
} }
/****************************************************************/ /****************************************************************/
void WinEDA_CommandFrame::AddFastLaunch( wxBitmapButton * button ) void WinEDA_CommandFrame::AddFastLaunch( wxBitmapButton * button )
/****************************************************************/ /****************************************************************/
/** Function AddFastLaunch /** Function AddFastLaunch
* add a Bitmap Button (fast launch button) to the window * add a Bitmap Button (fast launch button) to the window
* @param button = wxBitmapButton to add to the window * @param button = wxBitmapButton to add to the window
*/ */
{ {
button->Move( m_ButtonLastPosition ); button->Move( m_ButtonLastPosition );
m_ButtonLastPosition.x += button->GetSize().GetWidth() + m_ButtonSeparation; m_ButtonLastPosition.x += button->GetSize().GetWidth() + m_ButtonSeparation;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment