2011-09-16 18:54:04 +00:00
|
|
|
/**
|
|
|
|
* @file tool_pcb.cpp
|
|
|
|
* @brief PCB editor tool bars
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#include "fctsys.h"
|
2011-09-16 18:54:04 +00:00
|
|
|
#include "help_common_strings.h"
|
|
|
|
#include "dialog_helpers.h"
|
|
|
|
#include "class_layer_box_selector.h"
|
|
|
|
#include "colors_selection.h"
|
2011-09-23 13:57:12 +00:00
|
|
|
#include "wxPcbStruct.h"
|
|
|
|
|
|
|
|
#include "class_board.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#include "pcbnew.h"
|
2009-09-22 12:27:57 +00:00
|
|
|
#include "pcbnew_id.h"
|
2011-09-16 18:54:04 +00:00
|
|
|
#include "hotkeys.h"
|
|
|
|
|
|
|
|
#include "wx/wupdlock.h"
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#ifdef __UNIX__
|
2009-10-30 17:58:15 +00:00
|
|
|
#define LISTBOX_WIDTH 150
|
2007-06-05 12:10:51 +00:00
|
|
|
#else
|
2009-10-30 17:58:15 +00:00
|
|
|
#define LISTBOX_WIDTH 130
|
2007-06-05 12:10:51 +00:00
|
|
|
#endif
|
|
|
|
|
2007-08-04 01:08:43 +00:00
|
|
|
#define SEL_LAYER_HELP _( \
|
|
|
|
"Show active layer selections\nand select layer pair for route and place via" )
|
2007-06-13 15:35:40 +00:00
|
|
|
|
2011-09-16 18:54:04 +00:00
|
|
|
|
2007-06-13 15:35:40 +00:00
|
|
|
/* Data to build the layer pair indicator button */
|
2007-08-30 08:15:05 +00:00
|
|
|
static wxBitmap* LayerPairBitmap = NULL;
|
2007-09-11 04:17:46 +00:00
|
|
|
|
2011-09-16 18:54:04 +00:00
|
|
|
static const char s_BitmapLayerIcon[24][24] = {
|
2007-08-04 01:08:43 +00:00
|
|
|
// 0 = draw pixel with active layer color
|
2011-09-16 18:54:04 +00:00
|
|
|
// 1 = draw pixel with top layer color (top/bottom layer used inautoroute and place via)
|
2007-08-04 01:08:43 +00:00
|
|
|
// 2 = draw pixel with bottom layer color
|
|
|
|
// 3 = draw pixel with via color
|
2011-09-16 18:54:04 +00:00
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0 },
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0 },
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0 },
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0 },
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 },
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 },
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 },
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 0, 1, 1, 1, 1, 3, 0, 0, 0, 0, 0, 0, 0 },
|
|
|
|
{ 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 0, 1, 1, 1, 1, 3, 3, 2, 2, 2, 2, 2, 2, 2 },
|
|
|
|
{ 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 1, 1, 1, 1, 0, 3, 3, 2, 2, 2, 2, 2, 2, 2 },
|
|
|
|
{ 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 1, 1, 1, 1, 0, 3, 3, 2, 2, 2, 2, 2, 2, 2 },
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 1, 1, 1, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0 },
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
|
2007-06-13 15:35:40 +00:00
|
|
|
};
|
2007-08-04 01:08:43 +00:00
|
|
|
|
|
|
|
|
2009-10-14 19:43:31 +00:00
|
|
|
/* Draw the icon for the "Select layer pair" bitmap tool
|
2007-08-04 01:08:43 +00:00
|
|
|
*/
|
2011-03-01 19:26:17 +00:00
|
|
|
void PCB_EDIT_FRAME::PrepareLayerIndicator()
|
2007-06-13 15:35:40 +00:00
|
|
|
{
|
2007-08-04 01:08:43 +00:00
|
|
|
int ii, jj;
|
|
|
|
int active_layer_color, Route_Layer_TOP_color,
|
|
|
|
Route_Layer_BOTTOM_color, via_color;
|
|
|
|
bool change = false;
|
2011-09-19 16:29:46 +00:00
|
|
|
bool first_call = LayerPairBitmap == NULL;
|
2007-08-04 01:08:43 +00:00
|
|
|
|
|
|
|
static int previous_active_layer_color, previous_Route_Layer_TOP_color,
|
|
|
|
previous_Route_Layer_BOTTOM_color, previous_via_color;
|
|
|
|
|
|
|
|
/* get colors, and redraw bitmap button only on changes */
|
2010-01-31 20:01:46 +00:00
|
|
|
active_layer_color = GetBoard()->GetLayerColor(getActiveLayer());
|
2011-02-21 13:54:29 +00:00
|
|
|
|
2007-08-04 01:08:43 +00:00
|
|
|
if( previous_active_layer_color != active_layer_color )
|
|
|
|
{
|
|
|
|
previous_active_layer_color = active_layer_color;
|
2009-10-01 16:46:13 +00:00
|
|
|
change = true;
|
2007-08-04 01:08:43 +00:00
|
|
|
}
|
2011-02-21 13:54:29 +00:00
|
|
|
|
2011-03-01 19:26:17 +00:00
|
|
|
Route_Layer_TOP_color =
|
|
|
|
g_ColorsSettings.GetLayerColor( ( ( PCB_SCREEN* ) GetScreen() )->m_Route_Layer_TOP );
|
2011-02-21 13:54:29 +00:00
|
|
|
|
2007-08-04 01:08:43 +00:00
|
|
|
if( previous_Route_Layer_TOP_color != Route_Layer_TOP_color )
|
|
|
|
{
|
|
|
|
previous_Route_Layer_TOP_color = Route_Layer_TOP_color;
|
2009-10-01 16:46:13 +00:00
|
|
|
change = true;
|
2007-08-04 01:08:43 +00:00
|
|
|
}
|
2011-02-21 13:54:29 +00:00
|
|
|
|
2011-03-01 19:26:17 +00:00
|
|
|
Route_Layer_BOTTOM_color =
|
|
|
|
g_ColorsSettings.GetLayerColor( ( (PCB_SCREEN*) GetScreen() )->m_Route_Layer_BOTTOM );
|
2011-02-21 13:54:29 +00:00
|
|
|
|
2007-08-04 01:08:43 +00:00
|
|
|
if( previous_Route_Layer_BOTTOM_color != Route_Layer_BOTTOM_color )
|
|
|
|
{
|
|
|
|
previous_Route_Layer_BOTTOM_color = Route_Layer_BOTTOM_color;
|
2009-10-01 16:46:13 +00:00
|
|
|
change = true;
|
2007-08-04 01:08:43 +00:00
|
|
|
}
|
2010-01-31 20:01:46 +00:00
|
|
|
|
|
|
|
int via_type = GetBoard()->GetBoardDesignSettings()->m_CurrentViaType;
|
|
|
|
via_color = GetBoard()->GetVisibleElementColor(VIAS_VISIBLE+via_type);
|
2011-02-21 13:54:29 +00:00
|
|
|
|
2007-08-04 01:08:43 +00:00
|
|
|
if( previous_via_color != via_color )
|
|
|
|
{
|
|
|
|
previous_via_color = via_color;
|
2009-10-01 16:46:13 +00:00
|
|
|
change = true;
|
2007-08-04 01:08:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if( !change && (LayerPairBitmap != NULL) )
|
|
|
|
return;
|
|
|
|
|
2011-09-19 16:29:46 +00:00
|
|
|
/* Create the bitmap and its Memory DC, if not already made */
|
2007-08-04 01:08:43 +00:00
|
|
|
if( LayerPairBitmap == NULL )
|
|
|
|
{
|
2011-09-16 18:54:04 +00:00
|
|
|
LayerPairBitmap = new wxBitmap( 24, 24 );
|
2007-08-04 01:08:43 +00:00
|
|
|
}
|
|
|
|
|
2009-11-20 14:55:20 +00:00
|
|
|
/* Draw the icon, with colors according to the active layer and layer
|
|
|
|
* pairs for via command (change layer)
|
2007-08-04 01:08:43 +00:00
|
|
|
*/
|
|
|
|
wxMemoryDC iconDC;
|
|
|
|
iconDC.SelectObject( *LayerPairBitmap );
|
|
|
|
wxPen pen;
|
2011-09-16 18:54:04 +00:00
|
|
|
int buttonColor = -1;
|
2011-03-01 19:26:17 +00:00
|
|
|
|
2011-09-16 18:54:04 +00:00
|
|
|
for( ii = 0; ii < 24; ii++ )
|
2007-08-04 01:08:43 +00:00
|
|
|
{
|
2011-09-16 18:54:04 +00:00
|
|
|
for( jj = 0; jj < 24; jj++ )
|
2007-08-04 01:08:43 +00:00
|
|
|
{
|
2011-09-16 18:54:04 +00:00
|
|
|
if( s_BitmapLayerIcon[ii][jj] != buttonColor )
|
2007-08-04 01:08:43 +00:00
|
|
|
{
|
2011-09-16 18:54:04 +00:00
|
|
|
switch( s_BitmapLayerIcon[ii][jj] )
|
2007-08-04 01:08:43 +00:00
|
|
|
{
|
|
|
|
default:
|
|
|
|
case 0:
|
2011-09-16 18:54:04 +00:00
|
|
|
pen.SetColour( MakeColour( active_layer_color ) );
|
2007-08-04 01:08:43 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
2011-09-16 18:54:04 +00:00
|
|
|
pen.SetColour( MakeColour( Route_Layer_TOP_color) );
|
2007-08-04 01:08:43 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
2011-09-16 18:54:04 +00:00
|
|
|
pen.SetColour( MakeColour( Route_Layer_BOTTOM_color ) );
|
2007-08-04 01:08:43 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
2011-09-16 18:54:04 +00:00
|
|
|
pen.SetColour( MakeColour( via_color ) );
|
2007-08-04 01:08:43 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2011-09-16 18:54:04 +00:00
|
|
|
buttonColor = s_BitmapLayerIcon[ii][jj];
|
2007-08-04 01:08:43 +00:00
|
|
|
iconDC.SetPen( pen );
|
|
|
|
}
|
2011-03-01 19:26:17 +00:00
|
|
|
|
2007-08-04 01:08:43 +00:00
|
|
|
iconDC.DrawPoint( jj, ii );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Deselect the Tool Bitmap from DC,
|
|
|
|
* in order to delete the MemoryDC safely without deleting the bitmap */
|
|
|
|
iconDC.SelectObject( wxNullBitmap );
|
|
|
|
|
2011-09-19 16:29:46 +00:00
|
|
|
if( m_HToolBar && ! first_call )
|
2007-08-04 01:08:43 +00:00
|
|
|
{
|
2011-02-21 13:54:29 +00:00
|
|
|
m_HToolBar->SetToolBitmap( ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, *LayerPairBitmap );
|
2011-09-19 16:29:46 +00:00
|
|
|
m_HToolBar->Refresh();
|
2007-08-04 01:08:43 +00:00
|
|
|
}
|
2007-06-13 15:35:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-09-17 17:48:40 +00:00
|
|
|
/* Creates or updates the main horizontal toolbar for the board editor
|
2010-01-21 20:53:01 +00:00
|
|
|
*/
|
2011-03-01 19:26:17 +00:00
|
|
|
void PCB_EDIT_FRAME::ReCreateHToolbar()
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-08-30 08:15:05 +00:00
|
|
|
wxString msg;
|
2007-08-04 01:08:43 +00:00
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
if( m_HToolBar )
|
2007-08-04 01:08:43 +00:00
|
|
|
return;
|
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
wxWindowUpdateLocker dummy( this );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
2011-04-13 19:30:27 +00:00
|
|
|
m_HToolBar = new EDA_TOOLBAR( TOOLBAR_MAIN, this, ID_H_TOOLBAR, true );
|
2007-08-04 01:08:43 +00:00
|
|
|
m_HToolBar->SetRows( 1 );
|
2010-02-08 18:15:42 +00:00
|
|
|
|
2007-08-04 01:08:43 +00:00
|
|
|
// Set up toolbar
|
2011-08-28 20:02:27 +00:00
|
|
|
m_HToolBar->AddTool( ID_NEW_BOARD, wxEmptyString, KiBitmap( new_xpm ),
|
2010-01-21 20:53:01 +00:00
|
|
|
_( "New board" ) );
|
2011-08-28 20:02:27 +00:00
|
|
|
m_HToolBar->AddTool( ID_LOAD_FILE, wxEmptyString, KiBitmap( open_document_xpm ),
|
2010-01-21 20:53:01 +00:00
|
|
|
_( "Open existing board" ) );
|
2011-08-28 20:02:27 +00:00
|
|
|
m_HToolBar->AddTool( ID_SAVE_BOARD, wxEmptyString, KiBitmap( save_xpm ),
|
2010-01-21 20:53:01 +00:00
|
|
|
_( "Save board" ) );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
|
|
|
m_HToolBar->AddSeparator();
|
2011-08-28 20:02:27 +00:00
|
|
|
m_HToolBar->AddTool( ID_SHEET_SET, wxEmptyString, KiBitmap( sheetset_xpm ),
|
2011-07-02 12:48:45 +00:00
|
|
|
_( "Page settings for paper size and texts" ) );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
|
|
|
m_HToolBar->AddSeparator();
|
2011-08-28 20:02:27 +00:00
|
|
|
m_HToolBar->AddTool( ID_OPEN_MODULE_EDITOR, wxEmptyString, KiBitmap( modedit_xpm ),
|
2010-01-21 20:53:01 +00:00
|
|
|
_( "Open module editor" ) );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
|
|
|
m_HToolBar->AddSeparator();
|
2011-08-29 03:04:59 +00:00
|
|
|
m_HToolBar->AddTool( wxID_CUT, wxEmptyString, KiBitmap( cut_button_xpm ),
|
2010-01-21 20:53:01 +00:00
|
|
|
_( "Cut selected item" ) );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#if 0
|
2011-08-29 03:04:59 +00:00
|
|
|
m_HToolBar->AddTool( wxID_COPY, wxEmptyString, KiBitmap( copy_button_xpm ),
|
2010-01-21 20:53:01 +00:00
|
|
|
_( "Copy selected item" ) );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-08-28 20:02:27 +00:00
|
|
|
m_HToolBar->AddTool( wxID_PASTE, wxEmptyString, KiBitmap( paste_xpm ),
|
2010-01-21 20:53:01 +00:00
|
|
|
_( "Paste" ) );
|
2007-06-05 12:10:51 +00:00
|
|
|
#endif
|
|
|
|
|
2009-07-29 13:10:36 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
2011-09-23 20:00:30 +00:00
|
|
|
msg = AddHotkeyName( HELP_UNDO, g_Board_Editor_Hokeys_Descr, HK_UNDO, IS_COMMENT );
|
2011-08-28 20:02:27 +00:00
|
|
|
m_HToolBar->AddTool( wxID_UNDO, wxEmptyString, KiBitmap( undo_xpm ), HELP_UNDO );
|
2011-09-23 20:00:30 +00:00
|
|
|
msg = AddHotkeyName( HELP_REDO, g_Board_Editor_Hokeys_Descr, HK_REDO, IS_COMMENT );
|
2011-08-28 20:02:27 +00:00
|
|
|
m_HToolBar->AddTool( wxID_REDO, wxEmptyString, KiBitmap( redo_xpm ), HELP_REDO );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
|
|
|
m_HToolBar->AddSeparator();
|
2011-08-29 03:04:59 +00:00
|
|
|
m_HToolBar->AddTool( wxID_PRINT, wxEmptyString, KiBitmap( print_button_xpm ),
|
2010-01-21 20:53:01 +00:00
|
|
|
_( "Print board" ) );
|
2011-08-28 20:02:27 +00:00
|
|
|
m_HToolBar->AddTool( ID_GEN_PLOT, wxEmptyString, KiBitmap( plot_xpm ),
|
2010-01-21 20:53:01 +00:00
|
|
|
_( "Plot (HPGL, PostScript, or GERBER format)" ) );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
|
|
|
m_HToolBar->AddSeparator();
|
2011-09-23 20:00:30 +00:00
|
|
|
msg = AddHotkeyName( HELP_ZOOM_IN, g_Board_Editor_Hokeys_Descr, HK_ZOOM_IN, IS_COMMENT );
|
2011-08-28 20:02:27 +00:00
|
|
|
m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ), msg );
|
2011-02-21 13:54:29 +00:00
|
|
|
|
2011-09-23 20:00:30 +00:00
|
|
|
msg = AddHotkeyName( HELP_ZOOM_OUT, g_Board_Editor_Hokeys_Descr, HK_ZOOM_OUT, IS_COMMENT );
|
2011-08-28 20:02:27 +00:00
|
|
|
m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ), msg );
|
2011-02-21 13:54:29 +00:00
|
|
|
|
2011-09-23 20:00:30 +00:00
|
|
|
msg = AddHotkeyName( HELP_ZOOM_REDRAW, g_Board_Editor_Hokeys_Descr, HK_ZOOM_REDRAW, IS_COMMENT );
|
2011-08-28 20:02:27 +00:00
|
|
|
m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ), msg );
|
2011-02-21 13:54:29 +00:00
|
|
|
|
2011-09-23 20:00:30 +00:00
|
|
|
msg = AddHotkeyName( HELP_ZOOM_FIT, g_Board_Editor_Hokeys_Descr, HK_ZOOM_AUTO, IS_COMMENT );
|
2011-08-28 20:02:27 +00:00
|
|
|
m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ), msg );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
|
|
|
m_HToolBar->AddSeparator();
|
2011-09-23 20:00:30 +00:00
|
|
|
msg = AddHotkeyName( HELP_FIND, g_Board_Editor_Hokeys_Descr, HK_FIND_ITEM, IS_COMMENT );
|
2011-08-28 20:02:27 +00:00
|
|
|
m_HToolBar->AddTool( ID_FIND_ITEMS, wxEmptyString, KiBitmap( find_xpm ), msg );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
|
|
|
m_HToolBar->AddSeparator();
|
2011-08-28 20:02:27 +00:00
|
|
|
m_HToolBar->AddTool( ID_GET_NETLIST, wxEmptyString, KiBitmap( netlist_xpm ),
|
2010-01-21 20:53:01 +00:00
|
|
|
_( "Read netlist" ) );
|
2011-08-28 20:02:27 +00:00
|
|
|
m_HToolBar->AddTool( ID_DRC_CONTROL, wxEmptyString, KiBitmap( erc_xpm ),
|
2010-01-21 20:53:01 +00:00
|
|
|
_( "Perform design rules check" ) );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
|
|
|
m_HToolBar->AddSeparator();
|
2010-11-03 18:55:51 +00:00
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
if( m_SelLayerBox == NULL )
|
2011-03-23 08:00:53 +00:00
|
|
|
m_SelLayerBox = new LAYER_BOX_SELECTOR( m_HToolBar, ID_TOOLBARH_PCB_SELECT_LAYER );
|
2008-04-29 13:35:26 +00:00
|
|
|
|
2007-08-04 01:08:43 +00:00
|
|
|
ReCreateLayerBox( m_HToolBar );
|
2010-11-02 23:13:56 +00:00
|
|
|
m_HToolBar->AddControl( m_SelLayerBox );
|
2010-11-03 18:55:51 +00:00
|
|
|
|
2009-11-20 14:55:20 +00:00
|
|
|
PrepareLayerIndicator(); // Initialize the bitmap with current
|
|
|
|
// active layer colors for the next tool
|
2008-12-05 16:03:05 +00:00
|
|
|
m_HToolBar->AddTool( ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, wxEmptyString,
|
|
|
|
*LayerPairBitmap, SEL_LAYER_HELP );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
|
|
|
m_HToolBar->AddSeparator();
|
2011-08-28 20:02:27 +00:00
|
|
|
m_HToolBar->AddTool( ID_TOOLBARH_PCB_MODE_MODULE, wxEmptyString, KiBitmap( mode_module_xpm ),
|
2010-08-11 18:17:12 +00:00
|
|
|
_( "Mode footprint: manual and automatic move and place modules" ),
|
2007-08-04 01:08:43 +00:00
|
|
|
wxITEM_CHECK );
|
2011-08-28 20:02:27 +00:00
|
|
|
m_HToolBar->AddTool( ID_TOOLBARH_PCB_MODE_TRACKS, wxEmptyString, KiBitmap( mode_track_xpm ),
|
2010-08-11 18:17:12 +00:00
|
|
|
_( "Mode track: autorouting" ), wxITEM_CHECK );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
2008-04-29 03:18:02 +00:00
|
|
|
// Fast call to FreeROUTE Web Bases router
|
2008-03-14 10:09:39 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
2008-12-05 16:03:05 +00:00
|
|
|
m_HToolBar->AddTool( ID_TOOLBARH_PCB_FREEROUTE_ACCESS, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( web_support_xpm ),
|
2010-06-30 11:15:34 +00:00
|
|
|
_( "Fast access to the Web Based FreeROUTE advanced router" ) );
|
2008-04-29 03:18:02 +00:00
|
|
|
|
2010-10-19 19:18:30 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
2007-08-04 01:08:43 +00:00
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
// after adding the buttons to the toolbar, must call Realize() to reflect the changes
|
2007-08-04 01:08:43 +00:00
|
|
|
m_HToolBar->Realize();
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2007-08-04 01:08:43 +00:00
|
|
|
|
2011-03-01 19:26:17 +00:00
|
|
|
void PCB_EDIT_FRAME::ReCreateOptToolbar()
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-08-04 01:08:43 +00:00
|
|
|
if( m_OptionsToolBar )
|
|
|
|
return;
|
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
wxWindowUpdateLocker dummy( this );
|
2010-07-27 12:47:08 +00:00
|
|
|
|
2011-04-13 19:30:27 +00:00
|
|
|
m_OptionsToolBar = new EDA_TOOLBAR( TOOLBAR_OPTION, this, ID_OPT_TOOLBAR, false );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
2011-08-28 20:02:27 +00:00
|
|
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_DRC_OFF, wxEmptyString, KiBitmap( drc_off_xpm ),
|
2011-02-21 13:54:29 +00:00
|
|
|
_( "Enable design rule checking" ), wxITEM_CHECK );
|
2011-08-28 20:02:27 +00:00
|
|
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
|
2009-11-20 14:55:20 +00:00
|
|
|
_( "Hide grid" ), wxITEM_CHECK );
|
2007-08-04 01:08:43 +00:00
|
|
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( polar_coord_xpm ),
|
2009-11-20 14:55:20 +00:00
|
|
|
_( "Display polar coordinates" ), wxITEM_CHECK );
|
2007-08-04 01:08:43 +00:00
|
|
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( unit_inch_xpm ),
|
2008-12-05 16:03:05 +00:00
|
|
|
_( "Units in inches" ), wxITEM_CHECK );
|
2007-08-04 01:08:43 +00:00
|
|
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( unit_mm_xpm ),
|
2008-12-05 16:03:05 +00:00
|
|
|
_( "Units in millimeters" ), wxITEM_CHECK );
|
2007-08-04 01:08:43 +00:00
|
|
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( cursor_shape_xpm ),
|
2009-11-20 14:55:20 +00:00
|
|
|
_( "Change cursor shape" ), wxITEM_CHECK );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
|
|
|
m_OptionsToolBar->AddSeparator();
|
|
|
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_RATSNEST, wxEmptyString,
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( general_ratsnest_xpm ),
|
2009-11-20 14:55:20 +00:00
|
|
|
_( "Show board ratsnest" ), wxITEM_CHECK );
|
2007-08-04 01:08:43 +00:00
|
|
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_RATSNEST, wxEmptyString,
|
2011-09-02 07:23:46 +00:00
|
|
|
KiBitmap( local_ratsnest_xpm ),
|
2009-11-20 14:55:20 +00:00
|
|
|
_( "Show module ratsnest when moving" ),
|
2008-12-05 16:03:05 +00:00
|
|
|
wxITEM_CHECK );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
|
|
|
m_OptionsToolBar->AddSeparator();
|
|
|
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_AUTO_DEL_TRACK, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( auto_delete_track_xpm ),
|
2009-11-20 14:55:20 +00:00
|
|
|
_( "Enable automatic track deletion" ),
|
|
|
|
wxITEM_CHECK );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
|
|
|
m_OptionsToolBar->AddSeparator();
|
2008-12-12 21:30:07 +00:00
|
|
|
m_OptionsToolBar->AddRadioTool( ID_TB_OPTIONS_SHOW_ZONES, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( show_zone_xpm ), wxNullBitmap,
|
2010-01-21 20:53:01 +00:00
|
|
|
_( "Show filled areas in zones" ) );
|
2011-02-21 13:54:29 +00:00
|
|
|
m_OptionsToolBar->AddRadioTool( ID_TB_OPTIONS_SHOW_ZONES_DISABLE, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( show_zone_disable_xpm ),
|
2011-02-21 13:54:29 +00:00
|
|
|
wxNullBitmap, _( "Do not show filled areas in zones" ));
|
|
|
|
m_OptionsToolBar->AddRadioTool( ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( show_zone_outline_only_xpm ), wxNullBitmap,
|
2010-01-21 20:53:01 +00:00
|
|
|
_( "Show outlines of filled areas only in zones" ) );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
|
|
|
m_OptionsToolBar->AddSeparator();
|
|
|
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( pad_sketch_xpm ),
|
2009-11-20 14:55:20 +00:00
|
|
|
_( "Show pads in outline mode" ), wxITEM_CHECK );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
2009-09-29 04:44:35 +00:00
|
|
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_VIAS_SKETCH, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( via_sketch_xpm ),
|
2009-11-20 14:55:20 +00:00
|
|
|
_( "Show vias in outline mode" ), wxITEM_CHECK );
|
2009-09-29 04:44:35 +00:00
|
|
|
|
2007-08-04 01:08:43 +00:00
|
|
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( showtrack_xpm ),
|
2009-11-20 14:55:20 +00:00
|
|
|
_( "Show tracks in outline mode" ),
|
|
|
|
wxITEM_CHECK );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( palette_xpm ),
|
2009-11-20 14:55:20 +00:00
|
|
|
_( "Enable high contrast display mode" ),
|
2008-12-05 16:03:05 +00:00
|
|
|
wxITEM_CHECK );
|
2009-06-19 20:13:22 +00:00
|
|
|
|
2010-01-24 13:46:01 +00:00
|
|
|
// Tools to show/hide toolbars:
|
2007-08-04 01:08:43 +00:00
|
|
|
m_OptionsToolBar->AddSeparator();
|
2010-01-24 02:05:07 +00:00
|
|
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR,
|
2011-02-21 13:54:29 +00:00
|
|
|
wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( layers_manager_xpm ),
|
2011-02-21 13:54:29 +00:00
|
|
|
HELP_SHOW_HIDE_LAYERMANAGER,
|
|
|
|
wxITEM_CHECK );
|
2011-03-04 19:16:00 +00:00
|
|
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR_MICROWAVE,
|
2008-12-05 16:03:05 +00:00
|
|
|
wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( mw_toolbar_xpm ),
|
2010-01-22 12:55:29 +00:00
|
|
|
_( "Show/hide the toolbar for microwaves tools\n This is a experimental feature (under development)" ),
|
2007-08-04 01:08:43 +00:00
|
|
|
wxITEM_CHECK );
|
2010-01-22 12:55:29 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2010-10-19 19:18:30 +00:00
|
|
|
m_OptionsToolBar->AddSeparator();
|
2007-08-04 01:08:43 +00:00
|
|
|
m_OptionsToolBar->Realize();
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Create the main vertical right toolbar, showing usual tools
|
2007-08-04 01:08:43 +00:00
|
|
|
*/
|
2011-03-01 19:26:17 +00:00
|
|
|
void PCB_EDIT_FRAME::ReCreateVToolbar()
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-08-04 01:08:43 +00:00
|
|
|
if( m_VToolBar )
|
|
|
|
return;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
wxWindowUpdateLocker dummy( this );
|
2010-07-27 12:47:08 +00:00
|
|
|
|
2011-04-13 19:30:27 +00:00
|
|
|
m_VToolBar = new EDA_TOOLBAR( TOOLBAR_TOOL, this, ID_V_TOOLBAR, false );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-04 01:08:43 +00:00
|
|
|
// Set up toolbar
|
2011-08-28 20:02:27 +00:00
|
|
|
m_VToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ),
|
2011-02-21 13:54:29 +00:00
|
|
|
wxEmptyString, wxITEM_CHECK );
|
2007-08-04 01:08:43 +00:00
|
|
|
m_VToolBar->AddSeparator();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-08-28 20:02:27 +00:00
|
|
|
m_VToolBar->AddTool( ID_PCB_HIGHLIGHT_BUTT, wxEmptyString, KiBitmap( net_highlight_xpm ),
|
2011-02-21 13:54:29 +00:00
|
|
|
_( "Highlight net" ), wxITEM_CHECK );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-09-02 07:23:46 +00:00
|
|
|
m_VToolBar->AddTool( ID_PCB_SHOW_1_RATSNEST_BUTT, wxEmptyString, KiBitmap( tool_ratsnest_xpm ),
|
2011-02-21 13:54:29 +00:00
|
|
|
_( "Display local ratsnest" ), wxITEM_CHECK );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-04 01:08:43 +00:00
|
|
|
m_VToolBar->AddSeparator();
|
2011-08-28 20:02:27 +00:00
|
|
|
m_VToolBar->AddTool( ID_PCB_MODULE_BUTT, wxEmptyString, KiBitmap( module_xpm ),
|
2007-08-04 01:08:43 +00:00
|
|
|
_( "Add modules" ), wxITEM_CHECK );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-08-28 20:02:27 +00:00
|
|
|
m_VToolBar->AddTool( ID_TRACK_BUTT, wxEmptyString, KiBitmap( add_tracks_xpm ),
|
2007-10-12 03:24:46 +00:00
|
|
|
_( "Add tracks and vias" ), wxITEM_CHECK );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-08-28 20:02:27 +00:00
|
|
|
m_VToolBar->AddTool( ID_PCB_ZONES_BUTT, wxEmptyString, KiBitmap( add_zone_xpm ),
|
2010-10-30 10:03:41 +00:00
|
|
|
_( "Add filled zones" ), wxITEM_CHECK );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-04 01:08:43 +00:00
|
|
|
m_VToolBar->AddSeparator();
|
2011-08-28 20:02:27 +00:00
|
|
|
m_VToolBar->AddTool( ID_PCB_ADD_LINE_BUTT, wxEmptyString, KiBitmap( add_dashed_line_xpm ),
|
2007-08-04 01:08:43 +00:00
|
|
|
_( "Add graphic line or polygon" ), wxITEM_CHECK );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-08-28 20:02:27 +00:00
|
|
|
m_VToolBar->AddTool( ID_PCB_CIRCLE_BUTT, wxEmptyString, KiBitmap( add_circle_xpm ),
|
2007-08-04 01:08:43 +00:00
|
|
|
_( "Add graphic circle" ), wxITEM_CHECK );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-08-28 20:02:27 +00:00
|
|
|
m_VToolBar->AddTool( ID_PCB_ARC_BUTT, wxEmptyString, KiBitmap( add_arc_xpm ),
|
2007-08-04 01:08:43 +00:00
|
|
|
_( "Add graphic arc" ), wxITEM_CHECK );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-08-28 20:02:27 +00:00
|
|
|
m_VToolBar->AddTool( ID_PCB_ADD_TEXT_BUTT, wxEmptyString, KiBitmap( add_text_xpm ),
|
2010-10-30 10:03:41 +00:00
|
|
|
_( "Add text on copper layers or graphic text" ), wxITEM_CHECK );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-04 01:08:43 +00:00
|
|
|
m_VToolBar->AddSeparator();
|
2011-08-28 20:02:27 +00:00
|
|
|
m_VToolBar->AddTool( ID_PCB_DIMENSION_BUTT, wxEmptyString, KiBitmap( add_dimension_xpm ),
|
2007-10-12 03:24:46 +00:00
|
|
|
_( "Add dimension" ), wxITEM_CHECK );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-08-28 20:02:27 +00:00
|
|
|
m_VToolBar->AddTool( ID_PCB_MIRE_BUTT, wxEmptyString, KiBitmap( add_mires_xpm ),
|
2007-10-10 14:08:26 +00:00
|
|
|
_( "Add layer alignment target" ), wxITEM_CHECK );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-04 01:08:43 +00:00
|
|
|
m_VToolBar->AddSeparator();
|
2011-08-28 20:02:27 +00:00
|
|
|
m_VToolBar->AddTool( ID_PCB_DELETE_ITEM_BUTT, wxEmptyString, KiBitmap( delete_body_xpm ),
|
2007-08-04 01:08:43 +00:00
|
|
|
_( "Delete items" ), wxITEM_CHECK );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-04 01:08:43 +00:00
|
|
|
m_VToolBar->AddSeparator();
|
2011-08-28 20:02:27 +00:00
|
|
|
m_VToolBar->AddTool( ID_PCB_PLACE_OFFSET_COORD_BUTT, wxEmptyString, KiBitmap( pcb_offset_xpm ),
|
2010-10-30 10:03:41 +00:00
|
|
|
_( "Place the origin point for drill and place files" ),
|
2008-12-05 16:03:05 +00:00
|
|
|
wxITEM_CHECK );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2010-07-13 10:42:32 +00:00
|
|
|
m_VToolBar->AddTool( ID_PCB_PLACE_GRID_COORD_BUTT, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( grid_select_axis_xpm ),
|
2010-07-13 10:42:32 +00:00
|
|
|
_( "Set the origin point for the grid" ),
|
|
|
|
wxITEM_CHECK );
|
|
|
|
|
2007-08-04 01:08:43 +00:00
|
|
|
m_VToolBar->Realize();
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-09-16 18:54:04 +00:00
|
|
|
/* Create the auxiliary vertical right toolbar, showing tools for microwave applications
|
2007-08-04 01:08:43 +00:00
|
|
|
*/
|
2011-03-01 19:26:17 +00:00
|
|
|
void PCB_EDIT_FRAME::ReCreateMicrowaveVToolbar()
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-08-04 01:08:43 +00:00
|
|
|
if( m_AuxVToolBar )
|
|
|
|
return;
|
|
|
|
|
2010-07-27 12:47:08 +00:00
|
|
|
wxWindowUpdateLocker dummy(this);
|
|
|
|
|
2011-04-13 19:30:27 +00:00
|
|
|
m_AuxVToolBar = new EDA_TOOLBAR( TOOLBAR_TOOL, this, ID_MICROWAVE_V_TOOLBAR, false );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
|
|
|
// Set up toolbar
|
2009-05-02 07:35:04 +00:00
|
|
|
m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_SELF_CMD, wxEmptyString,
|
2011-08-29 03:04:59 +00:00
|
|
|
KiBitmap( mw_add_line_xpm ),
|
2010-01-21 20:53:01 +00:00
|
|
|
_( "Create line of specified length for microwave applications" ) );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
2009-05-02 07:35:04 +00:00
|
|
|
m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_GAP_CMD, wxEmptyString,
|
2011-08-29 03:04:59 +00:00
|
|
|
KiBitmap( mw_add_gap_xpm ),
|
2010-01-21 20:53:01 +00:00
|
|
|
_( "Create gap of specified length for microwave applications" ) );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
|
|
|
m_AuxVToolBar->AddSeparator();
|
|
|
|
|
2009-05-02 07:35:04 +00:00
|
|
|
m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_STUB_CMD, wxEmptyString,
|
2011-08-29 03:04:59 +00:00
|
|
|
KiBitmap( mw_add_stub_xpm ),
|
2010-01-21 20:53:01 +00:00
|
|
|
_( "Create stub of specified length for microwave applications" ) );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
2009-05-02 07:35:04 +00:00
|
|
|
m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_STUB_ARC_CMD, wxEmptyString,
|
2011-08-29 03:04:59 +00:00
|
|
|
KiBitmap( mw_add_stub_arc_xpm ),
|
2007-08-04 01:08:43 +00:00
|
|
|
_( "Create stub (arc) of specified length for microwave applications" )
|
2007-08-30 08:15:05 +00:00
|
|
|
);
|
2007-08-04 01:08:43 +00:00
|
|
|
|
2009-05-02 07:35:04 +00:00
|
|
|
m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_FUNCTION_SHAPE_CMD, wxEmptyString,
|
2011-08-29 03:04:59 +00:00
|
|
|
KiBitmap( mw_add_shape_xpm ),
|
2010-01-21 20:53:01 +00:00
|
|
|
_( "Create a polynomial shape for microwave applications" ) );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
|
|
|
m_AuxVToolBar->Realize();
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2007-08-04 01:08:43 +00:00
|
|
|
|
2009-10-03 17:18:08 +00:00
|
|
|
/* Creates auxiliary horizontal toolbar
|
2008-01-28 18:44:14 +00:00
|
|
|
* displays:
|
|
|
|
* existing track width choice
|
|
|
|
* selection for auto track width
|
|
|
|
* existing via size choice
|
2009-10-03 17:18:08 +00:00
|
|
|
* Current strategy (to choose the track and via sizes)
|
2008-01-28 18:44:14 +00:00
|
|
|
* grid size choice
|
|
|
|
* zoom level choice
|
2007-08-04 01:08:43 +00:00
|
|
|
*/
|
2011-03-01 19:26:17 +00:00
|
|
|
void PCB_EDIT_FRAME::ReCreateAuxiliaryToolbar()
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-08-04 01:08:43 +00:00
|
|
|
wxString msg;
|
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
wxWindowUpdateLocker dummy( this );
|
2010-07-27 12:47:08 +00:00
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
if( m_AuxiliaryToolBar )
|
|
|
|
return;
|
|
|
|
|
2011-04-13 19:30:27 +00:00
|
|
|
m_AuxiliaryToolBar = new EDA_TOOLBAR( TOOLBAR_AUX, this, ID_AUX_TOOLBAR, true );
|
2011-02-21 13:54:29 +00:00
|
|
|
|
|
|
|
/* Set up toolbar items */
|
|
|
|
|
|
|
|
// Creates box to display and choose tracks widths:
|
2011-04-19 19:19:41 +00:00
|
|
|
m_SelTrackWidthBox = new wxComboBox( m_AuxiliaryToolBar,
|
|
|
|
ID_AUX_TOOLBAR_PCB_TRACK_WIDTH,
|
|
|
|
wxEmptyString,
|
|
|
|
wxPoint( -1, -1 ),
|
|
|
|
wxSize( LISTBOX_WIDTH, -1 ),
|
|
|
|
0, NULL, wxCB_READONLY );
|
2011-02-21 13:54:29 +00:00
|
|
|
m_AuxiliaryToolBar->AddControl( m_SelTrackWidthBox );
|
|
|
|
m_AuxiliaryToolBar->AddSeparator();
|
|
|
|
|
|
|
|
// Creates box to display and choose vias diameters:
|
2011-04-19 19:19:41 +00:00
|
|
|
m_SelViaSizeBox = new wxComboBox( m_AuxiliaryToolBar,
|
|
|
|
ID_AUX_TOOLBAR_PCB_VIA_SIZE,
|
|
|
|
wxEmptyString,
|
|
|
|
wxPoint( -1, -1 ),
|
|
|
|
wxSize( (LISTBOX_WIDTH*12)/10, -1 ),
|
|
|
|
0, NULL, wxCB_READONLY );
|
2011-02-21 13:54:29 +00:00
|
|
|
m_AuxiliaryToolBar->AddControl( m_SelViaSizeBox );
|
|
|
|
m_AuxiliaryToolBar->AddSeparator();
|
|
|
|
|
|
|
|
// Creates box to display and choose strategy to handle tracks an vias sizes:
|
|
|
|
m_AuxiliaryToolBar->AddTool( ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH,
|
|
|
|
wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( auto_track_width_xpm ),
|
2011-02-21 13:54:29 +00:00
|
|
|
_( "Auto track width: when starting on \
|
2010-01-21 20:53:01 +00:00
|
|
|
an existing track use its width\notherwise, use current width setting" ),
|
2011-02-21 13:54:29 +00:00
|
|
|
wxITEM_CHECK );
|
|
|
|
|
|
|
|
// Add the box to display and select the current grid size:
|
|
|
|
m_AuxiliaryToolBar->AddSeparator();
|
2011-04-19 19:19:41 +00:00
|
|
|
m_SelGridBox = new wxComboBox( m_AuxiliaryToolBar,
|
|
|
|
ID_ON_GRID_SELECT,
|
|
|
|
wxEmptyString,
|
|
|
|
wxPoint( -1, -1 ),
|
|
|
|
wxSize( LISTBOX_WIDTH, -1 ),
|
|
|
|
0, NULL, wxCB_READONLY );
|
2011-02-21 13:54:29 +00:00
|
|
|
m_AuxiliaryToolBar->AddControl( m_SelGridBox );
|
|
|
|
|
|
|
|
// Add the box to display and select the current Zoom
|
|
|
|
m_AuxiliaryToolBar->AddSeparator();
|
2011-04-19 19:19:41 +00:00
|
|
|
m_SelZoomBox = new wxComboBox( m_AuxiliaryToolBar,
|
|
|
|
ID_ON_ZOOM_SELECT,
|
|
|
|
wxEmptyString,
|
|
|
|
wxPoint( -1, -1 ),
|
|
|
|
wxSize( LISTBOX_WIDTH, -1 ),
|
|
|
|
0, NULL, wxCB_READONLY );
|
2011-02-21 13:54:29 +00:00
|
|
|
m_AuxiliaryToolBar->AddControl( m_SelZoomBox );
|
2007-08-04 01:08:43 +00:00
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
updateZoomSelectBox();
|
|
|
|
updateGridSelectBox();
|
|
|
|
updateTraceWidthSelectBox();
|
|
|
|
updateViaSizeSelectBox();
|
2007-08-04 01:08:43 +00:00
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
// after adding the buttons to the toolbar, must call Realize()
|
|
|
|
m_AuxiliaryToolBar->Realize();
|
|
|
|
m_AuxiliaryToolBar->AddSeparator();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-03-01 19:26:17 +00:00
|
|
|
void PCB_EDIT_FRAME::updateTraceWidthSelectBox()
|
2011-02-21 13:54:29 +00:00
|
|
|
{
|
|
|
|
if( m_SelTrackWidthBox == NULL )
|
|
|
|
return;
|
|
|
|
|
|
|
|
wxString msg;
|
|
|
|
|
|
|
|
m_SelTrackWidthBox->Clear();
|
|
|
|
|
|
|
|
for( unsigned ii = 0; ii < GetBoard()->m_TrackWidthList.size(); ii++ )
|
2010-07-12 14:07:09 +00:00
|
|
|
{
|
2011-03-11 15:53:28 +00:00
|
|
|
msg = _( "Track " ) + CoordinateToString( GetBoard()->m_TrackWidthList[ii], true );
|
2010-07-12 14:07:09 +00:00
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
if( ii == 0 )
|
|
|
|
msg << _( " *" );
|
2010-07-12 14:07:09 +00:00
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
m_SelTrackWidthBox->Append( msg );
|
2010-07-12 14:07:09 +00:00
|
|
|
}
|
2011-03-01 19:26:17 +00:00
|
|
|
|
|
|
|
if( GetBoard()->m_TrackWidthSelector >= GetBoard()->m_TrackWidthList.size() )
|
|
|
|
GetBoard()->m_TrackWidthSelector = 0;
|
2011-02-21 13:54:29 +00:00
|
|
|
}
|
|
|
|
|
2007-08-04 01:08:43 +00:00
|
|
|
|
2011-03-01 19:26:17 +00:00
|
|
|
void PCB_EDIT_FRAME::updateViaSizeSelectBox()
|
2011-02-21 13:54:29 +00:00
|
|
|
{
|
|
|
|
if( m_SelViaSizeBox == NULL )
|
|
|
|
return;
|
|
|
|
|
|
|
|
wxString msg;
|
|
|
|
|
|
|
|
m_SelViaSizeBox->Clear();
|
|
|
|
|
|
|
|
for( unsigned ii = 0; ii < GetBoard()->m_ViasDimensionsList.size(); ii++ )
|
2007-08-04 01:08:43 +00:00
|
|
|
{
|
2011-03-11 15:53:28 +00:00
|
|
|
msg = _( "Via " );
|
|
|
|
msg << CoordinateToString( GetBoard()->m_ViasDimensionsList[ii].m_Diameter, true );
|
2010-12-08 20:12:46 +00:00
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
if( GetBoard()->m_ViasDimensionsList[ii].m_Drill )
|
2011-03-11 15:53:28 +00:00
|
|
|
msg << wxT("/ ")
|
|
|
|
<< CoordinateToString( GetBoard()->m_ViasDimensionsList[ii].m_Drill, true );
|
2008-12-05 16:03:05 +00:00
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
if( ii == 0 )
|
|
|
|
msg << _( " *" );
|
2009-10-14 19:43:31 +00:00
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
m_SelViaSizeBox->Append( msg );
|
2007-08-04 01:08:43 +00:00
|
|
|
}
|
2011-03-01 19:26:17 +00:00
|
|
|
|
|
|
|
if( GetBoard()->m_ViaSizeSelector >= GetBoard()->m_ViasDimensionsList.size() )
|
|
|
|
GetBoard()->m_ViaSizeSelector = 0;
|
2011-02-21 13:54:29 +00:00
|
|
|
}
|
2007-08-04 01:08:43 +00:00
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
|
2011-04-13 19:30:27 +00:00
|
|
|
LAYER_BOX_SELECTOR* PCB_EDIT_FRAME::ReCreateLayerBox( EDA_TOOLBAR* parent )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2010-11-03 18:55:51 +00:00
|
|
|
if( m_SelLayerBox == NULL )
|
2010-11-02 23:13:56 +00:00
|
|
|
return NULL;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2010-11-24 15:10:33 +00:00
|
|
|
m_SelLayerBox->m_hotkeys = g_Board_Editor_Hokeys_Descr;
|
2010-11-02 23:13:56 +00:00
|
|
|
m_SelLayerBox->Resync();
|
2008-04-29 13:35:26 +00:00
|
|
|
m_SelLayerBox->SetToolTip( _( "+/- to switch" ) );
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
return m_SelLayerBox;
|
|
|
|
}
|