beautified
This commit is contained in:
parent
72f7cb164c
commit
ede37ecfa7
|
@ -1,5 +1,5 @@
|
||||||
/********************************************************************************/
|
/********************************************************************************/
|
||||||
/* tool_onrightclick.cpp: fonctions appelées par le bouton droit sur un TOOL */
|
/* tool_onrightclick.cpp: fonctions appel<EFBFBD>s par le bouton droit sur un TOOL */
|
||||||
/********************************************************************************/
|
/********************************************************************************/
|
||||||
|
|
||||||
#include "fctsys.h"
|
#include "fctsys.h"
|
||||||
|
@ -15,22 +15,21 @@
|
||||||
#include "protos.h"
|
#include "protos.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************/
|
/*****************************************************************/
|
||||||
void WinEDA_PcbFrame::ToolOnRightClick(wxCommandEvent& event)
|
void WinEDA_PcbFrame::ToolOnRightClick( wxCommandEvent& event )
|
||||||
/*****************************************************************/
|
/*****************************************************************/
|
||||||
{
|
{
|
||||||
wxPoint pos;
|
wxPoint pos;
|
||||||
int id = event.GetSelection();
|
int id = event.GetSelection();
|
||||||
|
|
||||||
wxGetMousePosition(&pos.x, &pos.y);
|
wxGetMousePosition( &pos.x, &pos.y );
|
||||||
pos.x -= 400;
|
pos.x -= 400;
|
||||||
pos.y -= 30;
|
pos.y -= 30;
|
||||||
|
|
||||||
switch ( id )
|
switch( id )
|
||||||
{
|
{
|
||||||
case ID_TRACK_BUTT:
|
case ID_TRACK_BUTT:
|
||||||
InstallPcbOptionsFrame(pos, NULL, ID_PCB_TRACK_SIZE_SETUP);
|
InstallPcbOptionsFrame( pos, NULL, ID_PCB_TRACK_SIZE_SETUP );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_COMPONENT_BUTT:
|
case ID_COMPONENT_BUTT:
|
||||||
|
@ -41,7 +40,7 @@ int id = event.GetSelection();
|
||||||
case ID_LINE_COMMENT_BUTT:
|
case ID_LINE_COMMENT_BUTT:
|
||||||
case ID_PCB_COTATION_BUTT:
|
case ID_PCB_COTATION_BUTT:
|
||||||
case ID_TEXT_COMMENT_BUTT:
|
case ID_TEXT_COMMENT_BUTT:
|
||||||
InstallPcbOptionsFrame(pos, NULL, ID_PCB_DRAWINGS_WIDTHS_SETUP);
|
InstallPcbOptionsFrame( pos, NULL, ID_PCB_DRAWINGS_WIDTHS_SETUP );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -49,21 +48,22 @@ int id = event.GetSelection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
void WinEDA_ModuleEditFrame::ToolOnRightClick(wxCommandEvent& event)
|
void WinEDA_ModuleEditFrame::ToolOnRightClick( wxCommandEvent& event )
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
{
|
{
|
||||||
wxPoint pos;
|
wxPoint pos;
|
||||||
int id = event.GetSelection();
|
int id = event.GetSelection();
|
||||||
|
|
||||||
wxGetMousePosition(&pos.x, &pos.y);
|
wxGetMousePosition( &pos.x, &pos.y );
|
||||||
pos.x -= 400;
|
pos.x -= 400;
|
||||||
pos.y -= 30;
|
pos.y -= 30;
|
||||||
|
|
||||||
switch ( id )
|
switch( id )
|
||||||
{
|
{
|
||||||
case ID_MODEDIT_ADD_PAD:
|
case ID_MODEDIT_ADD_PAD:
|
||||||
InstallPadOptionsFrame(NULL, NULL, wxPoint(-1,-1) );
|
InstallPadOptionsFrame( NULL, NULL, wxPoint( -1, -1 ) );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_PCB_CIRCLE_BUTT:
|
case ID_PCB_CIRCLE_BUTT:
|
||||||
|
@ -71,13 +71,11 @@ int id = event.GetSelection();
|
||||||
case ID_LINE_COMMENT_BUTT:
|
case ID_LINE_COMMENT_BUTT:
|
||||||
case ID_PCB_COTATION_BUTT:
|
case ID_PCB_COTATION_BUTT:
|
||||||
case ID_TEXT_COMMENT_BUTT:
|
case ID_TEXT_COMMENT_BUTT:
|
||||||
InstallOptionsFrame(pos);
|
InstallOptionsFrame( pos );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DisplayError(this, wxT("ToolOnRightClick() error"));
|
DisplayError( this, wxT( "ToolOnRightClick() error" ) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*********************************************/
|
/*********************************************/
|
||||||
/* tool_pcb.cpp: construction des tool bars */
|
/* tool_pcb.cpp: construction des tool bars */
|
||||||
/*********************************************/
|
/*********************************************/
|
||||||
|
|
||||||
#include "fctsys.h"
|
#include "fctsys.h"
|
||||||
#include "gr_basic.h"
|
#include "gr_basic.h"
|
||||||
|
@ -46,164 +46,181 @@
|
||||||
#include "general_ratsnet.xpm"
|
#include "general_ratsnet.xpm"
|
||||||
#include "add_cotation.xpm"
|
#include "add_cotation.xpm"
|
||||||
|
|
||||||
#define SEL_LAYER_HELP _("Show active layer selections\nand select layer pair for route and place via")
|
#define SEL_LAYER_HELP _( \
|
||||||
|
"Show active layer selections\nand select layer pair for route and place via" )
|
||||||
|
|
||||||
/* Data to build the layer pair indicator button */
|
/* Data to build the layer pair indicator button */
|
||||||
static wxBitmap * LayerPairBitmap = NULL;
|
static wxBitmap* LayerPairBitmap = NULL;
|
||||||
static char s_BitmapLayerIcon[16][16] = {
|
static char s_BitmapLayerIcon[16][16] = {
|
||||||
// 0 = draw pixel with active layer color
|
// 0 = draw pixel with active layer color
|
||||||
// 1 = draw pixel with top layer color (top/bottom layer used in autoroute and place via)
|
// 1 = draw pixel with top layer color (top/bottom layer used in autoroute and place via)
|
||||||
// 2 = draw pixel with bottom layer color
|
// 2 = draw pixel with bottom layer color
|
||||||
// 3 = draw pixel with via color
|
// 3 = draw pixel with via color
|
||||||
{0,0,0,0,0,0,0,3,3,3,1,1,1,1,0,0},
|
{ 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 1, 1, 1, 1, 0, 0 },
|
||||||
{0,0,0,0,0,0,3,3,3,3,3,1,1,0,0,0},
|
{ 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 1, 1, 0, 0, 0 },
|
||||||
{0,0,0,0,0,3,3,0,1,1,3,3,0,0,0,0},
|
{ 0, 0, 0, 0, 0, 3, 3, 0, 1, 1, 3, 3, 0, 0, 0, 0 },
|
||||||
{2,2,2,2,3,3,0,1,1,1,1,3,3,2,2,2},
|
{ 2, 2, 2, 2, 3, 3, 0, 1, 1, 1, 1, 3, 3, 2, 2, 2 },
|
||||||
{2,2,2,2,3,3,1,1,1,0,0,3,3,2,2,2},
|
{ 2, 2, 2, 2, 3, 3, 1, 1, 1, 0, 0, 3, 3, 2, 2, 2 },
|
||||||
{2,2,2,2,3,3,1,1,1,1,0,3,3,2,2,2},
|
{ 2, 2, 2, 2, 3, 3, 1, 1, 1, 1, 0, 3, 3, 2, 2, 2 },
|
||||||
{0,0,0,0,0,3,3,1,1,0,3,3,0,0,0,0},
|
{ 0, 0, 0, 0, 0, 3, 3, 1, 1, 0, 3, 3, 0, 0, 0, 0 },
|
||||||
{0,0,0,0,0,1,3,3,3,3,3,0,0,0,0,0},
|
{ 0, 0, 0, 0, 0, 1, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0 },
|
||||||
{0,0,0,0,0,1,1,3,3,3,0,0,0,0,0,0},
|
{ 0, 0, 0, 0, 0, 1, 1, 3, 3, 3, 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, 1, 1, 1, 1, 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, 1, 1, 1, 1, 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, 1, 1, 1, 1, 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, 1, 1, 1, 1, 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, 1, 1, 1, 1, 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, 1, 1, 1, 1, 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, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/************************************************************/
|
/************************************************************/
|
||||||
void WinEDA_PcbFrame::PrepareLayerIndicator(void)
|
void WinEDA_PcbFrame::PrepareLayerIndicator( void )
|
||||||
/************************************************************/
|
/************************************************************/
|
||||||
|
|
||||||
/* Draw the icon for the "Select layet pair" bitmap tool
|
/* Draw the icon for the "Select layet pair" bitmap tool
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
int ii, jj;
|
int ii, jj;
|
||||||
static int previous_active_layer_color, previous_Route_Layer_TOP_color,
|
int active_layer_color, Route_Layer_TOP_color,
|
||||||
previous_Route_Layer_BOTTOM_color, previous_via_color;
|
|
||||||
int active_layer_color, Route_Layer_TOP_color,
|
|
||||||
Route_Layer_BOTTOM_color, via_color;
|
Route_Layer_BOTTOM_color, via_color;
|
||||||
bool change = false;
|
bool change = false;
|
||||||
|
|
||||||
|
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 */
|
/* get colors, and redraw bitmap button only on changes */
|
||||||
active_layer_color = g_DesignSettings.m_LayerColor[GetScreen()->m_Active_Layer];
|
active_layer_color = g_DesignSettings.m_LayerColor[GetScreen()->m_Active_Layer];
|
||||||
if ( previous_active_layer_color != active_layer_color )
|
if( previous_active_layer_color != active_layer_color )
|
||||||
{
|
{
|
||||||
previous_active_layer_color = active_layer_color;
|
previous_active_layer_color = active_layer_color;
|
||||||
change = TRUE;
|
change = TRUE;
|
||||||
}
|
}
|
||||||
Route_Layer_TOP_color = g_DesignSettings.m_LayerColor[GetScreen()->m_Route_Layer_TOP];
|
Route_Layer_TOP_color = g_DesignSettings.m_LayerColor[GetScreen()->m_Route_Layer_TOP];
|
||||||
if ( previous_Route_Layer_TOP_color != Route_Layer_TOP_color )
|
if( previous_Route_Layer_TOP_color != Route_Layer_TOP_color )
|
||||||
{
|
{
|
||||||
previous_Route_Layer_TOP_color = Route_Layer_TOP_color;
|
previous_Route_Layer_TOP_color = Route_Layer_TOP_color;
|
||||||
change = TRUE;
|
change = TRUE;
|
||||||
}
|
}
|
||||||
Route_Layer_BOTTOM_color = g_DesignSettings.m_LayerColor[GetScreen()->m_Route_Layer_BOTTOM];
|
Route_Layer_BOTTOM_color = g_DesignSettings.m_LayerColor[GetScreen()->m_Route_Layer_BOTTOM];
|
||||||
if ( previous_Route_Layer_BOTTOM_color != Route_Layer_BOTTOM_color )
|
if( previous_Route_Layer_BOTTOM_color != Route_Layer_BOTTOM_color )
|
||||||
{
|
{
|
||||||
previous_Route_Layer_BOTTOM_color = Route_Layer_BOTTOM_color;
|
previous_Route_Layer_BOTTOM_color = Route_Layer_BOTTOM_color;
|
||||||
change = TRUE;
|
change = TRUE;
|
||||||
}
|
}
|
||||||
via_color = g_DesignSettings.m_ViaColor[g_DesignSettings.m_CurrentViaType ];
|
via_color = g_DesignSettings.m_ViaColor[g_DesignSettings.m_CurrentViaType ];
|
||||||
if ( previous_via_color != via_color )
|
if( previous_via_color != via_color )
|
||||||
{
|
{
|
||||||
previous_via_color = via_color;
|
previous_via_color = via_color;
|
||||||
change = TRUE;
|
change = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! change && (LayerPairBitmap != NULL) ) return;
|
if( !change && (LayerPairBitmap != NULL) )
|
||||||
|
return;
|
||||||
|
|
||||||
/* Creat the bitmap too and its Memory DC, if not already made */
|
/* Creat the bitmap too and its Memory DC, if not already made */
|
||||||
if ( LayerPairBitmap == NULL )
|
if( LayerPairBitmap == NULL )
|
||||||
{
|
{
|
||||||
LayerPairBitmap = new wxBitmap(16, 16);
|
LayerPairBitmap = new wxBitmap( 16, 16 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Draw the icon, with colors according to the active layer and layer pairs for
|
/* Draw the icon, with colors according to the active layer and layer pairs for
|
||||||
via command (change layer) */
|
* via command (change layer)
|
||||||
wxMemoryDC iconDC;
|
*/
|
||||||
|
wxMemoryDC iconDC;
|
||||||
iconDC.SelectObject( *LayerPairBitmap );
|
iconDC.SelectObject( *LayerPairBitmap );
|
||||||
int buttcolor = -1;
|
int buttcolor = -1;
|
||||||
wxPen pen;
|
wxPen pen;
|
||||||
for ( ii = 0; ii < 16; ii++ )
|
for( ii = 0; ii < 16; ii++ )
|
||||||
{
|
{
|
||||||
for ( jj = 0; jj < 16; jj++ )
|
for( jj = 0; jj < 16; jj++ )
|
||||||
{
|
{
|
||||||
if ( s_BitmapLayerIcon[ii][jj] != buttcolor )
|
if( s_BitmapLayerIcon[ii][jj] != buttcolor )
|
||||||
{
|
{
|
||||||
buttcolor = s_BitmapLayerIcon[ii][jj];
|
buttcolor = s_BitmapLayerIcon[ii][jj];
|
||||||
int color;
|
int color;
|
||||||
switch ( buttcolor )
|
|
||||||
|
switch( buttcolor )
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
case 0:
|
case 0:
|
||||||
color = active_layer_color;
|
color = active_layer_color;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
color = Route_Layer_TOP_color;
|
color = Route_Layer_TOP_color;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
color = Route_Layer_BOTTOM_color;
|
color = Route_Layer_BOTTOM_color;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
color = via_color;
|
color = via_color;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
color &= MASKCOLOR;
|
color &= MASKCOLOR;
|
||||||
pen.SetColour(
|
pen.SetColour(
|
||||||
ColorRefs[color].m_Red,
|
ColorRefs[color].m_Red,
|
||||||
ColorRefs[color].m_Green,
|
ColorRefs[color].m_Green,
|
||||||
ColorRefs[color].m_Blue
|
ColorRefs[color].m_Blue
|
||||||
);
|
);
|
||||||
iconDC.SetPen(pen);
|
iconDC.SetPen( pen );
|
||||||
}
|
}
|
||||||
iconDC.DrawPoint(jj,ii);
|
iconDC.DrawPoint( jj, ii );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Deselect the Tool Bitmap from DC,
|
/* Deselect the Tool Bitmap from DC,
|
||||||
in order to delete the MemoryDC safely without deleting the bitmap */
|
* in order to delete the MemoryDC safely without deleting the bitmap */
|
||||||
iconDC.SelectObject( wxNullBitmap );
|
iconDC.SelectObject( wxNullBitmap );
|
||||||
|
|
||||||
if (m_HToolBar) {
|
if( m_HToolBar )
|
||||||
#if wxCHECK_VERSION(2,8,3)
|
{
|
||||||
m_HToolBar->SetToolNormalBitmap(ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, *LayerPairBitmap);
|
#if wxCHECK_VERSION( 2, 8, 3 )
|
||||||
|
m_HToolBar->SetToolNormalBitmap( ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, *LayerPairBitmap );
|
||||||
#else
|
#else
|
||||||
int pos = m_HToolBar->GetToolPos(ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR);
|
int pos = m_HToolBar->GetToolPos( ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR );
|
||||||
if (pos != wxNOT_FOUND) {
|
if( pos != wxNOT_FOUND )
|
||||||
m_HToolBar->DeleteTool(ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR);
|
{
|
||||||
m_HToolBar->InsertTool(pos, ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, *LayerPairBitmap,
|
m_HToolBar->DeleteTool( ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR );
|
||||||
wxNullBitmap, false, NULL, SEL_LAYER_HELP);
|
m_HToolBar->InsertTool( pos, ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, *LayerPairBitmap,
|
||||||
|
wxNullBitmap, false, NULL, SEL_LAYER_HELP );
|
||||||
m_HToolBar->Realize();
|
m_HToolBar->Realize();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/******************************************/
|
/******************************************/
|
||||||
void WinEDA_PcbFrame::ReCreateHToolbar(void)
|
void WinEDA_PcbFrame::ReCreateHToolbar( void )
|
||||||
/******************************************/
|
/******************************************/
|
||||||
|
|
||||||
// Create the main horizontal toolbar
|
// Create the main horizontal toolbar
|
||||||
{
|
{
|
||||||
int ii;
|
int ii;
|
||||||
|
|
||||||
if ( m_HToolBar != NULL )
|
if( m_HToolBar != NULL )
|
||||||
{ // simple mise a jour de la liste des fichiers anciens
|
{ // simple mise a jour de la liste des fichiers anciens
|
||||||
wxMenuItem * item;
|
wxMenuItem* item;
|
||||||
for ( ii = 9; ii >=0 ; ii-- )
|
for( ii = 9; ii >=0; ii-- )
|
||||||
{
|
{
|
||||||
if( m_FilesMenu->FindItem(ID_LOAD_FILE_1 + ii) )
|
if( m_FilesMenu->FindItem( ID_LOAD_FILE_1 + ii ) )
|
||||||
{
|
{
|
||||||
item = m_FilesMenu->Remove(ID_LOAD_FILE_1 + ii);
|
item = m_FilesMenu->Remove( ID_LOAD_FILE_1 + ii );
|
||||||
if ( item ) delete item;
|
if( item )
|
||||||
|
delete item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for ( ii = 0; ii < 10; ii++ )
|
|
||||||
|
for( ii = 0; ii < 10; ii++ )
|
||||||
{
|
{
|
||||||
if ( GetLastProject(ii).IsEmpty() ) break;
|
if( GetLastProject( ii ).IsEmpty() )
|
||||||
m_FilesMenu->Append(ID_LOAD_FILE_1 + ii, GetLastProject(ii) );
|
break;
|
||||||
|
m_FilesMenu->Append( ID_LOAD_FILE_1 + ii, GetLastProject( ii ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
SetToolbars();
|
SetToolbars();
|
||||||
|
@ -211,63 +228,75 @@ int ii;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
m_HToolBar = new WinEDA_Toolbar(TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE);
|
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
|
||||||
m_HToolBar->SetRows(1);
|
m_HToolBar->SetRows( 1 );
|
||||||
SetToolBar(m_HToolBar);
|
SetToolBar( m_HToolBar );
|
||||||
|
|
||||||
// Set up toolbar
|
// Set up toolbar
|
||||||
m_HToolBar->AddTool(ID_NEW_BOARD, wxEmptyString, BITMAP(new_xpm), _("New Board"));
|
m_HToolBar->AddTool( ID_NEW_BOARD, wxEmptyString, BITMAP( new_xpm ), _( "New Board" ) );
|
||||||
m_HToolBar->AddTool(ID_LOAD_FILE, wxEmptyString, BITMAP(open_xpm), _("Open existing Board"));
|
m_HToolBar->AddTool( ID_LOAD_FILE, wxEmptyString, BITMAP( open_xpm ),
|
||||||
m_HToolBar->AddTool(ID_SAVE_BOARD, wxEmptyString, BITMAP(save_xpm), _("Save Board"));
|
_( "Open existing Board" ) );
|
||||||
|
m_HToolBar->AddTool( ID_SAVE_BOARD, wxEmptyString, BITMAP( save_xpm ), _( "Save Board" ) );
|
||||||
|
|
||||||
m_HToolBar->AddSeparator();
|
m_HToolBar->AddSeparator();
|
||||||
m_HToolBar->AddTool(ID_SHEET_SET, wxEmptyString, BITMAP(sheetset_xpm), _("page settings (size, texts)") );
|
m_HToolBar->AddTool( ID_SHEET_SET, wxEmptyString, BITMAP( sheetset_xpm ),
|
||||||
|
_( "page settings (size, texts)" ) );
|
||||||
|
|
||||||
m_HToolBar->AddSeparator();
|
m_HToolBar->AddSeparator();
|
||||||
m_HToolBar->AddTool(ID_OPEN_MODULE_EDITOR, wxEmptyString, BITMAP(modedit_xpm),
|
m_HToolBar->AddTool( ID_OPEN_MODULE_EDITOR, wxEmptyString, BITMAP( modedit_xpm ),
|
||||||
_("Open Module Editor"));
|
_( "Open Module Editor" ) );
|
||||||
|
|
||||||
m_HToolBar->AddSeparator();
|
m_HToolBar->AddSeparator();
|
||||||
m_HToolBar->AddTool(wxID_CUT, wxEmptyString, BITMAP(cut_button), _("Cut selected item"));
|
m_HToolBar->AddTool( wxID_CUT, wxEmptyString, BITMAP( cut_button ), _( "Cut selected item" ) );
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
m_HToolBar->AddTool(wxID_COPY, wxEmptyString, BITMAP(copy_button), _("Copy selected item"));
|
m_HToolBar->AddTool( wxID_COPY, wxEmptyString, BITMAP( copy_button ),
|
||||||
|
_( "Copy selected item" ) );
|
||||||
|
|
||||||
m_HToolBar->AddTool(wxID_PASTE, wxEmptyString, BITMAP(paste_xpm), _("Paste"));
|
m_HToolBar->AddTool( wxID_PASTE, wxEmptyString, BITMAP( paste_xpm ), _( "Paste" ) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_HToolBar->AddTool(ID_UNDO_BUTT, wxEmptyString, BITMAP(undelete_xpm), _("Undelete"));
|
m_HToolBar->AddTool( ID_UNDO_BUTT, wxEmptyString, BITMAP( undelete_xpm ), _( "Undelete" ) );
|
||||||
|
|
||||||
m_HToolBar->AddSeparator();
|
m_HToolBar->AddSeparator();
|
||||||
m_HToolBar->AddTool(ID_GEN_PRINT, wxEmptyString, BITMAP(print_button), _("Print Board"));
|
m_HToolBar->AddTool( ID_GEN_PRINT, wxEmptyString, BITMAP( print_button ), _( "Print Board" ) );
|
||||||
m_HToolBar->AddTool(ID_GEN_PLOT, wxEmptyString, BITMAP(plot_xpm), _("Plot (HPGL, PostScript, or GERBER format)"));
|
m_HToolBar->AddTool( ID_GEN_PLOT, wxEmptyString, BITMAP( plot_xpm ),
|
||||||
|
_( "Plot (HPGL, PostScript, or GERBER format)" ) );
|
||||||
|
|
||||||
m_HToolBar->AddSeparator();
|
m_HToolBar->AddSeparator();
|
||||||
m_HToolBar->AddTool(ID_ZOOM_PLUS_BUTT, wxEmptyString, BITMAP(zoom_in_xpm), _("zoom + (F1)"));
|
m_HToolBar->AddTool( ID_ZOOM_PLUS_BUTT, wxEmptyString, BITMAP( zoom_in_xpm ),
|
||||||
m_HToolBar->AddTool(ID_ZOOM_MOINS_BUTT, wxEmptyString, BITMAP(zoom_out_xpm), _("zoom - (F2)"));
|
_( "zoom + (F1)" ) );
|
||||||
m_HToolBar->AddTool(ID_ZOOM_REDRAW_BUTT, wxEmptyString, BITMAP(repaint_xpm), _("redraw (F3)"));
|
m_HToolBar->AddTool( ID_ZOOM_MOINS_BUTT, wxEmptyString, BITMAP( zoom_out_xpm ),
|
||||||
|
_( "zoom - (F2)" ) );
|
||||||
|
m_HToolBar->AddTool( ID_ZOOM_REDRAW_BUTT, wxEmptyString, BITMAP( repaint_xpm ),
|
||||||
|
_( "redraw (F3)" ) );
|
||||||
|
|
||||||
m_HToolBar->AddTool(ID_ZOOM_PAGE_BUTT, wxEmptyString, BITMAP(zoom_optimal_xpm), _("auto zoom"));
|
m_HToolBar->AddTool( ID_ZOOM_PAGE_BUTT, wxEmptyString, BITMAP( zoom_optimal_xpm ),
|
||||||
|
_( "auto zoom" ) );
|
||||||
|
|
||||||
m_HToolBar->AddSeparator();
|
m_HToolBar->AddSeparator();
|
||||||
m_HToolBar->AddTool(ID_FIND_ITEMS, wxEmptyString, BITMAP(find_xpm), _("Find components and texts (Ctrl-F)"));
|
m_HToolBar->AddTool( ID_FIND_ITEMS, wxEmptyString, BITMAP( find_xpm ),
|
||||||
|
_( "Find components and texts (Ctrl-F)" ) );
|
||||||
|
|
||||||
m_HToolBar->AddSeparator();
|
m_HToolBar->AddSeparator();
|
||||||
m_HToolBar->AddTool(ID_GET_NETLIST, wxEmptyString, BITMAP(netlist_xpm), _("Read Netlist"));
|
m_HToolBar->AddTool( ID_GET_NETLIST, wxEmptyString, BITMAP( netlist_xpm ),
|
||||||
m_HToolBar->AddTool(ID_DRC_CONTROL, wxEmptyString, BITMAP(erc_xpm), _("Pcb Design Rules Check"));
|
_( "Read Netlist" ) );
|
||||||
|
m_HToolBar->AddTool( ID_DRC_CONTROL, wxEmptyString, BITMAP( erc_xpm ),
|
||||||
|
_( "Pcb Design Rules Check" ) );
|
||||||
|
|
||||||
m_HToolBar->AddSeparator();
|
m_HToolBar->AddSeparator();
|
||||||
ReCreateLayerBox(m_HToolBar);
|
ReCreateLayerBox( m_HToolBar );
|
||||||
PrepareLayerIndicator(); // Initialise the bitmap with current active layer colors for the next tool
|
PrepareLayerIndicator(); // Initialise the bitmap with current active layer colors for the next tool
|
||||||
m_HToolBar->AddTool(ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, wxEmptyString, * LayerPairBitmap,
|
m_HToolBar->AddTool( ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, wxEmptyString, *LayerPairBitmap,
|
||||||
SEL_LAYER_HELP);
|
SEL_LAYER_HELP );
|
||||||
|
|
||||||
m_HToolBar->AddSeparator();
|
m_HToolBar->AddSeparator();
|
||||||
m_HToolBar->AddTool(ID_TOOLBARH_PCB_AUTOPLACE, wxEmptyString, BITMAP(mode_module_xpm),
|
m_HToolBar->AddTool( ID_TOOLBARH_PCB_AUTOPLACE, wxEmptyString, BITMAP( mode_module_xpm ),
|
||||||
_("Mode Module: Manual and Automatic Move or Place for modules"), wxITEM_CHECK );
|
_(
|
||||||
m_HToolBar->AddTool(ID_TOOLBARH_PCB_AUTOROUTE, wxEmptyString, BITMAP(mode_track_xpm),
|
"Mode Module: Manual and Automatic Move or Place for modules" ),
|
||||||
_("Mode Track and Autorouting"), wxITEM_CHECK);
|
wxITEM_CHECK );
|
||||||
|
m_HToolBar->AddTool( ID_TOOLBARH_PCB_AUTOROUTE, wxEmptyString, BITMAP( mode_track_xpm ),
|
||||||
|
_( "Mode Track and Autorouting" ), wxITEM_CHECK );
|
||||||
|
|
||||||
// after adding the buttons to the toolbar, must call Realize() to reflect
|
// after adding the buttons to the toolbar, must call Realize() to reflect
|
||||||
// the changes
|
// the changes
|
||||||
|
@ -277,65 +306,73 @@ int ii;
|
||||||
SetToolbars();
|
SetToolbars();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*********************************************/
|
/*********************************************/
|
||||||
void WinEDA_PcbFrame::ReCreateOptToolbar(void)
|
void WinEDA_PcbFrame::ReCreateOptToolbar( void )
|
||||||
/*********************************************/
|
/*********************************************/
|
||||||
|
|
||||||
// Create the left vertical toolbar (option selections)
|
// Create the left vertical toolbar (option selections)
|
||||||
{
|
{
|
||||||
if ( m_OptionsToolBar ) return;
|
if( m_OptionsToolBar )
|
||||||
|
return;
|
||||||
|
|
||||||
// creation du tool bar options
|
// creation du tool bar options
|
||||||
m_OptionsToolBar = new WinEDA_Toolbar(TOOLBAR_OPTION, this, ID_OPT_TOOLBAR, FALSE);
|
m_OptionsToolBar = new WinEDA_Toolbar( TOOLBAR_OPTION, this, ID_OPT_TOOLBAR, FALSE );
|
||||||
|
|
||||||
m_OptionsToolBar->AddTool(ID_TB_OPTIONS_DRC_OFF, wxEmptyString, BITMAP(drc_off_xpm),
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_DRC_OFF, wxEmptyString, BITMAP( drc_off_xpm ),
|
||||||
_("Drc OFF"), wxITEM_CHECK);
|
_( "Drc OFF" ), wxITEM_CHECK );
|
||||||
m_OptionsToolBar->AddTool(ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, BITMAP(grid_xpm),
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, BITMAP( grid_xpm ),
|
||||||
_("Display Grid OFF"), wxITEM_CHECK);
|
_( "Display Grid OFF" ), wxITEM_CHECK );
|
||||||
m_OptionsToolBar->AddTool(ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString,
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString,
|
||||||
BITMAP(polar_coord_xpm), _("Display Polar Coord ON"), wxITEM_CHECK);
|
BITMAP( polar_coord_xpm ), _(
|
||||||
m_OptionsToolBar->AddTool(ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
|
"Display Polar Coord ON" ), wxITEM_CHECK );
|
||||||
BITMAP(unit_inch_xpm), _("Units = Inch"), wxITEM_CHECK );
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
|
||||||
m_OptionsToolBar->AddTool(ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
|
BITMAP( unit_inch_xpm ), _( "Units = Inch" ), wxITEM_CHECK );
|
||||||
BITMAP(unit_mm_xpm), _("Units = mm"), wxITEM_CHECK );
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
|
||||||
m_OptionsToolBar->AddTool(ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString, BITMAP(cursor_shape_xpm),
|
BITMAP( unit_mm_xpm ), _( "Units = mm" ), wxITEM_CHECK );
|
||||||
_("Change Cursor Shape"), wxITEM_CHECK);
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
|
||||||
|
BITMAP( cursor_shape_xpm ),
|
||||||
|
_( "Change Cursor Shape" ), wxITEM_CHECK );
|
||||||
|
|
||||||
m_OptionsToolBar->AddSeparator();
|
m_OptionsToolBar->AddSeparator();
|
||||||
m_OptionsToolBar->AddTool(ID_TB_OPTIONS_SHOW_RATSNEST, wxEmptyString,
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_RATSNEST, wxEmptyString,
|
||||||
BITMAP(general_ratsnet_xpm),
|
BITMAP( general_ratsnet_xpm ),
|
||||||
_("Show General Ratsnest"), wxITEM_CHECK);
|
_( "Show General Ratsnest" ), wxITEM_CHECK );
|
||||||
m_OptionsToolBar->AddTool(ID_TB_OPTIONS_SHOW_MODULE_RATSNEST,wxEmptyString,
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_RATSNEST, wxEmptyString,
|
||||||
BITMAP(local_ratsnet_xpm),
|
BITMAP( local_ratsnet_xpm ),
|
||||||
_("Show Module Ratsnest when moving"), wxITEM_CHECK);
|
_( "Show Module Ratsnest when moving" ), wxITEM_CHECK );
|
||||||
|
|
||||||
m_OptionsToolBar->AddSeparator();
|
m_OptionsToolBar->AddSeparator();
|
||||||
m_OptionsToolBar->AddTool(ID_TB_OPTIONS_AUTO_DEL_TRACK, wxEmptyString, BITMAP(auto_delete_track_xpm),
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_AUTO_DEL_TRACK, wxEmptyString,
|
||||||
_("Enable Auto Del Track"), wxITEM_CHECK);
|
BITMAP( auto_delete_track_xpm ),
|
||||||
|
_( "Enable Auto Del Track" ), wxITEM_CHECK );
|
||||||
|
|
||||||
m_OptionsToolBar->AddSeparator();
|
m_OptionsToolBar->AddSeparator();
|
||||||
m_OptionsToolBar->AddTool(ID_TB_OPTIONS_SHOW_ZONES,wxEmptyString, BITMAP(show_zone_xpm),
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_ZONES, wxEmptyString, BITMAP( show_zone_xpm ),
|
||||||
_("Show Zones"), wxITEM_CHECK);
|
_( "Show Zones" ), wxITEM_CHECK );
|
||||||
|
|
||||||
m_OptionsToolBar->AddSeparator();
|
m_OptionsToolBar->AddSeparator();
|
||||||
m_OptionsToolBar->AddTool(ID_TB_OPTIONS_SHOW_PADS_SKETCH,wxEmptyString,
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH, wxEmptyString,
|
||||||
BITMAP(pad_sketch_xpm),
|
BITMAP( pad_sketch_xpm ),
|
||||||
_("Show Pads Sketch"), wxITEM_CHECK);
|
_( "Show Pads Sketch" ), wxITEM_CHECK );
|
||||||
|
|
||||||
m_OptionsToolBar->AddTool(ID_TB_OPTIONS_SHOW_TRACKS_SKETCH,wxEmptyString,
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, wxEmptyString,
|
||||||
BITMAP(showtrack_xpm),
|
BITMAP( showtrack_xpm ),
|
||||||
_("Show Tracks Sketch"), wxITEM_CHECK);
|
_( "Show Tracks Sketch" ), wxITEM_CHECK );
|
||||||
|
|
||||||
m_OptionsToolBar->AddTool(ID_TB_OPTIONS_SHOW_HIGHT_CONTRAST_MODE, wxEmptyString,
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_HIGHT_CONTRAST_MODE, wxEmptyString,
|
||||||
BITMAP(palette_xpm),
|
BITMAP( palette_xpm ),
|
||||||
_("Hight Contrast Mode Display"), wxITEM_CHECK);
|
_( "Hight Contrast Mode Display" ), wxITEM_CHECK );
|
||||||
m_OptionsToolBar->ToggleTool(ID_TB_OPTIONS_SHOW_HIGHT_CONTRAST_MODE,
|
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_HIGHT_CONTRAST_MODE,
|
||||||
DisplayOpt.ContrastModeDisplay);
|
DisplayOpt.ContrastModeDisplay );
|
||||||
|
|
||||||
#ifdef MUWAVE_ENBL
|
#ifdef MUWAVE_ENBL
|
||||||
m_OptionsToolBar->AddSeparator();
|
m_OptionsToolBar->AddSeparator();
|
||||||
m_OptionsToolBar->AddTool(ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1, wxEmptyString,
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1, wxEmptyString,
|
||||||
BITMAP(mw_toolbar_xpm),
|
BITMAP( mw_toolbar_xpm ),
|
||||||
_("Display auxiliary vertical toolbar (tools for micro wave applications)\n This is a very experimental feature (under development)"), wxITEM_CHECK);
|
_(
|
||||||
|
"Display auxiliary vertical toolbar (tools for micro wave applications)\n This is a very experimental feature (under development)" ),
|
||||||
|
wxITEM_CHECK );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_OptionsToolBar->Realize();
|
m_OptionsToolBar->Realize();
|
||||||
|
@ -345,76 +382,78 @@ void WinEDA_PcbFrame::ReCreateOptToolbar(void)
|
||||||
|
|
||||||
|
|
||||||
/********************************************/
|
/********************************************/
|
||||||
void WinEDA_PcbFrame::ReCreateVToolbar(void)
|
void WinEDA_PcbFrame::ReCreateVToolbar( void )
|
||||||
/********************************************/
|
/********************************************/
|
||||||
/* Create the main vertical right toolbar, showing usual tools
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
if( m_VToolBar ) return;
|
|
||||||
|
|
||||||
m_VToolBar = new WinEDA_Toolbar(TOOLBAR_TOOL, this, ID_V_TOOLBAR, FALSE);
|
/* Create the main vertical right toolbar, showing usual tools
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
if( m_VToolBar )
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_VToolBar = new WinEDA_Toolbar( TOOLBAR_TOOL, this, ID_V_TOOLBAR, FALSE );
|
||||||
|
|
||||||
// Set up toolbar
|
// Set up toolbar
|
||||||
m_VToolBar->AddTool(ID_NO_SELECT_BUTT, wxEmptyString,
|
m_VToolBar->AddTool( ID_NO_SELECT_BUTT, wxEmptyString,
|
||||||
BITMAP(cursor_xpm), wxEmptyString, wxITEM_CHECK );
|
BITMAP( cursor_xpm ), wxEmptyString, wxITEM_CHECK );
|
||||||
m_VToolBar->ToggleTool(ID_NO_SELECT_BUTT, TRUE);
|
m_VToolBar->ToggleTool( ID_NO_SELECT_BUTT, TRUE );
|
||||||
m_VToolBar->AddSeparator();
|
m_VToolBar->AddSeparator();
|
||||||
|
|
||||||
m_VToolBar->AddTool(ID_PCB_HIGHLIGHT_BUTT, wxEmptyString,
|
m_VToolBar->AddTool( ID_PCB_HIGHLIGHT_BUTT, wxEmptyString,
|
||||||
BITMAP(net_hightlight_xpm), _("Net highlight"), wxITEM_CHECK );
|
BITMAP( net_hightlight_xpm ), _( "Net highlight" ), wxITEM_CHECK );
|
||||||
|
|
||||||
m_VToolBar->AddTool(ID_PCB_SHOW_1_RATSNEST_BUTT, wxEmptyString,
|
m_VToolBar->AddTool( ID_PCB_SHOW_1_RATSNEST_BUTT, wxEmptyString,
|
||||||
BITMAP(tool_ratsnet_xpm),
|
BITMAP( tool_ratsnet_xpm ),
|
||||||
_("Display local ratsnest (pad or module)"), wxITEM_CHECK );
|
_( "Display local ratsnest (pad or module)" ), wxITEM_CHECK );
|
||||||
|
|
||||||
m_VToolBar->AddSeparator();
|
m_VToolBar->AddSeparator();
|
||||||
m_VToolBar->AddTool(ID_COMPONENT_BUTT, wxEmptyString,
|
m_VToolBar->AddTool( ID_COMPONENT_BUTT, wxEmptyString,
|
||||||
BITMAP(module_xpm),
|
BITMAP( module_xpm ),
|
||||||
_("Add modules"), wxITEM_CHECK);
|
_( "Add modules" ), wxITEM_CHECK );
|
||||||
|
|
||||||
m_VToolBar->AddTool(ID_TRACK_BUTT, wxEmptyString,
|
m_VToolBar->AddTool( ID_TRACK_BUTT, wxEmptyString,
|
||||||
BITMAP(add_tracks_xpm),
|
BITMAP( add_tracks_xpm ),
|
||||||
_("Add Tracks an vias"), wxITEM_CHECK);
|
_( "Add Tracks an vias" ), wxITEM_CHECK );
|
||||||
|
|
||||||
m_VToolBar->AddTool(ID_PCB_ZONES_BUTT, wxEmptyString,
|
m_VToolBar->AddTool( ID_PCB_ZONES_BUTT, wxEmptyString,
|
||||||
BITMAP(add_zone_xpm),
|
BITMAP( add_zone_xpm ),
|
||||||
_("Add Zones"), wxITEM_CHECK);
|
_( "Add Zones" ), wxITEM_CHECK );
|
||||||
|
|
||||||
m_VToolBar->AddSeparator();
|
m_VToolBar->AddSeparator();
|
||||||
m_VToolBar->AddTool(ID_LINE_COMMENT_BUTT, wxEmptyString,
|
m_VToolBar->AddTool( ID_LINE_COMMENT_BUTT, wxEmptyString,
|
||||||
BITMAP(add_dashed_line_xpm),
|
BITMAP( add_dashed_line_xpm ),
|
||||||
_("Add graphic line or polygon"), wxITEM_CHECK);
|
_( "Add graphic line or polygon" ), wxITEM_CHECK );
|
||||||
|
|
||||||
m_VToolBar->AddTool(ID_PCB_CIRCLE_BUTT, wxEmptyString,
|
m_VToolBar->AddTool( ID_PCB_CIRCLE_BUTT, wxEmptyString,
|
||||||
BITMAP(add_circle_xpm),
|
BITMAP( add_circle_xpm ),
|
||||||
_("Add graphic circle"), wxITEM_CHECK);
|
_( "Add graphic circle" ), wxITEM_CHECK );
|
||||||
|
|
||||||
m_VToolBar->AddTool(ID_PCB_ARC_BUTT, wxEmptyString,
|
m_VToolBar->AddTool( ID_PCB_ARC_BUTT, wxEmptyString,
|
||||||
BITMAP(add_arc_xpm),
|
BITMAP( add_arc_xpm ),
|
||||||
_("Add graphic arc"), wxITEM_CHECK);
|
_( "Add graphic arc" ), wxITEM_CHECK );
|
||||||
|
|
||||||
m_VToolBar->AddTool(ID_TEXT_COMMENT_BUTT, wxEmptyString,
|
m_VToolBar->AddTool( ID_TEXT_COMMENT_BUTT, wxEmptyString,
|
||||||
BITMAP(add_text_xpm),
|
BITMAP( add_text_xpm ),
|
||||||
_("Add Text"), wxITEM_CHECK);
|
_( "Add Text" ), wxITEM_CHECK );
|
||||||
|
|
||||||
m_VToolBar->AddSeparator();
|
m_VToolBar->AddSeparator();
|
||||||
m_VToolBar->AddTool(ID_PCB_COTATION_BUTT, wxEmptyString,
|
m_VToolBar->AddTool( ID_PCB_COTATION_BUTT, wxEmptyString,
|
||||||
BITMAP(add_cotation_xpm),
|
BITMAP( add_cotation_xpm ),
|
||||||
_("Add Cotation"), wxITEM_CHECK);
|
_( "Add Cotation" ), wxITEM_CHECK );
|
||||||
|
|
||||||
m_VToolBar->AddTool(ID_PCB_MIRE_BUTT, wxEmptyString,
|
m_VToolBar->AddTool( ID_PCB_MIRE_BUTT, wxEmptyString,
|
||||||
BITMAP(add_mires_xpm),
|
BITMAP( add_mires_xpm ),
|
||||||
_("Add Mires"), wxITEM_CHECK);
|
_( "Add Mires" ), wxITEM_CHECK );
|
||||||
|
|
||||||
m_VToolBar->AddSeparator();
|
m_VToolBar->AddSeparator();
|
||||||
m_VToolBar->AddTool(ID_PCB_DELETE_ITEM_BUTT, wxEmptyString,
|
m_VToolBar->AddTool( ID_PCB_DELETE_ITEM_BUTT, wxEmptyString,
|
||||||
BITMAP(delete_body_xpm),
|
BITMAP( delete_body_xpm ),
|
||||||
_("Delete items"), wxITEM_CHECK);
|
_( "Delete items" ), wxITEM_CHECK );
|
||||||
|
|
||||||
m_VToolBar->AddSeparator();
|
m_VToolBar->AddSeparator();
|
||||||
m_VToolBar->AddTool(ID_PCB_PLACE_OFFSET_COORD_BUTT, wxEmptyString,
|
m_VToolBar->AddTool( ID_PCB_PLACE_OFFSET_COORD_BUTT, wxEmptyString,
|
||||||
BITMAP(pcb_offset_xpm),
|
BITMAP( pcb_offset_xpm ),
|
||||||
_("Offset adjust for drill and place files"), wxITEM_CHECK);
|
_( "Offset adjust for drill and place files" ), wxITEM_CHECK );
|
||||||
|
|
||||||
m_VToolBar->Realize();
|
m_VToolBar->Realize();
|
||||||
|
|
||||||
|
@ -423,102 +462,110 @@ void WinEDA_PcbFrame::ReCreateVToolbar(void)
|
||||||
|
|
||||||
|
|
||||||
/*********************************************/
|
/*********************************************/
|
||||||
void WinEDA_PcbFrame::ReCreateAuxVToolbar(void)
|
void WinEDA_PcbFrame::ReCreateAuxVToolbar( void )
|
||||||
/*********************************************/
|
/*********************************************/
|
||||||
/* Create the auxiliary vertical right toolbar, showing tools fo microwave applications
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
if( m_AuxVToolBar ) return;
|
|
||||||
|
|
||||||
m_AuxVToolBar = new WinEDA_Toolbar(TOOLBAR_TOOL, this, ID_AUX_V_TOOLBAR, FALSE);
|
/* Create the auxiliary vertical right toolbar, showing tools fo microwave applications
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
if( m_AuxVToolBar )
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_AuxVToolBar = new WinEDA_Toolbar( TOOLBAR_TOOL, this, ID_AUX_V_TOOLBAR, FALSE );
|
||||||
|
|
||||||
// Set up toolbar
|
// Set up toolbar
|
||||||
m_AuxVToolBar->AddTool(ID_PCB_MUWAVE_TOOL_SELF_CMD,
|
m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_SELF_CMD,
|
||||||
BITMAP(mw_Add_Line_xpm),
|
BITMAP( mw_Add_Line_xpm ),
|
||||||
wxNullBitmap, TRUE,
|
wxNullBitmap, TRUE,
|
||||||
-1,-1, (wxObject *) NULL,
|
-1, -1, (wxObject*) NULL,
|
||||||
_("Create line of specified length for microwave applications") );
|
_( "Create line of specified length for microwave applications" ) );
|
||||||
|
|
||||||
m_AuxVToolBar->AddTool(ID_PCB_MUWAVE_TOOL_GAP_CMD,
|
m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_GAP_CMD,
|
||||||
BITMAP(mw_Add_Gap_xpm),
|
BITMAP( mw_Add_Gap_xpm ),
|
||||||
wxNullBitmap, TRUE,
|
wxNullBitmap, TRUE,
|
||||||
-1,-1, (wxObject *) NULL,
|
-1, -1, (wxObject*) NULL,
|
||||||
_("Create gap of specified length for microwave applications") );
|
_( "Create gap of specified length for microwave applications" ) );
|
||||||
|
|
||||||
m_AuxVToolBar->AddSeparator();
|
m_AuxVToolBar->AddSeparator();
|
||||||
|
|
||||||
m_AuxVToolBar->AddTool(ID_PCB_MUWAVE_TOOL_STUB_CMD,
|
m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_STUB_CMD,
|
||||||
BITMAP(mw_Add_Stub_xpm),
|
BITMAP( mw_Add_Stub_xpm ),
|
||||||
wxNullBitmap, TRUE,
|
wxNullBitmap, TRUE,
|
||||||
-1,-1, (wxObject *) NULL,
|
-1, -1, (wxObject*) NULL,
|
||||||
_("Create stub of specified length for microwave applications") );
|
_( "Create stub of specified length for microwave applications" ) );
|
||||||
|
|
||||||
m_AuxVToolBar->AddTool(ID_PCB_MUWAVE_TOOL_STUB_ARC_CMD,
|
m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_STUB_ARC_CMD,
|
||||||
BITMAP(mw_Add_stub_arc_xpm),
|
BITMAP( mw_Add_stub_arc_xpm ),
|
||||||
wxNullBitmap, TRUE,
|
wxNullBitmap, TRUE,
|
||||||
-1,-1, (wxObject *) NULL,
|
-1, -1, (wxObject*) NULL,
|
||||||
_("Create stub (arc) of specified length for microwave applications") );
|
_( "Create stub (arc) of specified length for microwave applications" )
|
||||||
|
);
|
||||||
|
|
||||||
m_AuxVToolBar->AddTool(ID_PCB_MUWAVE_TOOL_FUNCTION_SHAPE_CMD,
|
m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_FUNCTION_SHAPE_CMD,
|
||||||
BITMAP(mw_Add_Shape_xpm),
|
BITMAP( mw_Add_Shape_xpm ),
|
||||||
wxNullBitmap, TRUE,
|
wxNullBitmap, TRUE,
|
||||||
-1,-1, (wxObject *) NULL,
|
-1, -1, (wxObject*) NULL,
|
||||||
_("Create a polynomial shape for microwave applications") );
|
_( "Create a polynomial shape for microwave applications" ) );
|
||||||
|
|
||||||
m_AuxVToolBar->Realize();
|
m_AuxVToolBar->Realize();
|
||||||
|
|
||||||
SetToolbars();
|
SetToolbars();
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************/
|
|
||||||
void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar(void)
|
|
||||||
/****************************************************/
|
|
||||||
/* Create auxiliary horizontal toolbar
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
int ii;
|
|
||||||
wxString msg;
|
|
||||||
|
|
||||||
if ( m_AuxiliaryToolBar == NULL )
|
/****************************************************/
|
||||||
|
void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar( void )
|
||||||
|
/****************************************************/
|
||||||
|
|
||||||
|
/* Create auxiliary horizontal toolbar
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
int ii;
|
||||||
|
wxString msg;
|
||||||
|
|
||||||
|
if( m_AuxiliaryToolBar == NULL )
|
||||||
{
|
{
|
||||||
m_AuxiliaryToolBar = new WinEDA_Toolbar(TOOLBAR_AUX, this, ID_AUX_TOOLBAR, TRUE);
|
m_AuxiliaryToolBar = new WinEDA_Toolbar( TOOLBAR_AUX, this, ID_AUX_TOOLBAR, TRUE );
|
||||||
|
|
||||||
// Set up toolbar
|
// Set up toolbar
|
||||||
m_AuxiliaryToolBar->AddSeparator();
|
m_AuxiliaryToolBar->AddSeparator();
|
||||||
m_SelTrackWidthBox = new WinEDAChoiceBox(m_AuxiliaryToolBar,
|
m_SelTrackWidthBox = new WinEDAChoiceBox( m_AuxiliaryToolBar,
|
||||||
ID_AUX_TOOLBAR_PCB_TRACK_WIDTH,
|
ID_AUX_TOOLBAR_PCB_TRACK_WIDTH,
|
||||||
wxPoint(-1,-1), wxSize(LISTBOX_WIDTH+20, -1));
|
wxPoint( -1,
|
||||||
m_AuxiliaryToolBar->AddControl(m_SelTrackWidthBox);
|
-1 ), wxSize( LISTBOX_WIDTH + 20, -1 ) );
|
||||||
|
m_AuxiliaryToolBar->AddControl( m_SelTrackWidthBox );
|
||||||
m_SelTrackWidthBox_Changed = TRUE;
|
m_SelTrackWidthBox_Changed = TRUE;
|
||||||
|
|
||||||
m_AuxiliaryToolBar->AddSeparator();
|
m_AuxiliaryToolBar->AddSeparator();
|
||||||
m_SelViaSizeBox = new WinEDAChoiceBox(m_AuxiliaryToolBar,
|
m_SelViaSizeBox = new WinEDAChoiceBox( m_AuxiliaryToolBar,
|
||||||
ID_AUX_TOOLBAR_PCB_VIA_SIZE,
|
ID_AUX_TOOLBAR_PCB_VIA_SIZE,
|
||||||
wxPoint(-1,-1), wxSize(LISTBOX_WIDTH+10, -1));
|
wxPoint( -1, -1 ), wxSize( LISTBOX_WIDTH + 10, -1 ) );
|
||||||
m_AuxiliaryToolBar->AddControl(m_SelViaSizeBox);
|
m_AuxiliaryToolBar->AddControl( m_SelViaSizeBox );
|
||||||
|
|
||||||
m_AuxiliaryToolBar->AddSeparator();
|
m_AuxiliaryToolBar->AddSeparator();
|
||||||
|
|
||||||
// Boite de selection du pas de grille
|
// Boite de selection du pas de grille
|
||||||
m_SelGridBox = new WinEDAChoiceBox(m_AuxiliaryToolBar,
|
m_SelGridBox = new WinEDAChoiceBox( m_AuxiliaryToolBar,
|
||||||
ID_ON_GRID_SELECT,
|
ID_ON_GRID_SELECT,
|
||||||
wxPoint(-1,-1), wxSize(LISTBOX_WIDTH, -1));
|
wxPoint( -1, -1 ), wxSize( LISTBOX_WIDTH, -1 ) );
|
||||||
m_AuxiliaryToolBar->AddControl( m_SelGridBox);
|
m_AuxiliaryToolBar->AddControl( m_SelGridBox );
|
||||||
|
|
||||||
// Boite de selection du Zoom
|
// Boite de selection du Zoom
|
||||||
m_AuxiliaryToolBar->AddSeparator();
|
m_AuxiliaryToolBar->AddSeparator();
|
||||||
m_SelZoomBox = new WinEDAChoiceBox(m_AuxiliaryToolBar,
|
m_SelZoomBox = new WinEDAChoiceBox( m_AuxiliaryToolBar,
|
||||||
ID_ON_ZOOM_SELECT,
|
ID_ON_ZOOM_SELECT,
|
||||||
wxPoint(-1,-1), wxSize(LISTBOX_WIDTH, -1));
|
wxPoint( -1, -1 ), wxSize( LISTBOX_WIDTH, -1 ) );
|
||||||
msg = _("Auto");
|
msg = _( "Auto" );
|
||||||
m_SelZoomBox->Append(msg);
|
m_SelZoomBox->Append( msg );
|
||||||
for ( int jj = 0, ii = 1; ii <= m_ZoomMaxValue; ii <<= 1, jj++ )
|
for( int jj = 0, ii = 1; ii <= m_ZoomMaxValue; ii <<= 1, jj++ )
|
||||||
{
|
{
|
||||||
msg = _("Zoom "); msg << ii;
|
msg = _( "Zoom " ); msg << ii;
|
||||||
m_SelZoomBox->Append(msg);
|
m_SelZoomBox->Append( msg );
|
||||||
}
|
}
|
||||||
m_SelZoomBox->Append(wxT(""));
|
|
||||||
|
|
||||||
m_AuxiliaryToolBar->AddControl( m_SelZoomBox);
|
m_SelZoomBox->Append( wxT( "" ) );
|
||||||
|
|
||||||
|
m_AuxiliaryToolBar->AddControl( m_SelZoomBox );
|
||||||
|
|
||||||
// after adding the buttons to the toolbar, must call Realize()
|
// after adding the buttons to the toolbar, must call Realize()
|
||||||
m_AuxiliaryToolBar->Realize();
|
m_AuxiliaryToolBar->Realize();
|
||||||
|
@ -526,20 +573,23 @@ wxString msg;
|
||||||
|
|
||||||
// mise a jour des affichages
|
// mise a jour des affichages
|
||||||
m_SelGridBox->Clear();
|
m_SelGridBox->Clear();
|
||||||
wxString format = _("Grid");
|
wxString format = _( "Grid" );
|
||||||
if ( g_UnitMetric == INCHES ) format += wxT(" %.1f");
|
if( g_UnitMetric == INCHES )
|
||||||
else format += wxT(" %.3f");
|
format += wxT( " %.1f" );
|
||||||
|
|
||||||
for ( ii = 0; g_GridList[ii].x > 0; ii++ )
|
|
||||||
{
|
|
||||||
double value = To_User_Unit(g_UnitMetric, g_GridList[ii].x, PCB_INTERNAL_UNIT);
|
|
||||||
if ( g_UnitMetric == INCHES )
|
|
||||||
msg.Printf( format.GetData(), value * 1000);
|
|
||||||
else
|
else
|
||||||
msg.Printf( format.GetData(), value);
|
format += wxT( " %.3f" );
|
||||||
m_SelGridBox->Append(msg);
|
|
||||||
|
for( ii = 0; g_GridList[ii].x > 0; ii++ )
|
||||||
|
{
|
||||||
|
double value = To_User_Unit( g_UnitMetric, g_GridList[ii].x, PCB_INTERNAL_UNIT );
|
||||||
|
if( g_UnitMetric == INCHES )
|
||||||
|
msg.Printf( format.GetData(), value * 1000 );
|
||||||
|
else
|
||||||
|
msg.Printf( format.GetData(), value );
|
||||||
|
m_SelGridBox->Append( msg );
|
||||||
}
|
}
|
||||||
m_SelGridBox->Append( _("User Grid") );
|
|
||||||
|
m_SelGridBox->Append( _( "User Grid" ) );
|
||||||
|
|
||||||
m_SelViaSizeBox_Changed = TRUE;
|
m_SelViaSizeBox_Changed = TRUE;
|
||||||
m_SelTrackWidthBox_Changed = TRUE;
|
m_SelTrackWidthBox_Changed = TRUE;
|
||||||
|
@ -549,46 +599,50 @@ wxString msg;
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
WinEDAChoiceBox * WinEDA_PcbFrame::ReCreateLayerBox(WinEDA_Toolbar * parent)
|
WinEDAChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent )
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
{
|
{
|
||||||
int ii, jj, ll;
|
int ii, jj, ll;
|
||||||
bool rebuild = FALSE;
|
bool rebuild = FALSE;
|
||||||
long current_mask_layer;
|
long current_mask_layer;
|
||||||
|
|
||||||
if ( m_SelLayerBox == NULL )
|
if( m_SelLayerBox == NULL )
|
||||||
{
|
{
|
||||||
if ( parent == NULL ) return NULL;
|
if( parent == NULL )
|
||||||
m_SelLayerBox = new WinEDAChoiceBox(parent, ID_TOOLBARH_PCB_SELECT_LAYER,
|
return NULL;
|
||||||
wxPoint(-1,-1), wxSize(LISTBOX_WIDTH, -1));
|
m_SelLayerBox = new WinEDAChoiceBox( parent, ID_TOOLBARH_PCB_SELECT_LAYER,
|
||||||
parent->AddControl(m_SelLayerBox);
|
wxPoint( -1, -1 ), wxSize( LISTBOX_WIDTH, -1 ) );
|
||||||
|
parent->AddControl( m_SelLayerBox );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test si reconstruction de la liste necessaire
|
// Test si reconstruction de la liste necessaire
|
||||||
current_mask_layer = 0;
|
current_mask_layer = 0;
|
||||||
int Masque_Layer = g_TabAllCopperLayerMask[g_DesignSettings.m_CopperLayerCount-1];
|
int Masque_Layer = g_TabAllCopperLayerMask[g_DesignSettings.m_CopperLayerCount - 1];
|
||||||
Masque_Layer |= ALL_NO_CU_LAYERS;
|
Masque_Layer |= ALL_NO_CU_LAYERS;
|
||||||
for ( ii = 0; ii < (int)m_SelLayerBox->GetCount() ; ii ++ )
|
for( ii = 0; ii < (int) m_SelLayerBox->GetCount(); ii++ )
|
||||||
{
|
{
|
||||||
jj = (int) ((size_t) m_SelLayerBox->GetClientData(ii));
|
jj = (int) ( (size_t) m_SelLayerBox->GetClientData( ii ) );
|
||||||
current_mask_layer |= g_TabOneLayerMask[jj];
|
current_mask_layer |= g_TabOneLayerMask[jj];
|
||||||
}
|
}
|
||||||
if ( current_mask_layer != Masque_Layer) rebuild = TRUE;
|
|
||||||
|
if( current_mask_layer != Masque_Layer )
|
||||||
|
rebuild = TRUE;
|
||||||
|
|
||||||
// Construction de la liste
|
// Construction de la liste
|
||||||
if ( rebuild )
|
if( rebuild )
|
||||||
{
|
{
|
||||||
m_SelLayerBox->Clear();
|
m_SelLayerBox->Clear();
|
||||||
for ( ii = 0, jj = 0; ii <= EDGE_N ; ii ++ )
|
for( ii = 0, jj = 0; ii <= EDGE_N; ii++ )
|
||||||
{
|
{
|
||||||
if ( (g_TabOneLayerMask[ii] & Masque_Layer) )
|
if( (g_TabOneLayerMask[ii] & Masque_Layer) )
|
||||||
{
|
{
|
||||||
m_SelLayerBox->Append(ReturnPcbLayerName(ii,false,true));
|
m_SelLayerBox->Append( ReturnPcbLayerName( ii, false, true ) );
|
||||||
m_SelLayerBox->SetClientData(jj, (void*)ii);
|
m_SelLayerBox->SetClientData( jj, (void*) ii );
|
||||||
jj++;
|
jj++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_SelLayerBox->SetToolTip(_("+/- to switch"));
|
|
||||||
|
m_SelLayerBox->SetToolTip( _( "+/- to switch" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Activation de l'affichage sur la bonne couche
|
// Activation de l'affichage sur la bonne couche
|
||||||
|
@ -596,16 +650,15 @@ long current_mask_layer;
|
||||||
// elle est mauvaise (Pb corrige sur wxGTK 2.6.0)
|
// elle est mauvaise (Pb corrige sur wxGTK 2.6.0)
|
||||||
jj = m_SelLayerBox->GetCount();
|
jj = m_SelLayerBox->GetCount();
|
||||||
ll = m_SelLayerBox->GetChoice();
|
ll = m_SelLayerBox->GetChoice();
|
||||||
for ( ii = 0; ii < jj ; ii ++ )
|
for( ii = 0; ii < jj; ii++ )
|
||||||
{
|
{
|
||||||
if ( (int)((size_t)m_SelLayerBox->GetClientData(ii)) == GetScreen()->m_Active_Layer )
|
if( (int) ( (size_t) m_SelLayerBox->GetClientData( ii ) ) == GetScreen()->m_Active_Layer )
|
||||||
{
|
{
|
||||||
if ( ii != ll ) m_SelLayerBox->SetSelection( ii );
|
if( ii != ll )
|
||||||
|
m_SelLayerBox->SetSelection( ii );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_SelLayerBox;
|
return m_SelLayerBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue