More EDA_DRAW_FRAME encapsulation work.

This commit is contained in:
Wayne Stambaugh 2011-12-14 15:03:15 -05:00
parent 463c17b807
commit 95891006cd
35 changed files with 560 additions and 530 deletions

View File

@ -88,26 +88,23 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& ti
{
wxSize minsize;
m_VToolBar = NULL;
m_AuxVToolBar = NULL;
m_OptionsToolBar = NULL;
m_AuxiliaryToolBar = NULL;
m_SelGridBox = NULL;
m_SelZoomBox = NULL;
m_drawToolBar = NULL;
m_optionsToolBar = NULL;
m_gridSelectBox = NULL;
m_zoomSelectBox = NULL;
m_HotkeysZoomAndGridList = NULL;
DrawPanel = NULL;
m_messagePanel = NULL;
m_currentScreen = NULL;
m_toolId = ID_NO_TOOL_SELECTED;
m_ID_last_state = ID_NO_TOOL_SELECTED;
m_lastDrawToolId = ID_NO_TOOL_SELECTED;
m_HTOOL_current_state = 0;
m_Draw_Axis = false; // true to draw axis.
m_Draw_Sheet_Ref = false; // true to display reference sheet.
m_showAxis = false; // true to draw axis.
m_showBorderAndTitleBlock = false; // true to display reference sheet.
m_Print_Sheet_Ref = true; // true to print reference sheet.
m_Draw_Auxiliary_Axis = false; // true draw auxiliary axis.
m_Draw_Grid_Axis = false; // true to draw the grid axis
m_CursorShape = 0;
m_showGridAxis = false; // true to draw the grid axis
m_cursorShape = 0;
m_LastGridSizeId = 0;
m_DrawGrid = true; // hide/Show grid. default = show
m_GridColor = DARKGRAY; // Grid color
@ -229,7 +226,7 @@ void EDA_DRAW_FRAME::OnToggleCrossHairStyle( wxCommandEvent& aEvent )
{
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
DrawPanel->CrossHairOff( &dc );
m_CursorShape = !m_CursorShape;
m_cursorShape = !m_cursorShape;
DrawPanel->CrossHairOn( &dc );
}
@ -265,13 +262,13 @@ void EDA_DRAW_FRAME::OnUpdateGrid( wxUpdateUIEvent& aEvent )
wxString tool_tip = IsGridVisible() ? _( "Hide grid" ) : _( "Show grid" );
aEvent.Check( IsGridVisible() );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_GRID, tool_tip );
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_GRID, tool_tip );
}
void EDA_DRAW_FRAME::OnUpdateCrossHairStyle( wxUpdateUIEvent& aEvent )
{
aEvent.Check( m_CursorShape );
aEvent.Check( m_cursorShape );
}
@ -308,7 +305,7 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
if( event.GetEventType() == wxEVT_COMMAND_COMBOBOX_SELECTED )
{
if( m_SelGridBox == NULL )
if( m_gridSelectBox == NULL )
return;
/*
@ -316,9 +313,9 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
* returns NULL in GTK. This solution is not as elegant but
* it works.
*/
int index = m_SelGridBox->GetSelection();
int index = m_gridSelectBox->GetSelection();
wxASSERT( index != wxNOT_FOUND );
clientData = (int*) m_SelGridBox->wxItemContainer::GetClientData( index );
clientData = (int*) m_gridSelectBox->wxItemContainer::GetClientData( index );
if( clientData != NULL )
id = *clientData;
@ -330,15 +327,15 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
/* Update the grid select combobox if the grid size was changed
* by menu event.
*/
if( m_SelGridBox != NULL )
if( m_gridSelectBox != NULL )
{
for( size_t i = 0; i < m_SelGridBox->GetCount(); i++ )
for( size_t i = 0; i < m_gridSelectBox->GetCount(); i++ )
{
clientData = (int*) m_SelGridBox->wxItemContainer::GetClientData( i );
clientData = (int*) m_gridSelectBox->wxItemContainer::GetClientData( i );
if( clientData && id == *clientData )
{
m_SelGridBox->SetSelection( i );
m_gridSelectBox->SetSelection( i );
break;
}
}
@ -364,12 +361,12 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
void EDA_DRAW_FRAME::OnSelectZoom( wxCommandEvent& event )
{
if( m_SelZoomBox == NULL )
if( m_zoomSelectBox == NULL )
return; // Should not happen!
int id = m_SelZoomBox->GetCurrentSelection();
int id = m_zoomSelectBox->GetCurrentSelection();
if( id < 0 || !( id < (int)m_SelZoomBox->GetCount() ) )
if( id < 0 || !( id < (int)m_zoomSelectBox->GetCount() ) )
return;
if( id == 0 ) // Auto zoom (Fit in Page)
@ -839,7 +836,7 @@ void EDA_DRAW_FRAME::LoadSettings()
wxConfig* cfg = wxGetApp().m_EDA_Config;
EDA_BASE_FRAME::LoadSettings();
cfg->Read( m_FrameName + CursorShapeEntryKeyword, &m_CursorShape, ( long )0 );
cfg->Read( m_FrameName + CursorShapeEntryKeyword, &m_cursorShape, ( long )0 );
bool btmp;
if ( cfg->Read( m_FrameName + ShowGridEntryKeyword, &btmp ) )
@ -861,7 +858,7 @@ void EDA_DRAW_FRAME::SaveSettings()
wxConfig* cfg = wxGetApp().m_EDA_Config;
EDA_BASE_FRAME::SaveSettings();
cfg->Write( m_FrameName + CursorShapeEntryKeyword, m_CursorShape );
cfg->Write( m_FrameName + CursorShapeEntryKeyword, m_cursorShape );
cfg->Write( m_FrameName + ShowGridEntryKeyword, IsGridVisible() );
cfg->Write( m_FrameName + GridColorEntryKeyword, GetGridColor() );
cfg->Write( m_FrameName + LastGridSizeId, ( long ) m_LastGridSizeId );

View File

@ -150,7 +150,7 @@ void EDA_DRAW_PANEL::DrawCrossHair( wxDC* aDC, int aColor )
GRSetDrawMode( aDC, GR_XOR );
if( GetParent()->m_CursorShape == 1 ) /* Draws a crosshair. */
if( GetParent()->m_cursorShape != 0 ) /* Draws full screen crosshair. */
{
wxSize clientSize = GetClientSize();
wxPoint lineStart = wxPoint( Cursor.x, aDC->DeviceToLogicalY( 0 ) );
@ -535,7 +535,7 @@ void EDA_DRAW_PANEL::DrawBackGround( wxDC* DC )
DrawGrid( DC );
/* Draw axis */
if( GetParent()->m_Draw_Axis )
if( GetParent()->m_showAxis )
{
/* Draw the Y axis */
GRDashedLine( &m_ClipBox, DC, 0, -screen->ReturnPageSize().y,
@ -546,10 +546,10 @@ void EDA_DRAW_PANEL::DrawBackGround( wxDC* DC )
screen->ReturnPageSize().x, 0, 0, axis_color );
}
if( GetParent()->m_Draw_Auxiliary_Axis )
if( GetParent()->m_showOriginAxis )
DrawAuxiliaryAxis( DC, GR_COPY );
if( GetParent()->m_Draw_Grid_Axis )
if( GetParent()->m_showGridAxis )
DrawGridAxis( DC, GR_COPY );
}
@ -676,7 +676,7 @@ void EDA_DRAW_PANEL::DrawGrid( wxDC* aDC )
void EDA_DRAW_PANEL::DrawAuxiliaryAxis( wxDC* aDC, int aDrawMode )
{
if( GetParent()->m_Auxiliary_Axis_Position == wxPoint( 0, 0 ) )
if( GetParent()->m_originAxisPosition == wxPoint( 0, 0 ) )
return;
int Color = DARKRED;
@ -686,18 +686,18 @@ void EDA_DRAW_PANEL::DrawAuxiliaryAxis( wxDC* aDC, int aDrawMode )
/* Draw the Y axis */
GRDashedLine( &m_ClipBox, aDC,
GetParent()->m_Auxiliary_Axis_Position.x,
GetParent()->m_originAxisPosition.x,
-screen->ReturnPageSize().y,
GetParent()->m_Auxiliary_Axis_Position.x,
GetParent()->m_originAxisPosition.x,
screen->ReturnPageSize().y,
0, Color );
/* Draw the X axis */
GRDashedLine( &m_ClipBox, aDC,
-screen->ReturnPageSize().x,
GetParent()->m_Auxiliary_Axis_Position.y,
GetParent()->m_originAxisPosition.y,
screen->ReturnPageSize().x,
GetParent()->m_Auxiliary_Axis_Position.y,
GetParent()->m_originAxisPosition.y,
0, Color );
}
@ -706,7 +706,7 @@ void EDA_DRAW_PANEL::DrawGridAxis( wxDC* aDC, int aDrawMode )
{
BASE_SCREEN* screen = GetScreen();
if( !GetParent()->m_Draw_Grid_Axis
if( !GetParent()->m_showGridAxis
|| ( screen->m_GridOrigin.x == 0 && screen->m_GridOrigin.y == 0 ) )
return;

View File

@ -993,7 +993,7 @@ Ki_WorkSheetData WS_Segm5_LT =
*/
void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_width )
{
if( !m_Draw_Sheet_Ref )
if( !m_showBorderAndTitleBlock )
return;
Ki_PageDescr* Sheet = screen->m_CurrentSheetDesc;

View File

@ -79,7 +79,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father,
PCB_BASE_FRAME( father, CVPCB_DISPLAY_FRAME, title, pos, size, style )
{
m_FrameName = wxT( "CmpFrame" );
m_Draw_Axis = true; // true to draw axis.
m_showAxis = true; // true to draw axis.
// Give an icon
wxIcon icon;
@ -124,9 +124,9 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father,
m_auimgr.AddPane( m_HToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top(). Row( 0 ) );
if( m_VToolBar ) // Currently, no vertical right toolbar.
m_auimgr.AddPane( m_VToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_VToolBar" ) ).Right() );
if( m_drawToolBar ) // Currently, no vertical right toolbar.
m_auimgr.AddPane( m_drawToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_drawToolBar" ) ).Right() );
m_auimgr.AddPane( DrawPanel,
wxAuiPaneInfo().Name( wxT( "DisplayFrame" ) ).CentrePane() );
@ -134,8 +134,8 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father,
m_auimgr.AddPane( m_messagePanel,
wxAuiPaneInfo( mesg ).Name( wxT( "MsgPanel" ) ).Bottom().Layer(10) );
m_auimgr.AddPane( m_OptionsToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_OptionsToolBar" ) ).Left() );
m_auimgr.AddPane( m_optionsToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left() );
m_auimgr.Update();
@ -174,45 +174,45 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateVToolbar()
void DISPLAY_FOOTPRINTS_FRAME::ReCreateOptToolbar()
{
if( m_OptionsToolBar )
if( m_optionsToolBar )
return;
// Create options tool bar.
m_OptionsToolBar = new EDA_TOOLBAR( TOOLBAR_OPTION, this, ID_OPT_TOOLBAR, false );
m_optionsToolBar = new EDA_TOOLBAR( TOOLBAR_OPTION, this, ID_OPT_TOOLBAR, false );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
_( "Hide grid" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString,
KiBitmap( polar_coord_xpm ),
_( "Display polar coordinates" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
KiBitmap( unit_inch_xpm ),
_( "Units in inches" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
KiBitmap( unit_mm_xpm ),
_( "Units in millimeters" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
KiBitmap( cursor_shape_xpm ),
_( "Change cursor shape" ), wxITEM_CHECK );
m_OptionsToolBar->AddSeparator();
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH, wxEmptyString,
m_optionsToolBar->AddSeparator();
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH, wxEmptyString,
KiBitmap( pad_sketch_xpm ),
_( "Show pads in outline mode" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, wxEmptyString,
KiBitmap( text_sketch_xpm ),
_( "Show texts in line mode" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, wxEmptyString,
KiBitmap( show_mod_edge_xpm ),
_( "Show outlines in line mode" ), wxITEM_CHECK );
m_OptionsToolBar->Realize();
m_optionsToolBar->Realize();
}
@ -262,7 +262,7 @@ void DISPLAY_FOOTPRINTS_FRAME::OnUpdateTextDrawMode( wxUpdateUIEvent& aEvent )
i = 0;
aEvent.Check( m_DisplayModText == 0 );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, msgTextsFill[i] );
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, msgTextsFill[i] );
}
@ -279,7 +279,7 @@ void DISPLAY_FOOTPRINTS_FRAME::OnUpdateLineDrawMode( wxUpdateUIEvent& aEvent )
i = 0;
aEvent.Check( m_DisplayModEdge == 0 );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, msgEdgesFill[i] );
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, msgEdgesFill[i] );
}

View File

@ -194,7 +194,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent,
wxASSERT( aParent );
m_FrameName = wxT( "LibeditFrame" );
m_Draw_Axis = true; // true to draw axis
m_showAxis = true; // true to draw axis
m_configPath = wxT( "LibraryEditor" );
SetShowDeMorgan( false );
m_drawSpecificConvert = true;
@ -250,11 +250,11 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent,
m_auimgr.AddPane( m_HToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top().Row( 0 ) );
m_auimgr.AddPane( m_VToolBar,
m_auimgr.AddPane( m_drawToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_VToolBar" ) ).Right() );
m_auimgr.AddPane( m_OptionsToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_OptionsToolBar" ) ).Left() );
m_auimgr.AddPane( m_optionsToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left() );
m_auimgr.AddPane( DrawPanel,
wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
@ -450,7 +450,7 @@ void LIB_EDIT_FRAME::OnUpdateEditingPart( wxUpdateUIEvent& aEvent )
{
aEvent.Enable( m_component != NULL );
if( m_component != NULL && aEvent.GetEventObject() == m_VToolBar )
if( m_component != NULL && aEvent.GetEventObject() == m_drawToolBar )
aEvent.Check( GetToolId() == aEvent.GetId() );
}

View File

@ -550,7 +550,7 @@ void SCH_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
void SCH_EDIT_FRAME::OnUpdateSelectTool( wxUpdateUIEvent& aEvent )
{
if( aEvent.GetEventObject() == m_VToolBar )
if( aEvent.GetEventObject() == m_drawToolBar )
aEvent.Check( GetToolId() == aEvent.GetId() );
}

View File

@ -186,8 +186,8 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* father,
EDA_DRAW_FRAME( father, SCHEMATIC_FRAME, title, pos, size, style )
{
m_FrameName = wxT( "SchematicFrame" );
m_Draw_Axis = false; // true to show axis
m_Draw_Sheet_Ref = true; // true to show sheet references
m_showAxis = false; // true to show axis
m_showBorderAndTitleBlock = true; // true to show sheet references
m_CurrentSheet = new SCH_SHEET_PATH();
m_TextFieldSize = DEFAULT_SIZE_TEXT;
m_LibeditFrame = NULL; // Component editor frame.
@ -253,12 +253,12 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* father,
m_auimgr.AddPane( m_HToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top().Row( 0 ) );
if( m_VToolBar )
m_auimgr.AddPane( m_VToolBar, wxAuiPaneInfo( vert ).Name( wxT( "m_VToolBar" ) ).Right() );
if( m_drawToolBar )
m_auimgr.AddPane( m_drawToolBar, wxAuiPaneInfo( vert ).Name( wxT( "m_drawToolBar" ) ).Right() );
if( m_OptionsToolBar )
m_auimgr.AddPane( m_OptionsToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_OptionsToolBar" ) ).Left() );
if( m_optionsToolBar )
m_auimgr.AddPane( m_optionsToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left() );
if( DrawPanel )
m_auimgr.AddPane( DrawPanel, wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
@ -585,7 +585,7 @@ void SCH_EDIT_FRAME::OnUpdateBusOrientation( wxUpdateUIEvent& aEvent )
_( "Draw horizontal and vertical wires and buses only" );
aEvent.Check( g_HVLines );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_BUS_WIRES_ORIENT, tool_tip );
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_BUS_WIRES_ORIENT, tool_tip );
}
@ -595,7 +595,7 @@ void SCH_EDIT_FRAME::OnUpdateHiddenPins( wxUpdateUIEvent& aEvent )
_( "Show hidden pins" );
aEvent.Check( m_showAllPins );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_HIDDEN_PINS, tool_tip );
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_HIDDEN_PINS, tool_tip );
}

View File

@ -52,46 +52,46 @@ extern int CreateNewLibAndSavePartId;
void LIB_EDIT_FRAME::ReCreateVToolbar()
{
if( m_VToolBar != NULL )
if( m_drawToolBar != NULL )
return;
m_VToolBar = new EDA_TOOLBAR( TOOLBAR_TOOL, this, ID_V_TOOLBAR, false );
m_drawToolBar = new EDA_TOOLBAR( TOOLBAR_TOOL, this, ID_V_TOOLBAR, false );
// Set up toolbar
m_VToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ),
m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ),
_( "Deselect current tool" ), wxITEM_CHECK );
m_VToolBar->AddTool( ID_LIBEDIT_PIN_BUTT, wxEmptyString, KiBitmap( pin_xpm ),
m_drawToolBar->AddTool( ID_LIBEDIT_PIN_BUTT, wxEmptyString, KiBitmap( pin_xpm ),
HELP_ADD_PIN, wxITEM_CHECK );
m_VToolBar->AddTool( ID_LIBEDIT_BODY_TEXT_BUTT, wxEmptyString, KiBitmap( add_text_xpm ),
m_drawToolBar->AddTool( ID_LIBEDIT_BODY_TEXT_BUTT, wxEmptyString, KiBitmap( add_text_xpm ),
HELP_ADD_BODYTEXT, wxITEM_CHECK );
m_VToolBar->AddTool( ID_LIBEDIT_BODY_RECT_BUTT, wxEmptyString, KiBitmap( add_rectangle_xpm ),
m_drawToolBar->AddTool( ID_LIBEDIT_BODY_RECT_BUTT, wxEmptyString, KiBitmap( add_rectangle_xpm ),
HELP_ADD_BODYRECT, wxITEM_CHECK );
m_VToolBar->AddTool( ID_LIBEDIT_BODY_CIRCLE_BUTT, wxEmptyString, KiBitmap( add_circle_xpm ),
m_drawToolBar->AddTool( ID_LIBEDIT_BODY_CIRCLE_BUTT, wxEmptyString, KiBitmap( add_circle_xpm ),
HELP_ADD_BODYCIRCLE, wxITEM_CHECK );
m_VToolBar->AddTool( ID_LIBEDIT_BODY_ARC_BUTT, wxEmptyString, KiBitmap( add_arc_xpm ),
m_drawToolBar->AddTool( ID_LIBEDIT_BODY_ARC_BUTT, wxEmptyString, KiBitmap( add_arc_xpm ),
HELP_ADD_BODYARC, wxITEM_CHECK );
m_VToolBar->AddTool( ID_LIBEDIT_BODY_LINE_BUTT, wxEmptyString, KiBitmap( add_polygon_xpm ),
m_drawToolBar->AddTool( ID_LIBEDIT_BODY_LINE_BUTT, wxEmptyString, KiBitmap( add_polygon_xpm ),
HELP_ADD_BODYPOLYGON, wxITEM_CHECK );
m_VToolBar->AddTool( ID_LIBEDIT_ANCHOR_ITEM_BUTT, wxEmptyString, KiBitmap( anchor_xpm ),
m_drawToolBar->AddTool( ID_LIBEDIT_ANCHOR_ITEM_BUTT, wxEmptyString, KiBitmap( anchor_xpm ),
_( "Move part anchor" ), wxITEM_CHECK );
m_VToolBar->AddTool( ID_LIBEDIT_IMPORT_BODY_BUTT, wxEmptyString, KiBitmap( import_xpm ),
m_drawToolBar->AddTool( ID_LIBEDIT_IMPORT_BODY_BUTT, wxEmptyString, KiBitmap( import_xpm ),
_( "Import existing drawings" ), wxITEM_CHECK );
m_VToolBar->AddTool( ID_LIBEDIT_EXPORT_BODY_BUTT, wxEmptyString, KiBitmap( export_xpm ),
m_drawToolBar->AddTool( ID_LIBEDIT_EXPORT_BODY_BUTT, wxEmptyString, KiBitmap( export_xpm ),
_( "Export current drawing" ), wxITEM_CHECK );
m_VToolBar->AddTool( ID_LIBEDIT_DELETE_ITEM_BUTT, wxEmptyString, KiBitmap( delete_body_xpm ),
m_drawToolBar->AddTool( ID_LIBEDIT_DELETE_ITEM_BUTT, wxEmptyString, KiBitmap( delete_body_xpm ),
HELP_DELETE_ITEMS, wxITEM_CHECK );
m_VToolBar->Realize();
m_drawToolBar->Realize();
}
@ -143,7 +143,8 @@ void LIB_EDIT_FRAME::ReCreateHToolbar()
m_HToolBar->AddSeparator();
msg = AddHotkeyName( _( "Undo last command" ), s_Schematic_Hokeys_Descr, HK_UNDO, IS_COMMENT );
m_HToolBar->AddTool( wxID_UNDO, wxEmptyString, KiBitmap( undo_xpm ), msg );
msg = AddHotkeyName( _( "Redo the last command" ), s_Schematic_Hokeys_Descr, HK_REDO, IS_COMMENT );
msg = AddHotkeyName( _( "Redo the last command" ), s_Schematic_Hokeys_Descr, HK_REDO,
IS_COMMENT );
m_HToolBar->AddTool( wxID_REDO, wxEmptyString, KiBitmap( redo_xpm ), msg );
m_HToolBar->AddSeparator();
@ -209,24 +210,24 @@ void LIB_EDIT_FRAME::ReCreateHToolbar()
void LIB_EDIT_FRAME::CreateOptionToolbar()
{
if( m_OptionsToolBar )
if( m_optionsToolBar )
return;
m_OptionsToolBar = new EDA_TOOLBAR( TOOLBAR_OPTION, this, ID_OPT_TOOLBAR, false );
m_optionsToolBar = new EDA_TOOLBAR( TOOLBAR_OPTION, this, ID_OPT_TOOLBAR, false );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
_( "Turn grid off" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
KiBitmap( unit_inch_xpm ), _( "Units in inches" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
KiBitmap( unit_mm_xpm ),
_( "Units in millimeters" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
KiBitmap( cursor_shape_xpm ),
_( "Change cursor shape" ), wxITEM_CHECK );
m_OptionsToolBar->Realize();
m_optionsToolBar->Realize();
}

View File

@ -156,83 +156,85 @@ void SCH_EDIT_FRAME::ReCreateHToolbar()
*/
void SCH_EDIT_FRAME::ReCreateVToolbar()
{
if( m_VToolBar )
if( m_drawToolBar )
return;
m_VToolBar = new EDA_TOOLBAR( TOOLBAR_TOOL, this, ID_V_TOOLBAR, false );
m_drawToolBar = new EDA_TOOLBAR( TOOLBAR_TOOL, this, ID_V_TOOLBAR, false );
// Set up toolbar
m_VToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ),
m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ),
wxEmptyString, wxITEM_CHECK );
m_VToolBar->AddTool( ID_HIERARCHY_PUSH_POP_BUTT, wxEmptyString,
m_drawToolBar->AddTool( ID_HIERARCHY_PUSH_POP_BUTT, wxEmptyString,
KiBitmap( hierarchy_cursor_xpm ),
_( "Ascend or descend hierarchy" ), wxITEM_CHECK );
m_VToolBar->AddTool( ID_SCH_PLACE_COMPONENT, wxEmptyString, KiBitmap( add_component_xpm ),
m_drawToolBar->AddTool( ID_SCH_PLACE_COMPONENT, wxEmptyString, KiBitmap( add_component_xpm ),
HELP_PLACE_COMPONENTS, wxITEM_CHECK );
m_VToolBar->AddTool( ID_PLACE_POWER_BUTT, wxEmptyString, KiBitmap( add_power_xpm ),
m_drawToolBar->AddTool( ID_PLACE_POWER_BUTT, wxEmptyString, KiBitmap( add_power_xpm ),
HELP_PLACE_POWERPORT, wxITEM_CHECK );
m_VToolBar->AddTool( ID_WIRE_BUTT, wxEmptyString, KiBitmap( add_line_xpm ),
m_drawToolBar->AddTool( ID_WIRE_BUTT, wxEmptyString, KiBitmap( add_line_xpm ),
HELP_PLACE_WIRE, wxITEM_CHECK );
m_VToolBar->AddTool( ID_BUS_BUTT, wxEmptyString, KiBitmap( add_bus_xpm ),
m_drawToolBar->AddTool( ID_BUS_BUTT, wxEmptyString, KiBitmap( add_bus_xpm ),
HELP_PLACE_BUS, wxITEM_CHECK );
m_VToolBar->AddTool( ID_WIRETOBUS_ENTRY_BUTT, wxEmptyString, KiBitmap( add_line2bus_xpm ),
m_drawToolBar->AddTool( ID_WIRETOBUS_ENTRY_BUTT, wxEmptyString, KiBitmap( add_line2bus_xpm ),
HELP_PLACE_WIRE2BUS_ENTRY, wxITEM_CHECK );
m_VToolBar->AddTool( ID_BUSTOBUS_ENTRY_BUTT, wxEmptyString, KiBitmap( add_bus2bus_xpm ),
m_drawToolBar->AddTool( ID_BUSTOBUS_ENTRY_BUTT, wxEmptyString, KiBitmap( add_bus2bus_xpm ),
HELP_PLACE_BUS2BUS_ENTRY, wxITEM_CHECK );
m_VToolBar->AddTool( ID_NOCONN_BUTT, wxEmptyString, KiBitmap( noconn_xpm ),
m_drawToolBar->AddTool( ID_NOCONN_BUTT, wxEmptyString, KiBitmap( noconn_xpm ),
HELP_PLACE_NC_FLAG, wxITEM_CHECK );
m_VToolBar->AddTool( ID_LABEL_BUTT, wxEmptyString, KiBitmap( add_line_label_xpm ),
m_drawToolBar->AddTool( ID_LABEL_BUTT, wxEmptyString, KiBitmap( add_line_label_xpm ),
HELP_PLACE_NETLABEL, wxITEM_CHECK );
m_VToolBar->AddTool( ID_GLABEL_BUTT, wxEmptyString, KiBitmap( add_glabel_xpm ),
m_drawToolBar->AddTool( ID_GLABEL_BUTT, wxEmptyString, KiBitmap( add_glabel_xpm ),
HELP_PLACE_GLOBALLABEL, wxITEM_CHECK );
m_VToolBar->AddTool( ID_JUNCTION_BUTT, wxEmptyString, KiBitmap( add_junction_xpm ),
m_drawToolBar->AddTool( ID_JUNCTION_BUTT, wxEmptyString, KiBitmap( add_junction_xpm ),
HELP_PLACE_JUNCTION, wxITEM_CHECK );
m_VToolBar->AddTool( ID_HIERLABEL_BUTT, wxEmptyString, KiBitmap( add_hierarchical_label_xpm ),
m_drawToolBar->AddTool( ID_HIERLABEL_BUTT, wxEmptyString,
KiBitmap( add_hierarchical_label_xpm ),
HELP_PLACE_HIER_LABEL, wxITEM_CHECK );
m_VToolBar->AddTool( ID_SHEET_SYMBOL_BUTT, wxEmptyString,
m_drawToolBar->AddTool( ID_SHEET_SYMBOL_BUTT, wxEmptyString,
KiBitmap( add_hierarchical_subsheet_xpm ),
HELP_PLACE_SHEET, wxITEM_CHECK );
m_VToolBar->AddTool( ID_IMPORT_HLABEL_BUTT, wxEmptyString,
m_drawToolBar->AddTool( ID_IMPORT_HLABEL_BUTT, wxEmptyString,
KiBitmap( import_hierarchical_label_xpm ),
HELP_IMPORT_SHEETPIN, wxITEM_CHECK );
m_VToolBar->AddTool( ID_SHEET_PIN_BUTT, wxEmptyString,
m_drawToolBar->AddTool( ID_SHEET_PIN_BUTT, wxEmptyString,
KiBitmap( add_hierar_pin_xpm ),
HELP_PLACE_SHEETPIN, wxITEM_CHECK );
m_VToolBar->AddTool( ID_LINE_COMMENT_BUTT, wxEmptyString,
m_drawToolBar->AddTool( ID_LINE_COMMENT_BUTT, wxEmptyString,
KiBitmap( add_dashed_line_xpm ),
HELP_PLACE_GRAPHICLINES, wxITEM_CHECK );
m_VToolBar->AddTool( ID_TEXT_COMMENT_BUTT, wxEmptyString, KiBitmap( add_text_xpm ),
m_drawToolBar->AddTool( ID_TEXT_COMMENT_BUTT, wxEmptyString, KiBitmap( add_text_xpm ),
HELP_PLACE_GRAPHICTEXTS, wxITEM_CHECK );
m_VToolBar->AddTool( ID_ADD_IMAGE_BUTT, wxEmptyString, KiBitmap( image_xpm ),
m_drawToolBar->AddTool( ID_ADD_IMAGE_BUTT, wxEmptyString, KiBitmap( image_xpm ),
_("Add a bitmap image"), wxITEM_CHECK );
m_VToolBar->AddTool( ID_SCHEMATIC_DELETE_ITEM_BUTT, wxEmptyString, KiBitmap( delete_body_xpm ),
m_drawToolBar->AddTool( ID_SCHEMATIC_DELETE_ITEM_BUTT, wxEmptyString,
KiBitmap( delete_body_xpm ),
HELP_DELETE_ITEMS, wxITEM_CHECK );
// set icon paddings
m_VToolBar->SetToolBorderPadding(2); // padding
m_VToolBar->SetToolSeparation(0);
//m_VToolBar->SetMargins(1,0); // margins width and height
m_drawToolBar->SetToolBorderPadding(2); // padding
m_drawToolBar->SetToolSeparation(0);
//m_drawToolBar->SetMargins(1,0); // margins width and height
m_VToolBar->Realize();
m_drawToolBar->Realize();
}
@ -240,43 +242,43 @@ void SCH_EDIT_FRAME::ReCreateVToolbar()
*/
void SCH_EDIT_FRAME::ReCreateOptToolbar()
{
if( m_OptionsToolBar )
if( m_optionsToolBar )
return;
m_OptionsToolBar = new EDA_TOOLBAR( TOOLBAR_OPTION, this, ID_OPT_TOOLBAR, false );
m_optionsToolBar = new EDA_TOOLBAR( TOOLBAR_OPTION, this, ID_OPT_TOOLBAR, false );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString,
KiBitmap( grid_xpm ),
_( "Turn grid off" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
KiBitmap( unit_inch_xpm ),
_( "Units in inches" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
KiBitmap( unit_mm_xpm ),
_( "Units in millimeters" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
KiBitmap( cursor_shape_xpm ),
_( "Change cursor shape" ), wxITEM_CHECK );
//m_OptionsToolBar->AddSeparator();
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_HIDDEN_PINS, wxEmptyString,
//m_optionsToolBar->AddSeparator();
m_optionsToolBar->AddTool( ID_TB_OPTIONS_HIDDEN_PINS, wxEmptyString,
KiBitmap( hidden_pin_xpm ),
_( "Show hidden pins" ), wxITEM_CHECK );
//m_OptionsToolBar->AddSeparator();
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_BUS_WIRES_ORIENT, wxEmptyString,
//m_optionsToolBar->AddSeparator();
m_optionsToolBar->AddTool( ID_TB_OPTIONS_BUS_WIRES_ORIENT, wxEmptyString,
KiBitmap( lines90_xpm ),
_( "HV orientation for wires and bus" ),
wxITEM_CHECK );
// set icon paddings
m_OptionsToolBar->SetToolBorderPadding(2); // padding
m_OptionsToolBar->SetToolSeparation(0);
//m_OptionsToolBar->SetMargins(4,0); // margins width and height
m_optionsToolBar->SetToolBorderPadding(2); // padding
m_optionsToolBar->SetToolSeparation(0);
//m_optionsToolBar->SetMargins(4,0); // margins width and height
m_OptionsToolBar->Realize();
m_optionsToolBar->Realize();
}
@ -290,12 +292,12 @@ void SCH_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
switch( id )
{
case ID_TB_OPTIONS_HIDDEN_PINS:
m_showAllPins = m_OptionsToolBar->GetToolState( id );
m_showAllPins = m_optionsToolBar->GetToolState( id );
DrawPanel->Refresh( );
break;
case ID_TB_OPTIONS_BUS_WIRES_ORIENT:
g_HVLines = m_OptionsToolBar->GetToolState( id );
g_HVLines = m_optionsToolBar->GetToolState( id );
break;
default:

View File

@ -40,7 +40,8 @@ DIALOG_PAGE_SHOW_PAGE_BORDERS::DIALOG_PAGE_SHOW_PAGE_BORDERS( GERBVIEW_FRAME *pa
SetFocus();
m_ShowPageLimits->SetSelection(0);
if( m_Parent->m_Draw_Sheet_Ref )
if( m_Parent->GetShowBorderAndTitleBlock() )
{
for( int ii = 1; g_GerberPageSizeList[ii] != NULL; ii++ )
{
@ -67,16 +68,12 @@ void DIALOG_PAGE_SHOW_PAGE_BORDERS::OnCancelButtonClick( wxCommandEvent& event )
void DIALOG_PAGE_SHOW_PAGE_BORDERS::OnOKBUttonClick( wxCommandEvent& event )
{
m_Parent->m_DisplayPadFill = m_Parent->m_DisplayViaFill =
DisplayOpt.DisplayViaFill;
m_Parent->m_DisplayPadFill = m_Parent->m_DisplayViaFill = DisplayOpt.DisplayViaFill;
m_Parent->m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill;
int idx = m_ShowPageLimits->GetSelection();
if( idx > 0 )
m_Parent->m_Draw_Sheet_Ref = true;
else
m_Parent->m_Draw_Sheet_Ref = false;
m_Parent->SetShowBorderAndTitleBlock( (idx > 0) ? true : false );
m_Parent->GetScreen()->m_CurrentSheetDesc = g_GerberPageSizeList[idx];
EndModal( wxID_OK );

View File

@ -65,7 +65,7 @@ void DIALOG_DISPLAY_OPTIONS::initOptDialog( )
m_PolarDisplay->SetSelection( DisplayOpt.DisplayPolarCood ? 1 : 0 );
m_BoxUnits->SetSelection( g_UserUnit ? 1 : 0 );
m_CursorShape->SetSelection( m_Parent->m_CursorShape ? 1 : 0 );
m_CursorShape->SetSelection( m_Parent->GetCursorShape() ? 1 : 0 );
// Show Option Draw Lines. We use DisplayPcbTrackFill as Lines draw option
m_OptDisplayLines->SetSelection( DisplayOpt.DisplayPcbTrackFill ? 1 : 0 );
@ -74,7 +74,8 @@ void DIALOG_DISPLAY_OPTIONS::initOptDialog( )
m_OptDisplayPolygons->SetSelection( g_DisplayPolygonsModeSketch ? 0 : 1 );
m_ShowPageLimits->SetSelection(0);
if( m_Parent->m_Draw_Sheet_Ref )
if( m_Parent->GetShowBorderAndTitleBlock() )
{
for( int ii = 1; g_GerberPageSizeList[ii] != NULL; ii++ )
{
@ -92,14 +93,14 @@ void DIALOG_DISPLAY_OPTIONS::initOptDialog( )
void DIALOG_DISPLAY_OPTIONS::OnOKBUttonClick( wxCommandEvent& event )
{
DisplayOpt.DisplayPolarCood =
(m_PolarDisplay->GetSelection() == 0) ? FALSE : TRUE;
(m_PolarDisplay->GetSelection() == 0) ? false : true;
g_UserUnit = (m_BoxUnits->GetSelection() == 0) ? INCHES : MILLIMETRES;
m_Parent->m_CursorShape = m_CursorShape->GetSelection();
m_Parent->SetCursorShape( m_CursorShape->GetSelection() );
if( m_OptDisplayLines->GetSelection() == 1 )
DisplayOpt.DisplayPcbTrackFill = TRUE;
DisplayOpt.DisplayPcbTrackFill = true;
else
DisplayOpt.DisplayPcbTrackFill = FALSE;
DisplayOpt.DisplayPcbTrackFill = false;
if( m_OptDisplayFlashedItems->GetSelection() == 1 )
{
@ -120,16 +121,12 @@ void DIALOG_DISPLAY_OPTIONS::OnOKBUttonClick( wxCommandEvent& event )
m_Parent->SetElementVisibility( DCODES_VISIBLE, m_OptDisplayDCodes->GetValue() );
m_Parent->m_DisplayPadFill = m_Parent->m_DisplayViaFill =
DisplayOpt.DisplayViaFill;
m_Parent->m_DisplayPadFill = m_Parent->m_DisplayViaFill = DisplayOpt.DisplayViaFill;
m_Parent->m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill;
int idx = m_ShowPageLimits->GetSelection();
if( idx > 0 )
m_Parent->m_Draw_Sheet_Ref = true;
else
m_Parent->m_Draw_Sheet_Ref = false;
m_Parent->SetShowBorderAndTitleBlock( ( idx > 0 ) ? true : false );
m_Parent->GetScreen()->m_CurrentSheetDesc = g_GerberPageSizeList[idx];
EndModal( 1 );

View File

@ -67,8 +67,8 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( wxWindow* father,
m_FrameName = wxT( "GerberFrame" );
m_show_layer_manager_tools = true;
m_Draw_Axis = true; // true to show X and Y axis on screen
m_Draw_Sheet_Ref = false; // true for reference drawings.
m_showAxis = true; // true to show X and Y axis on screen
m_showBorderAndTitleBlock = false; // true for reference drawings.
m_HotkeysZoomAndGridList = s_Gerbview_Hokeys_Descr;
m_SelLayerBox = NULL;
m_DCodeSelector = NULL;
@ -132,16 +132,16 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( wxWindow* father,
m_auimgr.AddPane( m_HToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top().Row( 0 ) );
if( m_VToolBar )
m_auimgr.AddPane( m_VToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_VToolBar" ) ).Right().Row( 1 ) );
if( m_drawToolBar )
m_auimgr.AddPane( m_drawToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_drawToolBar" ) ).Right().Row( 1 ) );
m_auimgr.AddPane( m_LayersManager,
lyrs.Name( wxT( "m_LayersManagerToolBar" ) ).Right().Layer( 0 ) );
if( m_OptionsToolBar )
m_auimgr.AddPane( m_OptionsToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_OptionsToolBar" ) ).Left() );
if( m_optionsToolBar )
m_auimgr.AddPane( m_optionsToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left() );
if( DrawPanel )
m_auimgr.AddPane( DrawPanel,
@ -223,7 +223,7 @@ void GERBVIEW_FRAME::LoadSettings()
if( pageSize_opt > 0 )
{
m_Draw_Sheet_Ref = true;
m_showBorderAndTitleBlock = true;
}
long tmp;
@ -256,7 +256,7 @@ void GERBVIEW_FRAME::SaveSettings()
long pageSize_opt = 0;
if( m_Draw_Sheet_Ref )
if( m_showBorderAndTitleBlock )
{
for( int ii = 1; g_GerberPageSizeList[ii] != NULL; ii++ )
{

View File

@ -28,7 +28,7 @@ void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
break;
default:
state = m_OptionsToolBar->GetToolState( id );
state = m_optionsToolBar->GetToolState( id );
break;
}

View File

@ -126,92 +126,92 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void )
void GERBVIEW_FRAME::ReCreateVToolbar( void )
{
if( m_VToolBar )
if( m_drawToolBar )
return;
m_VToolBar = new EDA_TOOLBAR( TOOLBAR_TOOL, this, ID_V_TOOLBAR, FALSE );
m_drawToolBar = new EDA_TOOLBAR( TOOLBAR_TOOL, this, ID_V_TOOLBAR, FALSE );
// Set up toolbar
m_VToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ) );
m_VToolBar->AddSeparator();
m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ) );
m_drawToolBar->AddSeparator();
m_VToolBar->Realize();
m_drawToolBar->Realize();
}
void GERBVIEW_FRAME::ReCreateOptToolbar( void )
{
if( m_OptionsToolBar )
if( m_optionsToolBar )
return;
// creation of tool bar options
m_OptionsToolBar = new EDA_TOOLBAR( TOOLBAR_OPTION, this, ID_OPT_TOOLBAR, FALSE );
m_optionsToolBar = new EDA_TOOLBAR( TOOLBAR_OPTION, this, ID_OPT_TOOLBAR, FALSE );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
_( "Turn grid off" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString,
KiBitmap( polar_coord_xpm ),
_( "Turn polar coordinate on" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
KiBitmap( unit_inch_xpm ),
_( "Set units to inches" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
KiBitmap( unit_mm_xpm ),
_( "Set units to millimeters" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
KiBitmap( cursor_shape_xpm ),
_( "Change cursor shape" ), wxITEM_CHECK );
m_OptionsToolBar->AddSeparator();
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_FLASHED_ITEMS_SKETCH, wxEmptyString,
m_optionsToolBar->AddSeparator();
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_FLASHED_ITEMS_SKETCH, wxEmptyString,
KiBitmap( pad_sketch_xpm ),
_( "Show spots in sketch mode" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_LINES_SKETCH, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_LINES_SKETCH, wxEmptyString,
KiBitmap( showtrack_xpm ),
_( "Show lines in sketch mode" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH, wxEmptyString,
KiBitmap( opt_show_polygon_xpm ),
_( "Show polygons in sketch mode" ),
wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_DCODES, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_DCODES, wxEmptyString,
KiBitmap( show_dcodenumber_xpm ),
_( "Show dcode number" ), wxITEM_CHECK );
// tools to select draw mode in GerbView
m_OptionsToolBar->AddSeparator();
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_0, wxEmptyString,
m_optionsToolBar->AddSeparator();
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_0, wxEmptyString,
KiBitmap( gbr_select_mode0_xpm ),
_( "Show layers in raw mode \
(could have problems with negative items when more than one gerber file is shown)" ),
wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_1, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_1, wxEmptyString,
KiBitmap( gbr_select_mode1_xpm ),
_( "Show layers in stacked mode \
(show negative items without artifacts, sometimes slow)" ),
wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_2, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_2, wxEmptyString,
KiBitmap( gbr_select_mode2_xpm ),
_( "Show layers in transparency mode \
(show negative items without artifacts, sometimes slow)" ),
wxITEM_CHECK );
// Tools to show/hide toolbars:
m_OptionsToolBar->AddSeparator();
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR,
m_optionsToolBar->AddSeparator();
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR,
wxEmptyString,
KiBitmap( layers_manager_xpm ),
_( "Show/hide the layers manager toolbar" ),
wxITEM_CHECK );
m_OptionsToolBar->Realize();
m_optionsToolBar->Realize();
}
@ -265,12 +265,12 @@ void GERBVIEW_FRAME::OnUpdateShowLayerManager( wxUpdateUIEvent& aEvent )
{
aEvent.Check( m_show_layer_manager_tools );
if( m_OptionsToolBar )
if( m_optionsToolBar )
{
if( m_show_layer_manager_tools )
m_OptionsToolBar->SetToolShortHelp( aEvent.GetId(), _("Hide layers manager" ) );
m_optionsToolBar->SetToolShortHelp( aEvent.GetId(), _("Hide layers manager" ) );
else
m_OptionsToolBar->SetToolShortHelp( aEvent.GetId(), _("Show layers manager" ) );
m_optionsToolBar->SetToolShortHelp( aEvent.GetId(), _("Show layers manager" ) );
}
}

View File

@ -84,13 +84,14 @@ protected:
BOARD* m_Pcb;
GENERAL_COLLECTOR* m_Collector;
/// Auxiliary tool bar typically shown below the main tool bar at the top of the
/// main window.
EDA_TOOLBAR* m_auxiliaryToolBar;
void updateGridSelectBox();
void updateZoomSelectBox();
virtual void unitsChangeRefresh();
public:
PCB_BASE_FRAME( wxWindow* father, int idtype, const wxString& title,
const wxPoint& pos, const wxSize& size,

View File

@ -82,6 +82,9 @@ class PCB_EDIT_FRAME : public PCB_BASE_FRAME
int m_RecordingMacros;
MACROS_RECORDED m_Macros[10];
/// The auxiliary right vertical tool bar used to access the microwave tools.
EDA_TOOLBAR* m_microWaveToolBar;
protected:
PCB_LAYER_WIDGET* m_Layers;

View File

@ -376,19 +376,6 @@ class EDA_DRAW_FRAME : public EDA_BASE_FRAME
public:
EDA_DRAW_PANEL* DrawPanel; // Draw area
EDA_TOOLBAR* m_VToolBar; // Vertical (right side) Toolbar
EDA_TOOLBAR* m_AuxVToolBar; // Auxiliary Vertical (right side)
// Toolbar
EDA_TOOLBAR* m_OptionsToolBar; // Options Toolbar (left side)
EDA_TOOLBAR* m_AuxiliaryToolBar; // Auxiliary Toolbar used in Pcbnew
wxComboBox* m_SelGridBox; // Choice box to choose the grid size
wxComboBox* m_SelZoomBox; // Choice box to choose the zoom value
int m_CursorShape; // shape for cursor (0 = default
// cursor)
int m_ID_last_state; // Id of previous active button
// on the vertical toolbar
int m_HTOOL_current_state; // Id of active button on
// horizontal toolbar
@ -396,18 +383,7 @@ public:
// = 1000 for Eeschema, = 10000
// for Pcbnew and GerbView
bool m_Draw_Axis; // true to show X and Y axis
bool m_Draw_Grid_Axis; // true to show grid axis.
bool m_Draw_Sheet_Ref; // true to show frame references
bool m_Print_Sheet_Ref; // true to print frame references
bool m_Draw_Auxiliary_Axis; /* true to show auxiliary axis.
* Used in Pcbnew: the auxiliary
* axis is the origin of
* coordinates for drill, gerber
* and component position files
*/
wxPoint m_Auxiliary_Axis_Position; // position of the auxiliary axis
protected:
EDA_HOTKEY_CONFIG* m_HotkeysZoomAndGridList;
@ -415,9 +391,50 @@ protected:
bool m_DrawGrid; // hide/Show grid
int m_GridColor; // Grid color
/// Tool ID of previously active draw tool bar button.
int m_lastDrawToolId;
// on the vertical toolbar
/// The shape of the KiCad cursor. The default value (0) is the normal cross
/// hair cursor. Set to non-zero value to draw the full screen cursor.
/// @note This is not the system mouse cursor.
int m_cursorShape;
/// True shows the X and Y axis indicators.
bool m_showAxis;
/// True shows the grid axis indicators.
bool m_showGridAxis;
/// True shows the origin axis used to indicate the coordinate offset for
/// drill, gerber, and component position files.
bool m_showOriginAxis;
/// Position of the origin axis.
wxPoint m_originAxisPosition;
/// True shows the drawing border and title block.
bool m_showBorderAndTitleBlock;
/// Choice box to choose the grid size.
wxComboBox* m_gridSelectBox;
/// Choice box to choose the zoom value.
wxComboBox* m_zoomSelectBox;
/// The tool bar that contains the buttons for quick access to the application draw
/// tools. It typically is located on the right side of the main window.
EDA_TOOLBAR* m_drawToolBar;
/// The options tool bar typcially located on the left edge of the main window.
EDA_TOOLBAR* m_optionsToolBar;
/// Panel used to display information at the bottom of the main window.
EDA_MSG_PANEL* m_messagePanel;
/// Let the #EDA_DRAW_PANEL object have access to the protected data since
/// it is closely tied to the #EDA_DRAW_FRAME.
friend class EDA_DRAW_PANEL;
private:
BASE_SCREEN* m_currentScreen; ///< current used SCREEN
bool m_snapToGrid; ///< Indicates if cursor should be snapped to grid.
@ -444,6 +461,18 @@ public:
~EDA_DRAW_FRAME();
wxPoint GetOriginAxisPosition() const { return m_originAxisPosition; }
void SetOriginAxisPosition( const wxPoint& aPosition ) { m_originAxisPosition = aPosition; }
int GetCursorShape() const { return m_cursorShape; }
void SetCursorShape( int aCursorShape ) { m_cursorShape = aCursorShape; }
bool GetShowBorderAndTitleBlock() const { return m_showBorderAndTitleBlock; }
void SetShowBorderAndTitleBlock( bool aShow ) { m_showBorderAndTitleBlock = aShow; }
virtual wxString GetScreenDesc();
/**

View File

@ -104,6 +104,8 @@ PCB_BASE_FRAME::PCB_BASE_FRAME( wxWindow* father,
m_FastGrid1 = 0;
m_FastGrid2 = 0;
m_auxiliaryToolBar = NULL;
}
@ -132,7 +134,7 @@ EDA_RECT PCB_BASE_FRAME::GetBoardBoundingBox( bool aBoardEdgesOnly ) const
if( area.GetWidth() == 0 && area.GetHeight() == 0 )
{
if( m_Draw_Sheet_Ref )
if( m_showBorderAndTitleBlock )
{
area.SetOrigin( 0, 0 );
area.SetEnd( GetScreen()->ReturnPageSize().x,
@ -298,7 +300,7 @@ void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent )
void PCB_BASE_FRAME::OnUpdateCoordType( wxUpdateUIEvent& aEvent )
{
aEvent.Check( DisplayOpt.DisplayPolarCood );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_POLAR_COORD,
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_POLAR_COORD,
DisplayOpt.DisplayPolarCood ?
_( "Display rectangular coordinates" ) :
_( "Display polar coordinates" ) );
@ -308,7 +310,7 @@ void PCB_BASE_FRAME::OnUpdateCoordType( wxUpdateUIEvent& aEvent )
void PCB_BASE_FRAME::OnUpdatePadDrawMode( wxUpdateUIEvent& aEvent )
{
aEvent.Check( !m_DisplayPadFill );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_PADS_SKETCH,
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_PADS_SKETCH,
m_DisplayPadFill ?
_( "Show pads in outline mode" ) :
_( "Show pads in fill mode" ) );
@ -319,7 +321,7 @@ void PCB_BASE_FRAME::OnUpdateSelectGrid( wxUpdateUIEvent& aEvent )
{
// No need to update the grid select box if it doesn't exist or the grid setting change
// was made using the select box.
if( m_SelGridBox == NULL || m_AuxiliaryToolBar == NULL )
if( m_gridSelectBox == NULL || m_auxiliaryToolBar == NULL )
return;
int select = wxNOT_FOUND;
@ -333,14 +335,14 @@ void PCB_BASE_FRAME::OnUpdateSelectGrid( wxUpdateUIEvent& aEvent )
}
}
if( select != m_SelGridBox->GetSelection() )
m_SelGridBox->SetSelection( select );
if( select != m_gridSelectBox->GetSelection() )
m_gridSelectBox->SetSelection( select );
}
void PCB_BASE_FRAME::OnUpdateSelectZoom( wxUpdateUIEvent& aEvent )
{
if( m_SelZoomBox == NULL || m_AuxiliaryToolBar == NULL )
if( m_zoomSelectBox == NULL || m_auxiliaryToolBar == NULL )
return;
int current = 0;
@ -354,8 +356,8 @@ void PCB_BASE_FRAME::OnUpdateSelectZoom( wxUpdateUIEvent& aEvent )
}
}
if( current != m_SelZoomBox->GetSelection() )
m_SelZoomBox->SetSelection( current );
if( current != m_zoomSelectBox->GetSelection() )
m_zoomSelectBox->SetSelection( current );
}
@ -593,11 +595,11 @@ void PCB_BASE_FRAME::updateGridSelectBox()
UpdateStatusBar();
DisplayUnitsMsg();
if( m_SelGridBox == NULL )
if( m_gridSelectBox == NULL )
return;
// Update grid values with the current units setting.
m_SelGridBox->Clear();
m_gridSelectBox->Clear();
wxString msg;
wxString format = _( "Grid");
@ -639,24 +641,24 @@ void PCB_BASE_FRAME::updateGridSelectBox()
else
msg = _( "User Grid" );
m_SelGridBox->Append( msg, (void*) &grid.m_Id );
m_gridSelectBox->Append( msg, (void*) &grid.m_Id );
if( ( m_LastGridSizeId + ID_POPUP_GRID_LEVEL_1000 ) == GetScreen()->GetGrid( i ).m_Id )
m_SelGridBox->SetSelection( i );
m_gridSelectBox->SetSelection( i );
}
}
void PCB_BASE_FRAME::updateZoomSelectBox()
{
if( m_SelZoomBox == NULL )
if( m_zoomSelectBox == NULL )
return;
wxString msg;
m_SelZoomBox->Clear();
m_SelZoomBox->Append( _( "Auto" ) );
m_SelZoomBox->SetSelection( 0 );
m_zoomSelectBox->Clear();
m_zoomSelectBox->Append( _( "Auto" ) );
m_zoomSelectBox->SetSelection( 0 );
for( int i = 0; i < (int)GetScreen()->m_ZoomList.GetCount(); i++ )
{
@ -666,9 +668,9 @@ void PCB_BASE_FRAME::updateZoomSelectBox()
value.Printf( wxT( "%g" ), GetScreen()->m_ZoomList[i]);
msg += value;
m_SelZoomBox->Append( msg );
m_zoomSelectBox->Append( msg );
if( GetScreen()->GetZoom() == GetScreen()->m_ZoomList[i] )
m_SelZoomBox->SetSelection( i + 1 );
m_zoomSelectBox->SetSelection( i + 1 );
}
}

View File

@ -340,7 +340,7 @@ void DIALOG_GENDRILL::SetParams( void )
if( m_Choice_Drill_Offset->GetSelection() == 0 )
m_FileDrillOffset = wxPoint( 0, 0 );
else
m_FileDrillOffset = m_Parent->m_Auxiliary_Axis_Position;
m_FileDrillOffset = m_Parent->GetOriginAxisPosition();
// get precision
int idx = m_Choice_Precision->GetSelection();

View File

@ -64,7 +64,7 @@ void Dialog_GeneralOptions::init()
/* Set display options */
m_PolarDisplay->SetSelection( DisplayOpt.DisplayPolarCood ? 1 : 0 );
m_UnitsSelection->SetSelection( g_UserUnit ? 1 : 0 );
m_CursorShape->SetSelection( GetParent()->m_CursorShape ? 1 : 0 );
m_CursorShape->SetSelection( GetParent()->GetCursorShape() ? 1 : 0 );
switch( g_RotationAngle )
@ -107,15 +107,14 @@ void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event )
{
EDA_UNITS_T ii;
DisplayOpt.DisplayPolarCood =
( m_PolarDisplay->GetSelection() == 0 ) ? false : true;
DisplayOpt.DisplayPolarCood = ( m_PolarDisplay->GetSelection() == 0 ) ? false : true;
ii = g_UserUnit;
g_UserUnit = ( m_UnitsSelection->GetSelection() == 0 ) ? INCHES : MILLIMETRES;
if( ii != g_UserUnit )
GetParent()->ReCreateAuxiliaryToolbar();
GetParent()->m_CursorShape = m_CursorShape->GetSelection();
GetParent()->SetCursorShape( m_CursorShape->GetSelection() );
GetParent()->SetAutoSaveInterval( m_SaveTime->GetValue() * 60 );
g_RotationAngle = 10 * wxAtoi( m_RotationAngle->GetStringSelection() );
@ -150,7 +149,7 @@ void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event )
void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
{
int id = event.GetId();
bool state = m_OptionsToolBar->GetToolState( id );
bool state = m_optionsToolBar->GetToolState( id );
switch( id )
{
@ -218,7 +217,7 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
case ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR_MICROWAVE:
m_show_microwave_tools = state;
m_auimgr.GetPane( wxT( "m_AuxVToolBar" ) ).Show( m_show_microwave_tools );
m_auimgr.GetPane( wxT( "m_microWaveToolBar" ) ).Show( m_show_microwave_tools );
m_auimgr.Update();
break;

View File

@ -169,8 +169,8 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
if( GetToolId() != id )
{
if( m_ID_last_state != GetToolId() )
m_ID_last_state = GetToolId();
if( m_lastDrawToolId != GetToolId() )
m_lastDrawToolId = GetToolId();
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString );
}

View File

@ -145,8 +145,8 @@ void PCB_EDIT_FRAME::ExportToGenCAD( wxCommandEvent& aEvent )
GetBoard()->ComputeBoundingBox();
// Save the auxiliary origin for the rest of the module
GencadOffsetX = m_Auxiliary_Axis_Position.x;
GencadOffsetY = m_Auxiliary_Axis_Position.y;
GencadOffsetX = m_originAxisPosition.x;
GencadOffsetY = m_originAxisPosition.y;
// No idea on *why* this should be needed... maybe to fix net names?
Compile_Ratsnest( NULL, true );
@ -705,8 +705,8 @@ static bool CreateHeaderInfoData( FILE* aFile, PCB_EDIT_FRAME* aFrame )
fputs( TO_UTF8( msg ), aFile );
fputs( "UNITS INCH\n", aFile );
msg.Printf( wxT( "ORIGIN %g %g\n" ),
MapXTo( aFrame->m_Auxiliary_Axis_Position.x ),
MapYTo( aFrame->m_Auxiliary_Axis_Position.y ) );
MapXTo( aFrame->GetOriginAxisPosition().x ),
MapYTo( aFrame->GetOriginAxisPosition().y ) );
fputs( TO_UTF8( msg ), aFile );
fputs( "INTERTRACK 0\n", aFile );
fputs( "$ENDHEADER\n\n", aFile );

View File

@ -93,7 +93,7 @@ void PCB_EDIT_FRAME::GenModulesPosition( wxCommandEvent& event )
FILE* fpBack = 0;
bool switchedLocale = false;
File_Place_Offset = m_Auxiliary_Axis_Position;
File_Place_Offset = m_originAxisPosition;
/* Calculating the number of useful modules (CMS attribute, not VIRTUAL) */
int moduleCount = 0;

View File

@ -249,9 +249,9 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
break;
case HK_SWITCH_GRID_TO_FASTGRID1:
if( m_SelGridBox )
if( m_gridSelectBox )
{
m_SelGridBox->SetSelection( m_FastGrid1 );
m_gridSelectBox->SetSelection( m_FastGrid1 );
cmd.SetEventType( wxEVT_COMMAND_COMBOBOX_SELECTED );
OnSelectGrid( cmd );
}
@ -259,9 +259,9 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
break;
case HK_SWITCH_GRID_TO_FASTGRID2:
if( m_SelGridBox )
if( m_gridSelectBox )
{
m_SelGridBox->SetSelection( m_FastGrid2 );
m_gridSelectBox->SetSelection( m_FastGrid2 );
cmd.SetEventType( wxEVT_COMMAND_COMBOBOX_SELECTED );
OnSelectGrid( cmd );
}
@ -269,10 +269,10 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
break;
case HK_SWITCH_GRID_TO_NEXT:
if( m_SelGridBox )
if( m_gridSelectBox )
{
m_SelGridBox->SetSelection( ( m_SelGridBox->GetSelection() + 1 ) %
m_SelGridBox->GetCount() );
m_gridSelectBox->SetSelection( ( m_gridSelectBox->GetSelection() + 1 ) %
m_gridSelectBox->GetCount() );
cmd.SetEventType( wxEVT_COMMAND_COMBOBOX_SELECTED );
OnSelectGrid( cmd );
}
@ -280,16 +280,16 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
break;
case HK_SWITCH_GRID_TO_PREVIOUS:
if( m_SelGridBox )
if( m_gridSelectBox )
{
cnt = m_SelGridBox->GetSelection();
cnt = m_gridSelectBox->GetSelection();
if ( cnt == 0 )
cnt = m_SelGridBox->GetCount() - 1;
cnt = m_gridSelectBox->GetCount() - 1;
else
cnt--;
m_SelGridBox->SetSelection( cnt );
m_gridSelectBox->SetSelection( cnt );
cmd.SetEventType( wxEVT_COMMAND_COMBOBOX_SELECTED );
OnSelectGrid( cmd );
}

View File

@ -389,8 +389,8 @@ int PCB_BASE_FRAME::ReadSetup( LINE_READER* aReader )
if( data )
gy = atoi( data );
m_Auxiliary_Axis_Position.x = gx;
m_Auxiliary_Axis_Position.y = gy;
m_originAxisPosition.x = gx;
m_originAxisPosition.y = gy;
continue;
}
@ -762,8 +762,8 @@ static int WriteSetup( FILE* aFile, PCB_EDIT_FRAME* aFrame, BOARD* aBoard )
fprintf( aFile,
"AuxiliaryAxisOrg %d %d\n",
aFrame->m_Auxiliary_Axis_Position.x,
aFrame->m_Auxiliary_Axis_Position.y );
aFrame->GetOriginAxisPosition().x,
aFrame->GetOriginAxisPosition().y );
STRING_FORMATTER sf;

View File

@ -567,8 +567,8 @@ void KICAD_PLUGIN::loadSETUP()
BIU gy = biuParse( data );
/* @todo
m_Auxiliary_Axis_Position.x = gx;
m_Auxiliary_Axis_Position.y = gy;
m_originAxisPosition.x = gx;
m_originAxisPosition.y = gy;
*/
}

View File

@ -23,24 +23,24 @@ void FOOTPRINT_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
switch( id )
{
case ID_TB_OPTIONS_SHOW_PADS_SKETCH:
m_DisplayPadFill = !m_OptionsToolBar->GetToolState( id );
m_DisplayPadFill = !m_optionsToolBar->GetToolState( id );
DrawPanel->Refresh( );
break;
case ID_TB_OPTIONS_SHOW_VIAS_SKETCH:
m_DisplayViaFill = !m_OptionsToolBar->GetToolState( id );
m_DisplayViaFill = !m_optionsToolBar->GetToolState( id );
DrawPanel->Refresh( );
break;
case ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH:
m_DisplayModText =
m_OptionsToolBar->GetToolState( id ) ? SKETCH : FILLED;
m_optionsToolBar->GetToolState( id ) ? SKETCH : FILLED;
DrawPanel->Refresh( );
break;
case ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH:
m_DisplayModEdge =
m_OptionsToolBar->GetToolState( id ) ? SKETCH : FILLED;
m_optionsToolBar->GetToolState( id ) ? SKETCH : FILLED;
DrawPanel->Refresh( );
break;

View File

@ -142,9 +142,9 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( wxWindow* father,
PCB_BASE_FRAME( father, MODULE_EDITOR_FRAME, wxEmptyString, pos, size, style )
{
m_FrameName = wxT( "ModEditFrame" );
m_Draw_Sheet_Ref = false; // true to show the frame references
m_Draw_Axis = true; // true to show X and Y axis on screen
m_Draw_Grid_Axis = true; // show the grid origin axis
m_showBorderAndTitleBlock = false; // true to show the frame references
m_showAxis = true; // true to show X and Y axis on screen
m_showGridAxis = true; // show the grid origin axis
m_HotkeysZoomAndGridList = g_Module_Editor_Hokeys_Descr;
// Give an icon
@ -194,14 +194,14 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( wxWindow* father,
m_auimgr.AddPane( m_HToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top(). Row( 0 ) );
m_auimgr.AddPane( m_AuxiliaryToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_AuxiliaryToolBar" ) ).Top().Row( 1 ) );
m_auimgr.AddPane( m_auxiliaryToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_auxiliaryToolBar" ) ).Top().Row( 1 ) );
m_auimgr.AddPane( m_VToolBar,
m_auimgr.AddPane( m_drawToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_VToolBar" ) ).Right() );
m_auimgr.AddPane( m_OptionsToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_OptionsToolBar" ) ). Left() );
m_auimgr.AddPane( m_optionsToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ). Left() );
m_auimgr.AddPane( DrawPanel,
wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
@ -253,7 +253,7 @@ void FOOTPRINT_EDIT_FRAME::OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent )
{
aEvent.Enable( GetBoard()->m_Modules != NULL );
if( aEvent.GetEventObject() == m_VToolBar )
if( aEvent.GetEventObject() == m_drawToolBar )
aEvent.Check( GetToolId() == aEvent.GetId() );
}

View File

@ -423,7 +423,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
case ID_PCB_PLACE_OFFSET_COORD_BUTT:
DrawPanel->DrawAuxiliaryAxis( aDC, GR_XOR );
m_Auxiliary_Axis_Position = GetScreen()->GetCrossHairPosition();
m_originAxisPosition = GetScreen()->GetCrossHairPosition();
DrawPanel->DrawAuxiliaryAxis( aDC, GR_COPY );
OnModify();
break;

View File

@ -267,10 +267,10 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( wxWindow* parent, const wxString& title,
PCB_BASE_FRAME( parent, PCB_FRAME, title, pos, size, style )
{
m_FrameName = wxT( "PcbFrame" );
m_Draw_Sheet_Ref = true; // true to display sheet references
m_Draw_Axis = false; // true to display X and Y axis
m_Draw_Auxiliary_Axis = true;
m_Draw_Grid_Axis = true;
m_showBorderAndTitleBlock = true; // true to display sheet references
m_showAxis = false; // true to display X and Y axis
m_showOriginAxis = true;
m_showGridAxis = true;
m_SelTrackWidthBox = NULL;
m_SelViaSizeBox = NULL;
m_SelLayerBox = NULL;
@ -279,6 +279,7 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( wxWindow* parent, const wxString& title,
m_HotkeysZoomAndGridList = g_Board_Editor_Hokeys_Descr;
m_hasAutoSave = true;
m_RecordingMacros = -1;
m_microWaveToolBar = NULL;
for ( int i = 0; i < 10; i++ )
m_Macros[i].m_Record.clear();
@ -361,30 +362,30 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( wxWindow* parent, const wxString& title,
wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top().Row( 0 ) );
}
if( m_AuxiliaryToolBar ) // the auxiliary horizontal toolbar, that shows track and via sizes, zoom ...)
if( m_auxiliaryToolBar ) // the auxiliary horizontal toolbar, that shows track and via sizes, zoom ...)
{
m_auimgr.AddPane( m_AuxiliaryToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_AuxiliaryToolBar" ) ).Top().Row( 1 ) );
m_auimgr.AddPane( m_auxiliaryToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_auxiliaryToolBar" ) ).Top().Row( 1 ) );
}
if( m_AuxVToolBar ) // The auxiliary vertical right toolbar (currently microwave tools)
m_auimgr.AddPane( m_AuxVToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_AuxVToolBar" ) ).Right().Layer( 1 ).Position(1).Hide() );
if( m_microWaveToolBar ) // The auxiliary vertical right toolbar (currently microwave tools)
m_auimgr.AddPane( m_microWaveToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_microWaveToolBar" ) ).Right().Layer( 1 ).Position(1).Hide() );
if( m_VToolBar ) // The main right vertical toolbar
m_auimgr.AddPane( m_VToolBar,
if( m_drawToolBar ) // The main right vertical toolbar
m_auimgr.AddPane( m_drawToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_VToolBar" ) ).Right().Layer( 2 ) );
// Add the layer manager ( most right side of pcbframe )
m_auimgr.AddPane( m_Layers, lyrs.Name( wxT( "m_LayersManagerToolBar" ) ).Right().Layer( 3 ) );
if( m_OptionsToolBar ) // The left vertical toolbar (fast acces display options of Pcbnew)
if( m_optionsToolBar ) // The left vertical toolbar (fast acces display options of Pcbnew)
{
m_auimgr.AddPane( m_OptionsToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_OptionsToolBar" ) ).Left().Layer(1) );
m_auimgr.AddPane( m_optionsToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left().Layer(1) );
m_auimgr.GetPane( wxT( "m_LayersManagerToolBar" ) ).Show( m_show_layer_manager_tools );
m_auimgr.GetPane( wxT( "m_AuxVToolBar" ) ).Show( m_show_microwave_tools );
m_auimgr.GetPane( wxT( "m_microWaveToolBar" ) ).Show( m_show_microwave_tools );
}
if( DrawPanel )

View File

@ -40,7 +40,7 @@ bool PCB_BASE_FRAME::ExportToGerberFile( const wxString& aFullFileName, int aLay
if( aPlotOriginIsAuxAxis )
{
offset = m_Auxiliary_Axis_Position;
offset = m_originAxisPosition;
}
else
{

View File

@ -45,8 +45,8 @@ void PCB_BASE_FRAME::InstallGridFrame( const wxPoint& pos )
dlg.SetGridSize( m_UserGridSize );
dlg.SetGridOrigin( GetScreen()->m_GridOrigin );
if( m_SelGridBox )
dlg.SetGridForFastSwitching( m_SelGridBox->GetStrings(), m_FastGrid1, m_FastGrid2 );
if( m_gridSelectBox )
dlg.SetGridForFastSwitching( m_gridSelectBox->GetStrings(), m_FastGrid1, m_FastGrid2 );
if( dlg.ShowModal() == wxID_CANCEL )
return;

View File

@ -116,90 +116,90 @@ void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar()
void FOOTPRINT_EDIT_FRAME::ReCreateVToolbar()
{
if( m_VToolBar )
if( m_drawToolBar )
return;
m_VToolBar = new EDA_TOOLBAR( TOOLBAR_TOOL, this, ID_V_TOOLBAR, false );
m_drawToolBar = new EDA_TOOLBAR( TOOLBAR_TOOL, this, ID_V_TOOLBAR, false );
// Set up toolbar
m_VToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ),
m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ),
wxEmptyString, wxITEM_CHECK );
m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_MODEDIT_PAD_TOOL, wxEmptyString, KiBitmap( pad_xpm ),
m_drawToolBar->AddSeparator();
m_drawToolBar->AddTool( ID_MODEDIT_PAD_TOOL, wxEmptyString, KiBitmap( pad_xpm ),
_( "Add pads" ), wxITEM_CHECK );
m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_MODEDIT_LINE_TOOL, wxEmptyString, KiBitmap( add_polygon_xpm ),
m_drawToolBar->AddSeparator();
m_drawToolBar->AddTool( ID_MODEDIT_LINE_TOOL, wxEmptyString, KiBitmap( add_polygon_xpm ),
_( "Add graphic line or polygon" ), wxITEM_CHECK );
m_VToolBar->AddTool( ID_MODEDIT_CIRCLE_TOOL, wxEmptyString, KiBitmap( add_circle_xpm ),
m_drawToolBar->AddTool( ID_MODEDIT_CIRCLE_TOOL, wxEmptyString, KiBitmap( add_circle_xpm ),
_( "Add graphic circle" ), wxITEM_CHECK );
m_VToolBar->AddTool( ID_MODEDIT_ARC_TOOL, wxEmptyString, KiBitmap( add_arc_xpm ),
m_drawToolBar->AddTool( ID_MODEDIT_ARC_TOOL, wxEmptyString, KiBitmap( add_arc_xpm ),
_( "Add graphic arc" ), wxITEM_CHECK );
m_VToolBar->AddTool( ID_MODEDIT_TEXT_TOOL, wxEmptyString, KiBitmap( add_text_xpm ),
m_drawToolBar->AddTool( ID_MODEDIT_TEXT_TOOL, wxEmptyString, KiBitmap( add_text_xpm ),
_( "Add Text" ), wxITEM_CHECK );
m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_MODEDIT_ANCHOR_TOOL, wxEmptyString, KiBitmap( anchor_xpm ),
m_drawToolBar->AddSeparator();
m_drawToolBar->AddTool( ID_MODEDIT_ANCHOR_TOOL, wxEmptyString, KiBitmap( anchor_xpm ),
_( "Place the footprint module reference anchor" ),
wxITEM_CHECK );
m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_MODEDIT_DELETE_TOOL, wxEmptyString, KiBitmap( delete_body_xpm ),
m_drawToolBar->AddSeparator();
m_drawToolBar->AddTool( ID_MODEDIT_DELETE_TOOL, wxEmptyString, KiBitmap( delete_body_xpm ),
_( "Delete items" ), wxITEM_CHECK );
m_VToolBar->AddTool( ID_MODEDIT_PLACE_GRID_COORD, wxEmptyString,
m_drawToolBar->AddTool( ID_MODEDIT_PLACE_GRID_COORD, wxEmptyString,
KiBitmap( grid_select_axis_xpm ),
_( "Set the origin point for the grid" ),
wxITEM_CHECK );
m_VToolBar->Realize();
m_drawToolBar->Realize();
}
void FOOTPRINT_EDIT_FRAME::ReCreateOptToolbar()
{
if( m_OptionsToolBar )
if( m_optionsToolBar )
return;
// Create options tool bar.
m_OptionsToolBar = new EDA_TOOLBAR( TOOLBAR_OPTION, this, ID_OPT_TOOLBAR, false );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
m_optionsToolBar = new EDA_TOOLBAR( TOOLBAR_OPTION, this, ID_OPT_TOOLBAR, false );
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
_( "Hide grid" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString,
KiBitmap( polar_coord_xpm ),
_( "Display Polar Coord ON" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
KiBitmap( unit_inch_xpm ),
_( "Units in inches" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
KiBitmap( unit_mm_xpm ),
_( "Units in millimeters" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
KiBitmap( cursor_shape_xpm ),
_( "Change Cursor Shape" ), wxITEM_CHECK );
m_OptionsToolBar->AddSeparator();
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH, wxEmptyString,
m_optionsToolBar->AddSeparator();
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH, wxEmptyString,
KiBitmap( pad_sketch_xpm ),
_( "Show Pads Sketch" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, wxEmptyString,
KiBitmap( text_sketch_xpm ),
_( "Show Texts Sketch" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, wxEmptyString,
KiBitmap( show_mod_edge_xpm ),
_( "Show Edges Sketch" ), wxITEM_CHECK );
m_OptionsToolBar->Realize();
m_optionsToolBar->Realize();
}
@ -207,37 +207,37 @@ void FOOTPRINT_EDIT_FRAME::ReCreateAuxiliaryToolbar()
{
wxString msg;
if( m_AuxiliaryToolBar )
if( m_auxiliaryToolBar )
return;
m_AuxiliaryToolBar = new EDA_TOOLBAR( TOOLBAR_AUX, this, ID_AUX_TOOLBAR, true );
m_auxiliaryToolBar = new EDA_TOOLBAR( TOOLBAR_AUX, this, ID_AUX_TOOLBAR, true );
// Set up toolbar
m_AuxiliaryToolBar->AddSeparator();
m_auxiliaryToolBar->AddSeparator();
// Grid selection choice box.
m_SelGridBox = new wxComboBox( m_AuxiliaryToolBar,
m_gridSelectBox = new wxComboBox( m_auxiliaryToolBar,
ID_ON_GRID_SELECT,
wxEmptyString,
wxPoint( -1, -1 ),
wxSize( LISTBOX_WIDTH, -1 ),
0, NULL, wxCB_READONLY );
m_AuxiliaryToolBar->AddControl( m_SelGridBox );
m_auxiliaryToolBar->AddControl( m_gridSelectBox );
// Zoom selection choice box.
m_AuxiliaryToolBar->AddSeparator();
m_SelZoomBox = new wxComboBox( m_AuxiliaryToolBar,
m_auxiliaryToolBar->AddSeparator();
m_zoomSelectBox = new wxComboBox( m_auxiliaryToolBar,
ID_ON_ZOOM_SELECT,
wxEmptyString,
wxPoint( -1, -1 ),
wxSize( LISTBOX_WIDTH, -1 ),
0, NULL, wxCB_READONLY );
m_AuxiliaryToolBar->AddControl( m_SelZoomBox );
m_auxiliaryToolBar->AddControl( m_zoomSelectBox );
// Update tool bar to reflect setting.
updateGridSelectBox();
updateZoomSelectBox();
// after adding the buttons to the toolbar, must call Realize() to reflect the changes
m_AuxiliaryToolBar->Realize();
m_auxiliaryToolBar->Realize();
}

View File

@ -287,91 +287,91 @@ void PCB_EDIT_FRAME::ReCreateHToolbar()
void PCB_EDIT_FRAME::ReCreateOptToolbar()
{
if( m_OptionsToolBar )
if( m_optionsToolBar )
return;
wxWindowUpdateLocker dummy( this );
m_OptionsToolBar = new EDA_TOOLBAR( TOOLBAR_OPTION, this, ID_OPT_TOOLBAR, false );
m_optionsToolBar = new EDA_TOOLBAR( TOOLBAR_OPTION, this, ID_OPT_TOOLBAR, false );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_DRC_OFF, wxEmptyString, KiBitmap( drc_off_xpm ),
m_optionsToolBar->AddTool( ID_TB_OPTIONS_DRC_OFF, wxEmptyString, KiBitmap( drc_off_xpm ),
_( "Enable design rule checking" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
_( "Hide grid" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString,
KiBitmap( polar_coord_xpm ),
_( "Display polar coordinates" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
KiBitmap( unit_inch_xpm ),
_( "Units in inches" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
KiBitmap( unit_mm_xpm ),
_( "Units in millimeters" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
KiBitmap( cursor_shape_xpm ),
_( "Change cursor shape" ), wxITEM_CHECK );
m_OptionsToolBar->AddSeparator();
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_RATSNEST, wxEmptyString,
m_optionsToolBar->AddSeparator();
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_RATSNEST, wxEmptyString,
KiBitmap( general_ratsnest_xpm ),
_( "Show board ratsnest" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_RATSNEST, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_RATSNEST, wxEmptyString,
KiBitmap( local_ratsnest_xpm ),
_( "Show module ratsnest when moving" ),
wxITEM_CHECK );
m_OptionsToolBar->AddSeparator();
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_AUTO_DEL_TRACK, wxEmptyString,
m_optionsToolBar->AddSeparator();
m_optionsToolBar->AddTool( ID_TB_OPTIONS_AUTO_DEL_TRACK, wxEmptyString,
KiBitmap( auto_delete_track_xpm ),
_( "Enable automatic track deletion" ),
wxITEM_CHECK );
m_OptionsToolBar->AddSeparator();
m_OptionsToolBar->AddRadioTool( ID_TB_OPTIONS_SHOW_ZONES, wxEmptyString,
m_optionsToolBar->AddSeparator();
m_optionsToolBar->AddRadioTool( ID_TB_OPTIONS_SHOW_ZONES, wxEmptyString,
KiBitmap( show_zone_xpm ), wxNullBitmap,
_( "Show filled areas in zones" ) );
m_OptionsToolBar->AddRadioTool( ID_TB_OPTIONS_SHOW_ZONES_DISABLE, wxEmptyString,
m_optionsToolBar->AddRadioTool( ID_TB_OPTIONS_SHOW_ZONES_DISABLE, wxEmptyString,
KiBitmap( show_zone_disable_xpm ),
wxNullBitmap, _( "Do not show filled areas in zones" ));
m_OptionsToolBar->AddRadioTool( ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY, wxEmptyString,
m_optionsToolBar->AddRadioTool( ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY, wxEmptyString,
KiBitmap( show_zone_outline_only_xpm ), wxNullBitmap,
_( "Show outlines of filled areas only in zones" ) );
m_OptionsToolBar->AddSeparator();
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH, wxEmptyString,
m_optionsToolBar->AddSeparator();
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH, wxEmptyString,
KiBitmap( pad_sketch_xpm ),
_( "Show pads in outline mode" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_VIAS_SKETCH, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_VIAS_SKETCH, wxEmptyString,
KiBitmap( via_sketch_xpm ),
_( "Show vias in outline mode" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, wxEmptyString,
KiBitmap( showtrack_xpm ),
_( "Show tracks in outline mode" ),
wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE, wxEmptyString,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE, wxEmptyString,
KiBitmap( palette_xpm ),
_( "Enable high contrast display mode" ),
wxITEM_CHECK );
// Tools to show/hide toolbars:
m_OptionsToolBar->AddSeparator();
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR,
m_optionsToolBar->AddSeparator();
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR,
wxEmptyString,
KiBitmap( layers_manager_xpm ),
HELP_SHOW_HIDE_LAYERMANAGER,
wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR_MICROWAVE,
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR_MICROWAVE,
wxEmptyString,
KiBitmap( mw_toolbar_xpm ),
_( "Show/hide the toolbar for microwaves tools\n This is a experimental feature (under development)" ),
wxITEM_CHECK );
m_OptionsToolBar->AddSeparator();
m_OptionsToolBar->Realize();
m_optionsToolBar->AddSeparator();
m_optionsToolBar->Realize();
}
@ -379,69 +379,71 @@ void PCB_EDIT_FRAME::ReCreateOptToolbar()
*/
void PCB_EDIT_FRAME::ReCreateVToolbar()
{
if( m_VToolBar )
if( m_drawToolBar )
return;
wxWindowUpdateLocker dummy( this );
m_VToolBar = new EDA_TOOLBAR( TOOLBAR_TOOL, this, ID_V_TOOLBAR, false );
m_drawToolBar = new EDA_TOOLBAR( TOOLBAR_TOOL, this, ID_V_TOOLBAR, false );
// Set up toolbar
m_VToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ),
m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ),
wxEmptyString, wxITEM_CHECK );
m_VToolBar->AddSeparator();
m_drawToolBar->AddSeparator();
m_VToolBar->AddTool( ID_PCB_HIGHLIGHT_BUTT, wxEmptyString, KiBitmap( net_highlight_xpm ),
m_drawToolBar->AddTool( ID_PCB_HIGHLIGHT_BUTT, wxEmptyString, KiBitmap( net_highlight_xpm ),
_( "Highlight net" ), wxITEM_CHECK );
m_VToolBar->AddTool( ID_PCB_SHOW_1_RATSNEST_BUTT, wxEmptyString, KiBitmap( tool_ratsnest_xpm ),
m_drawToolBar->AddTool( ID_PCB_SHOW_1_RATSNEST_BUTT, wxEmptyString,
KiBitmap( tool_ratsnest_xpm ),
_( "Display local ratsnest" ), wxITEM_CHECK );
m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_PCB_MODULE_BUTT, wxEmptyString, KiBitmap( module_xpm ),
m_drawToolBar->AddSeparator();
m_drawToolBar->AddTool( ID_PCB_MODULE_BUTT, wxEmptyString, KiBitmap( module_xpm ),
_( "Add modules" ), wxITEM_CHECK );
m_VToolBar->AddTool( ID_TRACK_BUTT, wxEmptyString, KiBitmap( add_tracks_xpm ),
m_drawToolBar->AddTool( ID_TRACK_BUTT, wxEmptyString, KiBitmap( add_tracks_xpm ),
_( "Add tracks and vias" ), wxITEM_CHECK );
m_VToolBar->AddTool( ID_PCB_ZONES_BUTT, wxEmptyString, KiBitmap( add_zone_xpm ),
m_drawToolBar->AddTool( ID_PCB_ZONES_BUTT, wxEmptyString, KiBitmap( add_zone_xpm ),
_( "Add filled zones" ), wxITEM_CHECK );
m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_PCB_ADD_LINE_BUTT, wxEmptyString, KiBitmap( add_dashed_line_xpm ),
m_drawToolBar->AddSeparator();
m_drawToolBar->AddTool( ID_PCB_ADD_LINE_BUTT, wxEmptyString, KiBitmap( add_dashed_line_xpm ),
_( "Add graphic line or polygon" ), wxITEM_CHECK );
m_VToolBar->AddTool( ID_PCB_CIRCLE_BUTT, wxEmptyString, KiBitmap( add_circle_xpm ),
m_drawToolBar->AddTool( ID_PCB_CIRCLE_BUTT, wxEmptyString, KiBitmap( add_circle_xpm ),
_( "Add graphic circle" ), wxITEM_CHECK );
m_VToolBar->AddTool( ID_PCB_ARC_BUTT, wxEmptyString, KiBitmap( add_arc_xpm ),
m_drawToolBar->AddTool( ID_PCB_ARC_BUTT, wxEmptyString, KiBitmap( add_arc_xpm ),
_( "Add graphic arc" ), wxITEM_CHECK );
m_VToolBar->AddTool( ID_PCB_ADD_TEXT_BUTT, wxEmptyString, KiBitmap( add_text_xpm ),
m_drawToolBar->AddTool( ID_PCB_ADD_TEXT_BUTT, wxEmptyString, KiBitmap( add_text_xpm ),
_( "Add text on copper layers or graphic text" ), wxITEM_CHECK );
m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_PCB_DIMENSION_BUTT, wxEmptyString, KiBitmap( add_dimension_xpm ),
m_drawToolBar->AddSeparator();
m_drawToolBar->AddTool( ID_PCB_DIMENSION_BUTT, wxEmptyString, KiBitmap( add_dimension_xpm ),
_( "Add dimension" ), wxITEM_CHECK );
m_VToolBar->AddTool( ID_PCB_MIRE_BUTT, wxEmptyString, KiBitmap( add_mires_xpm ),
m_drawToolBar->AddTool( ID_PCB_MIRE_BUTT, wxEmptyString, KiBitmap( add_mires_xpm ),
_( "Add layer alignment target" ), wxITEM_CHECK );
m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_PCB_DELETE_ITEM_BUTT, wxEmptyString, KiBitmap( delete_body_xpm ),
m_drawToolBar->AddSeparator();
m_drawToolBar->AddTool( ID_PCB_DELETE_ITEM_BUTT, wxEmptyString, KiBitmap( delete_body_xpm ),
_( "Delete items" ), wxITEM_CHECK );
m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_PCB_PLACE_OFFSET_COORD_BUTT, wxEmptyString, KiBitmap( pcb_offset_xpm ),
m_drawToolBar->AddSeparator();
m_drawToolBar->AddTool( ID_PCB_PLACE_OFFSET_COORD_BUTT, wxEmptyString,
KiBitmap( pcb_offset_xpm ),
_( "Place the origin point for drill and place files" ),
wxITEM_CHECK );
m_VToolBar->AddTool( ID_PCB_PLACE_GRID_COORD_BUTT, wxEmptyString,
m_drawToolBar->AddTool( ID_PCB_PLACE_GRID_COORD_BUTT, wxEmptyString,
KiBitmap( grid_select_axis_xpm ),
_( "Set the origin point for the grid" ),
wxITEM_CHECK );
m_VToolBar->Realize();
m_drawToolBar->Realize();
}
@ -449,38 +451,37 @@ void PCB_EDIT_FRAME::ReCreateVToolbar()
*/
void PCB_EDIT_FRAME::ReCreateMicrowaveVToolbar()
{
if( m_AuxVToolBar )
if( m_microWaveToolBar )
return;
wxWindowUpdateLocker dummy(this);
m_AuxVToolBar = new EDA_TOOLBAR( TOOLBAR_TOOL, this, ID_MICROWAVE_V_TOOLBAR, false );
m_microWaveToolBar = new EDA_TOOLBAR( TOOLBAR_TOOL, this, ID_MICROWAVE_V_TOOLBAR, false );
// Set up toolbar
m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_SELF_CMD, wxEmptyString,
m_microWaveToolBar->AddTool( ID_PCB_MUWAVE_TOOL_SELF_CMD, wxEmptyString,
KiBitmap( mw_add_line_xpm ),
_( "Create line of specified length for microwave applications" ) );
m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_GAP_CMD, wxEmptyString,
m_microWaveToolBar->AddTool( ID_PCB_MUWAVE_TOOL_GAP_CMD, wxEmptyString,
KiBitmap( mw_add_gap_xpm ),
_( "Create gap of specified length for microwave applications" ) );
m_AuxVToolBar->AddSeparator();
m_microWaveToolBar->AddSeparator();
m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_STUB_CMD, wxEmptyString,
m_microWaveToolBar->AddTool( ID_PCB_MUWAVE_TOOL_STUB_CMD, wxEmptyString,
KiBitmap( mw_add_stub_xpm ),
_( "Create stub of specified length for microwave applications" ) );
m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_STUB_ARC_CMD, wxEmptyString,
m_microWaveToolBar->AddTool( ID_PCB_MUWAVE_TOOL_STUB_ARC_CMD, wxEmptyString,
KiBitmap( mw_add_stub_arc_xpm ),
_( "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, wxEmptyString,
m_microWaveToolBar->AddTool( ID_PCB_MUWAVE_TOOL_FUNCTION_SHAPE_CMD, wxEmptyString,
KiBitmap( mw_add_shape_xpm ),
_( "Create a polynomial shape for microwave applications" ) );
m_AuxVToolBar->Realize();
m_microWaveToolBar->Realize();
}
@ -499,35 +500,35 @@ void PCB_EDIT_FRAME::ReCreateAuxiliaryToolbar()
wxWindowUpdateLocker dummy( this );
if( m_AuxiliaryToolBar )
if( m_auxiliaryToolBar )
return;
m_AuxiliaryToolBar = new EDA_TOOLBAR( TOOLBAR_AUX, this, ID_AUX_TOOLBAR, true );
m_auxiliaryToolBar = new EDA_TOOLBAR( TOOLBAR_AUX, this, ID_AUX_TOOLBAR, true );
/* Set up toolbar items */
// Creates box to display and choose tracks widths:
m_SelTrackWidthBox = new wxComboBox( m_AuxiliaryToolBar,
m_SelTrackWidthBox = new wxComboBox( m_auxiliaryToolBar,
ID_AUX_TOOLBAR_PCB_TRACK_WIDTH,
wxEmptyString,
wxPoint( -1, -1 ),
wxSize( LISTBOX_WIDTH, -1 ),
0, NULL, wxCB_READONLY );
m_AuxiliaryToolBar->AddControl( m_SelTrackWidthBox );
m_AuxiliaryToolBar->AddSeparator();
m_auxiliaryToolBar->AddControl( m_SelTrackWidthBox );
m_auxiliaryToolBar->AddSeparator();
// Creates box to display and choose vias diameters:
m_SelViaSizeBox = new wxComboBox( m_AuxiliaryToolBar,
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 );
m_AuxiliaryToolBar->AddControl( m_SelViaSizeBox );
m_AuxiliaryToolBar->AddSeparator();
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,
m_auxiliaryToolBar->AddTool( ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH,
wxEmptyString,
KiBitmap( auto_track_width_xpm ),
_( "Auto track width: when starting on \
@ -535,24 +536,24 @@ an existing track use its width\notherwise, use current width setting" ),
wxITEM_CHECK );
// Add the box to display and select the current grid size:
m_AuxiliaryToolBar->AddSeparator();
m_SelGridBox = new wxComboBox( m_AuxiliaryToolBar,
m_auxiliaryToolBar->AddSeparator();
m_gridSelectBox = new wxComboBox( m_auxiliaryToolBar,
ID_ON_GRID_SELECT,
wxEmptyString,
wxPoint( -1, -1 ),
wxSize( LISTBOX_WIDTH, -1 ),
0, NULL, wxCB_READONLY );
m_AuxiliaryToolBar->AddControl( m_SelGridBox );
m_auxiliaryToolBar->AddControl( m_gridSelectBox );
// Add the box to display and select the current Zoom
m_AuxiliaryToolBar->AddSeparator();
m_SelZoomBox = new wxComboBox( m_AuxiliaryToolBar,
m_auxiliaryToolBar->AddSeparator();
m_zoomSelectBox = new wxComboBox( m_auxiliaryToolBar,
ID_ON_ZOOM_SELECT,
wxEmptyString,
wxPoint( -1, -1 ),
wxSize( LISTBOX_WIDTH, -1 ),
0, NULL, wxCB_READONLY );
m_AuxiliaryToolBar->AddControl( m_SelZoomBox );
m_auxiliaryToolBar->AddControl( m_zoomSelectBox );
updateZoomSelectBox();
updateGridSelectBox();
@ -560,8 +561,8 @@ an existing track use its width\notherwise, use current width setting" ),
updateViaSizeSelectBox();
// after adding the buttons to the toolbar, must call Realize()
m_AuxiliaryToolBar->Realize();
m_AuxiliaryToolBar->AddSeparator();
m_auxiliaryToolBar->Realize();
m_auxiliaryToolBar->AddSeparator();
}

View File

@ -87,7 +87,7 @@ void PCB_EDIT_FRAME::OnUpdateZoneDisplayStyle( wxUpdateUIEvent& aEvent )
void PCB_EDIT_FRAME::OnUpdateDrcEnable( wxUpdateUIEvent& aEvent )
{
aEvent.Check( !Drc_On );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_DRC_OFF,
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_DRC_OFF,
Drc_On ?
_( "Disable design rule checking" ) :
_( "Enable design rule checking" ) );
@ -96,7 +96,7 @@ void PCB_EDIT_FRAME::OnUpdateDrcEnable( wxUpdateUIEvent& aEvent )
void PCB_EDIT_FRAME::OnUpdateShowBoardRatsnest( wxUpdateUIEvent& aEvent )
{
aEvent.Check( GetBoard()->IsElementVisible( RATSNEST_VISIBLE ) );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_RATSNEST,
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_RATSNEST,
GetBoard()->IsElementVisible( RATSNEST_VISIBLE ) ?
_( "Hide board ratsnest" ) :
_( "Show board ratsnest" ) );
@ -106,7 +106,7 @@ void PCB_EDIT_FRAME::OnUpdateShowBoardRatsnest( wxUpdateUIEvent& aEvent )
void PCB_EDIT_FRAME::OnUpdateShowModuleRatsnest( wxUpdateUIEvent& aEvent )
{
aEvent.Check( g_Show_Module_Ratsnest );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_MODULE_RATSNEST,
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_MODULE_RATSNEST,
g_Show_Module_Ratsnest ?
_( "Hide module ratsnest" ) :
_( "Show module ratsnest" ) );
@ -116,7 +116,7 @@ void PCB_EDIT_FRAME::OnUpdateShowModuleRatsnest( wxUpdateUIEvent& aEvent )
void PCB_EDIT_FRAME::OnUpdateAutoDeleteTrack( wxUpdateUIEvent& aEvent )
{
aEvent.Check( g_AutoDeleteOldTrack );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_AUTO_DEL_TRACK,
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_AUTO_DEL_TRACK,
g_AutoDeleteOldTrack ?
_( "Disable auto delete old track" ) :
_( "Enable auto delete old track" ) );
@ -126,7 +126,7 @@ void PCB_EDIT_FRAME::OnUpdateAutoDeleteTrack( wxUpdateUIEvent& aEvent )
void PCB_EDIT_FRAME::OnUpdateViaDrawMode( wxUpdateUIEvent& aEvent )
{
aEvent.Check( !m_DisplayViaFill );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_VIAS_SKETCH,
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_VIAS_SKETCH,
m_DisplayViaFill ?
_( "Show vias in outline mode" ) :
_( "Show vias in fill mode" ) );
@ -136,7 +136,7 @@ void PCB_EDIT_FRAME::OnUpdateViaDrawMode( wxUpdateUIEvent& aEvent )
void PCB_EDIT_FRAME::OnUpdateTraceDrawMode( wxUpdateUIEvent& aEvent )
{
aEvent.Check( !m_DisplayPcbTrackFill );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH,
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH,
m_DisplayPcbTrackFill ?
_( "Show tracks in outline mode" ) :
_( "Show tracks in fill mode" ) );
@ -146,7 +146,7 @@ void PCB_EDIT_FRAME::OnUpdateTraceDrawMode( wxUpdateUIEvent& aEvent )
void PCB_EDIT_FRAME::OnUpdateHighContrastDisplayMode( wxUpdateUIEvent& aEvent )
{
aEvent.Check( DisplayOpt.ContrastModeDisplay );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE,
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE,
DisplayOpt.ContrastModeDisplay ?
_( "Normal contrast display mode" ) :
_( "High contrast display mode" ) );
@ -160,7 +160,7 @@ void PCB_EDIT_FRAME::OnUpdateShowLayerManager( wxUpdateUIEvent& aEvent )
void PCB_EDIT_FRAME::OnUpdateShowMicrowaveToolbar( wxUpdateUIEvent& aEvent )
{
aEvent.Check( m_auimgr.GetPane( wxT( "m_AuxVToolBar" ) ).IsShown() );
aEvent.Check( m_auimgr.GetPane( wxT( "m_microWaveToolBar" ) ).IsShown() );
}
@ -172,6 +172,6 @@ void PCB_EDIT_FRAME::OnUpdateSave( wxUpdateUIEvent& aEvent )
void PCB_EDIT_FRAME::OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent )
{
if( aEvent.GetEventObject() == m_VToolBar )
if( aEvent.GetEventObject() == m_drawToolBar )
aEvent.Check( GetToolId() == aEvent.GetId() );
}