Commit fac288cf authored by Wayne Stambaugh's avatar Wayne Stambaugh

More encapsulation work and other minor improvements.

* EDA_DRAW_FRAME completely encapsulated except for DrawFrame member.
* Moved members specific to Pcbnew from EDA_DRAW_FRAME to PCB_BASE_FRAME
  or PCB_EDIT_FRAME as appropriate.
* Replace EDA_TOOLBAR with wxAuiToolBar as EDA_TOOL bar provided no
  additional functionality and made code less readable.
* Remove EDA_TOOLBAR class definition from wxstruct.h and delete file
  wineda_toolbar.cpp.
* Rename tool bar members to something more descriptive since the
  horizontal and vertical references wont mean anything once the
  tool bars are movable.
* Lots of dead code removal.
parent c9269232
......@@ -41,7 +41,8 @@ void EDA_3D_FRAME::ReCreateHToolbar()
return;
}
m_HToolBar = new EDA_TOOLBAR( TOOLBAR_MAIN, this, ID_H_TOOLBAR, true );
m_HToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
// Set up toolbar
m_HToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString,
......
......@@ -268,8 +268,8 @@ public:
private:
wxString m_FrameName; // name used for writing and reading setup. It is "Frame3D"
EDA_3D_CANVAS* m_Canvas;
EDA_TOOLBAR* m_HToolBar;
EDA_TOOLBAR* m_VToolBar;
wxAuiToolBar* m_HToolBar;
wxAuiToolBar* m_VToolBar;
int m_InternalUnits;
wxPoint m_FramePos;
wxSize m_FrameSize;
......
......@@ -65,7 +65,6 @@ set(COMMON_SRCS
richio.cpp
selcolor.cpp
string.cpp
wineda_toolbar.cpp
trigo.cpp
worksheet.cpp
wxwineda.cpp
......
......@@ -66,7 +66,7 @@ EDA_BASE_FRAME::EDA_BASE_FRAME( wxWindow* father,
wxSize minsize;
m_Ident = idtype;
m_HToolBar = NULL;
m_mainToolBar = NULL;
m_FrameIsActive = true;
m_hasAutoSave = false;
m_autoSaveState = false;
......
......@@ -21,7 +21,7 @@
*
*/
LAYER_BOX_SELECTOR::LAYER_BOX_SELECTOR( EDA_TOOLBAR* parent, wxWindowID id,
LAYER_BOX_SELECTOR::LAYER_BOX_SELECTOR( wxAuiToolBar* parent, wxWindowID id,
const wxPoint& pos, const wxSize& size,
int n, const wxString choices[] ) :
wxBitmapComboBox( parent, id, wxEmptyString, pos, size, n, choices, wxCB_READONLY )
......@@ -35,7 +35,7 @@ LAYER_BOX_SELECTOR::LAYER_BOX_SELECTOR( EDA_TOOLBAR* parent, wxWindowID id,
}
LAYER_BOX_SELECTOR::LAYER_BOX_SELECTOR( EDA_TOOLBAR* parent, wxWindowID id,
LAYER_BOX_SELECTOR::LAYER_BOX_SELECTOR( wxAuiToolBar* parent, wxWindowID id,
const wxPoint& pos, const wxSize& size,
const wxArrayString& choices ) :
wxBitmapComboBox( parent, id, wxEmptyString, pos, size, choices, wxCB_READONLY )
......
......@@ -51,7 +51,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
BASE_SCREEN* screen = aFrame->DrawPanel->GetScreen();
/* scale is the ratio resolution/internal units */
float scale = 82.0 / aFrame->m_InternalUnits;
float scale = 82.0 / aFrame->GetInternalUnits();
if( screen->IsBlockActive() )
{
......
......@@ -99,10 +99,8 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& ti
m_currentScreen = NULL;
m_toolId = ID_NO_TOOL_SELECTED;
m_lastDrawToolId = ID_NO_TOOL_SELECTED;
m_HTOOL_current_state = 0;
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_showGridAxis = false; // true to draw the grid axis
m_cursorShape = 0;
m_LastGridSizeId = 0;
......@@ -111,7 +109,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& ti
m_snapToGrid = true;
// Internal units per inch: = 1000 for schema, = 10000 for PCB
m_InternalUnits = EESCHEMA_INTERNAL_UNIT;
m_internalUnits = EESCHEMA_INTERNAL_UNIT;
minsize.x = 470;
minsize.y = 350 + m_MsgFrameHeight;
......@@ -757,8 +755,8 @@ void EDA_DRAW_FRAME::UpdateStatusBar()
SetStatusText( Line, 1 );
/* Display absolute coordinates: */
double dXpos = To_User_Unit( g_UserUnit, screen->GetCrossHairPosition().x, m_InternalUnits );
double dYpos = To_User_Unit( g_UserUnit, screen->GetCrossHairPosition().y, m_InternalUnits );
double dXpos = To_User_Unit( g_UserUnit, screen->GetCrossHairPosition().x, m_internalUnits );
double dYpos = To_User_Unit( g_UserUnit, screen->GetCrossHairPosition().y, m_internalUnits );
/*
* Converting from inches to mm can give some coordinates due to
......@@ -767,8 +765,8 @@ void EDA_DRAW_FRAME::UpdateStatusBar()
*/
if ( g_UserUnit == MILLIMETRES )
{
dXpos = RoundTo0( dXpos, (double)( m_InternalUnits / 10 ) );
dYpos = RoundTo0( dYpos, (double)( m_InternalUnits / 10 ) );
dXpos = RoundTo0( dXpos, (double)( m_internalUnits / 10 ) );
dYpos = RoundTo0( dYpos, (double)( m_internalUnits / 10 ) );
}
/* The following sadly is an if Eeschema/if Pcbnew */
......@@ -777,7 +775,7 @@ void EDA_DRAW_FRAME::UpdateStatusBar()
switch( g_UserUnit )
{
case INCHES:
if( m_InternalUnits == EESCHEMA_INTERNAL_UNIT )
if( m_internalUnits == EESCHEMA_INTERNAL_UNIT )
{
absformatter = wxT( "X %.3f Y %.3f" );
locformatter = wxT( "dx %.3f dy %.3f" );
......@@ -790,7 +788,7 @@ void EDA_DRAW_FRAME::UpdateStatusBar()
break;
case MILLIMETRES:
if( m_InternalUnits == EESCHEMA_INTERNAL_UNIT )
if( m_internalUnits == EESCHEMA_INTERNAL_UNIT )
{
absformatter = wxT( "X %.2f Y %.2f" );
locformatter = wxT( "dx %.2f dy %.2f" );
......@@ -814,13 +812,13 @@ void EDA_DRAW_FRAME::UpdateStatusBar()
/* Display relative coordinates: */
dx = screen->GetCrossHairPosition().x - screen->m_O_Curseur.x;
dy = screen->GetCrossHairPosition().y - screen->m_O_Curseur.y;
dXpos = To_User_Unit( g_UserUnit, dx, m_InternalUnits );
dYpos = To_User_Unit( g_UserUnit, dy, m_InternalUnits );
dXpos = To_User_Unit( g_UserUnit, dx, m_internalUnits );
dYpos = To_User_Unit( g_UserUnit, dy, m_internalUnits );
if( g_UserUnit == MILLIMETRES )
{
dXpos = RoundTo0( dXpos, (double) ( m_InternalUnits / 10 ) );
dYpos = RoundTo0( dYpos, (double) ( m_InternalUnits / 10 ) );
dXpos = RoundTo0( dXpos, (double) ( m_internalUnits / 10 ) );
dYpos = RoundTo0( dYpos, (double) ( m_internalUnits / 10 ) );
}
/* We already decided the formatter above */
......@@ -887,5 +885,5 @@ void EDA_DRAW_FRAME::ClearMsgPanel( void )
wxString EDA_DRAW_FRAME::CoordinateToString( int aValue, bool aConvertToMils )
{
return ::CoordinateToString( aValue, m_InternalUnits, aConvertToMils );
return ::CoordinateToString( aValue, m_internalUnits, aConvertToMils );
}
/****************/
/* msgpanel.cpp */
/****************/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifdef __GNUG__
#pragma implementation
......@@ -21,7 +42,6 @@ EDA_MSG_PANEL::EDA_MSG_PANEL( EDA_DRAW_FRAME* parent, int id,
const wxPoint& pos, const wxSize& size ) :
wxPanel( parent, id, pos, size )
{
m_Parent = parent;
SetFont( wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ) );
SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
m_last_x = 0;
......
/****************/
/* toolbars.cpp */
/****************/
#ifdef __GNUG__
#pragma implementation
#endif
#include "fctsys.h"
#include "wxstruct.h"
EDA_TOOLBAR::EDA_TOOLBAR( id_toolbar type, wxWindow * parent, wxWindowID id, bool horizontal ):
wxAuiToolBar( parent, id, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | ( ( horizontal ) ?
wxAUI_TB_HORZ_LAYOUT :
wxAUI_TB_VERTICAL ) )
{
m_Parent = parent;
m_Ident = type;
m_Horizontal = horizontal;
SetToolBitmapSize(wxSize(16,16));
SetMargins(0,0);
SetToolSeparation(1);
SetToolPacking(1);
}
int EDA_TOOLBAR::GetDimension( )
{
if( m_Horizontal )
return GetSize().y;
else
return GetSize().x;
}
......@@ -1003,7 +1003,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
EDA_Colors Color;
wxString Line;
Ki_WorkSheetData* WsItem;
int scale = m_InternalUnits / 1000;
int scale = m_internalUnits / 1000;
wxSize size( SIZETEXT * scale, SIZETEXT * scale );
#if defined(KICAD_GOST)
wxSize size2( SIZETEXT * scale * 2, SIZETEXT * scale * 2);
......
......@@ -197,8 +197,8 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu )
for( size_t i = 0; i < screen->GetGridCount(); i++ )
{
tmp = screen->GetGrid( i );
double gridValueInch = To_User_Unit( INCHES, tmp.m_Size.x, m_InternalUnits );
double gridValue_mm = To_User_Unit( MILLIMETRES, tmp.m_Size.x, m_InternalUnits );
double gridValueInch = To_User_Unit( INCHES, tmp.m_Size.x, m_internalUnits );
double gridValue_mm = To_User_Unit( MILLIMETRES, tmp.m_Size.x, m_internalUnits );
if( tmp.m_Id == ID_POPUP_GRID_USER )
{
......
......@@ -121,8 +121,8 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father,
m_auimgr.AddPane( m_HToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top(). Row( 0 ) );
m_auimgr.AddPane( m_mainToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_mainToolBar" ) ).Top(). Row( 0 ) );
if( m_drawToolBar ) // Currently, no vertical right toolbar.
m_auimgr.AddPane( m_drawToolBar,
......@@ -178,7 +178,8 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateOptToolbar()
return;
// Create options tool bar.
m_optionsToolBar = new EDA_TOOLBAR( TOOLBAR_OPTION, this, ID_OPT_TOOLBAR, false );
m_optionsToolBar = new wxAuiToolBar( this, ID_OPT_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
_( "Hide grid" ), wxITEM_CHECK );
......@@ -218,35 +219,36 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateOptToolbar()
void DISPLAY_FOOTPRINTS_FRAME::ReCreateHToolbar()
{
if( m_HToolBar != NULL )
if( m_mainToolBar != NULL )
return;
m_HToolBar = new EDA_TOOLBAR( TOOLBAR_MAIN, this, ID_H_TOOLBAR, true );
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
m_HToolBar->AddTool( ID_OPTIONS_SETUP, wxEmptyString, KiBitmap( display_options_xpm ),
m_mainToolBar->AddTool( ID_OPTIONS_SETUP, wxEmptyString, KiBitmap( display_options_xpm ),
_( "Display options" ) );
m_HToolBar->AddSeparator();
m_mainToolBar->AddSeparator();
m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ),
m_mainToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ),
_( "Zoom in (F1)" ) );
m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ),
m_mainToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ),
_( "Zoom out (F2)" ) );
m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ),
m_mainToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ),
_( "Redraw view (F3)" ) );
m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ),
m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ),
_( "Zoom auto (Home)" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_SHOW3D_FRAME, wxEmptyString, KiBitmap( three_d_xpm ),
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_CVPCB_SHOW3D_FRAME, wxEmptyString, KiBitmap( three_d_xpm ),
_( "3D Display" ) );
// after adding the buttons to the toolbar, must call Realize() to reflect
// the changes
m_HToolBar->Realize();
m_mainToolBar->Realize();
}
......
......@@ -109,7 +109,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( const wxString& title, long style ) :
m_ListCmp = NULL;
m_FootprintList = NULL;
m_DisplayFootprintFrame = NULL;
m_HToolBar = NULL;
m_mainToolBar = NULL;
m_modified = false;
m_isEESchemaNetlist = false;
m_KeepCvpcbOpen = false;
......@@ -166,9 +166,9 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( const wxString& title, long style ) :
info.InfoToolbarPane();
if( m_HToolBar )
m_auimgr.AddPane( m_HToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top() );
if( m_mainToolBar )
m_auimgr.AddPane( m_mainToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_mainToolBar" ) ).Top() );
if( m_ListCmp )
m_auimgr.AddPane( m_ListCmp,
......@@ -189,7 +189,7 @@ CVPCB_MAINFRAME::~CVPCB_MAINFRAME()
if( config )
{
int state = m_HToolBar->GetToolState( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST );
int state = m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST );
config->Write( wxT( FILTERFOOTPRINTKEY ), state );
}
......@@ -504,7 +504,7 @@ void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
{
int selection;
if( !m_HToolBar->GetToolState( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST ) )
if( !m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST ) )
{
m_FootprintList->SetActiveFootprintList( true, true );
return;
......@@ -554,11 +554,11 @@ void CVPCB_MAINFRAME::OnSelectFilteringFootprint( wxCommandEvent& event )
switch( event.GetId() )
{
case ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST:
m_HToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, false );
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, false );
break;
case ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST:
m_HToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, false );
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, false );
break;
default:
......
......@@ -15,7 +15,7 @@
/* Forward declarations of all top-level window classes. */
class EDA_TOOLBAR;
class wxAuiToolBar;
class FOOTPRINTS_LISTBOX;
class COMPONENTS_LISTBOX;
class DISPLAY_FOOTPRINTS_FRAME;
......@@ -32,7 +32,7 @@ public:
FOOTPRINTS_LISTBOX* m_FootprintList;
COMPONENTS_LISTBOX* m_ListCmp;
DISPLAY_FOOTPRINTS_FRAME* m_DisplayFootprintFrame;
EDA_TOOLBAR* m_HToolBar;
wxAuiToolBar* m_mainToolBar;
wxFileName m_NetlistFileName;
wxArrayString m_ModuleLibNames;
wxArrayString m_AliasLibNames;
......
/********************/
/* tool_cvpcb.cpp */
/********************/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2007 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2007-2011 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file tool_cvpcb.cpp
*/
#include "fctsys.h"
#include "appl_wxstruct.h"
......@@ -16,78 +41,81 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
{
wxConfig* config = wxGetApp().m_EDA_Config;
if( m_HToolBar != NULL )
if( m_mainToolBar != NULL )
return;
m_HToolBar = new EDA_TOOLBAR( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
m_HToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxEmptyString,
m_mainToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxEmptyString,
KiBitmap( open_document_xpm ),
_( "Open a net list file" ) );
m_HToolBar->AddTool( wxID_SAVE, wxEmptyString, KiBitmap( save_xpm ),
m_mainToolBar->AddTool( wxID_SAVE, wxEmptyString, KiBitmap( save_xpm ),
_( "Save net list and footprint files" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_CREATE_CONFIGWINDOW, wxEmptyString,
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_CVPCB_CREATE_CONFIGWINDOW, wxEmptyString,
KiBitmap( config_xpm ),
_( "Configuration" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_CREATE_SCREENCMP, wxEmptyString,
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_CVPCB_CREATE_SCREENCMP, wxEmptyString,
KiBitmap( show_footprint_xpm ),
_( "View selected footprint" ) );
m_HToolBar->AddTool( ID_CVPCB_AUTO_ASSOCIE, wxEmptyString,
m_mainToolBar->AddTool( ID_CVPCB_AUTO_ASSOCIE, wxEmptyString,
KiBitmap( auto_associe_xpm ),
_( "Perform automatic footprint association" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_GOTO_PREVIOUSNA, wxEmptyString,
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_CVPCB_GOTO_PREVIOUSNA, wxEmptyString,
KiBitmap( left_xpm ),
_( "Select previous free component" ) );
m_HToolBar->AddTool( ID_CVPCB_GOTO_FIRSTNA, wxEmptyString,
m_mainToolBar->AddTool( ID_CVPCB_GOTO_FIRSTNA, wxEmptyString,
KiBitmap( right_xpm ),
_( "Select next free component" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_DEL_ASSOCIATIONS, wxEmptyString,
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_CVPCB_DEL_ASSOCIATIONS, wxEmptyString,
KiBitmap( delete_association_xpm ),
_( "Delete all associations" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_CREATE_STUFF_FILE, wxEmptyString,
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_CVPCB_CREATE_STUFF_FILE, wxEmptyString,
KiBitmap( export_footprint_names_xpm ),
_( "Create export file (component/footprint list, \
used by Eeschema to fill the footprint field of components)" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_PCB_DISPLAY_FOOTPRINT_DOC, wxEmptyString,
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_PCB_DISPLAY_FOOTPRINT_DOC, wxEmptyString,
KiBitmap( datasheet_xpm ),
_( "Display footprints list documentation" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddSeparator();
m_HToolBar->AddRadioTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
wxEmptyString,
m_mainToolBar->AddSeparator();
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
KiBitmap( module_filtered_list_xpm ),
wxNullBitmap,
_( "Display the filtered footprint list for the current component" ) );
true, NULL,
_( "Display the filtered footprint list for the current component" ),
wxEmptyString );
m_HToolBar->AddRadioTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
wxEmptyString, KiBitmap( module_full_list_xpm ),
wxNullBitmap,
_( "Display the full footprint list (without filtering)" ) );
m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
KiBitmap( module_full_list_xpm ),
wxNullBitmap, true, NULL,
_( "Display the full footprint list (without filtering)" ),
wxEmptyString );
if( config )
{
wxString key = wxT( FILTERFOOTPRINTKEY );
int opt = config->Read( key, (long) 1 );
m_HToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, opt );
m_HToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, !opt );
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, opt );
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, !opt );
}
// after adding the buttons to the toolbar, must call Realize() to reflect the changes
m_HToolBar->Realize();
m_mainToolBar->Realize();
}
......@@ -79,7 +79,7 @@ void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event )
AddUnitSymbol( *m_TextPenWidth, g_UserUnit );
m_DialogPenWidth->SetValue(
ReturnStringFromValue( g_UserUnit, g_DrawDefaultLineThickness,
m_Parent->m_InternalUnits ) );
m_Parent->GetInternalUnits() ) );
m_Print_Sheet_Ref->SetValue( s_Print_Frame_Ref );
if( GetSizer() )
......@@ -92,7 +92,7 @@ void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event )
void DIALOG_SVG_PRINT::SetPenWidth()
{
g_DrawDefaultLineThickness =
ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->m_InternalUnits );
ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->GetInternalUnits() );
if( g_DrawDefaultLineThickness > WIDTH_MAX_VALUE )
{
......@@ -106,7 +106,7 @@ void DIALOG_SVG_PRINT::SetPenWidth()
m_DialogPenWidth->SetValue(
ReturnStringFromValue( g_UserUnit, g_DrawDefaultLineThickness,
m_Parent->m_InternalUnits ) );
m_Parent->GetInternalUnits() ) );
}
......@@ -118,7 +118,7 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
SetPenWidth();
g_DrawDefaultLineThickness =
ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->m_InternalUnits );
ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->GetInternalUnits() );
SCH_SCREEN* screen = (SCH_SCREEN*) m_Parent->GetScreen();
......@@ -217,7 +217,7 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame,
SetLocaleTo_C_standard(); // Switch the locale to standard C (needed
// to print floating point numbers like 1.3)
float dpi = (float) frame->m_InternalUnits;
float dpi = (float) frame->GetInternalUnits();
wxSVGFileDC dc( FullFileName, SheetSize.x, SheetSize.y, dpi );
EDA_RECT tmp = panel->m_ClipBox;
......
......@@ -175,7 +175,7 @@ void DialogLabelEditor::InitDialog()
m_staticSizeUnits->SetLabel( msg );
msg = ReturnStringFromValue( g_UserUnit, m_CurrentText->m_Size.x,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
m_TextSize->SetValue( msg );
if( m_CurrentText->Type() != SCH_GLOBAL_LABEL_T
......@@ -239,7 +239,7 @@ void DialogLabelEditor::TextPropertiesAccept( wxCommandEvent& aEvent )
m_CurrentText->SetOrientation( m_TextOrient->GetSelection() );
text = m_TextSize->GetValue();
value = ReturnValueFromString( g_UserUnit, text, m_Parent->m_InternalUnits );
value = ReturnValueFromString( g_UserUnit, text, m_Parent->GetInternalUnits() );
m_CurrentText->m_Size.x = m_CurrentText->m_Size.y = value;
if( m_TextShape )
......
......@@ -119,7 +119,7 @@ void DIALOG_LIB_EDIT_PIN::OnPropertiesChange( wxCommandEvent& event )
{
if( ! IsShown() ) // do nothing at init time
return;
int units = ((LIB_EDIT_FRAME*)GetParent())->m_InternalUnits;
int units = ((LIB_EDIT_FRAME*)GetParent())->GetInternalUnits();
int pinNameSize = ReturnValueFromString( g_UserUnit, GetNameTextSize(), units );
int pinNumSize = ReturnValueFromString( g_UserUnit, GetPadNameTextSize(), units);
int pinOrient = LIB_PIN::GetOrientationCode( GetOrientation() );
......
......@@ -61,7 +61,7 @@ void DIALOG_LIB_EDIT_TEXT::initDlg( )
if ( m_GraphicText )
{
msg = ReturnStringFromValue( g_UserUnit, m_GraphicText->m_Size.x,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
m_TextSize->SetValue( msg );
m_TextValue->SetValue( m_GraphicText->m_Text );
......@@ -114,7 +114,7 @@ void DIALOG_LIB_EDIT_TEXT::initDlg( )
else
{
msg = ReturnStringFromValue( g_UserUnit, m_Parent->m_textSize,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
m_TextSize->SetValue( msg );
if ( ! m_Parent->m_drawSpecificUnit )
......@@ -146,7 +146,7 @@ void DIALOG_LIB_EDIT_TEXT::OnOkClick( wxCommandEvent& event )
Line = m_TextValue->GetValue();
m_Parent->m_textOrientation = m_Orient->GetValue() ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ;
wxString msg = m_TextSize->GetValue();
m_Parent->m_textSize = ReturnValueFromString( g_UserUnit, msg, m_Parent->m_InternalUnits );
m_Parent->m_textSize = ReturnValueFromString( g_UserUnit, msg, m_Parent->GetInternalUnits() );
m_Parent->m_drawSpecificConvert = m_CommonConvert->GetValue() ? false : true;
m_Parent->m_drawSpecificUnit = m_CommonUnit->GetValue() ? false : true;
......
......@@ -96,9 +96,9 @@ void SCH_EDIT_FRAME::OnFindDrcMarker( wxFindDialogEvent& event )
wxString path = sheetFoundIn->Path();
wxString units = GetAbbreviatedUnitsLabel();
double x = To_User_Unit( g_UserUnit, (double) lastMarker->GetPosition().x,
m_InternalUnits );
m_internalUnits );
double y = To_User_Unit( g_UserUnit, (double) lastMarker->GetPosition().y,
m_InternalUnits );
m_internalUnits );
msg.Printf( _( "Design rule check marker found in sheet %s at %0.3f%s, %0.3f%s" ),
GetChars( path ), x, GetChars( units ), y, GetChars( units) );
SetStatusText( msg );
......
......@@ -635,7 +635,7 @@ lost!\n\nClear the current component from the screen?" ) ) )
GetScreen()->ClearUndoRedoList();
OnModify();
DrawPanel->Refresh();
m_HToolBar->Refresh();
m_mainToolBar->Refresh();
}
......
......@@ -247,8 +247,8 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent,
EDA_PANEINFO mesg;
mesg.MessageToolbarPane();
m_auimgr.AddPane( m_HToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top().Row( 0 ) );
m_auimgr.AddPane( m_mainToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_mainToolBar" ) ).Top().Row( 0 ) );
m_auimgr.AddPane( m_drawToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_VToolBar" ) ).Right() );
......@@ -522,7 +522,7 @@ void LIB_EDIT_FRAME::OnUpdatePartNumber( wxUpdateUIEvent& event )
void LIB_EDIT_FRAME::OnUpdateDeMorganNormal( wxUpdateUIEvent& event )
{
if( m_HToolBar == NULL )
if( m_mainToolBar == NULL )
return;
event.Enable( GetShowDeMorgan() || ( m_component && m_component->HasConversion() ) );
......@@ -532,7 +532,7 @@ void LIB_EDIT_FRAME::OnUpdateDeMorganNormal( wxUpdateUIEvent& event )
void LIB_EDIT_FRAME::OnUpdateDeMorganConvert( wxUpdateUIEvent& event )
{
if( m_HToolBar == NULL )
if( m_mainToolBar == NULL )
return;
event.Enable( GetShowDeMorgan() || ( m_component && m_component->HasConversion() ) );
......@@ -674,7 +674,7 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break;
case ID_LIBEDIT_EDIT_PIN_BY_PIN:
m_editPinsPerPartOrConvert = m_HToolBar->GetToolState( ID_LIBEDIT_EDIT_PIN_BY_PIN );
m_editPinsPerPartOrConvert = m_mainToolBar->GetToolToggled( ID_LIBEDIT_EDIT_PIN_BY_PIN );
break;
case ID_POPUP_LIBEDIT_END_CREATE_ITEM:
......
......@@ -86,15 +86,15 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
dlg.SetName( pin->GetName() );
dlg.SetNameTextSize( ReturnStringFromValue( g_UserUnit,
pin->GetNameTextSize(),
m_InternalUnits ) );
m_internalUnits ) );
dlg.SetNameTextSizeUnits( units );
dlg.SetPadName( pin->GetNumberString() );
dlg.SetPadNameTextSize( ReturnStringFromValue( g_UserUnit,
pin->GetNumberTextSize(),
m_InternalUnits ) );
m_internalUnits ) );
dlg.SetPadNameTextSizeUnits( units );
dlg.SetLength( ReturnStringFromValue( g_UserUnit, pin->GetLength(), m_InternalUnits ) );
dlg.SetLength( ReturnStringFromValue( g_UserUnit, pin->GetLength(), m_internalUnits ) );
dlg.SetLengthUnits( units );
dlg.SetAddToAllParts( pin->GetUnit() == 0 );
dlg.SetAddToAllBodyStyles( pin->GetConvert() == 0 );
......@@ -122,10 +122,10 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
}
/* Save the pin properties to use for the next new pin. */
LastPinNameSize = ReturnValueFromString( g_UserUnit, dlg.GetNameTextSize(), m_InternalUnits );
LastPinNumSize = ReturnValueFromString( g_UserUnit, dlg.GetPadNameTextSize(), m_InternalUnits );
LastPinNameSize = ReturnValueFromString( g_UserUnit, dlg.GetNameTextSize(), m_internalUnits );
LastPinNumSize = ReturnValueFromString( g_UserUnit, dlg.GetPadNameTextSize(), m_internalUnits );
LastPinOrient = LIB_PIN::GetOrientationCode( dlg.GetOrientation() );
LastPinLength = ReturnValueFromString( g_UserUnit, dlg.GetLength(), m_InternalUnits );
LastPinLength = ReturnValueFromString( g_UserUnit, dlg.GetLength(), m_internalUnits );
LastPinShape = LIB_PIN::GetStyleCode( dlg.GetStyle() );
LastPinType = dlg.GetElectricalType();
LastPinCommonConvert = dlg.GetAddToAllBodyStyles();
......
......@@ -249,9 +249,9 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* father,
if( m_HToolBar )
m_auimgr.AddPane( m_HToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top().Row( 0 ) );
if( m_mainToolBar )
m_auimgr.AddPane( m_mainToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_mainToolBar" ) ).Top().Row( 0 ) );
if( m_drawToolBar )
m_auimgr.AddPane( m_drawToolBar, wxAuiPaneInfo( vert ).Name( wxT( "m_drawToolBar" ) ).Right() );
......
......@@ -51,12 +51,12 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC )
dlg.SetFileName( aSheet->GetFileName() );
dlg.SetFileNameTextSize( ReturnStringFromValue( g_UserUnit,
aSheet->GetFileNameSize(),
m_InternalUnits ) );
m_internalUnits ) );
dlg.SetFileNameTextSizeUnits( units );
dlg.SetSheetName( aSheet->GetName() );
dlg.SetSheetNameTextSize( ReturnStringFromValue( g_UserUnit,
aSheet->GetSheetNameSize(),
m_InternalUnits ) );
m_internalUnits ) );
dlg.SetSheetNameTextSizeUnits( units );
/* This ugly hack fixes a bug in wxWidgets 2.8.7 and likely earlier
......@@ -194,11 +194,11 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC )
aSheet->SetFileNameSize( ReturnValueFromString( g_UserUnit,
dlg.GetFileNameTextSize(),
m_InternalUnits ) );
m_internalUnits ) );
aSheet->SetName( dlg.GetSheetName() );
aSheet->SetSheetNameSize( ReturnValueFromString( g_UserUnit,
dlg.GetSheetNameTextSize(),
m_InternalUnits ) );
m_internalUnits ) );
if( aSheet->GetName().IsEmpty() )
aSheet->SetName( wxString::Format( wxT( "Sheet%8.8lX" ), aSheet->GetTimeStamp() ) );
......
......@@ -56,9 +56,9 @@ int SCH_EDIT_FRAME::EditSheetPin( SCH_SHEET_PIN* aSheetPin, wxDC* aDC )
DIALOG_SCH_EDIT_SHEET_PIN dlg( this );
dlg.SetLabelName( aSheetPin->m_Text );
dlg.SetTextHeight( ReturnStringFromValue( g_UserUnit, aSheetPin->m_Size.y, m_InternalUnits ) );
dlg.SetTextHeight( ReturnStringFromValue( g_UserUnit, aSheetPin->m_Size.y, m_internalUnits ) );
dlg.SetTextHeightUnits( GetUnitsLabel( g_UserUnit ) );
dlg.SetTextWidth( ReturnStringFromValue( g_UserUnit, aSheetPin->m_Size.x, m_InternalUnits ) );
dlg.SetTextWidth( ReturnStringFromValue( g_UserUnit, aSheetPin->m_Size.x, m_internalUnits ) );
dlg.SetTextWidthUnits( GetUnitsLabel( g_UserUnit ) );
dlg.SetConnectionType( aSheetPin->GetShape() );
......@@ -84,8 +84,8 @@ int SCH_EDIT_FRAME::EditSheetPin( SCH_SHEET_PIN* aSheetPin, wxDC* aDC )
}
aSheetPin->m_Text = dlg.GetLabelName();
aSheetPin->m_Size.y = ReturnValueFromString( g_UserUnit, dlg.GetTextHeight(), m_InternalUnits );
aSheetPin->m_Size.x = ReturnValueFromString( g_UserUnit, dlg.GetTextWidth(), m_InternalUnits );
aSheetPin->m_Size.y = ReturnValueFromString( g_UserUnit, dlg.GetTextHeight(), m_internalUnits );
aSheetPin->m_Size.x = ReturnValueFromString( g_UserUnit, dlg.GetTextWidth(), m_internalUnits );
aSheetPin->SetShape( dlg.GetConnectionType() );
if( aDC )
......
......@@ -42,7 +42,7 @@ void LIB_EDIT_FRAME::EditGraphicSymbol( wxDC* DC, LIB_ITEM* DrawItem )
dialog.SetWidthUnits( ReturnUnitSymbol( g_UserUnit ) );
wxString val = ReturnStringFromValue( g_UserUnit, m_drawLineWidth, m_InternalUnits );
wxString val = ReturnStringFromValue( g_UserUnit, m_drawLineWidth, m_internalUnits );
dialog.SetWidth( val );
dialog.SetApplyToAllUnits( !m_drawSpecificUnit );
dialog.EnableApplyToAllUnits( component && component->GetPartCount() > 1 );
......@@ -56,7 +56,7 @@ void LIB_EDIT_FRAME::EditGraphicSymbol( wxDC* DC, LIB_ITEM* DrawItem )
return;
val = dialog.GetWidth();
m_drawLineWidth = ReturnValueFromString( g_UserUnit, val, m_InternalUnits );
m_drawLineWidth = ReturnValueFromString( g_UserUnit, val, m_internalUnits );
m_drawSpecificConvert = !dialog.GetApplyToAllConversions();
m_drawSpecificUnit = !dialog.GetApplyToAllUnits();
......
......@@ -55,7 +55,8 @@ void LIB_EDIT_FRAME::ReCreateVToolbar()
if( m_drawToolBar != NULL )
return;
m_drawToolBar = new EDA_TOOLBAR( TOOLBAR_TOOL, this, ID_V_TOOLBAR, false );
m_drawToolBar = new wxAuiToolBar( this, ID_V_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
// Set up toolbar
m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ),
......@@ -100,111 +101,114 @@ void LIB_EDIT_FRAME::ReCreateHToolbar()
wxString msg;
// Create the toolbar if not exists
if( m_HToolBar != NULL )
if( m_mainToolBar != NULL )
return;
m_HToolBar = new EDA_TOOLBAR( TOOLBAR_MAIN, this, ID_H_TOOLBAR, true );
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
// Set up toolbar
m_HToolBar->AddTool( ID_LIBEDIT_SAVE_CURRENT_LIB, wxEmptyString, KiBitmap( save_library_xpm ),
m_mainToolBar->AddTool( ID_LIBEDIT_SAVE_CURRENT_LIB, wxEmptyString,
KiBitmap( save_library_xpm ),
_( "Save current library to disk" ) );
m_HToolBar->AddTool( ID_LIBEDIT_SELECT_CURRENT_LIB, wxEmptyString, KiBitmap( library_xpm ),
m_mainToolBar->AddTool( ID_LIBEDIT_SELECT_CURRENT_LIB, wxEmptyString, KiBitmap( library_xpm ),
_( "Select working library" ) );
m_HToolBar->AddTool( ID_LIBEDIT_DELETE_PART, wxEmptyString, KiBitmap( delete_xpm ),
m_mainToolBar->AddTool( ID_LIBEDIT_DELETE_PART, wxEmptyString, KiBitmap( delete_xpm ),
_( "Delete component in current library" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_LIBEDIT_NEW_PART, wxEmptyString, KiBitmap( new_component_xpm ),
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_LIBEDIT_NEW_PART, wxEmptyString, KiBitmap( new_component_xpm ),
_( "Create a new component" ) );
m_HToolBar->AddTool( ID_LIBEDIT_SELECT_PART, wxEmptyString,
m_mainToolBar->AddTool( ID_LIBEDIT_SELECT_PART, wxEmptyString,
KiBitmap( import_cmp_from_lib_xpm ),
_( "Load component to edit from the current library" ) );
m_HToolBar->AddTool( ID_LIBEDIT_NEW_PART_FROM_EXISTING, wxEmptyString,
m_mainToolBar->AddTool( ID_LIBEDIT_NEW_PART_FROM_EXISTING, wxEmptyString,
KiBitmap( copycomponent_xpm ),
_( "Create a new component from the current one" ) );
m_HToolBar->AddTool( ID_LIBEDIT_SAVE_CURRENT_PART, wxEmptyString,
m_mainToolBar->AddTool( ID_LIBEDIT_SAVE_CURRENT_PART, wxEmptyString,
KiBitmap( save_part_in_mem_xpm ),
_( "Update current component in current library" ) );
m_HToolBar->AddTool( ImportPartId, wxEmptyString, KiBitmap( import_xpm ),
m_mainToolBar->AddTool( ImportPartId, wxEmptyString, KiBitmap( import_xpm ),
_( "Import component" ) );
m_HToolBar->AddTool( ExportPartId, wxEmptyString, KiBitmap( export_xpm ),
m_mainToolBar->AddTool( ExportPartId, wxEmptyString, KiBitmap( export_xpm ),
_( "Export component" ) );
m_HToolBar->AddTool( CreateNewLibAndSavePartId, wxEmptyString, KiBitmap( new_library_xpm ),
m_mainToolBar->AddTool( CreateNewLibAndSavePartId, wxEmptyString, KiBitmap( new_library_xpm ),
_( "Save current component to new library" ) );
m_HToolBar->AddSeparator();
m_mainToolBar->AddSeparator();
msg = AddHotkeyName( _( "Undo last command" ), s_Schematic_Hokeys_Descr, HK_UNDO, IS_COMMENT );
m_HToolBar->AddTool( wxID_UNDO, wxEmptyString, KiBitmap( undo_xpm ), msg );
m_mainToolBar->AddTool( wxID_UNDO, wxEmptyString, KiBitmap( undo_xpm ), msg );
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_mainToolBar->AddTool( wxID_REDO, wxEmptyString, KiBitmap( redo_xpm ), msg );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_LIBEDIT_GET_FRAME_EDIT_PART, wxEmptyString,
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_LIBEDIT_GET_FRAME_EDIT_PART, wxEmptyString,
KiBitmap( part_properties_xpm ), _( "Edit component properties" ) );
m_HToolBar->AddTool( ID_LIBEDIT_GET_FRAME_EDIT_FIELDS, wxEmptyString, KiBitmap( add_text_xpm ),
m_mainToolBar->AddTool( ID_LIBEDIT_GET_FRAME_EDIT_FIELDS, wxEmptyString,
KiBitmap( add_text_xpm ),
_( "Add and remove fields and edit field properties" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_LIBEDIT_CHECK_PART, wxEmptyString, KiBitmap( erc_xpm ),
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_LIBEDIT_CHECK_PART, wxEmptyString, KiBitmap( erc_xpm ),
_( "Test for duplicate and off grid pins" ) );
m_HToolBar->AddSeparator();
m_mainToolBar->AddSeparator();
msg = AddHotkeyName( HELP_ZOOM_IN, s_Libedit_Hokeys_Descr, HK_ZOOM_IN, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ), msg );
m_mainToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ), msg );
msg = AddHotkeyName( HELP_ZOOM_OUT, s_Libedit_Hokeys_Descr, HK_ZOOM_OUT, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ), msg );
m_mainToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ), msg );
msg = AddHotkeyName( HELP_ZOOM_REDRAW, s_Libedit_Hokeys_Descr, HK_ZOOM_REDRAW, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ), msg );
m_mainToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ), msg );
msg = AddHotkeyName( HELP_ZOOM_FIT, s_Libedit_Hokeys_Descr, HK_ZOOM_AUTO, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ), msg );
m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ), msg );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_DE_MORGAN_NORMAL_BUTT, wxEmptyString, KiBitmap( morgan1_xpm ),
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_DE_MORGAN_NORMAL_BUTT, wxEmptyString, KiBitmap( morgan1_xpm ),
_( "Show as \"De Morgan\" normal part" ), wxITEM_CHECK );
m_HToolBar->AddTool( ID_DE_MORGAN_CONVERT_BUTT, wxEmptyString, KiBitmap( morgan2_xpm ),
m_mainToolBar->AddTool( ID_DE_MORGAN_CONVERT_BUTT, wxEmptyString, KiBitmap( morgan2_xpm ),
_( "Show as \"De Morgan\" convert part" ), wxITEM_CHECK );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_LIBEDIT_VIEW_DOC, wxEmptyString, KiBitmap( datasheet_xpm ),
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_LIBEDIT_VIEW_DOC, wxEmptyString, KiBitmap( datasheet_xpm ),
_( "Edit document file" ) );
m_HToolBar->AddSeparator();
m_partSelectBox = new wxComboBox( m_HToolBar,
m_mainToolBar->AddSeparator();
m_partSelectBox = new wxComboBox( m_mainToolBar,
ID_LIBEDIT_SELECT_PART_NUMBER,
wxEmptyString,
wxDefaultPosition,
wxSize( LISTBOX_WIDTH, -1 ),
0, NULL, wxCB_READONLY );
m_HToolBar->AddControl( m_partSelectBox );
m_mainToolBar->AddControl( m_partSelectBox );
m_aliasSelectBox = new wxComboBox( m_HToolBar,
m_aliasSelectBox = new wxComboBox( m_mainToolBar,
ID_LIBEDIT_SELECT_ALIAS,
wxEmptyString,
wxDefaultPosition,
wxSize( LISTBOX_WIDTH, -1 ),
0, NULL, wxCB_READONLY );
m_HToolBar->AddControl( m_aliasSelectBox );
m_mainToolBar->AddControl( m_aliasSelectBox );
m_HToolBar->AddSeparator();
m_mainToolBar->AddSeparator();
msg = _( "Edit pins per part or body style (Use carefully!)" );
m_HToolBar->AddTool( ID_LIBEDIT_EDIT_PIN_BY_PIN, wxEmptyString, KiBitmap( pin2pin_xpm ),
m_mainToolBar->AddTool( ID_LIBEDIT_EDIT_PIN_BY_PIN, wxEmptyString, KiBitmap( pin2pin_xpm ),
msg, wxITEM_CHECK );
// after adding the buttons to the toolbar, must call Realize() to reflect the changes
m_HToolBar->Realize();
m_mainToolBar->Realize();
}
......@@ -213,7 +217,8 @@ void LIB_EDIT_FRAME::CreateOptionToolbar()
if( m_optionsToolBar )
return;
m_optionsToolBar = new EDA_TOOLBAR( TOOLBAR_OPTION, this, ID_OPT_TOOLBAR, false );
m_optionsToolBar = new wxAuiToolBar( this, ID_OPT_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
_( "Turn grid off" ), wxITEM_CHECK );
......
This diff is collapsed.
/****************************************************************/
/* tool_viewlib.cpp: Build the toolbars for the library browser */
/****************************************************************/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file tool_viewlib.cpp
* @brief Build the toolbars for the library browser.
*/
#include "fctsys.h"
#include "macros.h"
......@@ -23,85 +49,86 @@ void LIB_VIEW_FRAME::ReCreateHToolbar()
LIB_ALIAS* entry = NULL;
bool asdeMorgan = false;
if( m_HToolBar == NULL )
if( m_mainToolBar == NULL )
{
m_HToolBar = new EDA_TOOLBAR( TOOLBAR_MAIN, this, ID_H_TOOLBAR, true );
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
// Set up toolbar
m_HToolBar->AddTool( ID_LIBVIEW_SELECT_LIB, wxEmptyString,
m_mainToolBar->AddTool( ID_LIBVIEW_SELECT_LIB, wxEmptyString,
KiBitmap( library_xpm ),
_( "Select library to browse" ) );
m_HToolBar->AddTool( ID_LIBVIEW_SELECT_PART, wxEmptyString,
m_mainToolBar->AddTool( ID_LIBVIEW_SELECT_PART, wxEmptyString,
KiBitmap( add_component_xpm ),
_( "Select part to browse" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_LIBVIEW_PREVIOUS, wxEmptyString,
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_LIBVIEW_PREVIOUS, wxEmptyString,
KiBitmap( lib_previous_xpm ),
_( "Display previous part" ) );
m_HToolBar->AddTool( ID_LIBVIEW_NEXT, wxEmptyString,
m_mainToolBar->AddTool( ID_LIBVIEW_NEXT, wxEmptyString,
KiBitmap( lib_next_xpm ),
_( "Display next part" ) );
m_HToolBar->AddSeparator();
m_mainToolBar->AddSeparator();
msg = AddHotkeyName( _( "Zoom in" ), s_Viewlib_Hokeys_Descr,
HK_ZOOM_IN, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString,
m_mainToolBar->AddTool( ID_ZOOM_IN, wxEmptyString,
KiBitmap( zoom_in_xpm ), msg );
msg = AddHotkeyName( _( "Zoom out" ), s_Viewlib_Hokeys_Descr,
HK_ZOOM_OUT, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString,
m_mainToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString,
KiBitmap( zoom_out_xpm ), msg );
msg = AddHotkeyName( _( "Redraw view" ), s_Viewlib_Hokeys_Descr,
HK_ZOOM_REDRAW, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString,
m_mainToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString,
KiBitmap( zoom_redraw_xpm ), msg );
msg = AddHotkeyName( _( "Zoom auto" ), s_Viewlib_Hokeys_Descr,
HK_ZOOM_AUTO, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString,
m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString,
KiBitmap( zoom_fit_in_page_xpm ), msg );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, wxEmptyString,
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, wxEmptyString,
KiBitmap( morgan1_xpm ),
_( "Show as \"De Morgan\" normal part" ),
wxITEM_CHECK );
m_HToolBar->AddTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, wxEmptyString,
m_mainToolBar->AddTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, wxEmptyString,
KiBitmap( morgan2_xpm ),
_( "Show as \"De Morgan\" convert part" ),
wxITEM_CHECK );
m_HToolBar->AddSeparator();
m_mainToolBar->AddSeparator();
SelpartBox = new wxComboBox( m_HToolBar, ID_LIBVIEW_SELECT_PART_NUMBER,
SelpartBox = new wxComboBox( m_mainToolBar, ID_LIBVIEW_SELECT_PART_NUMBER,
wxEmptyString, wxDefaultPosition,
wxSize( 150, -1 ), 0, NULL, wxCB_READONLY );
m_HToolBar->AddControl( SelpartBox );
m_mainToolBar->AddControl( SelpartBox );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_LIBVIEW_VIEWDOC, wxEmptyString,
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_LIBVIEW_VIEWDOC, wxEmptyString,
KiBitmap( datasheet_xpm ),
_( "View component documents" ) );
m_HToolBar->EnableTool( ID_LIBVIEW_VIEWDOC, false );
m_mainToolBar->EnableTool( ID_LIBVIEW_VIEWDOC, false );
if( m_Semaphore )
{
// The library browser is called from a "load component" command
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC,
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC,
wxEmptyString, KiBitmap( export_xpm ),
_( "Insert component in schematic" ) );
}
// after adding the buttons to the toolbar, must call Realize() to
// reflect the changes
m_HToolBar->Realize();
m_mainToolBar->Realize();
}
if( (m_libraryName != wxEmptyString) && (m_entryName != wxEmptyString) )
......@@ -120,25 +147,29 @@ void LIB_VIEW_FRAME::ReCreateHToolbar()
}
// Must be AFTER Realize():
m_HToolBar->EnableTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, asdeMorgan );
m_HToolBar->EnableTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, asdeMorgan );
m_mainToolBar->EnableTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, asdeMorgan );
m_mainToolBar->EnableTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, asdeMorgan );
if( asdeMorgan )
{
bool normal = m_convert <= 1;
m_HToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT,normal );
m_HToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, !normal );
m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT,normal );
m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, !normal );
}
else
{
m_HToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, true );
m_HToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, false );
m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, true );
m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, false );
}
int parts_count = 1;
if( component )
parts_count = MAX( component->GetPartCount(), 1 );
SelpartBox->Clear();
for( ii = 0; ii < parts_count; ii++ )
{
wxString msg;
......@@ -149,10 +180,10 @@ void LIB_VIEW_FRAME::ReCreateHToolbar()
SelpartBox->SetSelection( (m_unit > 0 ) ? m_unit - 1 : 0 );
SelpartBox->Enable( parts_count > 1 );
m_HToolBar->EnableTool( ID_LIBVIEW_VIEWDOC,
m_mainToolBar->EnableTool( ID_LIBVIEW_VIEWDOC,
entry && ( entry->GetDocFileName() != wxEmptyString ) );
m_HToolBar->Refresh();
m_mainToolBar->Refresh();
}
......
......@@ -211,8 +211,8 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaph
// Manage main toolbal
m_auimgr.AddPane( m_HToolBar,
wxAuiPaneInfo( horiz ).Name( wxT ("m_HToolBar" ) ).Top().Row( 0 ) );
m_auimgr.AddPane( m_mainToolBar,
wxAuiPaneInfo( horiz ).Name( wxT ("m_mainToolBar" ) ).Top().Row( 0 ) );
wxSize minsize( 60, -1 );
......
......@@ -56,15 +56,15 @@ void LIB_VIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
break;
case ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT:
m_HToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, true );
m_HToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, FALSE );
m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, true );
m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, FALSE );
m_convert = 1;
DrawPanel->Refresh();
break;
case ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT:
m_HToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, FALSE );
m_HToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, true );
m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, FALSE );
m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, true );
m_convert = 2;
DrawPanel->Refresh();
break;
......
......@@ -14,7 +14,7 @@
/* Helper class for displaying DCodes list */
/*******************************************/
DCODE_SELECTION_BOX::DCODE_SELECTION_BOX( EDA_TOOLBAR* aParent, wxWindowID aId,
DCODE_SELECTION_BOX::DCODE_SELECTION_BOX( wxAuiToolBar* aParent, wxWindowID aId,
const wxPoint& aLocation, const wxSize& aSize,
const wxArrayString& aChoices ) :
wxComboBox( aParent, aId, wxEmptyString, aLocation, aSize, 0, NULL, wxCB_READONLY )
......
......@@ -14,7 +14,7 @@ class DCODE_SELECTION_BOX : public wxComboBox
private:
const wxArrayString* m_dcodeList;
public: DCODE_SELECTION_BOX( EDA_TOOLBAR* aParent, wxWindowID aId,
public: DCODE_SELECTION_BOX( wxAuiToolBar* aParent, wxWindowID aId,
const wxPoint& aLocation, const wxSize& aSize,
const wxArrayString& aChoices);
~DCODE_SELECTION_BOX();
......
......@@ -128,9 +128,9 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( wxWindow* father,
lyrs.Caption( _( "Visibles" ) );
if( m_HToolBar )
m_auimgr.AddPane( m_HToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top().Row( 0 ) );
if( m_mainToolBar )
m_auimgr.AddPane( m_mainToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_mainToolBar" ) ).Top().Row( 0 ) );
if( m_drawToolBar )
m_auimgr.AddPane( m_drawToolBar,
......
......@@ -28,7 +28,7 @@ void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
break;
default:
state = m_optionsToolBar->GetToolState( id );
state = m_optionsToolBar->GetToolToggled( id );
break;
}
......
......@@ -46,45 +46,46 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void )
int ii;
wxString msg;
if( m_HToolBar != NULL )
if( m_mainToolBar != NULL )
return;
m_HToolBar = new EDA_TOOLBAR( TOOLBAR_MAIN, this, ID_H_TOOLBAR, true );
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
// Set up toolbar
m_HToolBar->AddTool( ID_GERBVIEW_ERASE_ALL, wxEmptyString,
m_mainToolBar->AddTool( ID_GERBVIEW_ERASE_ALL, wxEmptyString,
KiBitmap( gerbview_clear_layers_xpm ),
_( "Erase all layers" ) );
m_HToolBar->AddTool( wxID_FILE, wxEmptyString, KiBitmap( gerber_file_xpm ),
m_mainToolBar->AddTool( wxID_FILE, wxEmptyString, KiBitmap( gerber_file_xpm ),
_( "Load a new Gerber file on the current layer. Previous data will be deleted" ) );
m_HToolBar->AddTool( ID_GERBVIEW_LOAD_DRILL_FILE, wxEmptyString,
m_mainToolBar->AddTool( ID_GERBVIEW_LOAD_DRILL_FILE, wxEmptyString,
KiBitmap( gerbview_drill_file_xpm ),
_( "Load an excellon drill file on the current layer. Previous data will be deleted" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_GERBVIEW_SET_PAGE_BORDER, wxEmptyString, KiBitmap( sheetset_xpm ),
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_GERBVIEW_SET_PAGE_BORDER, wxEmptyString, KiBitmap( sheetset_xpm ),
_( "Show/hide frame reference and select paper size for printing" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( wxID_PRINT, wxEmptyString, KiBitmap( print_button_xpm ),
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( wxID_PRINT, wxEmptyString, KiBitmap( print_button_xpm ),
_( "Print layers" ) );
m_HToolBar->AddSeparator();
m_mainToolBar->AddSeparator();
msg = AddHotkeyName( _( "Zoom in" ), s_Gerbview_Hokeys_Descr, HK_ZOOM_IN, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ), msg );
m_mainToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ), msg );
msg = AddHotkeyName( _( "Zoom out" ), s_Gerbview_Hokeys_Descr, HK_ZOOM_OUT, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ), msg );
m_mainToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ), msg );
msg = AddHotkeyName( _( "Redraw view" ), s_Gerbview_Hokeys_Descr, HK_ZOOM_REDRAW, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ), msg );
m_mainToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ), msg );
msg = AddHotkeyName( _( "Zoom auto" ), s_Gerbview_Hokeys_Descr, HK_ZOOM_AUTO, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ), msg );
m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ), msg );
m_HToolBar->AddSeparator();
m_mainToolBar->AddSeparator();
wxArrayString choices;
......@@ -94,11 +95,11 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void )
choices.Add( msg );
}
m_SelLayerBox = new LAYER_BOX_SELECTOR( m_HToolBar, ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER,
m_SelLayerBox = new LAYER_BOX_SELECTOR( m_mainToolBar, ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER,
wxDefaultPosition, wxSize( 150, -1 ), choices );
m_HToolBar->AddControl( m_SelLayerBox );
m_mainToolBar->AddControl( m_SelLayerBox );
m_HToolBar->AddSeparator();
m_mainToolBar->AddSeparator();
m_DCodesList.Alloc(TOOLS_MAX_COUNT+1);
m_DCodesList.Add( _( "No tool" ) );
......@@ -110,17 +111,18 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void )
m_DCodesList.Add( msg );
}
m_DCodeSelector = new DCODE_SELECTION_BOX( m_HToolBar, ID_TOOLBARH_GERBER_SELECT_ACTIVE_DCODE,
m_DCodeSelector = new DCODE_SELECTION_BOX( m_mainToolBar,
ID_TOOLBARH_GERBER_SELECT_ACTIVE_DCODE,
wxDefaultPosition, wxSize( 150, -1 ),
m_DCodesList );
m_HToolBar->AddControl( m_DCodeSelector );
m_mainToolBar->AddControl( m_DCodeSelector );
m_TextInfo = new wxTextCtrl( m_HToolBar, wxID_ANY, wxEmptyString, wxDefaultPosition,
m_TextInfo = new wxTextCtrl( m_mainToolBar, wxID_ANY, wxEmptyString, wxDefaultPosition,
wxSize(150,-1), wxTE_READONLY );
m_HToolBar->AddControl( m_TextInfo );
m_mainToolBar->AddControl( m_TextInfo );
// after adding the buttons to the toolbar, must call Realize() to reflect the changes
m_HToolBar->Realize();
m_mainToolBar->Realize();
}
......@@ -129,7 +131,8 @@ void GERBVIEW_FRAME::ReCreateVToolbar( void )
if( m_drawToolBar )
return;
m_drawToolBar = new EDA_TOOLBAR( TOOLBAR_TOOL, this, ID_V_TOOLBAR, FALSE );
m_drawToolBar = new wxAuiToolBar( this, ID_V_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
// Set up toolbar
m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ) );
......@@ -145,7 +148,8 @@ void GERBVIEW_FRAME::ReCreateOptToolbar( void )
return;
// creation of tool bar options
m_optionsToolBar = new EDA_TOOLBAR( TOOLBAR_OPTION, this, ID_OPT_TOOLBAR, FALSE );
m_optionsToolBar = new wxAuiToolBar( this, ID_OPT_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
_( "Turn grid off" ), wxITEM_CHECK );
......
......@@ -5,7 +5,7 @@
#include <wx/bmpcbox.h>
class EDA_TOOLBAR;
class wxAuiToolBar;
/* class to display a layer list.
......@@ -18,12 +18,12 @@ private:
bool m_layerhotkeys;
bool m_layerorder;
public:
LAYER_BOX_SELECTOR( EDA_TOOLBAR* parent, wxWindowID id,
LAYER_BOX_SELECTOR( wxAuiToolBar* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL );
LAYER_BOX_SELECTOR( EDA_TOOLBAR* parent, wxWindowID id,
LAYER_BOX_SELECTOR( wxAuiToolBar* parent, wxWindowID id,
const wxPoint& pos, const wxSize& size,
const wxArrayString& choices );
......
......@@ -86,7 +86,10 @@ protected:
/// Auxiliary tool bar typically shown below the main tool bar at the top of the
/// main window.
EDA_TOOLBAR* m_auxiliaryToolBar;
wxAuiToolBar* m_auxiliaryToolBar;
/// True prints or plots the drawing border and title block.
bool m_printBorderAndTitleBlock;
void updateGridSelectBox();
void updateZoomSelectBox();
......@@ -99,6 +102,8 @@ public:
~PCB_BASE_FRAME();
bool GetPrintBorderAndTitleBlock() const { return m_printBorderAndTitleBlock; }
/**
* Function GetBoardBoundingBox
* calculates the bounding box containing all board items (or board edge segments).
......
......@@ -82,8 +82,12 @@ class PCB_EDIT_FRAME : public PCB_BASE_FRAME
int m_RecordingMacros;
MACROS_RECORDED m_Macros[10];
/// The command ID of the current auto place mode which will be set for either
/// automatic placement of tracks or modules.
int m_autoPlaceModeId;
/// The auxiliary right vertical tool bar used to access the microwave tools.
EDA_TOOLBAR* m_microWaveToolBar;
wxAuiToolBar* m_microWaveToolBar;
protected:
......@@ -236,6 +240,8 @@ public:
void OnUpdateZoneDisplayStyle( wxUpdateUIEvent& aEvent );
void OnUpdateSelectTrackWidth( wxUpdateUIEvent& aEvent );
void OnUpdateSelectAutoTrackWidth( wxUpdateUIEvent& aEvent );
void OnUpdateAutoPlaceModulesMode( wxUpdateUIEvent& aEvent );
void OnUpdateAutoPlaceTracksMode( wxUpdateUIEvent& aEvent );
/**
* Function RecordMacros.
......@@ -474,7 +480,7 @@ public:
void ReCreateMicrowaveVToolbar();
void ReCreateOptToolbar();
void ReCreateMenuBar();
LAYER_BOX_SELECTOR* ReCreateLayerBox( EDA_TOOLBAR* parent );
LAYER_BOX_SELECTOR* ReCreateLayerBox( wxAuiToolBar* parent );
/**
* Function OnModify
......@@ -1321,6 +1327,8 @@ public:
// Autoplacement:
void AutoPlace( wxCommandEvent& event );
void OnSelectAutoPlaceMode( wxCommandEvent& aEvent );
/**
* Function OnOrientFootprints
* install the dialog box for the common Orient Footprints
......
......@@ -71,7 +71,6 @@ class EDA_RECT;
class EDA_DRAW_PANEL;
class EDA_MSG_PANEL;
class BASE_SCREEN;
class EDA_TOOLBAR;
class PARAM_CFG_BASE;
class Ki_PageDescr;
class PLOTTER;
......@@ -98,13 +97,6 @@ enum id_drawframe {
KICAD_MAIN_FRAME
};
enum id_toolbar {
TOOLBAR_MAIN = 1, // Main horizontal Toolbar
TOOLBAR_TOOL, // Right vertical Toolbar (list of tools)
TOOLBAR_OPTION, // Left vertical Toolbar (option toolbar
TOOLBAR_AUX // Secondary horizontal Toolbar
};
/// Custom trace mask to enable and disable auto save tracing.
extern const wxChar* traceAutoSave;
......@@ -123,7 +115,7 @@ protected:
wxSize m_FrameSize;
int m_MsgFrameHeight;
EDA_TOOLBAR* m_HToolBar; // Standard horizontal Toolbar
wxAuiToolBar* m_mainToolBar; // Standard horizontal Toolbar
bool m_FrameIsActive;
wxString m_FrameName; // name used for writing and reading setup
// It is "SchematicFrame", "PcbFrame" ....
......@@ -376,14 +368,6 @@ class EDA_DRAW_FRAME : public EDA_BASE_FRAME
public:
EDA_DRAW_PANEL* DrawPanel; // Draw area
int m_HTOOL_current_state; // Id of active button on
// horizontal toolbar
int m_InternalUnits; // Internal units count in 1 inch
// = 1000 for Eeschema, = 10000
// for Pcbnew and GerbView
bool m_Print_Sheet_Ref; // true to print frame references
protected:
EDA_HOTKEY_CONFIG* m_HotkeysZoomAndGridList;
......@@ -391,6 +375,10 @@ protected:
bool m_DrawGrid; // hide/Show grid
int m_GridColor; // Grid color
/// Internal units count that is equivalent to 1 inch. Set to 1000 (0.001") for
/// schematic drawing and 10000 (0.0001") for PCB drawing.
int m_internalUnits;
/// Tool ID of previously active draw tool bar button.
int m_lastDrawToolId;
// on the vertical toolbar
......@@ -423,10 +411,10 @@ protected:
/// 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;
wxAuiToolBar* m_drawToolBar;
/// The options tool bar typcially located on the left edge of the main window.
EDA_TOOLBAR* m_optionsToolBar;
wxAuiToolBar* m_optionsToolBar;
/// Panel used to display information at the bottom of the main window.
EDA_MSG_PANEL* m_messagePanel;
......@@ -473,6 +461,8 @@ public:
void SetShowBorderAndTitleBlock( bool aShow ) { m_showBorderAndTitleBlock = aShow; }
int GetInternalUnits() const { return m_internalUnits; }
virtual wxString GetScreenDesc();
/**
......@@ -876,10 +866,6 @@ protected:
*/
wxSize computeTextSize( const wxString& text );
public:
EDA_DRAW_FRAME* m_Parent;
int m_BgColor;
public:
EDA_MSG_PANEL( EDA_DRAW_FRAME* parent, int id, const wxPoint& pos, const wxSize& size );
~EDA_MSG_PANEL();
......@@ -927,45 +913,6 @@ public:
};
/**
* Class EDA_TOOLBAR
* is the base class for deriving KiCad tool bars.
*/
class EDA_TOOLBAR : public wxAuiToolBar
{
public:
wxWindow* m_Parent;
id_toolbar m_Ident;
bool m_Horizontal; // some auxiliary TB are horizontal, others vertical
public:
EDA_TOOLBAR( id_toolbar type, wxWindow* parent, wxWindowID id, bool horizontal );
bool GetToolState( int toolId ) { return GetToolToggled(toolId); };
void AddRadioTool( int toolid,
const wxString& label,
const wxBitmap& bitmap,
const wxBitmap& bmpDisabled = wxNullBitmap,
const wxString& shortHelp = wxEmptyString,
const wxString& longHelp = wxEmptyString,
wxObject* data = NULL )
{
AddTool( toolid, label, bitmap, bmpDisabled, wxITEM_CHECK,
shortHelp, longHelp, data );
};
void SetToolNormalBitmap( int id, const wxBitmap& bitmap ) {};
void SetRows( int nRows ) {};
/**
* Function GetDimension
* @return the dimension of this toolbar (Height if horizontal, Width if vertical.
*/
int GetDimension();
};
/**
* Function AddMenuItem
* is an inline helper function to create and insert a menu item with an image
......
......@@ -63,7 +63,7 @@ class KICAD_MANAGER_FRAME : public EDA_BASE_FRAME
public:
TREE_PROJECT_FRAME* m_LeftWin;
RIGHT_KM_FRAME* m_RightWin;
EDA_TOOLBAR* m_VToolBar; // Vertical toolbar (not used)
wxAuiToolBar* m_VToolBar; // Vertical toolbar (not used)
wxString m_BoardFileName;
wxString m_SchematicRootFileName;
wxFileName m_ProjectFileName;
......
......@@ -75,9 +75,9 @@ KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME( wxWindow* parent,
EDA_PANEINFO info;
info.InfoToolbarPane();
if( m_HToolBar )
m_auimgr.AddPane( m_HToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top().Layer( 1 ) );
if( m_mainToolBar )
m_auimgr.AddPane( m_mainToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_mainToolBar" ) ).Top().Layer( 1 ) );
if( m_RightWin )
m_auimgr.AddPane( m_RightWin,
......
......@@ -296,43 +296,44 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
void KICAD_MANAGER_FRAME::RecreateBaseHToolbar()
{
// Check if toolbar is not already created
if( m_HToolBar != NULL )
if( m_mainToolBar != NULL )
return;
// Allocate memory for m_HToolBar
m_HToolBar = new EDA_TOOLBAR( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
// Allocate memory for m_mainToolBar
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
// New
m_HToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString,
m_mainToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString,
KiBitmap( new_project_xpm ),
_( "Start a new project" ) );
// Load
m_HToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString,
m_mainToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString,
KiBitmap( open_project_xpm ),
_( "Load existing project" ) );
// Save
m_HToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString,
m_mainToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString,
KiBitmap( save_project_xpm ),
_( "Save current project" ) );
// Separator
m_HToolBar->AddSeparator();
m_mainToolBar->AddSeparator();
// Archive
m_HToolBar->AddTool( ID_SAVE_AND_ZIP_FILES, wxEmptyString,
m_mainToolBar->AddTool( ID_SAVE_AND_ZIP_FILES, wxEmptyString,
KiBitmap( zip_xpm ),
_( "Archive all project files" ) );
// Separator
m_HToolBar->AddSeparator();
m_mainToolBar->AddSeparator();
// Refresh project tree
m_HToolBar->AddTool( ID_PROJECT_TREE_REFRESH, wxEmptyString,
m_mainToolBar->AddTool( ID_PROJECT_TREE_REFRESH, wxEmptyString,
KiBitmap( reload_xpm ),
_( "Refresh project tree" ) );
// Create m_HToolBar
m_HToolBar->Realize();
// Create m_mainToolBar
m_mainToolBar->Realize();
}
/****************************************************************/
/* Routines for automatic displacement and rotation of modules. */
/****************************************************************/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file automove.cpp
* @brief Routines for automatic displacement and rotation of modules.
*/
#include <algorithm>
......@@ -39,46 +65,14 @@ wxString ModulesMaskSelection = wxT( "*" );
void PCB_EDIT_FRAME::AutoPlace( wxCommandEvent& event )
{
int id = event.GetId();
bool on_state;
if( m_HToolBar == NULL )
if( m_mainToolBar == NULL )
return;
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
switch( id )
{
case ID_TOOLBARH_PCB_MODE_MODULE:
on_state = m_HToolBar->GetToolState( ID_TOOLBARH_PCB_MODE_MODULE );
if( on_state )
{
m_HToolBar->ToggleTool( ID_TOOLBARH_PCB_MODE_TRACKS, false );
m_HTOOL_current_state = ID_TOOLBARH_PCB_MODE_MODULE;
}
else
{
m_HTOOL_current_state = 0;
}
return;
case ID_TOOLBARH_PCB_MODE_TRACKS:
on_state = m_HToolBar->GetToolState( ID_TOOLBARH_PCB_MODE_TRACKS );
if( on_state )
{
m_HToolBar->ToggleTool( ID_TOOLBARH_PCB_MODE_MODULE, false );
m_HTOOL_current_state = ID_TOOLBARH_PCB_MODE_TRACKS;
}
else
{
m_HTOOL_current_state = 0;
}
return;
case ID_POPUP_PCB_AUTOROUTE_SELECT_LAYERS:
return;
......
......@@ -85,7 +85,7 @@ PCB_BASE_FRAME::PCB_BASE_FRAME( wxWindow* father,
long style) :
EDA_DRAW_FRAME( father, idtype, title, pos, size, style )
{
m_InternalUnits = PCB_INTERNAL_UNIT; // Internal unit = 1/10000 inch
m_internalUnits = PCB_INTERNAL_UNIT; // Internal unit = 1/10000 inch
m_Pcb = NULL;
m_DisplayPadFill = true; // How to draw pads
......@@ -504,7 +504,7 @@ void PCB_BASE_FRAME::UpdateStatusBar()
break;
}
Line.Printf( formatter, To_User_Unit( g_UserUnit, ro, m_InternalUnits ), theta );
Line.Printf( formatter, To_User_Unit( g_UserUnit, ro, m_internalUnits ), theta );
// overwrite the absolute cartesian coordinates
SetStatusText( Line, 2 );
......@@ -624,7 +624,7 @@ void PCB_BASE_FRAME::updateGridSelectBox()
for( size_t i = 0; i < GetScreen()->GetGridCount(); i++ )
{
GRID_TYPE& grid = GetScreen()->GetGrid( i );
double value = To_User_Unit( g_UserUnit, grid.m_Size.x, m_InternalUnits );
double value = To_User_Unit( g_UserUnit, grid.m_Size.x, m_internalUnits );
if( grid.m_Id != ID_POPUP_GRID_USER )
{
......
......@@ -107,18 +107,12 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode )
}
else if( GetToolId() == ID_NO_TOOL_SELECTED )
{
switch( m_HTOOL_current_state )
{
case ID_TOOLBARH_PCB_MODE_MODULE:
if( m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_MODULE ) )
scanList = GENERAL_COLLECTOR::ModuleItems;
break;
default:
scanList = DisplayOpt.DisplayZonesMode == 0 ?
else
scanList = (DisplayOpt.DisplayZonesMode == 0) ?
GENERAL_COLLECTOR::AllBoardItems :
GENERAL_COLLECTOR::AllButZones;
break;
}
}
else
{
......
......@@ -73,7 +73,7 @@ void DIALOG_SVG_PRINT::initDialog( )
AddUnitSymbol( *m_TextPenWidth, g_UserUnit );
m_DialogPenWidth->SetValue(
ReturnStringFromValue( g_UserUnit, s_Parameters.m_PenDefaultSize,
m_Parent->m_InternalUnits ) );
m_Parent->GetInternalUnits() ) );
m_Print_Frame_Ref_Ctrl->SetValue( s_Parameters.m_Print_Sheet_Ref );
......@@ -138,7 +138,7 @@ void DIALOG_SVG_PRINT::initDialog( )
void DIALOG_SVG_PRINT::SetPenWidth()
{
s_Parameters.m_PenDefaultSize = ReturnValueFromTextCtrl( *m_DialogPenWidth,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
if( s_Parameters.m_PenDefaultSize > WIDTH_MAX_VALUE )
{
......@@ -153,7 +153,7 @@ void DIALOG_SVG_PRINT::SetPenWidth()
g_DrawDefaultLineThickness = s_Parameters.m_PenDefaultSize;
m_DialogPenWidth->SetValue(
ReturnStringFromValue( g_UserUnit, s_Parameters.m_PenDefaultSize,
m_Parent->m_InternalUnits ) );
m_Parent->GetInternalUnits() ) );
}
......@@ -239,11 +239,11 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName,
screen->m_DrawOrg.x = screen->m_DrawOrg.y = 0;
screen->m_StartVisu.x = screen->m_StartVisu.y = 0;
SheetSize = screen->m_CurrentSheetDesc->m_Size; // size in 1/1000 inch
SheetSize.x *= m_Parent->m_InternalUnits / 1000;
SheetSize.y *= m_Parent->m_InternalUnits / 1000; // size in pixels
SheetSize.x *= m_Parent->GetInternalUnits() / 1000;
SheetSize.y *= m_Parent->GetInternalUnits() / 1000; // size in pixels
screen->SetScalingFactor( 1.0 );
float dpi = (float)m_Parent->m_InternalUnits;
float dpi = (float)m_Parent->GetInternalUnits();
EDA_DRAW_PANEL* panel = m_Parent->DrawPanel;
......
......@@ -84,13 +84,13 @@ void DIALOG_COPPER_ZONE::initDialog()
AddUnitSymbol( *m_ClearanceValueTitle, g_UserUnit );
msg = ReturnStringFromValue( g_UserUnit,
m_Zone_Setting->m_ZoneClearance,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
m_ZoneClearanceCtrl->SetValue( msg );
AddUnitSymbol( *m_MinThicknessValueTitle, g_UserUnit );
msg = ReturnStringFromValue( g_UserUnit,
m_Zone_Setting->m_ZoneMinThickness,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
m_ZoneMinThicknessCtrl->SetValue( msg );
switch( m_Zone_Setting->m_Zone_Pad_Options )
......@@ -298,7 +298,7 @@ bool DIALOG_COPPER_ZONE::AcceptOptions( bool aPromptForErrors, bool aUseExportab
wxString txtvalue = m_ZoneClearanceCtrl->GetValue();
m_Zone_Setting->m_ZoneClearance =
ReturnValueFromString( g_UserUnit, txtvalue, m_Parent->m_InternalUnits );
ReturnValueFromString( g_UserUnit, txtvalue, m_Parent->GetInternalUnits() );
// Test if this is a reasonnable value for this parameter
// A too large value can hang Pcbnew
......@@ -311,7 +311,7 @@ bool DIALOG_COPPER_ZONE::AcceptOptions( bool aPromptForErrors, bool aUseExportab
txtvalue = m_ZoneMinThicknessCtrl->GetValue();
m_Zone_Setting->m_ZoneMinThickness =
ReturnValueFromString( g_UserUnit, txtvalue, m_Parent->m_InternalUnits );
ReturnValueFromString( g_UserUnit, txtvalue, m_Parent->GetInternalUnits() );
if( m_Zone_Setting->m_ZoneMinThickness < 10 )
{
DisplayError( this,
......@@ -321,7 +321,7 @@ bool DIALOG_COPPER_ZONE::AcceptOptions( bool aPromptForErrors, bool aUseExportab
m_Zone_Setting->SetCornerSmoothingType( m_cornerSmoothingChoice->GetSelection() );
txtvalue = m_cornerSmoothingCtrl->GetValue();
m_Zone_Setting->SetCornerRadius( ReturnValueFromString( g_UserUnit, txtvalue, m_Parent->m_InternalUnits ) );
m_Zone_Setting->SetCornerRadius( ReturnValueFromString( g_UserUnit, txtvalue, m_Parent->GetInternalUnits() ) );
if( m_OrientEdgesOpt->GetSelection() == 0 )
g_Zone_45_Only = FALSE;
......
......@@ -207,7 +207,7 @@ DIALOG_DESIGN_RULES::DIALOG_DESIGN_RULES( PCB_EDIT_FRAME* parent ) :
void DIALOG_DESIGN_RULES::PrintCurrentSettings()
{
wxString msg, value;
int internal_units = m_Parent->m_InternalUnits;
int internal_units = m_Parent->GetInternalUnits();
m_MessagesList->AppendToPage( _( "<b>Current general settings:</b><br>" ) );
......@@ -290,7 +290,7 @@ void DIALOG_DESIGN_RULES::InitGlobalRules()
AddUnitSymbol( *m_MicroViaMinDrillTitle );
AddUnitSymbol( *m_TrackMinWidthTitle );
int Internal_Unit = m_Parent->m_InternalUnits;
int Internal_Unit = m_Parent->GetInternalUnits();
PutValueInLocalUnits( *m_SetViasMinSizeCtrl, m_BrdSettings.m_ViasMinSize, Internal_Unit );
PutValueInLocalUnits( *m_SetViasMinDrillCtrl, m_BrdSettings.m_ViasMinDrill, Internal_Unit );
......@@ -326,7 +326,7 @@ void DIALOG_DESIGN_RULES::InitDimensionsLists()
*/
{
wxString msg;
int Internal_Unit = m_Parent->m_InternalUnits;
int Internal_Unit = m_Parent->GetInternalUnits();
// Compute the column widths here, after setting texts
msg = wxT("000000.000000"); // This is a very long text to display values.
......@@ -530,7 +530,7 @@ void DIALOG_DESIGN_RULES::InitRulesList()
}
// enter the Default NETCLASS.
class2gridRow( m_grid, 0, netclasses.GetDefault(), m_Parent->m_InternalUnits );
class2gridRow( m_grid, 0, netclasses.GetDefault(), m_Parent->GetInternalUnits() );
// enter others netclasses
int row = 1;
......@@ -538,7 +538,7 @@ void DIALOG_DESIGN_RULES::InitRulesList()
{
NETCLASS* netclass = i->second;
class2gridRow( m_grid, row, netclass, m_Parent->m_InternalUnits );
class2gridRow( m_grid, row, netclass, m_Parent->GetInternalUnits() );
}
}
......@@ -567,7 +567,7 @@ void DIALOG_DESIGN_RULES::CopyRulesListToBoard()
netclasses.Clear();
// Copy the default NetClass:
gridRow2class( m_grid, 0, netclasses.GetDefault(), m_Parent->m_InternalUnits );
gridRow2class( m_grid, 0, netclasses.GetDefault(), m_Parent->GetInternalUnits() );
// Copy other NetClasses :
for( int row = 1; row < m_grid->GetNumberRows(); ++row )
......@@ -586,7 +586,7 @@ void DIALOG_DESIGN_RULES::CopyRulesListToBoard()
continue;
}
gridRow2class( m_grid, row, nc, m_Parent->m_InternalUnits );
gridRow2class( m_grid, row, nc, m_Parent->GetInternalUnits() );
}
// Now read all nets and push them in the corresponding netclass net buffer
......@@ -611,21 +611,21 @@ void DIALOG_DESIGN_RULES::CopyGlobalRulesToBoard()
// Update vias minimum values for DRC
m_BrdSettings.m_ViasMinSize =
ReturnValueFromTextCtrl( *m_SetViasMinSizeCtrl, m_Parent->m_InternalUnits );
ReturnValueFromTextCtrl( *m_SetViasMinSizeCtrl, m_Parent->GetInternalUnits() );
m_BrdSettings.m_ViasMinDrill =
ReturnValueFromTextCtrl( *m_SetViasMinDrillCtrl, m_Parent->m_InternalUnits );
ReturnValueFromTextCtrl( *m_SetViasMinDrillCtrl, m_Parent->GetInternalUnits() );
m_BrdSettings.m_MicroViasAllowed = m_AllowMicroViaCtrl->GetSelection() == 1;
// Update microvias minimum values for DRC
m_BrdSettings.m_MicroViasMinSize =
ReturnValueFromTextCtrl( *m_SetMicroViasMinSizeCtrl, m_Parent->m_InternalUnits );
ReturnValueFromTextCtrl( *m_SetMicroViasMinSizeCtrl, m_Parent->GetInternalUnits() );
m_BrdSettings.m_MicroViasMinDrill =
ReturnValueFromTextCtrl( *m_SetMicroViasMinDrillCtrl, m_Parent->m_InternalUnits );
ReturnValueFromTextCtrl( *m_SetMicroViasMinDrillCtrl, m_Parent->GetInternalUnits() );
// Update tracks minimum values for DRC
m_BrdSettings.m_TrackMinWidth =
ReturnValueFromTextCtrl( *m_SetTrackMinWidthCtrl, m_Parent->m_InternalUnits );
ReturnValueFromTextCtrl( *m_SetTrackMinWidthCtrl, m_Parent->GetInternalUnits() );
}
......@@ -642,7 +642,7 @@ void DIALOG_DESIGN_RULES::CopyDimensionsListsToBoard()
msg = m_gridTrackWidthList->GetCellValue( row, 0 );
if( msg.IsEmpty() )
continue;
int value = ReturnValueFromString( g_UserUnit, msg, m_Parent->m_InternalUnits );
int value = ReturnValueFromString( g_UserUnit, msg, m_Parent->GetInternalUnits() );
m_TracksWidthList.push_back( value );
}
......@@ -656,13 +656,13 @@ void DIALOG_DESIGN_RULES::CopyDimensionsListsToBoard()
msg = m_gridViaSizeList->GetCellValue( row, 0 );
if( msg.IsEmpty() )
continue;
int value = ReturnValueFromString( g_UserUnit, msg, m_Parent->m_InternalUnits );
int value = ReturnValueFromString( g_UserUnit, msg, m_Parent->GetInternalUnits() );
VIA_DIMENSION via_dim;
via_dim.m_Diameter = value;
msg = m_gridViaSizeList->GetCellValue( row, 1 );
if( !msg.IsEmpty() )
{
value = ReturnValueFromString( g_UserUnit, msg, m_Parent->m_InternalUnits );
value = ReturnValueFromString( g_UserUnit, msg, m_Parent->GetInternalUnits() );
via_dim.m_Drill = value;
}
m_ViasDimensionsList.push_back( via_dim );
......@@ -995,22 +995,22 @@ bool DIALOG_DESIGN_RULES::TestDataValidity()
wxString msg;
int minViaDia = ReturnValueFromTextCtrl( *m_SetViasMinSizeCtrl,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
int minViaDrill = ReturnValueFromTextCtrl( *m_SetViasMinDrillCtrl,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
int minUViaDia = ReturnValueFromTextCtrl( *m_SetMicroViasMinSizeCtrl,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
int minUViaDrill = ReturnValueFromTextCtrl( *m_SetMicroViasMinDrillCtrl,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
int minTrackWidth = ReturnValueFromTextCtrl( *m_SetTrackMinWidthCtrl,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
for( int row = 0; row < m_grid->GetNumberRows(); row++ )
{
int tracksize = ReturnValueFromString( g_UserUnit,
m_grid->GetCellValue( row, GRID_TRACKSIZE ),
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
if( tracksize < minTrackWidth )
{
result = false;
......@@ -1023,7 +1023,7 @@ bool DIALOG_DESIGN_RULES::TestDataValidity()
// Test vias
int viadia = ReturnValueFromString( g_UserUnit,
m_grid->GetCellValue( row, GRID_VIASIZE ),
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
if( viadia < minViaDia )
{
......@@ -1036,7 +1036,7 @@ bool DIALOG_DESIGN_RULES::TestDataValidity()
int viadrill = ReturnValueFromString( g_UserUnit,
m_grid->GetCellValue( row, GRID_VIADRILL ),
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
if( viadrill >= viadia )
{
result = false;
......@@ -1058,7 +1058,7 @@ bool DIALOG_DESIGN_RULES::TestDataValidity()
// Test Micro vias
int muviadia = ReturnValueFromString( g_UserUnit,
m_grid->GetCellValue( row, GRID_uVIASIZE ),
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
if( muviadia < minUViaDia )
{
......@@ -1071,7 +1071,7 @@ bool DIALOG_DESIGN_RULES::TestDataValidity()
int muviadrill = ReturnValueFromString( g_UserUnit,
m_grid->GetCellValue( row, GRID_uVIADRILL ),
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
if( muviadrill >= muviadia )
{
result = false;
......@@ -1101,7 +1101,7 @@ bool DIALOG_DESIGN_RULES::TestDataValidity()
int tracksize = ReturnValueFromString( g_UserUnit,
tvalue,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
if( tracksize < minTrackWidth )
{
result = false;
......@@ -1128,12 +1128,12 @@ bool DIALOG_DESIGN_RULES::TestDataValidity()
continue;
int viadia = ReturnValueFromString( g_UserUnit, tvalue,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
int viadrill = 0;
wxString drlvalue = m_gridViaSizeList->GetCellValue( row, 1 );
if( !drlvalue.IsEmpty() )
viadrill = ReturnValueFromString( g_UserUnit, drlvalue,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
if( viadia < minViaDia )
{
result = false;
......
......@@ -131,11 +131,11 @@ void DIALOG_DRC_CONTROL::InitValues()
void DIALOG_DRC_CONTROL::SetDrcParmeters( )
{
m_BrdSettings.m_TrackMinWidth =
ReturnValueFromTextCtrl( *m_SetTrackMinWidthCtrl, m_Parent->m_InternalUnits );
ReturnValueFromTextCtrl( *m_SetTrackMinWidthCtrl, m_Parent->GetInternalUnits() );
m_BrdSettings.m_ViasMinSize =
ReturnValueFromTextCtrl( *m_SetViaMinSizeCtrl, m_Parent->m_InternalUnits );
ReturnValueFromTextCtrl( *m_SetViaMinSizeCtrl, m_Parent->GetInternalUnits() );
m_BrdSettings.m_MicroViasMinSize =
ReturnValueFromTextCtrl( *m_SetMicroViakMinSizeCtrl, m_Parent->m_InternalUnits );
ReturnValueFromTextCtrl( *m_SetMicroViakMinSizeCtrl, m_Parent->GetInternalUnits() );
m_Parent->GetBoard()->SetDesignSettings( m_BrdSettings );
}
......
......@@ -110,7 +110,7 @@ void DIALOG_MODULE_BOARD_EDITOR::InitBoardProperties()
m_SolderMaskMarginUnits->SetLabel( GetUnitsLabel( g_UserUnit ) );
m_SolderPasteMarginUnits->SetLabel( GetUnitsLabel( g_UserUnit ) );
int internalUnit = m_Parent->m_InternalUnits;
int internalUnit = m_Parent->GetInternalUnits();
PutValueInLocalUnits( *m_NetClearanceValueCtrl,
m_CurrentModule->m_LocalClearance, internalUnit );
PutValueInLocalUnits( *m_SolderMaskMarginCtrl,
......@@ -463,11 +463,11 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
// Initialize masks clearances
m_CurrentModule->m_LocalClearance =
ReturnValueFromTextCtrl( *m_NetClearanceValueCtrl, m_Parent->m_InternalUnits );
ReturnValueFromTextCtrl( *m_NetClearanceValueCtrl, m_Parent->GetInternalUnits() );
m_CurrentModule->m_LocalSolderMaskMargin =
ReturnValueFromTextCtrl( *m_SolderMaskMarginCtrl, m_Parent->m_InternalUnits );
ReturnValueFromTextCtrl( *m_SolderMaskMarginCtrl, m_Parent->GetInternalUnits() );
m_CurrentModule->m_LocalSolderPasteMargin =
ReturnValueFromTextCtrl( *m_SolderPasteMarginCtrl, m_Parent->m_InternalUnits );
ReturnValueFromTextCtrl( *m_SolderPasteMarginCtrl, m_Parent->GetInternalUnits() );
double dtmp = 0.0;
msg = m_SolderPasteMarginRatioCtrl->GetValue();
msg.ToDouble( &dtmp );
......
......@@ -147,7 +147,7 @@ void DIALOG_MODULE_MODULE_EDITOR::InitModeditProperties()
m_SolderPasteMarginUnits->SetLabel( GetUnitsLabel( g_UserUnit ) );
wxString msg;
int internalUnit = m_Parent->m_InternalUnits;
int internalUnit = m_Parent->GetInternalUnits();
PutValueInLocalUnits( *m_NetClearanceValueCtrl,
m_CurrentModule->m_LocalClearance, internalUnit );
PutValueInLocalUnits( *m_SolderMaskMarginCtrl,
......@@ -368,7 +368,7 @@ void DIALOG_MODULE_MODULE_EDITOR::OnOkClick( wxCommandEvent& event )
m_CurrentModule->m_Value->Copy(m_ValueCopy );
// Initialize masks clearances
int internalUnit = m_Parent->m_InternalUnits;
int internalUnit = m_Parent->GetInternalUnits();
m_CurrentModule->m_LocalClearance =
ReturnValueFromTextCtrl( *m_NetClearanceValueCtrl, internalUnit );
m_CurrentModule->m_LocalSolderMaskMargin =
......
......@@ -121,23 +121,23 @@ void DialogEditModuleText::initDlg( )
AddUnitSymbol( *m_SizeXTitle );
PutValueInLocalUnits( *m_TxtSizeCtrlX, m_currentText->m_Size.x,
m_parent->m_InternalUnits );
m_parent->GetInternalUnits() );
AddUnitSymbol( *m_SizeYTitle );
PutValueInLocalUnits( *m_TxtSizeCtrlY, m_currentText->m_Size.y,
m_parent->m_InternalUnits );
m_parent->GetInternalUnits() );
AddUnitSymbol( *m_PosXTitle );
PutValueInLocalUnits( *m_TxtPosCtrlX, m_currentText->GetPos0().x,
m_parent->m_InternalUnits );
m_parent->GetInternalUnits() );
AddUnitSymbol( *m_PosYTitle );
PutValueInLocalUnits( *m_TxtPosCtrlY, m_currentText->GetPos0().y,
m_parent->m_InternalUnits );
m_parent->GetInternalUnits() );
AddUnitSymbol( *m_WidthTitle );
PutValueInLocalUnits( *m_TxtWidthCtlr, m_currentText->m_Thickness,
m_parent->m_InternalUnits );
m_parent->GetInternalUnits() );
int text_orient = m_currentText->m_Orient;
NORMALIZE_ANGLE_90(text_orient)
......@@ -169,19 +169,19 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
wxPoint tmp;
msg = m_TxtPosCtrlX->GetValue();
tmp.x = ReturnValueFromString( g_UserUnit, msg, m_parent->m_InternalUnits );
tmp.x = ReturnValueFromString( g_UserUnit, msg, m_parent->GetInternalUnits() );
msg = m_TxtPosCtrlY->GetValue();
tmp.y = ReturnValueFromString( g_UserUnit, msg, m_parent->m_InternalUnits );
tmp.y = ReturnValueFromString( g_UserUnit, msg, m_parent->GetInternalUnits() );
m_currentText->SetPos0( tmp );
msg = m_TxtSizeCtrlX->GetValue();
m_currentText->m_Size.x = ReturnValueFromString( g_UserUnit, msg,
m_parent->m_InternalUnits );
m_parent->GetInternalUnits() );
msg = m_TxtSizeCtrlY->GetValue();
m_currentText->m_Size.y = ReturnValueFromString( g_UserUnit, msg,
m_parent->m_InternalUnits );
m_parent->GetInternalUnits() );
// Test for a reasonnable size:
if( m_currentText->m_Size.x< TEXTS_MIN_SIZE )
......@@ -190,7 +190,7 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
m_currentText->m_Size.y = TEXTS_MIN_SIZE;
msg = m_TxtWidthCtlr->GetValue();
int width = ReturnValueFromString( g_UserUnit, msg, m_parent->m_InternalUnits );
int width = ReturnValueFromString( g_UserUnit, msg, m_parent->GetInternalUnits() );
// Test for a reasonnable width:
if( width <= 1 )
......
......@@ -149,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->GetToolToggled( id );
switch( id )
{
......
......@@ -44,7 +44,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit()
wxString msg;
// Display current setup for tracks and vias
int Internal_Unit = m_Parent->m_InternalUnits;
int Internal_Unit = m_Parent->GetInternalUnits();
BOARD* board = m_Parent->GetBoard();
NETCLASSES& netclasses = board->m_NetClasses;
NETINFO_ITEM* net = board->FindNet( m_Netcode );
......
......@@ -119,23 +119,23 @@ void DialogGraphicItemProperties::initDlg( )
AddUnitSymbol( *m_Start_Center_XText );
PutValueInLocalUnits( *m_Center_StartXCtrl, m_Item->GetStart().x,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
AddUnitSymbol( *m_Start_Center_YText );
PutValueInLocalUnits( *m_Center_StartYCtrl, m_Item->GetStart().y,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
AddUnitSymbol( *m_EndX_Radius_Text );
PutValueInLocalUnits( *m_EndX_Radius_Ctrl, m_Item->GetEnd().x,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
AddUnitSymbol( *m_EndY_Text );
PutValueInLocalUnits( *m_EndY_Ctrl, m_Item->GetEnd().y,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
AddUnitSymbol( *m_ItemThicknessText );
PutValueInLocalUnits( *m_ThicknessCtrl, m_Item->GetWidth(),
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
AddUnitSymbol( *m_DefaultThicknessText );
......@@ -147,7 +147,7 @@ void DialogGraphicItemProperties::initDlg( )
thickness = m_BrdSettings.m_DrawSegmentWidth;
PutValueInLocalUnits( *m_DefaultThicknessCtrl, thickness,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
for( int layer=FIRST_NO_COPPER_LAYER; layer <= LAST_NO_COPPER_LAYER; ++layer )
{
......@@ -176,7 +176,7 @@ void DialogGraphicItemProperties::OnLayerChoice( wxCommandEvent& event )
thickness = m_BrdSettings.m_DrawSegmentWidth;
PutValueInLocalUnits( *m_DefaultThicknessCtrl, thickness,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
}
/*******************************************************************/
......@@ -192,22 +192,22 @@ void DialogGraphicItemProperties::OnOkClick( wxCommandEvent& event )
m_Item->Draw( m_Parent->DrawPanel, m_DC, GR_XOR );
msg = m_Center_StartXCtrl->GetValue();
m_Item->SetStartX( ReturnValueFromString( g_UserUnit, msg, m_Parent->m_InternalUnits ));
m_Item->SetStartX( ReturnValueFromString( g_UserUnit, msg, m_Parent->GetInternalUnits() ));
msg = m_Center_StartYCtrl->GetValue();
m_Item->SetStartY( ReturnValueFromString( g_UserUnit, msg, m_Parent->m_InternalUnits ));
m_Item->SetStartY( ReturnValueFromString( g_UserUnit, msg, m_Parent->GetInternalUnits() ));
msg = m_EndX_Radius_Ctrl->GetValue();
m_Item->SetEndX( ReturnValueFromString( g_UserUnit, msg, m_Parent->m_InternalUnits ));
m_Item->SetEndX( ReturnValueFromString( g_UserUnit, msg, m_Parent->GetInternalUnits() ));
msg = m_EndY_Ctrl->GetValue();
m_Item->SetEndY( ReturnValueFromString( g_UserUnit, msg, m_Parent->m_InternalUnits ));
m_Item->SetEndY( ReturnValueFromString( g_UserUnit, msg, m_Parent->GetInternalUnits() ));
msg = m_ThicknessCtrl->GetValue();
m_Item->SetWidth( ReturnValueFromString( g_UserUnit, msg, m_Parent->m_InternalUnits ));
m_Item->SetWidth( ReturnValueFromString( g_UserUnit, msg, m_Parent->GetInternalUnits() ));
msg = m_DefaultThicknessCtrl->GetValue();
int thickness = ReturnValueFromString( g_UserUnit, msg, m_Parent->m_InternalUnits );
int thickness = ReturnValueFromString( g_UserUnit, msg, m_Parent->GetInternalUnits() );
m_Item->SetLayer( m_LayerSelection->GetCurrentSelection() + FIRST_NO_COPPER_LAYER);
......
......@@ -42,7 +42,7 @@ void DIALOG_PADS_MASK_CLEARANCE::MyInit()
m_SolderMaskMarginUnits->SetLabel( GetUnitsLabel( g_UserUnit ) );
m_SolderPasteMarginUnits->SetLabel( GetUnitsLabel( g_UserUnit ) );
int Internal_Unit = m_Parent->m_InternalUnits;
int Internal_Unit = m_Parent->GetInternalUnits();
PutValueInLocalUnits( *m_SolderMaskMarginCtrl,
m_BrdSettings.m_SolderMaskMargin,
Internal_Unit );
......@@ -70,10 +70,10 @@ void DIALOG_PADS_MASK_CLEARANCE::OnButtonOkClick( wxCommandEvent& event )
/*******************************************************************/
{
m_BrdSettings.m_SolderMaskMargin =
ReturnValueFromTextCtrl( *m_SolderMaskMarginCtrl, m_Parent->m_InternalUnits );
ReturnValueFromTextCtrl( *m_SolderMaskMarginCtrl, m_Parent->GetInternalUnits() );
m_BrdSettings.m_SolderPasteMargin =
ReturnValueFromTextCtrl( *m_SolderPasteMarginCtrl, m_Parent->m_InternalUnits );
ReturnValueFromTextCtrl( *m_SolderPasteMarginCtrl, m_Parent->GetInternalUnits() );
double dtmp = 0;
wxString msg = m_SolderPasteMarginRatioCtrl->GetValue();
......
......@@ -190,7 +190,7 @@ void DIALOG_PAD_PROPERTIES::initValues()
{
SetFocus(); // Required under wxGTK if we want to demiss the dialog with the ESC key
int internalUnits = m_Parent->m_InternalUnits;
int internalUnits = m_Parent->GetInternalUnits();
wxString msg;
m_isFlipped = false;
if( m_CurrentPad )
......@@ -688,7 +688,7 @@ void DIALOG_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event )
bool DIALOG_PAD_PROPERTIES::TransfertDataToPad( D_PAD* aPad, bool aPromptOnError )
{
long PadLayerMask;
int internalUnits = m_Parent->m_InternalUnits;
int internalUnits = m_Parent->GetInternalUnits();
wxString msg;
aPad->m_Attribut = CodeType[m_PadType->GetSelection()];
......
......@@ -91,15 +91,15 @@ void DIALOG_PCB_TEXT_PROPERTIES::MyInit()
*m_TextContentCtrl << m_SelectedPCBText->m_Text;
PutValueInLocalUnits( *m_SizeXCtrl, m_SelectedPCBText->m_Size.x,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
PutValueInLocalUnits( *m_SizeYCtrl, m_SelectedPCBText->m_Size.y,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
PutValueInLocalUnits( *m_ThicknessCtrl, m_SelectedPCBText->m_Thickness,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
PutValueInLocalUnits( *m_PositionXCtrl, m_SelectedPCBText->m_Pos.x,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
PutValueInLocalUnits( *m_PositionYCtrl, m_SelectedPCBText->m_Pos.y,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
int enabledLayers = m_Parent->GetBoard()->GetEnabledLayers();
for( int layer = 0; layer < NB_LAYERS; ++layer )
......@@ -195,13 +195,13 @@ void DIALOG_PCB_TEXT_PROPERTIES::OnOkClick( wxCommandEvent& event )
}
// Set PCB Text position
newPosition.x = ReturnValueFromString( g_UserUnit, m_PositionXCtrl->GetValue(), m_Parent->m_InternalUnits );
newPosition.y = ReturnValueFromString( g_UserUnit, m_PositionYCtrl->GetValue(), m_Parent->m_InternalUnits );
newPosition.x = ReturnValueFromString( g_UserUnit, m_PositionXCtrl->GetValue(), m_Parent->GetInternalUnits() );
newPosition.y = ReturnValueFromString( g_UserUnit, m_PositionYCtrl->GetValue(), m_Parent->GetInternalUnits() );
m_SelectedPCBText->m_Pos = newPosition;
// Check constraints and set PCB Text size
newSize.x = ReturnValueFromString( g_UserUnit, m_SizeXCtrl->GetValue(), m_Parent->m_InternalUnits );
newSize.y = ReturnValueFromString( g_UserUnit, m_SizeYCtrl->GetValue(), m_Parent->m_InternalUnits );
newSize.x = ReturnValueFromString( g_UserUnit, m_SizeXCtrl->GetValue(), m_Parent->GetInternalUnits() );
newSize.y = ReturnValueFromString( g_UserUnit, m_SizeYCtrl->GetValue(), m_Parent->GetInternalUnits() );
if( newSize.x < TEXTS_MIN_SIZE )
newSize.x = TEXTS_MIN_SIZE;
......@@ -214,7 +214,7 @@ void DIALOG_PCB_TEXT_PROPERTIES::OnOkClick( wxCommandEvent& event )
m_SelectedPCBText->m_Size = newSize;
// Set the new thickness
m_SelectedPCBText->m_Thickness = ReturnValueFromString( g_UserUnit, m_ThicknessCtrl->GetValue(), m_Parent->m_InternalUnits );
m_SelectedPCBText->m_Thickness = ReturnValueFromString( g_UserUnit, m_ThicknessCtrl->GetValue(), m_Parent->GetInternalUnits() );
// Test for acceptable values for thickness and size and clamp if fails
int maxthickness = Clamp_Text_PenSize( m_SelectedPCBText->m_Thickness, m_SelectedPCBText->m_Size );
......
......@@ -266,7 +266,7 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( )
s_Parameters.m_PenDefaultSize = g_DrawDefaultLineThickness;
AddUnitSymbol( *m_TextPenWidth, g_UserUnit );
m_DialogPenWidth->SetValue(
ReturnStringFromValue( g_UserUnit, s_Parameters.m_PenDefaultSize, m_Parent->m_InternalUnits ) );
ReturnStringFromValue( g_UserUnit, s_Parameters.m_PenDefaultSize, m_Parent->GetInternalUnits() ) );
// Create scale adjust option
......@@ -420,7 +420,7 @@ void DIALOG_PRINT_USING_PRINTER::SetPenWidth()
* NOTE: s_Parameters.m_PenDefaultSize is in internal units
*/
{
s_Parameters.m_PenDefaultSize = ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->m_InternalUnits );
s_Parameters.m_PenDefaultSize = ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->GetInternalUnits() );
if( s_Parameters.m_PenDefaultSize > WIDTH_MAX_VALUE )
{
......@@ -435,7 +435,7 @@ void DIALOG_PRINT_USING_PRINTER::SetPenWidth()
g_DrawDefaultLineThickness = s_Parameters.m_PenDefaultSize;
m_DialogPenWidth->SetValue(
ReturnStringFromValue( g_UserUnit, s_Parameters.m_PenDefaultSize, m_Parent->m_InternalUnits ) );
ReturnStringFromValue( g_UserUnit, s_Parameters.m_PenDefaultSize, m_Parent->GetInternalUnits() ) );
}
void DIALOG_PRINT_USING_PRINTER::OnScaleSelectionClick( wxCommandEvent& event )
......
......@@ -92,23 +92,23 @@ DIALOG_DIMENSION_EDITOR::DIALOG_DIMENSION_EDITOR( PCB_EDIT_FRAME* aParent,
// Enter size value in dialog
PutValueInLocalUnits( *m_TxtSizeXCtrl, aDimension->m_Text.m_Size.x,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
AddUnitSymbol( *m_staticTextSizeX );
PutValueInLocalUnits( *m_TxtSizeYCtrl, aDimension->m_Text.m_Size.y,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
AddUnitSymbol( *m_staticTextSizeY );
// Enter lines thickness value in dialog
PutValueInLocalUnits( *m_TxtWidthCtrl, aDimension->m_Width,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
AddUnitSymbol( *m_staticTextWidth );
// Enter position value in dialog
PutValueInLocalUnits( *m_textCtrlPosX, aDimension->m_Text.m_Pos.x,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
AddUnitSymbol( *m_staticTextPosX );
PutValueInLocalUnits( *m_textCtrlPosY, aDimension->m_Text.m_Pos.y,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
AddUnitSymbol( *m_staticTextPosY );
for( int layer = FIRST_NO_COPPER_LAYER; layer<NB_LAYERS; layer++ )
......@@ -149,24 +149,24 @@ void DIALOG_DIMENSION_EDITOR::OnOKClick( wxCommandEvent& event )
// Get new size value:
msg = m_TxtSizeXCtrl->GetValue();
CurrentDimension->m_Text.m_Size.x = ReturnValueFromString( g_UserUnit, msg,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
msg = m_TxtSizeYCtrl->GetValue();
CurrentDimension->m_Text.m_Size.y = ReturnValueFromString( g_UserUnit, msg,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
// Get new position value:
// It will be copied later in dimension, because
msg = m_textCtrlPosX->GetValue();
CurrentDimension->m_Text.m_Pos.x = ReturnValueFromString( g_UserUnit, msg,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
msg = m_textCtrlPosY->GetValue();
CurrentDimension->m_Text.m_Pos.y = ReturnValueFromString( g_UserUnit, msg,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
// Get new line thickness value:
msg = m_TxtWidthCtrl->GetValue();
int width = ReturnValueFromString( g_UserUnit, msg,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
int maxthickness = Clamp_Text_PenSize( width, CurrentDimension->m_Text.m_Size );
if( width > maxthickness )
......
......@@ -56,13 +56,13 @@ void DRC::ShowDialog()
PutValueInLocalUnits( *m_ui->m_SetTrackMinWidthCtrl,
m_pcb->GetDesignSettings().m_TrackMinWidth,
m_mainWindow->m_InternalUnits );
m_mainWindow->GetInternalUnits() );
PutValueInLocalUnits( *m_ui->m_SetViaMinSizeCtrl,
m_pcb->GetDesignSettings().m_ViasMinSize,
m_mainWindow->m_InternalUnits );
m_mainWindow->GetInternalUnits() );
PutValueInLocalUnits( *m_ui->m_SetMicroViakMinSizeCtrl,
m_pcb->GetDesignSettings().m_MicroViasMinSize,
m_mainWindow->m_InternalUnits );
m_mainWindow->GetInternalUnits() );
m_ui->m_CreateRptCtrl->SetValue( m_doCreateRptFile );
m_ui->m_RptFilenameCtrl->SetValue( m_rptFilename );
......
......@@ -104,13 +104,13 @@ TARGET_PROPERTIES_DIALOG_EDITOR::TARGET_PROPERTIES_DIALOG_EDITOR( PCB_EDIT_FRAME
m_MireSizeCtrl = new EDA_VALUE_CTRL( this, _( "Size" ),
m_Target->GetSize(),
g_UserUnit, LeftBoxSizer,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
// Width:
m_MireWidthCtrl = new EDA_VALUE_CTRL( this, _( "Width" ),
m_Target->GetWidth(),
g_UserUnit, LeftBoxSizer,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
// Shape
wxString shape_list[2] = { _( "shape +" ), _( "shape X" ) };
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file modeditoptions.cpp
* @brief Pcbnew footprint (module) editor options.
......@@ -23,24 +48,22 @@ 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->GetToolToggled( id );
DrawPanel->Refresh( );
break;
case ID_TB_OPTIONS_SHOW_VIAS_SKETCH:
m_DisplayViaFill = !m_optionsToolBar->GetToolState( id );
m_DisplayViaFill = !m_optionsToolBar->GetToolToggled( id );
DrawPanel->Refresh( );
break;
case ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH:
m_DisplayModText =
m_optionsToolBar->GetToolState( id ) ? SKETCH : FILLED;
m_DisplayModText = m_optionsToolBar->GetToolToggled( id ) ? SKETCH : FILLED;
DrawPanel->Refresh( );
break;
case ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH:
m_DisplayModEdge =
m_optionsToolBar->GetToolState( id ) ? SKETCH : FILLED;
m_DisplayModEdge = m_optionsToolBar->GetToolToggled( id ) ? SKETCH : FILLED;
DrawPanel->Refresh( );
break;
......
......@@ -191,8 +191,8 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( wxWindow* father,
EDA_PANEINFO mesg_pane;
mesg_pane.MessageToolbarPane();
m_auimgr.AddPane( m_HToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top(). Row( 0 ) );
m_auimgr.AddPane( m_mainToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_mainToolBar" ) ).Top(). Row( 0 ) );
m_auimgr.AddPane( m_auxiliaryToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_auxiliaryToolBar" ) ).Top().Row( 1 ) );
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2007-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcbnew/onrightclick.cpp
* @brief Right mouse button functions.
......@@ -52,7 +77,8 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{
if( item && item->m_Flags )
{
AddMenuItem( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel" ), KiBitmap( cancel_xpm ) );
AddMenuItem( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel" ),
KiBitmap( cancel_xpm ) );
}
else
{
......@@ -118,7 +144,7 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
case PCB_MODULE_T:
createPopUpMenuForFootprints( (MODULE*) item, aPopMenu );
if( m_HTOOL_current_state == ID_TOOLBARH_PCB_MODE_MODULE )
if( m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_MODULE ) )
{
aPopMenu->AppendSeparator();
......@@ -142,7 +168,7 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
_( "Auto Place Module" ) );
}
if( m_HTOOL_current_state == ID_TOOLBARH_PCB_MODE_TRACKS )
if( m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_TRACKS ) )
{
if( !flags )
aPopMenu->Append( ID_POPUP_PCB_AUTOROUTE_MODULE, _( "Autoroute Module" ) );
......@@ -226,7 +252,8 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
HK_MOVE_ITEM );
AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_TEXT_DIMENSION_REQUEST,
msg, KiBitmap( move_text_xpm ) );
msg = AddHotkeyName( _( "Delete Dimension" ), g_Board_Editor_Hokeys_Descr, HK_DELETE );
msg = AddHotkeyName( _( "Delete Dimension" ), g_Board_Editor_Hokeys_Descr,
HK_DELETE );
AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_DIMENSION,
msg, KiBitmap( delete_xpm ) );
}
......@@ -303,7 +330,8 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
case ID_TRACK_BUTT:
if ( ! locate_track ) // This menu is already added when a track is located
AddMenuItem( aPopMenu, Append_Track_Width_List( GetBoard() ),
ID_POPUP_PCB_SELECT_WIDTH, _( "Select Track Width" ), KiBitmap( width_track_xpm ) );
ID_POPUP_PCB_SELECT_WIDTH, _( "Select Track Width" ),
KiBitmap( width_track_xpm ) );
AddMenuItem( aPopMenu, ID_POPUP_PCB_SELECT_CU_LAYER,
_( "Select Working Layer" ), KiBitmap( select_w_layer_xpm ) );
......@@ -329,7 +357,7 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
break;
case ID_NO_TOOL_SELECTED:
if( m_HTOOL_current_state == ID_TOOLBARH_PCB_MODE_MODULE )
if( m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_MODULE ) )
{
wxMenu* commands = new wxMenu;
AddMenuItem( aPopMenu, commands, ID_POPUP_PCB_AUTOPLACE_COMMANDS,
......@@ -352,7 +380,7 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
aPopMenu->AppendSeparator();
}
if( m_HTOOL_current_state == ID_TOOLBARH_PCB_MODE_TRACKS )
if( m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_TRACKS ) )
{
wxMenu* commands = new wxMenu;
aPopMenu->Append( ID_POPUP_PCB_AUTOROUTE_COMMANDS, _( "Autoroute" ), commands );
......@@ -385,7 +413,8 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
*/
void PCB_EDIT_FRAME::createPopUpBlockMenu( wxMenu* menu )
{
AddMenuItem( menu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel Block" ), KiBitmap( cancel_xpm ) );
AddMenuItem( menu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel Block" ),
KiBitmap( cancel_xpm ) );
AddMenuItem( menu, ID_POPUP_ZOOM_BLOCK, _( "Zoom Block" ), KiBitmap( zoom_area_xpm ) );
menu->AppendSeparator();
AddMenuItem( menu, ID_POPUP_PLACE_BLOCK, _( "Place Block" ), KiBitmap( apply_xpm ) );
......@@ -414,7 +443,8 @@ void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
{
if( Track->Type() == PCB_VIA_T )
{
AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_TRACK_NODE, _( "Drag Via" ), KiBitmap( move_xpm ) );
AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_TRACK_NODE, _( "Drag Via" ),
KiBitmap( move_xpm ) );
}
else
{
......@@ -523,7 +553,8 @@ void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
// Add lock/unlock flags menu:
track_mnu = new wxMenu;
AddMenuItem( PopMenu, track_mnu, ID_POPUP_PCB_SETFLAGS_TRACK_MNU, _( "Set Flags" ), KiBitmap( flag_xpm ) );
AddMenuItem( PopMenu, track_mnu, ID_POPUP_PCB_SETFLAGS_TRACK_MNU, _( "Set Flags" ),
KiBitmap( flag_xpm ) );
track_mnu->Append( ID_POPUP_PCB_LOCK_ON_TRACKSEG, _( "Locked: Yes" ), wxEmptyString, true );
track_mnu->Append( ID_POPUP_PCB_LOCK_OFF_TRACKSEG, _( "Locked: No" ), wxEmptyString, true );
......@@ -594,7 +625,8 @@ void PCB_EDIT_FRAME::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu*
_( "Add Cutout Area" ), KiBitmap( add_zone_cutout_xpm ) );
zones_menu->AppendSeparator();
AddMenuItem( zones_menu, ID_POPUP_PCB_FILL_ZONE, _( "Fill Zone" ), KiBitmap( fill_zone_xpm ) );
AddMenuItem( zones_menu, ID_POPUP_PCB_FILL_ZONE, _( "Fill Zone" ),
KiBitmap( fill_zone_xpm ) );
if( edge_zone->m_FilledPolysList.size() > 0 )
{
......@@ -657,7 +689,8 @@ void PCB_EDIT_FRAME::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* menu
if( !flags )
{
msg = AddHotkeyName( _( "Edit" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM );
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_EDIT_MODULE, msg, KiBitmap( edit_module_xpm ) );
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_EDIT_MODULE, msg,
KiBitmap( edit_module_xpm ) );
sub_menu_footprint->AppendSeparator();
msg = AddHotkeyName( _( "Delete Module" ), g_Board_Editor_Hokeys_Descr, HK_DELETE );
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_DELETE_MODULE,
......@@ -741,8 +774,10 @@ void PCB_EDIT_FRAME::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu )
sub_menu_Pad = new wxMenu;
AddMenuItem( menu, sub_menu_Pad, -1, msg, KiBitmap( pad_xpm ) );
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_MOVE_PAD_REQUEST, _( "Move" ), KiBitmap( move_pad_xpm ) );
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_DRAG_PAD_REQUEST, _( "Drag" ), KiBitmap( drag_pad_xpm ) );
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_MOVE_PAD_REQUEST, _( "Move" ),
KiBitmap( move_pad_xpm ) );
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_DRAG_PAD_REQUEST, _( "Drag" ),
KiBitmap( drag_pad_xpm ) );
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_EDIT_PAD, _( "Edit" ), KiBitmap( options_pad_xpm ) );
sub_menu_Pad->AppendSeparator();
......@@ -764,7 +799,7 @@ void PCB_EDIT_FRAME::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu )
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_DELETE_PAD, _( "Delete" ), KiBitmap( delete_pad_xpm ) );
if( m_HTOOL_current_state == ID_TOOLBARH_PCB_MODE_TRACKS )
if( m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_TRACKS ) )
{
menu->Append( ID_POPUP_PCB_AUTOROUTE_PAD, _( "Autoroute Pad" ) );
menu->Append( ID_POPUP_PCB_AUTOROUTE_NET, _( "Autoroute Net" ) );
......@@ -798,6 +833,7 @@ void PCB_EDIT_FRAME::createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu )
AddMenuItem( sub_menu_Text, ID_POPUP_PCB_MOVE_TEXTEPCB_REQUEST,
msg, KiBitmap( move_text_xpm ) );
}
msg = AddHotkeyName( _( "Rotate" ), g_Board_Editor_Hokeys_Descr, HK_ROTATE_ITEM );
AddMenuItem( sub_menu_Text, ID_POPUP_PCB_ROTATE_TEXTEPCB, msg, KiBitmap( rotate_ccw_xpm ) );
msg = AddHotkeyName( _( "Edit" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM );
......@@ -813,8 +849,10 @@ void PCB_EDIT_FRAME::createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu )
void PCB_EDIT_FRAME::createPopUpMenuForMarkers( MARKER_PCB* aMarker, wxMenu* aPopMenu )
{
AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_MARKER, _( "Delete Marker" ), KiBitmap( delete_xpm ) );
AddMenuItem( aPopMenu, ID_POPUP_PCB_GETINFO_MARKER, _( "Marker Error Info" ), KiBitmap( info_xpm ) );
AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_MARKER, _( "Delete Marker" ),
KiBitmap( delete_xpm ) );
AddMenuItem( aPopMenu, ID_POPUP_PCB_GETINFO_MARKER, _( "Marker Error Info" ),
KiBitmap( info_xpm ) );
}
......
......@@ -171,8 +171,8 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
EVT_COMBOBOX( ID_TOOLBARH_PCB_SELECT_LAYER, PCB_EDIT_FRAME::Process_Special_Functions )
EVT_COMBOBOX( ID_AUX_TOOLBAR_PCB_TRACK_WIDTH, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event )
EVT_COMBOBOX( ID_AUX_TOOLBAR_PCB_VIA_SIZE, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event )
EVT_TOOL( ID_TOOLBARH_PCB_MODE_MODULE, PCB_EDIT_FRAME::AutoPlace )
EVT_TOOL( ID_TOOLBARH_PCB_MODE_TRACKS, PCB_EDIT_FRAME::AutoPlace )
EVT_TOOL( ID_TOOLBARH_PCB_MODE_MODULE, PCB_EDIT_FRAME::OnSelectAutoPlaceMode )
EVT_TOOL( ID_TOOLBARH_PCB_MODE_TRACKS, PCB_EDIT_FRAME::OnSelectAutoPlaceMode )
EVT_TOOL( ID_TOOLBARH_PCB_FREEROUTE_ACCESS, PCB_EDIT_FRAME::Access_to_External_Tool )
// Option toolbar
......@@ -247,6 +247,8 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
PCB_EDIT_FRAME::OnUpdateSelectAutoTrackWidth )
EVT_UPDATE_UI( ID_POPUP_PCB_SELECT_AUTO_WIDTH, PCB_EDIT_FRAME::OnUpdateSelectAutoTrackWidth )
EVT_UPDATE_UI( ID_AUX_TOOLBAR_PCB_VIA_SIZE, PCB_EDIT_FRAME::OnUpdateSelectViaSize )
EVT_UPDATE_UI( ID_TOOLBARH_PCB_MODE_MODULE, PCB_EDIT_FRAME::OnUpdateAutoPlaceModulesMode )
EVT_UPDATE_UI( ID_TOOLBARH_PCB_MODE_TRACKS, PCB_EDIT_FRAME::OnUpdateAutoPlaceTracksMode )
EVT_UPDATE_UI_RANGE( ID_POPUP_PCB_SELECT_WIDTH1, ID_POPUP_PCB_SELECT_WIDTH8,
PCB_EDIT_FRAME::OnUpdateSelectTrackWidth )
EVT_UPDATE_UI_RANGE( ID_POPUP_PCB_SELECT_VIASIZE1, ID_POPUP_PCB_SELECT_VIASIZE8,
......@@ -280,6 +282,7 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( wxWindow* parent, const wxString& title,
m_hasAutoSave = true;
m_RecordingMacros = -1;
m_microWaveToolBar = NULL;
m_autoPlaceModeId = 0;
for ( int i = 0; i < 10; i++ )
m_Macros[i].m_Record.clear();
......@@ -313,7 +316,7 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( wxWindow* parent, const wxString& title,
icon.CopyFromBitmap( KiBitmap( icon_pcbnew_xpm ) );
SetIcon( icon );
m_InternalUnits = PCB_INTERNAL_UNIT; // Unites internes = 1/10000 inch
m_internalUnits = PCB_INTERNAL_UNIT; // Unites internes = 1/10000 inch
SetScreen( new PCB_SCREEN() );
GetScreen()->m_Center = false; // PCB drawings start in the upper left corner.
......@@ -356,10 +359,10 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( wxWindow* parent, const wxString& title,
lyrs.Caption( _( "Visibles" ) );
if( m_HToolBar ) // The main horizontal toolbar
if( m_mainToolBar ) // The main horizontal toolbar
{
m_auimgr.AddPane( m_HToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top().Row( 0 ) );
m_auimgr.AddPane( m_mainToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_mainToolBar" ) ).Top().Row( 0 ) );
}
if( m_auxiliaryToolBar ) // the auxiliary horizontal toolbar, that shows track and via sizes, zoom ...)
......@@ -751,3 +754,17 @@ void PCB_EDIT_FRAME::UpdateTitle()
SetTitle( title );
}
void PCB_EDIT_FRAME::OnSelectAutoPlaceMode( wxCommandEvent& aEvent )
{
if( aEvent.IsChecked() )
{
m_autoPlaceModeId = aEvent.GetId();
}
else
{
m_autoPlaceModeId = 0;
}
}
......@@ -182,7 +182,7 @@ void DIALOG_PLOT::Init_Dialog()
m_subtractMaskFromSilk->SetValue( g_PcbPlotOptions.GetSubtractMaskFromSilk() );
// Option to plot page references:
if( m_Parent->m_Print_Sheet_Ref )
if( m_Parent->GetPrintBorderAndTitleBlock() )
{
m_plotSheetRef->SetValue( g_PcbPlotOptions.m_PlotFrameRef );
}
......
......@@ -81,8 +81,8 @@ void FOOTPRINT_EDIT_FRAME::PrintPage( wxDC* aDC,
offset.x = GetScreen()->m_CurrentSheetDesc->m_Size.x / 2;
offset.y = GetScreen()->m_CurrentSheetDesc->m_Size.y / 2;
// offset is in mils, converts in internal units
offset.x *= m_InternalUnits / 1000;
offset.y *= m_InternalUnits / 1000;
offset.x *= m_internalUnits / 1000;
offset.y *= m_internalUnits / 1000;
for( ; Module != NULL; Module = Module->Next() )
{
......
......@@ -163,8 +163,8 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage()
screen->m_StartVisu.x = screen->m_StartVisu.y = 0;
SheetSize = screen->m_CurrentSheetDesc->m_Size; // size in 1/1000 inch
SheetSize.x *= m_Parent->m_InternalUnits / 1000;
SheetSize.y *= m_Parent->m_InternalUnits / 1000; // size in internal units
SheetSize.x *= m_Parent->GetInternalUnits() / 1000;
SheetSize.y *= m_Parent->GetInternalUnits() / 1000; // size in internal units
PCB_BASE_FRAME* pcbframe = (PCB_BASE_FRAME*) m_Parent;
......
......@@ -40,7 +40,7 @@ void PCB_BASE_FRAME::InstallGridFrame( const wxPoint& pos )
{
DIALOG_SET_GRID dlg( this, pos );
dlg.m_internalUnits = m_InternalUnits;
dlg.m_internalUnits = m_internalUnits;
dlg.SetGridUnits( m_UserGridUnit );
dlg.SetGridSize( m_UserGridSize );
dlg.SetGridOrigin( GetScreen()->m_GridOrigin );
......
/***********************************************/
/* tool_modeit.cpp: footprint editor toolbars. */
/***********************************************/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2005 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file tool_modedit.cpp
* @brief Footprint editor tool bars
*/
#include "fctsys.h"
......@@ -20,97 +46,99 @@
void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar()
{
if( m_HToolBar != NULL )
if( m_mainToolBar != NULL )
return;
wxString msg;
m_HToolBar = new EDA_TOOLBAR( TOOLBAR_MAIN, this, ID_H_TOOLBAR, true );
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
// Set up toolbar
m_HToolBar->AddTool( ID_MODEDIT_SELECT_CURRENT_LIB, wxEmptyString,
m_mainToolBar->AddTool( ID_MODEDIT_SELECT_CURRENT_LIB, wxEmptyString,
KiBitmap( open_library_xpm ),
_( "Select active library" ) );
m_HToolBar->AddTool( ID_MODEDIT_SAVE_LIBMODULE, wxEmptyString, KiBitmap( save_library_xpm ),
m_mainToolBar->AddTool( ID_MODEDIT_SAVE_LIBMODULE, wxEmptyString, KiBitmap( save_library_xpm ),
_( "Save module in active library" ) );
m_HToolBar->AddTool( ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART, wxEmptyString,
m_mainToolBar->AddTool( ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART, wxEmptyString,
KiBitmap( new_library_xpm ),
_( "Create new library and save current module" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_MODEDIT_DELETE_PART, wxEmptyString, KiBitmap( delete_xpm ),
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_MODEDIT_DELETE_PART, wxEmptyString, KiBitmap( delete_xpm ),
_( "Delete part from active library" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_MODEDIT_NEW_MODULE, wxEmptyString, KiBitmap( new_footprint_xpm ),
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_MODEDIT_NEW_MODULE, wxEmptyString, KiBitmap( new_footprint_xpm ),
_( "New module" ) );
m_HToolBar->AddTool( ID_MODEDIT_LOAD_MODULE, wxEmptyString,
m_mainToolBar->AddTool( ID_MODEDIT_LOAD_MODULE, wxEmptyString,
KiBitmap( load_module_lib_xpm ),
_( "Load module from library" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_MODEDIT_LOAD_MODULE_FROM_BOARD, wxEmptyString,
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_MODEDIT_LOAD_MODULE_FROM_BOARD, wxEmptyString,
KiBitmap( load_module_board_xpm ),
_( "Load module from current board" ) );
m_HToolBar->AddTool( ID_MODEDIT_UPDATE_MODULE_IN_BOARD, wxEmptyString,
m_mainToolBar->AddTool( ID_MODEDIT_UPDATE_MODULE_IN_BOARD, wxEmptyString,
KiBitmap( update_module_board_xpm ),
_( "Update module in current board" ) );
m_HToolBar->AddTool( ID_MODEDIT_INSERT_MODULE_IN_BOARD, wxEmptyString,
m_mainToolBar->AddTool( ID_MODEDIT_INSERT_MODULE_IN_BOARD, wxEmptyString,
KiBitmap( insert_module_board_xpm ),
_( "Insert module into current board" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_MODEDIT_IMPORT_PART, wxEmptyString, KiBitmap( import_module_xpm ),
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_MODEDIT_IMPORT_PART, wxEmptyString, KiBitmap( import_module_xpm ),
_( "Import module" ) );
m_HToolBar->AddTool( ID_MODEDIT_EXPORT_PART, wxEmptyString, KiBitmap( export_module_xpm ),
m_mainToolBar->AddTool( ID_MODEDIT_EXPORT_PART, wxEmptyString, KiBitmap( export_module_xpm ),
_( "Export module" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( wxID_UNDO, wxEmptyString, KiBitmap( undo_xpm ),
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( wxID_UNDO, wxEmptyString, KiBitmap( undo_xpm ),
_( "Undo last edition" ) );
m_HToolBar->AddTool( wxID_REDO, wxEmptyString, KiBitmap( redo_xpm ),
m_mainToolBar->AddTool( wxID_REDO, wxEmptyString, KiBitmap( redo_xpm ),
_( "Redo the last undo command" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_MODEDIT_EDIT_MODULE_PROPERTIES, wxEmptyString,
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_MODEDIT_EDIT_MODULE_PROPERTIES, wxEmptyString,
KiBitmap( module_options_xpm ),
_( "Module properties" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( wxID_PRINT, wxEmptyString, KiBitmap( print_button_xpm ),
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( wxID_PRINT, wxEmptyString, KiBitmap( print_button_xpm ),
_( "Print module" ) );
m_HToolBar->AddSeparator();
m_mainToolBar->AddSeparator();
msg = AddHotkeyName( _( "Zoom in" ), g_Module_Editor_Hokeys_Descr, HK_ZOOM_IN, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ), msg );
m_mainToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ), msg );
msg = AddHotkeyName( _( "Zoom out" ), g_Module_Editor_Hokeys_Descr, HK_ZOOM_OUT, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ), msg );
m_mainToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ), msg );
msg = AddHotkeyName( _( "Redraw view" ), g_Module_Editor_Hokeys_Descr, HK_ZOOM_REDRAW, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ), msg );
msg = AddHotkeyName( _( "Redraw view" ), g_Module_Editor_Hokeys_Descr, HK_ZOOM_REDRAW,
IS_COMMENT );
m_mainToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ), msg );
msg = AddHotkeyName( _( "Zoom auto" ), g_Module_Editor_Hokeys_Descr, HK_ZOOM_AUTO, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ), msg );
m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ), msg );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_MODEDIT_PAD_SETTINGS, wxEmptyString, KiBitmap( options_pad_xpm ),
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_MODEDIT_PAD_SETTINGS, wxEmptyString, KiBitmap( options_pad_xpm ),
_( "Pad settings" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_MODEDIT_CHECK, wxEmptyString,
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_MODEDIT_CHECK, wxEmptyString,
KiBitmap( module_check_xpm ),
_( "Check module" ) );
// after adding the buttons to the toolbar, must call Realize() to reflect the changes
m_HToolBar->Realize();
m_mainToolBar->Realize();
}
......@@ -119,7 +147,8 @@ void FOOTPRINT_EDIT_FRAME::ReCreateVToolbar()
if( m_drawToolBar )
return;
m_drawToolBar = new EDA_TOOLBAR( TOOLBAR_TOOL, this, ID_V_TOOLBAR, false );
m_drawToolBar = new wxAuiToolBar( this, ID_V_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
// Set up toolbar
m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ),
......@@ -166,7 +195,8 @@ void FOOTPRINT_EDIT_FRAME::ReCreateOptToolbar()
return;
// Create options tool bar.
m_optionsToolBar = new EDA_TOOLBAR( TOOLBAR_OPTION, this, ID_OPT_TOOLBAR, false );
m_optionsToolBar = new wxAuiToolBar( this, ID_OPT_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
_( "Hide grid" ), wxITEM_CHECK );
......@@ -210,7 +240,8 @@ void FOOTPRINT_EDIT_FRAME::ReCreateAuxiliaryToolbar()
if( m_auxiliaryToolBar )
return;
m_auxiliaryToolBar = new EDA_TOOLBAR( TOOLBAR_AUX, this, ID_AUX_TOOLBAR, true );
m_auxiliaryToolBar = new wxAuiToolBar( this, ID_AUX_TOOLBAR, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
// Set up toolbar
m_auxiliaryToolBar->AddSeparator();
......
This diff is collapsed.
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2007-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file toolbars_update_user_interface.cpp
* @brief Function to update toolbars UI after changing parameters.
......@@ -175,3 +200,19 @@ void PCB_EDIT_FRAME::OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent )
if( aEvent.GetEventObject() == m_drawToolBar )
aEvent.Check( GetToolId() == aEvent.GetId() );
}
void PCB_EDIT_FRAME::OnUpdateAutoPlaceTracksMode( wxUpdateUIEvent& aEvent )
{
// Automatic placement of modules and tracks is a mutually exclusive operation so
// clear the other tool if one of the two is selected.
aEvent.Check( m_autoPlaceModeId == ID_TOOLBARH_PCB_MODE_TRACKS );
}
void PCB_EDIT_FRAME::OnUpdateAutoPlaceModulesMode( wxUpdateUIEvent& aEvent )
{
// Automatic placement of modules and tracks is a mutually exclusive operation so
// clear the other tool if one of the two is selected.
aEvent.Check( m_autoPlaceModeId == ID_TOOLBARH_PCB_MODE_MODULE );
}
......@@ -78,7 +78,7 @@ void DialogNonCopperZonesEditor::Init()
AddUnitSymbol( *m_MinThicknessValueTitle, g_UserUnit );
wxString msg = ReturnStringFromValue( g_UserUnit,
m_Zone_Setting->m_ZoneMinThickness,
m_Parent->m_InternalUnits );
m_Parent->GetInternalUnits() );
m_ZoneMinThicknessCtrl->SetValue( msg );
if( g_Zone_45_Only )
......@@ -126,7 +126,7 @@ void DialogNonCopperZonesEditor::OnOkClick( wxCommandEvent& event )
{
wxString txtvalue = m_ZoneMinThicknessCtrl->GetValue();
m_Zone_Setting->m_ZoneMinThickness =
ReturnValueFromString( g_UserUnit, txtvalue, m_Parent->m_InternalUnits );
ReturnValueFromString( g_UserUnit, txtvalue, m_Parent->GetInternalUnits() );
if( m_Zone_Setting->m_ZoneMinThickness < 10 )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment