Commit 259d9a02 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: gen drill files code cleanup. Fix minor bug 680558

parent 78a58e04
...@@ -111,6 +111,16 @@ public: ...@@ -111,6 +111,16 @@ public:
return m_Layer == aLayer; return m_Layer == aLayer;
} }
/**
* Function IsTrack
* tests to see if this object is a track or via (or microvia).
* form of testing.
* @return bool - true if a track or via, else false.
*/
bool IsTrack( ) const
{
return (Type() == TYPE_TRACK) || (Type() == TYPE_VIA);
}
/** /**
* Function IsLocked * Function IsLocked
......
...@@ -21,26 +21,7 @@ else( USE_BOOST_POLYGON_LIBRARY ) ...@@ -21,26 +21,7 @@ else( USE_BOOST_POLYGON_LIBRARY )
set(PCBNEW_SRC_FILL_ZONE zones_convert_brd_items_to_polygons_with_Kbool.cpp) set(PCBNEW_SRC_FILL_ZONE zones_convert_brd_items_to_polygons_with_Kbool.cpp)
endif( USE_BOOST_POLYGON_LIBRARY ) endif( USE_BOOST_POLYGON_LIBRARY )
set(PCBNEW_SRCS set(PCBNEW_DIALOGS
pcbframe.cpp
attribut.cpp
automove.cpp
autoplac.cpp
autorout.cpp
board.cpp
board_items_to_polygon_shape_transform.cpp
board_undo_redo.cpp
block.cpp
block_module_editor.cpp
build_BOM_from_board.cpp
class_pcb_layer_widget.cpp
clean.cpp
connect.cpp
controle.cpp
dimension.cpp
cross-probing.cpp
debug_kbool_key_file_fct.cpp
deltrack.cpp
dialogs/dialog_block_options_base.cpp dialogs/dialog_block_options_base.cpp
dialogs/dialog_cleaning_options_base.cpp dialogs/dialog_cleaning_options_base.cpp
dialogs/dialog_cleaning_options.cpp dialogs/dialog_cleaning_options.cpp
...@@ -62,8 +43,8 @@ set(PCBNEW_SRCS ...@@ -62,8 +43,8 @@ set(PCBNEW_SRCS
dialog_export_3Dfiles_base.cpp dialog_export_3Dfiles_base.cpp
dialog_freeroute_exchange.cpp dialog_freeroute_exchange.cpp
dialog_freeroute_exchange_base.cpp dialog_freeroute_exchange_base.cpp
dialog_gendrill.cpp dialogs/dialog_gendrill.cpp
dialog_gendrill_base.cpp dialogs/dialog_gendrill_base.cpp
dialog_general_options.cpp dialog_general_options.cpp
dialog_general_options_BoardEditor_base.cpp dialog_general_options_BoardEditor_base.cpp
dialog_global_edit_tracks_and_vias.cpp dialog_global_edit_tracks_and_vias.cpp
...@@ -73,8 +54,6 @@ set(PCBNEW_SRCS ...@@ -73,8 +54,6 @@ set(PCBNEW_SRCS
dialog_graphic_items_options_base.cpp dialog_graphic_items_options_base.cpp
dialog_graphic_item_properties.cpp dialog_graphic_item_properties.cpp
dialog_graphic_item_properties_base.cpp dialog_graphic_item_properties_base.cpp
# dialog_initpcb.cpp
dialog_layers_setup.cpp dialog_layers_setup.cpp
dialog_layers_setup_base.cpp dialog_layers_setup_base.cpp
dialog_netlist.cpp dialog_netlist.cpp
...@@ -96,6 +75,29 @@ set(PCBNEW_SRCS ...@@ -96,6 +75,29 @@ set(PCBNEW_SRCS
dialog_SVG_print.cpp dialog_SVG_print.cpp
dialog_SVG_print_base.cpp dialog_SVG_print_base.cpp
dialog_set_grid_base.cpp dialog_set_grid_base.cpp
)
set(PCBNEW_SRCS
pcbframe.cpp
attribut.cpp
automove.cpp
autoplac.cpp
autorout.cpp
board.cpp
board_items_to_polygon_shape_transform.cpp
board_undo_redo.cpp
block.cpp
block_module_editor.cpp
build_BOM_from_board.cpp
class_pcb_layer_widget.cpp
clean.cpp
connect.cpp
controle.cpp
dimension.cpp
cross-probing.cpp
debug_kbool_key_file_fct.cpp
deltrack.cpp
${PCBNEW_DIALOGS}
dist.cpp dist.cpp
dragsegm.cpp dragsegm.cpp
drc.cpp drc.cpp
...@@ -123,6 +125,8 @@ set(PCBNEW_SRCS ...@@ -123,6 +125,8 @@ set(PCBNEW_SRCS
gpcb_exchange.cpp gpcb_exchange.cpp
graphpcb.cpp graphpcb.cpp
hotkeys.cpp hotkeys.cpp
hotkeys_board_editor.cpp
hotkeys_module_editor.cpp
initpcb.cpp initpcb.cpp
ioascii.cpp ioascii.cpp
layer_widget.cpp layer_widget.cpp
......
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_gendrill.cpp
// Author: jean-pierre Charras
// Licence: GPL
/////////////////////////////////////////////////////////////////////////////
#include "fctsys.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "gendrill.h"
#include "dialog_gendrill.h"
DIALOG_GENDRILL::DIALOG_GENDRILL( WinEDA_PcbFrame* parent )
: DIALOG_GENDRILL_BASE( parent )
{
m_Parent = parent;
SetReturnCode( 1 );
initDialog();
GetSizer()->SetSizeHints( this );
Centre( );
}
/*!
* DIALOG_GENDRILL destructor
*/
DIALOG_GENDRILL::~DIALOG_GENDRILL()
{
}
/*!
* Member initialisation
*/
void DIALOG_GENDRILL::initDialog()
{
SetFocus(); // Under wxGTK: mandatory to close dialog by the ESC key
InitDisplayParams();
}
/*!
* wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_RADIOBOX
*/
void DIALOG_GENDRILL::OnSelDrillUnitsSelected( wxCommandEvent& event )
{
UpdatePrecisionOptions(event);
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
*/
void DIALOG_GENDRILL::OnOkClick( wxCommandEvent& event )
{
GenDrillFiles(event);
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CLOSE
*/
void DIALOG_GENDRILL::OnCancelClick( wxCommandEvent& event )
{
UpdateConfig(); /* Save drill options: */
event.Skip(); // Process the default cancel event (close dialog)
}
/*!
* wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_SEL_ZEROS_FMT
*/
void DIALOG_GENDRILL::OnSelZerosFmtSelected( wxCommandEvent& event )
{
UpdatePrecisionOptions(event);
}
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_gendrill.h
// Author: jean-pierre Charras
// Created: 2010 apr 30
// Licence: GPL
/////////////////////////////////////////////////////////////////////////////
#ifndef _DIALOG_GENDRILL_H_
#define _DIALOG_GENDRILL_H_
#include "dialog_gendrill_base.h"
class DIALOG_GENDRILL: public DIALOG_GENDRILL_BASE
{
private:
WinEDA_PcbFrame* m_Parent;
int m_PadsHoleCount;
int m_ThroughViasCount;
int m_MicroViasCount;
int m_BlindOrBuriedViasCount;
public:
DIALOG_GENDRILL( WinEDA_PcbFrame* parent );
~DIALOG_GENDRILL();
private:
/// Initialises member variables
void initDialog();
/// wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_SEL_DRILL_UNITS
void OnSelDrillUnitsSelected( wxCommandEvent& event );
/// wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_SEL_ZEROS_FMT
void OnSelZerosFmtSelected( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
void OnOkClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void OnCancelClick( wxCommandEvent& event );
private:
void InitDisplayParams(void);
void SetParams(void);
void GenDrillFiles( wxCommandEvent& event );
void GenDrillMap( const wxString aFileName, std::vector<HOLE_INFO> & aHoleListBuffer, std::vector<DRILL_TOOL> & aToolListBuffer, int format );
void UpdatePrecisionOptions( wxCommandEvent& event );
void UpdateConfig();
void Write_Excellon_Header( FILE * aFile);
void GenDrillReport( const wxString aFileName );
int Create_Drill_File_EXCELLON(FILE *excellon_dest,
std::vector<HOLE_INFO> & aHoleListBuffer,
std::vector<DRILL_TOOL> & aToolListBuffer );
int Gen_Liste_Tools( std::vector<DRILL_TOOL> & buffer, bool print_header );
};
#endif // _DIALOG_GENDRILL_H_
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_gendrill.cpp
// Author: jean-pierre Charras
// Licence: GPL
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "pcbplot.h"
#include "gendrill.h"
#include "dialog_gendrill.h"
// Keywords for read and write config
#define ZerosFormatKey wxT( "DrillZerosFormat" )
#define PrecisionKey wxT( "DrilltPrecisionOpt" )
#define MirrorKey wxT( "DrillMirrorYOpt" )
#define MinimalHeaderKey wxT( "DrillMinHeader" )
#define UnitDrillInchKey wxT( "DrillUnit" )
#define DrillOriginIsAuxAxisKey wxT( "DrillAuxAxis" )
// list of allowed precision for EXCELLON files, when interger format:
// Due to difference between inches and mm,
// there are 2 set of reasonnable precision values, one for inches and one for metric
static DRILL_PRECISION precisionListForInches[] =
{
DRILL_PRECISION(2,3), DRILL_PRECISION(2,4)
};
static DRILL_PRECISION precisionListForMetric[] =
{
DRILL_PRECISION(3,2), DRILL_PRECISION(3,3)
};
DIALOG_GENDRILL::DIALOG_GENDRILL( WinEDA_PcbFrame* parent ) :
DIALOG_GENDRILL_BASE( parent )
{
m_Parent = parent;
SetReturnCode( 1 );
initDialog();
GetSizer()->SetSizeHints( this );
Centre();
}
// Static members of DIALOG_GENDRILL
int DIALOG_GENDRILL:: m_UnitDrillIsInch = true;
int DIALOG_GENDRILL:: m_ZerosFormat = DECIMAL_FORMAT;
bool DIALOG_GENDRILL::m_MinimalHeader = false;
bool DIALOG_GENDRILL::m_Mirror = true;
bool DIALOG_GENDRILL::m_DrillOriginIsAuxAxis = false;
int DIALOG_GENDRILL:: m_PrecisionFormat = 1;
/*!
* DIALOG_GENDRILL destructor
*/
DIALOG_GENDRILL::~DIALOG_GENDRILL()
{
UpdateConfig();
}
/*!
* Member initialisation
*/
void DIALOG_GENDRILL::initDialog()
{
SetFocus(); // Under wxGTK: mandatory to close dialog by the ESC key
wxConfig* Config = wxGetApp().m_EDA_Config;
if( Config )
{
Config->Read( ZerosFormatKey, &DIALOG_GENDRILL::m_ZerosFormat );
Config->Read( PrecisionKey, &DIALOG_GENDRILL::m_PrecisionFormat );
Config->Read( MirrorKey, &DIALOG_GENDRILL::m_Mirror );
Config->Read( MinimalHeaderKey, &DIALOG_GENDRILL::m_MinimalHeader );
Config->Read( UnitDrillInchKey, &DIALOG_GENDRILL::m_UnitDrillIsInch );
Config->Read( DrillOriginIsAuxAxisKey, &DIALOG_GENDRILL::m_DrillOriginIsAuxAxis );
}
InitDisplayParams();
}
/* some param values initialization before display dialog window
*/
void DIALOG_GENDRILL::InitDisplayParams( void )
{
wxString msg;
m_Choice_Unit->SetSelection( m_UnitDrillIsInch ? 1 : 0 );
m_Choice_Precision->SetSelection( m_PrecisionFormat );
m_Choice_Zeros_Format->SetSelection( m_ZerosFormat );
if( m_ZerosFormat == DECIMAL_FORMAT )
m_Choice_Precision->Enable( false );
UpdatePrecisionOptions( );
m_Check_Minimal->SetValue( m_MinimalHeader );
if( m_DrillOriginIsAuxAxis )
m_Choice_Drill_Offset->SetSelection( 1 );
m_Check_Mirror->SetValue( m_Mirror );
m_ViaDrillValue->SetLabel( _( "Use Netclasses values" ) );
m_MicroViaDrillValue->SetLabel( _( "Use Netclasses values" ) );
msg.Empty();
msg << g_pcb_plot_options.HPGL_Pen_Num;
m_PenNum->SetValue( msg );
msg.Empty();
msg << g_pcb_plot_options.HPGL_Pen_Speed;
m_PenSpeed->SetValue( msg );
// See if we have some buried vias or/and microvias, and display
// microvias drill value if so
m_ThroughViasCount = 0;
m_MicroViasCount = 0;
m_BlindOrBuriedViasCount = 0;
for( TRACK* track = m_Parent->GetBoard()->m_Track; track != NULL;
track = track->Next() )
{
if( track->Type() != TYPE_VIA )
continue;
if( track->Shape() == VIA_THROUGH )
m_ThroughViasCount++;
else if( track->Shape() == VIA_MICROVIA )
m_MicroViasCount++;
else if( track->Shape() == VIA_BLIND_BURIED )
m_BlindOrBuriedViasCount++;
}
m_MicroViaDrillValue->Enable( m_MicroViasCount );
// Pads holes round:
m_PadsHoleCount = 0;
for( MODULE* module = m_Parent->GetBoard()->m_Modules;
module != NULL; module = module->Next() )
{
for( D_PAD* pad = module->m_Pads; pad != NULL; pad = pad->Next() )
{
if( pad->m_DrillShape == PAD_CIRCLE )
{
if( pad->m_Drill.x != 0 )
m_PadsHoleCount++;
}
else
if( MIN( pad->m_Drill.x, pad->m_Drill.y ) != 0 )
m_PadsHoleCount++;
}
}
msg = m_PadsCountInfoMsg->GetLabel();
msg << wxT( " " ) << m_PadsHoleCount;
m_PadsCountInfoMsg->SetLabel( msg );
msg = m_ThroughViasInfoMsg->GetLabel();
msg << wxT( " " ) << m_ThroughViasCount;
m_ThroughViasInfoMsg->SetLabel( msg );
msg = m_MicroViasInfoMsg->GetLabel();
msg << wxT( " " ) << m_MicroViasCount;
m_MicroViasInfoMsg->SetLabel( msg );
msg = m_BuriedViasInfoMsg->GetLabel();
msg << wxT( " " ) << m_BlindOrBuriedViasCount;
m_BuriedViasInfoMsg->SetLabel( msg );
}
/* Save drill options: */
void DIALOG_GENDRILL::UpdateConfig()
{
SetParams();
wxConfig* Config = wxGetApp().m_EDA_Config;
if( Config )
{
Config->Write( ZerosFormatKey, m_ZerosFormat );
Config->Write( PrecisionKey, m_PrecisionFormat );
Config->Write( MirrorKey, m_Mirror );
Config->Write( MinimalHeaderKey, m_MinimalHeader );
Config->Write( UnitDrillInchKey, m_UnitDrillIsInch );
Config->Write( DrillOriginIsAuxAxisKey, m_DrillOriginIsAuxAxis );
}
}
/*!
* wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_RADIOBOX
*/
void DIALOG_GENDRILL::OnSelDrillUnitsSelected( wxCommandEvent& event )
{
UpdatePrecisionOptions( );
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
*/
void DIALOG_GENDRILL::OnOkClick( wxCommandEvent& event )
{
GenDrillOrReportFiles( );
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CLOSE
*/
void DIALOG_GENDRILL::OnCancelClick( wxCommandEvent& event )
{
UpdateConfig(); /* Save drill options: */
event.Skip(); // Process the default cancel event (close dialog)
}
/*!
* wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_SEL_ZEROS_FMT
*/
void DIALOG_GENDRILL::OnSelZerosFmtSelected( wxCommandEvent& event )
{
UpdatePrecisionOptions( );
}
void DIALOG_GENDRILL::UpdatePrecisionOptions( )
{
if( m_Choice_Unit->GetSelection()== 1 ) // Units = inches
{
/* inch options */
m_Choice_Precision->SetString( 0, precisionListForInches[0].GetPrecisionString() );
m_Choice_Precision->SetString( 1, precisionListForInches[1].GetPrecisionString() );
}
else
{
/* metric options */
m_Choice_Precision->SetString( 0, precisionListForMetric[0].GetPrecisionString() );
m_Choice_Precision->SetString( 1, precisionListForMetric[1].GetPrecisionString() );
}
if( m_Choice_Zeros_Format->GetSelection()==DECIMAL_FORMAT )
m_Choice_Precision->Enable( false );
else
m_Choice_Precision->Enable( true );
}
void DIALOG_GENDRILL::SetParams( void )
{
wxString msg;
long ltmp;
m_UnitDrillIsInch = (m_Choice_Unit->GetSelection() == 0) ? FALSE : TRUE;
m_MinimalHeader = m_Check_Minimal->IsChecked();
m_Mirror = m_Check_Mirror->IsChecked();
m_ZerosFormat = m_Choice_Zeros_Format->GetSelection();
m_DrillOriginIsAuxAxis = m_Choice_Drill_Offset->GetSelection();
m_PrecisionFormat = m_Choice_Precision->GetSelection();
msg = m_PenSpeed->GetValue();
if( msg.ToLong( &ltmp ) )
g_pcb_plot_options.HPGL_Pen_Speed = ltmp;
msg = m_PenNum->GetValue();
if( msg.ToLong( &ltmp ) )
g_pcb_plot_options.HPGL_Pen_Num = ltmp;
if( m_Choice_Drill_Offset->GetSelection() == 0 )
m_FileDrillOffset = wxPoint( 0, 0 );
else
m_FileDrillOffset = m_Parent->m_Auxiliary_Axis_Position;
// get precision
int idx = m_Choice_Precision->GetSelection();
if( m_UnitDrillIsInch )
m_Precision = precisionListForInches[idx];
else
m_Precision = precisionListForMetric[idx];
}
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_gendrill.h
// Author: jean-pierre Charras
// Created: 2010 apr 30
// Licence: GPL
/////////////////////////////////////////////////////////////////////////////
#ifndef _DIALOG_GENDRILL_H_
#define _DIALOG_GENDRILL_H_
#include "dialog_gendrill_base.h"
class DIALOG_GENDRILL : public DIALOG_GENDRILL_BASE
{
public:
static int m_UnitDrillIsInch;
static int m_ZerosFormat;
static int m_PrecisionFormat;
static bool m_MinimalHeader;
static bool m_Mirror;
static bool m_DrillOriginIsAuxAxis; /* Axis selection (main / auxiliary)
* for drill origin coordinates */
DRILL_PRECISION m_Precision; // Selected precision for drill files
wxPoint m_FileDrillOffset; // Drill offset: 0,0 for absolute coordiantes, or auxialry axis origin
private:
WinEDA_PcbFrame* m_Parent;
int m_PadsHoleCount;
int m_ThroughViasCount;
int m_MicroViasCount;
int m_BlindOrBuriedViasCount;
public: DIALOG_GENDRILL( WinEDA_PcbFrame* parent );
~DIALOG_GENDRILL();
private:
// Initialises member variables
void initDialog();
void InitDisplayParams( void );
// event functions
void OnSelDrillUnitsSelected( wxCommandEvent& event );
void OnSelZerosFmtSelected( wxCommandEvent& event );
void OnOkClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event );
// Specific functions:
void SetParams( void );
void GenDrillOrReportFiles();
void GenDrillMap( const wxString aFileName,
std::vector<HOLE_INFO>& aHoleListBuffer,
std::vector<DRILL_TOOL>& aToolListBuffer,
int format );
void UpdatePrecisionOptions( );
void UpdateConfig();
void Write_Excellon_Header( FILE* aFile, bool aMinimalHeader, zeros_fmt aFormat );
void GenDrillReport( const wxString aFileName );
int Create_Drill_File_EXCELLON( FILE* aFile,
wxPoint aOffset,
std::vector<HOLE_INFO>& aHoleListBuffer,
std::vector<DRILL_TOOL>& aToolListBuffer );
int Gen_Liste_Tools( std::vector<DRILL_TOOL>& buffer, bool print_header );
/**
* Return the selected format for coordinates, if not decimal
*/
DRILL_PRECISION GetPrecison();
};
#endif // _DIALOG_GENDRILL_H_
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008) // C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -75,17 +75,17 @@ DIALOG_GENDRILL_BASE::DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id, con ...@@ -75,17 +75,17 @@ DIALOG_GENDRILL_BASE::DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id, con
m_staticText1 = new wxStaticText( this, wxID_ANY, _("Speed (cm/s)"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText1 = new wxStaticText( this, wxID_ANY, _("Speed (cm/s)"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText1->Wrap( -1 ); m_staticText1->Wrap( -1 );
sbHPGOptionsSizer->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); sbHPGOptionsSizer->Add( m_staticText1, 0, wxRIGHT|wxLEFT, 5 );
m_PenSpeed = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_PenSpeed = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbHPGOptionsSizer->Add( m_PenSpeed, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); sbHPGOptionsSizer->Add( m_PenSpeed, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_staticText2 = new wxStaticText( this, wxID_ANY, _("Pen Number"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText2 = new wxStaticText( this, wxID_ANY, _("Pen Number"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText2->Wrap( -1 ); m_staticText2->Wrap( -1 );
sbHPGOptionsSizer->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); sbHPGOptionsSizer->Add( m_staticText2, 0, wxRIGHT|wxLEFT, 5 );
m_PenNum = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_PenNum = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbHPGOptionsSizer->Add( m_PenNum, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); sbHPGOptionsSizer->Add( m_PenNum, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
bMiddleBoxSizer->Add( sbHPGOptionsSizer, 0, wxEXPAND, 5 ); bMiddleBoxSizer->Add( sbHPGOptionsSizer, 0, wxEXPAND, 5 );
...@@ -93,12 +93,10 @@ DIALOG_GENDRILL_BASE::DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id, con ...@@ -93,12 +93,10 @@ DIALOG_GENDRILL_BASE::DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id, con
sbOptSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options:") ), wxVERTICAL ); sbOptSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options:") ), wxVERTICAL );
m_Check_Mirror = new wxCheckBox( this, wxID_ANY, _("Mirror y axis"), wxDefaultPosition, wxDefaultSize, 0 ); m_Check_Mirror = new wxCheckBox( this, wxID_ANY, _("Mirror y axis"), wxDefaultPosition, wxDefaultSize, 0 );
sbOptSizer->Add( m_Check_Mirror, 0, wxRIGHT|wxLEFT, 5 );
sbOptSizer->Add( m_Check_Mirror, 0, wxALL, 5 );
m_Check_Minimal = new wxCheckBox( this, wxID_ANY, _("Minimal header"), wxDefaultPosition, wxDefaultSize, 0 ); m_Check_Minimal = new wxCheckBox( this, wxID_ANY, _("Minimal header"), wxDefaultPosition, wxDefaultSize, 0 );
sbOptSizer->Add( m_Check_Minimal, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
sbOptSizer->Add( m_Check_Minimal, 0, wxALL, 5 );
bMiddleBoxSizer->Add( sbOptSizer, 0, wxEXPAND, 5 ); bMiddleBoxSizer->Add( sbOptSizer, 0, wxEXPAND, 5 );
...@@ -178,4 +176,5 @@ DIALOG_GENDRILL_BASE::~DIALOG_GENDRILL_BASE() ...@@ -178,4 +176,5 @@ DIALOG_GENDRILL_BASE::~DIALOG_GENDRILL_BASE()
m_Choice_Zeros_Format->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnSelZerosFmtSelected ), NULL, this ); m_Choice_Zeros_Format->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnSelZerosFmtSelected ), NULL, this );
m_OkButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnOkClick ), NULL, this ); m_OkButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnOkClick ), NULL, this );
m_CancelButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnCancelClick ), NULL, this ); m_CancelButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnCancelClick ), NULL, this );
} }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008) // C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -60,14 +60,15 @@ class DIALOG_GENDRILL_BASE : public wxDialog ...@@ -60,14 +60,15 @@ class DIALOG_GENDRILL_BASE : public wxDialog
wxButton* m_CancelButton; wxButton* m_CancelButton;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnSelDrillUnitsSelected( wxCommandEvent& event ){ event.Skip(); } virtual void OnSelDrillUnitsSelected( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSelZerosFmtSelected( wxCommandEvent& event ){ event.Skip(); } virtual void OnSelZerosFmtSelected( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
public: public:
DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Drill Files Generation"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 447,412 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Drill Files Generation"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 447,385 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_GENDRILL_BASE(); ~DIALOG_GENDRILL_BASE();
}; };
......
This diff is collapsed.
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
/* classes and functions declaration used in drill file and report generation */ /* classes and functions declaration used in drill file and report generation */
/******************************************************************************/ /******************************************************************************/
#ifndef GENDRILL_H #ifndef _GENDRILL_H_
#define GENDRILL_H #define _GENDRILL_H_
/* the DRILL_TOOL class handles tools used in the excellon drill file */ /* the DRILL_TOOL class handles tools used in the excellon drill file */
class DRILL_TOOL class DRILL_TOOL
...@@ -39,15 +39,25 @@ public: ...@@ -39,15 +39,25 @@ public:
}; };
/* the DrillPrecision class to handle drill precision format in excellon files*/ /* the DRILL_PRECISION helper class to handle drill precision format in excellon files
class DrillPrecision */
class DRILL_PRECISION
{ {
public: public:
int m_lhs; int m_lhs; // Left digit number (integer value of coordinates)
int m_rhs; int m_rhs; // Right digit number (deciam value of coordinates)
public: public:
DrillPrecision( int l, int r ) { m_lhs = l; m_rhs = r; } DRILL_PRECISION( int l = 2, int r = 4)
{
m_lhs = l; m_rhs = r;
}
wxString GetPrecisionString()
{
wxString text;
text << m_lhs << wxT(":") << m_rhs;
return text;
}
}; };
/* zeros format */ /* zeros format */
...@@ -99,4 +109,4 @@ void GenDrillReportFile( FILE* aFile, BOARD * aPcb, const wxString& aBoardFilena ...@@ -99,4 +109,4 @@ void GenDrillReportFile( FILE* aFile, BOARD * aPcb, const wxString& aBoardFilena
std::vector<DRILL_TOOL>& aToolListBuffer std::vector<DRILL_TOOL>& aToolListBuffer
); );
#endif // #ifndef GENDRILL_H #endif // #ifndef _GENDRILL_H_
This diff is collapsed.
...@@ -51,13 +51,24 @@ enum hotkey_id_commnand { ...@@ -51,13 +51,24 @@ enum hotkey_id_commnand {
HK_SLIDE_TRACK HK_SLIDE_TRACK
}; };
// List of hotkey descriptors for pcbnew // Full list of hotkey descriptors for borad editor and footprint editor
extern struct Ki_HotkeyInfoSectionDescriptor s_Pcbnew_Editor_Hokeys_Descr[]; extern struct Ki_HotkeyInfoSectionDescriptor g_Pcbnew_Editor_Hokeys_Descr[];
// List of hotkey descriptors for the board editor only // List of hotkey descriptors for the board editor only
extern struct Ki_HotkeyInfoSectionDescriptor s_Board_Editor_Hokeys_Descr[]; extern struct Ki_HotkeyInfoSectionDescriptor g_Board_Editor_Hokeys_Descr[];
// List of hotkey descriptors for the footprint editor only // List of hotkey descriptors for the footprint editor only
extern struct Ki_HotkeyInfoSectionDescriptor s_Module_Editor_Hokeys_Descr[]; extern struct Ki_HotkeyInfoSectionDescriptor g_Module_Editor_Hokeys_Descr[];
// List of common hotkey descriptors
// used in hotkeys_board_editor.cpp and hotkeys_module_editor.cpp
extern Ki_HotkeyInfo* common_Hotkey_List[];
// List of hotkey descriptors for pcbnew
// used in hotkeys_board_editor.cpp
extern Ki_HotkeyInfo* board_edit_Hotkey_List[];
// List of hotkey descriptors for the module editor
// used in hotkeys_module_editor.cpp
extern Ki_HotkeyInfo* module_edit_Hotkey_List[];
#endif /* _PCBNEW_HOTKEYS_H_ */ #endif /* _PCBNEW_HOTKEYS_H_ */
This diff is collapsed.
/*****************************/
/* hotkeys_module_editor.cpp */
/*****************************/
#include "fctsys.h"
#include "common.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "module_editor_frame.h"
#include "pcbnew_id.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "class_board_design_settings.h"
#include "hotkeys.h"
#include "protos.h"
/* How to add a new hotkey:
* See hotkeys.cpp
*/
/*****************************************************************************************/
void WinEDA_ModuleEditFrame::OnHotKey( wxDC* aDC, int hotkey, EDA_BaseStruct* DrawStruct )
/*****************************************************************************************/
/* Hot keys. Some commands are relative to the item under the mouse cursor
* Commands are case insensitive
*/
{
if( hotkey == 0 )
return;
BOARD_ITEM* item = GetCurItem();
bool ItemFree = (item == 0) || (item->m_Flags == 0);
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
cmd.SetEventObject( this );
/* Convert lower to upper case (the usual toupper function has problem with non ascii codes like function keys */
if( (hotkey >= 'a') && (hotkey <= 'z') )
hotkey += 'A' - 'a';
Ki_HotkeyInfo* HK_Descr = GetDescriptorFromHotkey( hotkey, common_Hotkey_List );
if( HK_Descr == NULL )
HK_Descr = GetDescriptorFromHotkey( hotkey, module_edit_Hotkey_List );
if( HK_Descr == NULL )
return;
switch( HK_Descr->m_Idcommand )
{
default:
case HK_NOT_FOUND:
return;
break;
case HK_HELP: // Display Current hotkey list
DisplayHotkeyList( this, g_Module_Editor_Hokeys_Descr );
break;
case HK_RESET_LOCAL_COORD: /*Reset the relative coord */
GetScreen()->m_O_Curseur = GetScreen()->m_Curseur;
break;
case HK_SWITCH_UNITS:
g_UserUnit = (g_UserUnit == INCHES) ? MILLIMETRES : INCHES;
break;
case HK_ZOOM_IN:
cmd.SetId( ID_POPUP_ZOOM_IN );
GetEventHandler()->ProcessEvent( cmd );
break;
case HK_ZOOM_OUT:
cmd.SetId( ID_POPUP_ZOOM_OUT );
GetEventHandler()->ProcessEvent( cmd );
break;
case HK_ZOOM_REDRAW:
cmd.SetId( ID_ZOOM_REDRAW );
GetEventHandler()->ProcessEvent( cmd );
break;
case HK_ZOOM_CENTER:
cmd.SetId( ID_POPUP_ZOOM_CENTER );
GetEventHandler()->ProcessEvent( cmd );
break;
case HK_UNDO:
case HK_REDO:
if( ItemFree )
{
wxCommandEvent event( wxEVT_COMMAND_TOOL_CLICKED,
HK_Descr->m_IdMenuEvent );
wxPostEvent( this, event );
}
break;
case HK_ZOOM_AUTO:
cmd.SetId( ID_ZOOM_PAGE );
GetEventHandler()->ProcessEvent( cmd );
break;
case HK_EDIT_ITEM:
OnHotkeyEditItem( HK_EDIT_ITEM );
break;
case HK_DELETE:
OnHotkeyDeleteItem( HK_DELETE );
break;
case HK_MOVE_ITEM:
OnHotkeyMoveItem( HK_MOVE_ITEM );
break;
case HK_ROTATE_ITEM:
OnHotkeyRotateItem( HK_ROTATE_ITEM );
break;
}
}
bool WinEDA_ModuleEditFrame::OnHotkeyEditItem( int aIdCommand )
{
BOARD_ITEM* item = GetCurItem();
bool itemCurrentlyEdited = item && item->m_Flags;
if( itemCurrentlyEdited )
return false;
item = ModeditLocateAndDisplay();
if( item == NULL )
return false;
SetCurItem( item );
int evt_type = 0; //Used to post a wxCommandEvent on demand
switch( item->Type() )
{
case TYPE_MODULE:
if( aIdCommand == HK_EDIT_ITEM )
evt_type = ID_POPUP_PCB_EDIT_MODULE;
break;
case TYPE_PAD:
if( aIdCommand == HK_EDIT_ITEM )
evt_type = ID_POPUP_PCB_EDIT_PAD;
break;
case TYPE_TEXTE_MODULE:
if( aIdCommand == HK_EDIT_ITEM )
evt_type = ID_POPUP_PCB_EDIT_TEXTMODULE;
break;
default:
break;
}
if( evt_type != 0 )
{
wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED );
evt.SetEventObject( this );
evt.SetId( evt_type );
wxPostEvent( this, evt );
return true;
}
return false;
}
bool WinEDA_ModuleEditFrame::OnHotkeyDeleteItem( int aIdCommand )
{
BOARD_ITEM* item = GetCurItem();
bool itemCurrentlyEdited = item && item->m_Flags;
if( itemCurrentlyEdited )
return false;
item = ModeditLocateAndDisplay();
if( item == NULL )
return false;
SetCurItem( item );
int evt_type = 0; //Used to post a wxCommandEvent on demand
switch( item->Type() )
{
case TYPE_PAD:
if( aIdCommand == HK_DELETE )
evt_type = ID_POPUP_PCB_DELETE_PAD;
break;
case TYPE_TEXTE_MODULE:
if( aIdCommand == HK_DELETE )
evt_type = ID_POPUP_PCB_DELETE_TEXTMODULE;
break;
case TYPE_EDGE_MODULE:
if( aIdCommand == HK_DELETE )
evt_type = ID_POPUP_PCB_DELETE_EDGE;
break;
default:
break;
}
if( evt_type != 0 )
{
wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED );
evt.SetEventObject( this );
evt.SetId( evt_type );
wxPostEvent( this, evt );
return true;
}
return false;
}
bool WinEDA_ModuleEditFrame::OnHotkeyMoveItem( int aIdCommand )
{
BOARD_ITEM* item = GetCurItem();
bool itemCurrentlyEdited = item && item->m_Flags;
if( itemCurrentlyEdited )
return false;
item = ModeditLocateAndDisplay();
if( item == NULL )
return false;
SetCurItem( item );
int evt_type = 0; //Used to post a wxCommandEvent on demand
switch( item->Type() )
{
case TYPE_PAD:
if( aIdCommand == HK_MOVE_ITEM )
evt_type = ID_POPUP_PCB_MOVE_PAD_REQUEST;
break;
case TYPE_TEXTE_MODULE:
if( aIdCommand == HK_MOVE_ITEM )
evt_type = ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST;
break;
case TYPE_EDGE_MODULE:
if( aIdCommand == HK_MOVE_ITEM )
evt_type = ID_POPUP_PCB_MOVE_EDGE;
break;
default:
break;
}
if( evt_type != 0 )
{
wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED );
evt.SetEventObject( this );
evt.SetId( evt_type );
wxPostEvent( this, evt );
return true;
}
return false;
}
bool WinEDA_ModuleEditFrame::OnHotkeyRotateItem( int aIdCommand )
{
BOARD_ITEM* item = GetCurItem();
bool itemCurrentlyEdited = item && item->m_Flags;
int evt_type = 0; // Used to post a wxCommandEvent on demand
if( !itemCurrentlyEdited )
item = ModeditLocateAndDisplay();
if( item == NULL )
return false;
SetCurItem( item );
switch( item->Type() )
{
case TYPE_TEXTE_MODULE:
if( aIdCommand == HK_ROTATE_ITEM ) // Rotation
evt_type = ID_POPUP_PCB_ROTATE_TEXTMODULE;
break;
default:
break;
}
if( evt_type != 0 )
{
wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED );
evt.SetEventObject( this );
evt.SetId( evt_type );
wxPostEvent( this, evt );
return true;
}
return false;
}
...@@ -240,14 +240,14 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -240,14 +240,14 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
wxMenu* editMenu = new wxMenu; wxMenu* editMenu = new wxMenu;
// Undo // Undo
text = AddHotkeyName( _( "Undo" ), s_Pcbnew_Editor_Hokeys_Descr, HK_UNDO ); text = AddHotkeyName( _( "Undo" ), g_Pcbnew_Editor_Hokeys_Descr, HK_UNDO );
item = new wxMenuItem( editMenu, wxID_UNDO, text, item = new wxMenuItem( editMenu, wxID_UNDO, text,
HELP_UNDO, wxITEM_NORMAL ); HELP_UNDO, wxITEM_NORMAL );
item->SetBitmap( undo_xpm ); item->SetBitmap( undo_xpm );
editMenu->Append( item ); editMenu->Append( item );
// Redo // Redo
text = AddHotkeyName( _( "Redo" ), s_Pcbnew_Editor_Hokeys_Descr, HK_REDO ); text = AddHotkeyName( _( "Redo" ), g_Pcbnew_Editor_Hokeys_Descr, HK_REDO );
item = new wxMenuItem( editMenu, wxID_REDO, text, item = new wxMenuItem( editMenu, wxID_REDO, text,
HELP_REDO, wxITEM_NORMAL ); HELP_REDO, wxITEM_NORMAL );
item->SetBitmap( redo_xpm ); item->SetBitmap( redo_xpm );
...@@ -262,7 +262,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -262,7 +262,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
editMenu->AppendSeparator(); editMenu->AppendSeparator();
// Find // Find
text = AddHotkeyName( _( "&Find" ), s_Pcbnew_Editor_Hokeys_Descr, HK_FIND_ITEM ); text = AddHotkeyName( _( "&Find" ), g_Pcbnew_Editor_Hokeys_Descr, HK_FIND_ITEM );
item = new wxMenuItem( editMenu, ID_FIND_ITEMS, item = new wxMenuItem( editMenu, ID_FIND_ITEMS,
text, HELP_FIND ); text, HELP_FIND );
item->SetBitmap( find_xpm ); item->SetBitmap( find_xpm );
...@@ -306,7 +306,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -306,7 +306,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
* for Zoom in and Zoom out sub menus * for Zoom in and Zoom out sub menus
*/ */
// Zoom In // Zoom In
text = AddHotkeyName( _( "Zoom In" ), s_Pcbnew_Editor_Hokeys_Descr, text = AddHotkeyName( _( "Zoom In" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_IN, false ); HK_ZOOM_IN, false );
item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text, item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text,
HELP_ZOOM_IN, wxITEM_NORMAL ); HELP_ZOOM_IN, wxITEM_NORMAL );
...@@ -314,7 +314,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -314,7 +314,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
viewMenu->Append( item ); viewMenu->Append( item );
// Zoom Out // Zoom Out
text = AddHotkeyName( _( "Zoom Out" ), s_Pcbnew_Editor_Hokeys_Descr, text = AddHotkeyName( _( "Zoom Out" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_OUT, false ); HK_ZOOM_OUT, false );
item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text, item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text,
HELP_ZOOM_OUT, wxITEM_NORMAL ); HELP_ZOOM_OUT, wxITEM_NORMAL );
...@@ -323,7 +323,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -323,7 +323,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
viewMenu->Append( item ); viewMenu->Append( item );
// Fit on Screen // Fit on Screen
text = AddHotkeyName( _( "Fit on Screen" ), s_Pcbnew_Editor_Hokeys_Descr, text = AddHotkeyName( _( "Fit on Screen" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_AUTO ); HK_ZOOM_AUTO );
item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text, item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text,
...@@ -334,7 +334,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -334,7 +334,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
viewMenu->AppendSeparator(); viewMenu->AppendSeparator();
// Redraw // Redraw
text = AddHotkeyName( _( "Redraw" ), s_Pcbnew_Editor_Hokeys_Descr, text = AddHotkeyName( _( "Redraw" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_REDRAW ); HK_ZOOM_REDRAW );
item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text, item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text,
...@@ -364,7 +364,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -364,7 +364,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
wxMenu* placeMenu = new wxMenu; wxMenu* placeMenu = new wxMenu;
// Module // Module
text = AddHotkeyName( _( "Module" ), s_Pcbnew_Editor_Hokeys_Descr, text = AddHotkeyName( _( "Module" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_ADD_MODULE, false ); HK_ADD_MODULE, false );
item = new wxMenuItem( placeMenu, ID_COMPONENT_BUTT, text, item = new wxMenuItem( placeMenu, ID_COMPONENT_BUTT, text,
_( "Add modules" ), wxITEM_NORMAL ); _( "Add modules" ), wxITEM_NORMAL );
...@@ -373,7 +373,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -373,7 +373,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
placeMenu->Append( item ); placeMenu->Append( item );
// Track // Track
text = AddHotkeyName( _( "Track" ), s_Pcbnew_Editor_Hokeys_Descr, text = AddHotkeyName( _( "Track" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_ADD_NEW_TRACK, false ); HK_ADD_NEW_TRACK, false );
item = new wxMenuItem( placeMenu, ID_TRACK_BUTT, text, item = new wxMenuItem( placeMenu, ID_TRACK_BUTT, text,
_( "Add tracks and vias" ), wxITEM_NORMAL ); _( "Add tracks and vias" ), wxITEM_NORMAL );
......
...@@ -265,7 +265,7 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos, ...@@ -265,7 +265,7 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos,
_( "Rotate" ), rotate_module_pos_xpm ); _( "Rotate" ), rotate_module_pos_xpm );
ADD_MENUITEM( transform_choice, ID_MODEDIT_MODULE_MIRROR, ADD_MENUITEM( transform_choice, ID_MODEDIT_MODULE_MIRROR,
_( "Mirror" ), mirror_H_xpm ); _( "Mirror" ), mirror_H_xpm );
msg = AddHotkeyName( _( "Edit Module" ), s_Module_Editor_Hokeys_Descr, msg = AddHotkeyName( _( "Edit Module" ), g_Module_Editor_Hokeys_Descr,
HK_EDIT_ITEM ); HK_EDIT_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_MODULE, ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_MODULE,
msg, edit_module_xpm ); msg, edit_module_xpm );
...@@ -278,12 +278,12 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos, ...@@ -278,12 +278,12 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos,
case TYPE_PAD: case TYPE_PAD:
if( !flags ) if( !flags )
{ {
msg = AddHotkeyName( _("Move Pad" ), s_Module_Editor_Hokeys_Descr, msg = AddHotkeyName( _("Move Pad" ), g_Module_Editor_Hokeys_Descr,
HK_MOVE_ITEM ); HK_MOVE_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_MOVE_PAD_REQUEST, ADD_MENUITEM( PopMenu, ID_POPUP_PCB_MOVE_PAD_REQUEST,
msg, move_pad_xpm ); msg, move_pad_xpm );
} }
msg = AddHotkeyName( _("Edit Pad" ), s_Module_Editor_Hokeys_Descr, msg = AddHotkeyName( _("Edit Pad" ), g_Module_Editor_Hokeys_Descr,
HK_EDIT_ITEM ); HK_EDIT_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_PAD, ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_PAD,
msg, options_pad_xpm ); msg, options_pad_xpm );
...@@ -291,7 +291,7 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos, ...@@ -291,7 +291,7 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos,
_( "New Pad Settings" ), options_new_pad_xpm ); _( "New Pad Settings" ), options_new_pad_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EXPORT_PAD_SETTINGS, ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EXPORT_PAD_SETTINGS,
_( "Export Pad Settings" ), export_options_pad_xpm ); _( "Export Pad Settings" ), export_options_pad_xpm );
msg = AddHotkeyName( _("Delete Pad" ), s_Module_Editor_Hokeys_Descr, msg = AddHotkeyName( _("Delete Pad" ), g_Module_Editor_Hokeys_Descr,
HK_DELETE ); HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DELETE_PAD, ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DELETE_PAD,
msg, delete_pad_xpm ); msg, delete_pad_xpm );
...@@ -306,24 +306,24 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos, ...@@ -306,24 +306,24 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos,
case TYPE_TEXTE_MODULE: case TYPE_TEXTE_MODULE:
if( !flags ) if( !flags )
{ {
msg = AddHotkeyName( _("Move Text Mod." ), s_Module_Editor_Hokeys_Descr, msg = AddHotkeyName( _("Move Text Mod." ), g_Module_Editor_Hokeys_Descr,
HK_MOVE_ITEM ); HK_MOVE_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST, ADD_MENUITEM( PopMenu, ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST,
msg, move_field_xpm ); msg, move_field_xpm );
} }
msg = AddHotkeyName( _("Rotate Text Mod." ), s_Module_Editor_Hokeys_Descr, msg = AddHotkeyName( _("Rotate Text Mod." ), g_Module_Editor_Hokeys_Descr,
HK_ROTATE_ITEM ); HK_ROTATE_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_ROTATE_TEXTMODULE, ADD_MENUITEM( PopMenu, ID_POPUP_PCB_ROTATE_TEXTMODULE,
msg, rotate_field_xpm ); msg, rotate_field_xpm );
if( !flags ) if( !flags )
{ {
msg = AddHotkeyName( _("Edit Text Mod." ), s_Module_Editor_Hokeys_Descr, msg = AddHotkeyName( _("Edit Text Mod." ), g_Module_Editor_Hokeys_Descr,
HK_EDIT_ITEM ); HK_EDIT_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_TEXTMODULE, ADD_MENUITEM( PopMenu, ID_POPUP_PCB_EDIT_TEXTMODULE,
msg, edit_text_xpm ); msg, edit_text_xpm );
if( ( (TEXTE_MODULE*) DrawStruct )->m_Type == TEXT_is_DIVERS ) if( ( (TEXTE_MODULE*) DrawStruct )->m_Type == TEXT_is_DIVERS )
{ {
msg = AddHotkeyName( _("Delete Text Mod." ), s_Module_Editor_Hokeys_Descr, msg = AddHotkeyName( _("Delete Text Mod." ), g_Module_Editor_Hokeys_Descr,
HK_DELETE ); HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DELETE_TEXTMODULE, ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DELETE_TEXTMODULE,
msg, delete_text_xpm ); msg, delete_text_xpm );
...@@ -338,7 +338,7 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos, ...@@ -338,7 +338,7 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos,
_( "End edge" ), apply_xpm ); _( "End edge" ), apply_xpm );
if( !flags ) if( !flags )
{ {
msg = AddHotkeyName( _("Move edge" ), s_Module_Editor_Hokeys_Descr, msg = AddHotkeyName( _("Move edge" ), g_Module_Editor_Hokeys_Descr,
HK_MOVE_ITEM ); HK_MOVE_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_MOVE_EDGE, ADD_MENUITEM( PopMenu, ID_POPUP_PCB_MOVE_EDGE,
msg, move_line_xpm ); msg, move_line_xpm );
...@@ -358,7 +358,7 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos, ...@@ -358,7 +358,7 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos,
_( "Edit Layer (Current)" ), select_layer_pair_xpm ); _( "Edit Layer (Current)" ), select_layer_pair_xpm );
ADD_MENUITEM( edit_mnu, ID_POPUP_PCB_EDIT_LAYER_ALL_EDGE, ADD_MENUITEM( edit_mnu, ID_POPUP_PCB_EDIT_LAYER_ALL_EDGE,
_( "Edit Layer (All)" ), select_layer_pair_xpm ); _( "Edit Layer (All)" ), select_layer_pair_xpm );
msg = AddHotkeyName( _("Delete edge" ), s_Module_Editor_Hokeys_Descr, msg = AddHotkeyName( _("Delete edge" ), g_Module_Editor_Hokeys_Descr,
HK_DELETE ); HK_DELETE );
ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DELETE_EDGE, ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DELETE_EDGE,
msg, delete_xpm ); msg, delete_xpm );
......
...@@ -160,7 +160,7 @@ WinEDA_ModuleEditFrame::WinEDA_ModuleEditFrame( wxWindow* father, ...@@ -160,7 +160,7 @@ WinEDA_ModuleEditFrame::WinEDA_ModuleEditFrame( wxWindow* father,
m_Draw_Sheet_Ref = false; // true to show the frame references m_Draw_Sheet_Ref = false; // true to show the frame references
m_Draw_Axis = true; // true to show X and Y axis on screen m_Draw_Axis = true; // true to show X and Y axis on screen
m_Draw_Grid_Axis = true; // show the grid origin axis m_Draw_Grid_Axis = true; // show the grid origin axis
m_HotkeysZoomAndGridList = s_Module_Editor_Hokeys_Descr; m_HotkeysZoomAndGridList = g_Module_Editor_Hokeys_Descr;
// Give an icon // Give an icon
SetIcon( wxICON( icon_modedit ) ); SetIcon( wxICON( icon_modedit ) );
......
This diff is collapsed.
...@@ -270,7 +270,7 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, ...@@ -270,7 +270,7 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
m_TrackAndViasSizesList_Changed = false; m_TrackAndViasSizesList_Changed = false;
m_show_microwave_tools = false; m_show_microwave_tools = false;
m_show_layer_manager_tools = true; m_show_layer_manager_tools = true;
m_HotkeysZoomAndGridList = s_Board_Editor_Hokeys_Descr; m_HotkeysZoomAndGridList = g_Board_Editor_Hokeys_Descr;
SetBoard( new BOARD( NULL, this ) ); SetBoard( new BOARD( NULL, this ) );
......
...@@ -137,7 +137,7 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) ); ...@@ -137,7 +137,7 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) );
/* Must be called before creating the main frame in order to /* Must be called before creating the main frame in order to
* display the real hotkeys in menus or tool tips */ * display the real hotkeys in menus or tool tips */
ReadHotkeyConfig( wxT("PcbFrame"), s_Board_Editor_Hokeys_Descr ); ReadHotkeyConfig( wxT("PcbFrame"), g_Board_Editor_Hokeys_Descr );
frame = new WinEDA_PcbFrame( NULL, wxT( "PcbNew" ), wxPoint( 0, 0 ), wxSize( 600, 400 ) ); frame = new WinEDA_PcbFrame( NULL, wxT( "PcbNew" ), wxPoint( 0, 0 ), wxSize( 600, 400 ) );
frame->SetTitle( GetTitle() + wxT( " " ) + GetBuildVersion() ); frame->SetTitle( GetTitle() + wxT( " " ) + GetBuildVersion() );
......
...@@ -109,20 +109,20 @@ void WinEDA_PcbFrame::Process_Config( wxCommandEvent& event ) ...@@ -109,20 +109,20 @@ void WinEDA_PcbFrame::Process_Config( wxCommandEvent& event )
/* Hotkey IDs */ /* Hotkey IDs */
case ID_PREFERENCES_HOTKEY_EXPORT_CONFIG: case ID_PREFERENCES_HOTKEY_EXPORT_CONFIG:
ExportHotkeyConfigToFile( s_Board_Editor_Hokeys_Descr ); ExportHotkeyConfigToFile( g_Board_Editor_Hokeys_Descr );
break; break;
case ID_PREFERENCES_HOTKEY_IMPORT_CONFIG: case ID_PREFERENCES_HOTKEY_IMPORT_CONFIG:
ImportHotkeyConfigFromFile( s_Board_Editor_Hokeys_Descr ); ImportHotkeyConfigFromFile( g_Board_Editor_Hokeys_Descr );
break; break;
case ID_PREFERENCES_HOTKEY_SHOW_EDITOR: case ID_PREFERENCES_HOTKEY_SHOW_EDITOR:
InstallHotkeyFrame( this, s_Board_Editor_Hokeys_Descr ); InstallHotkeyFrame( this, g_Board_Editor_Hokeys_Descr );
break; break;
case ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST: case ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST:
// Display current hotkey list for eeschema. // Display current hotkey list for eeschema.
DisplayHotkeyList( this, s_Board_Editor_Hokeys_Descr ); DisplayHotkeyList( this, g_Board_Editor_Hokeys_Descr );
break; break;
default: default:
......
...@@ -99,22 +99,22 @@ void WinEDA_ModuleEditFrame::ReCreateHToolbar() ...@@ -99,22 +99,22 @@ void WinEDA_ModuleEditFrame::ReCreateHToolbar()
_( "Print Module" ) ); _( "Print Module" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
msg = AddHotkeyName( _( "Zoom in" ), s_Module_Editor_Hokeys_Descr, msg = AddHotkeyName( _( "Zoom in" ), g_Module_Editor_Hokeys_Descr,
HK_ZOOM_IN, false ); HK_ZOOM_IN, false );
m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString,
wxBitmap( zoom_in_xpm ), msg ); wxBitmap( zoom_in_xpm ), msg );
msg = AddHotkeyName( _( "Zoom out" ), s_Module_Editor_Hokeys_Descr, msg = AddHotkeyName( _( "Zoom out" ), g_Module_Editor_Hokeys_Descr,
HK_ZOOM_OUT, false ); HK_ZOOM_OUT, false );
m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString,
wxBitmap( zoom_out_xpm ), msg ); wxBitmap( zoom_out_xpm ), msg );
msg = AddHotkeyName( _( "Redraw view" ), s_Module_Editor_Hokeys_Descr, msg = AddHotkeyName( _( "Redraw view" ), g_Module_Editor_Hokeys_Descr,
HK_ZOOM_REDRAW, false ); HK_ZOOM_REDRAW, false );
m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString,
wxBitmap( zoom_redraw_xpm ), msg ); wxBitmap( zoom_redraw_xpm ), msg );
msg = AddHotkeyName( _( "Zoom auto" ), s_Module_Editor_Hokeys_Descr, msg = AddHotkeyName( _( "Zoom auto" ), g_Module_Editor_Hokeys_Descr,
HK_ZOOM_AUTO, false ); HK_ZOOM_AUTO, false );
m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString,
wxBitmap( zoom_auto_xpm ), msg ); wxBitmap( zoom_auto_xpm ), msg );
......
...@@ -216,11 +216,11 @@ void WinEDA_PcbFrame::ReCreateHToolbar() ...@@ -216,11 +216,11 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
#endif #endif
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
msg = AddHotkeyName( HELP_UNDO, s_Board_Editor_Hokeys_Descr, msg = AddHotkeyName( HELP_UNDO, g_Board_Editor_Hokeys_Descr,
HK_UNDO, false ); HK_UNDO, false );
m_HToolBar->AddTool( wxID_UNDO, wxEmptyString, wxBitmap( undo_xpm ), m_HToolBar->AddTool( wxID_UNDO, wxEmptyString, wxBitmap( undo_xpm ),
HELP_UNDO ); HELP_UNDO );
msg = AddHotkeyName( HELP_REDO, s_Board_Editor_Hokeys_Descr, msg = AddHotkeyName( HELP_REDO, g_Board_Editor_Hokeys_Descr,
HK_REDO, false ); HK_REDO, false );
m_HToolBar->AddTool( wxID_REDO, wxEmptyString, wxBitmap( redo_xpm ), m_HToolBar->AddTool( wxID_REDO, wxEmptyString, wxBitmap( redo_xpm ),
HELP_REDO ); HELP_REDO );
...@@ -232,29 +232,29 @@ void WinEDA_PcbFrame::ReCreateHToolbar() ...@@ -232,29 +232,29 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
_( "Plot (HPGL, PostScript, or GERBER format)" ) ); _( "Plot (HPGL, PostScript, or GERBER format)" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
msg = AddHotkeyName( HELP_ZOOM_IN, s_Board_Editor_Hokeys_Descr, msg = AddHotkeyName( HELP_ZOOM_IN, g_Board_Editor_Hokeys_Descr,
HK_ZOOM_IN, false ); HK_ZOOM_IN, false );
m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, wxBitmap( zoom_in_xpm ), m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, wxBitmap( zoom_in_xpm ),
msg ); msg );
msg = AddHotkeyName( HELP_ZOOM_OUT, s_Board_Editor_Hokeys_Descr, msg = AddHotkeyName( HELP_ZOOM_OUT, g_Board_Editor_Hokeys_Descr,
HK_ZOOM_OUT, false ); HK_ZOOM_OUT, false );
m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString,
wxBitmap( zoom_out_xpm ), msg ); wxBitmap( zoom_out_xpm ), msg );
msg = AddHotkeyName( HELP_ZOOM_REDRAW, s_Board_Editor_Hokeys_Descr, msg = AddHotkeyName( HELP_ZOOM_REDRAW, g_Board_Editor_Hokeys_Descr,
HK_ZOOM_REDRAW, false ); HK_ZOOM_REDRAW, false );
m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString,
wxBitmap( zoom_redraw_xpm ), msg ); wxBitmap( zoom_redraw_xpm ), msg );
msg = AddHotkeyName( HELP_ZOOM_FIT, s_Board_Editor_Hokeys_Descr, msg = AddHotkeyName( HELP_ZOOM_FIT, g_Board_Editor_Hokeys_Descr,
HK_ZOOM_AUTO, false ); HK_ZOOM_AUTO, false );
m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString,
wxBitmap( zoom_auto_xpm ), msg ); wxBitmap( zoom_auto_xpm ), msg );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
msg = AddHotkeyName( HELP_FIND, // Find components and texts msg = AddHotkeyName( HELP_FIND, // Find components and texts
s_Board_Editor_Hokeys_Descr, g_Board_Editor_Hokeys_Descr,
HK_FIND_ITEM, false ); HK_FIND_ITEM, false );
m_HToolBar->AddTool( ID_FIND_ITEMS, wxEmptyString, wxBitmap( find_xpm ), m_HToolBar->AddTool( ID_FIND_ITEMS, wxEmptyString, wxBitmap( find_xpm ),
msg ); msg );
...@@ -699,7 +699,7 @@ WinEDALayerChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent ...@@ -699,7 +699,7 @@ WinEDALayerChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent
if( m_SelLayerBox == NULL ) if( m_SelLayerBox == NULL )
return NULL; return NULL;
m_SelLayerBox->m_hotkeys = s_Board_Editor_Hokeys_Descr; m_SelLayerBox->m_hotkeys = g_Board_Editor_Hokeys_Descr;
m_SelLayerBox->Resync(); m_SelLayerBox->Resync();
m_SelLayerBox->SetToolTip( _( "+/- to switch" ) ); m_SelLayerBox->SetToolTip( _( "+/- to switch" ) );
......
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