2009-11-18 12:52:19 +00:00
|
|
|
/***********************************************/
|
|
|
|
/* PCBNEW - Footprint (module) editor options. */
|
|
|
|
/***********************************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
#include "fctsys.h"
|
|
|
|
#include "common.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
#include "class_drawpanel.h"
|
|
|
|
#include "confirm.h"
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
#include "pcbnew.h"
|
2009-07-30 11:04:07 +00:00
|
|
|
#include "wxPcbStruct.h"
|
2010-08-10 18:34:26 +00:00
|
|
|
#include "module_editor_frame.h"
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
#include "pcbnew_id.h"
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
#include "protos.h"
|
|
|
|
|
|
|
|
|
2009-11-18 12:52:19 +00:00
|
|
|
void WinEDA_ModuleEditFrame::OnSelectOptionToolbar( wxCommandEvent& event )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2009-11-18 12:52:19 +00:00
|
|
|
int id = event.GetId();
|
|
|
|
|
|
|
|
switch( id )
|
|
|
|
{
|
|
|
|
case ID_TB_OPTIONS_SHOW_GRID:
|
2010-02-01 21:23:27 +00:00
|
|
|
SetGridVisibility( m_OptionsToolBar->GetToolState( id ) );
|
2009-12-19 16:10:25 +00:00
|
|
|
DrawPanel->Refresh( );
|
2009-11-18 12:52:19 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_TB_OPTIONS_SELECT_UNIT_MM:
|
2010-07-12 14:07:09 +00:00
|
|
|
g_UserUnit = MILLIMETRES;
|
2009-11-18 12:52:19 +00:00
|
|
|
|
|
|
|
case ID_TB_OPTIONS_SELECT_UNIT_INCH:
|
|
|
|
if( id == ID_TB_OPTIONS_SELECT_UNIT_INCH )
|
2010-07-12 14:07:09 +00:00
|
|
|
g_UserUnit = INCHES;
|
2009-11-18 12:52:19 +00:00
|
|
|
UpdateStatusBar();
|
|
|
|
ReCreateAuxiliaryToolbar();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_TB_OPTIONS_SHOW_POLAR_COORD:
|
|
|
|
Affiche_Message( wxEmptyString );
|
|
|
|
DisplayOpt.DisplayPolarCood = m_OptionsToolBar->GetToolState( id );
|
|
|
|
UpdateStatusBar();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_TB_OPTIONS_SELECT_CURSOR:
|
|
|
|
m_CursorShape = m_OptionsToolBar->GetToolState( id );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_TB_OPTIONS_SHOW_PADS_SKETCH:
|
|
|
|
m_DisplayPadFill = !m_OptionsToolBar->GetToolState( id );
|
2009-12-19 16:10:25 +00:00
|
|
|
DrawPanel->Refresh( );
|
2009-11-18 12:52:19 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_TB_OPTIONS_SHOW_VIAS_SKETCH:
|
|
|
|
m_DisplayViaFill = !m_OptionsToolBar->GetToolState( id );
|
2009-12-19 16:10:25 +00:00
|
|
|
DrawPanel->Refresh( );
|
2009-11-18 12:52:19 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH:
|
|
|
|
m_DisplayModText =
|
|
|
|
m_OptionsToolBar->GetToolState( id ) ? SKETCH : FILLED;
|
2009-12-19 16:10:25 +00:00
|
|
|
DrawPanel->Refresh( );
|
2009-11-18 12:52:19 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH:
|
|
|
|
m_DisplayModEdge =
|
|
|
|
m_OptionsToolBar->GetToolState( id ) ? SKETCH : FILLED;
|
2009-12-19 16:10:25 +00:00
|
|
|
DrawPanel->Refresh( );
|
2009-11-18 12:52:19 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
DisplayError( this,
|
|
|
|
wxT( "WinEDA_ModuleEditFrame::OnSelectOptionToolbar error" ) );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
SetToolbars();
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|