Pcbnew, dialog export STEP: fox not working export in countries using the comma as floating point separator.
Add origin at board center and serious cleaning code.
This commit is contained in:
parent
81a4182319
commit
9485a4d381
|
@ -37,9 +37,7 @@
|
|||
#include "class_board.h"
|
||||
#include "dialog_export_step_base.h"
|
||||
|
||||
#define OPTKEY_STEP_USE_DRILL_ORG "STEP_UseDrillOrigin"
|
||||
#define OPTKEY_STEP_USE_AUX_ORG "STEP_UseAuxOrigin"
|
||||
#define OPTKEY_STEP_USE_USER_ORG "STEP_UseUserOrigin"
|
||||
#define OPTKEY_STEP_ORIGIN_OPT "STEP_Origin_Opt"
|
||||
#define OPTKEY_STEP_UORG_UNITS "STEP_UserOriginUnits"
|
||||
#define OPTKEY_STEP_UORG_X "STEP_UserOriginX"
|
||||
#define OPTKEY_STEP_UORG_Y "STEP_UserOriginY"
|
||||
|
@ -48,72 +46,34 @@
|
|||
|
||||
class DIALOG_EXPORT_STEP: public DIALOG_EXPORT_STEP_BASE
|
||||
{
|
||||
public:
|
||||
enum STEP_ORG_OPT
|
||||
{
|
||||
STEP_ORG_0, // absolute coordinates
|
||||
STEP_ORG_PLOT_AXIS, // origin is plot/drill axis origin
|
||||
STEP_ORG_GRID_AXIS, // origin is grid origin
|
||||
STEP_ORG_BOARD_CENTER, // origin is board center
|
||||
STEP_ORG_USER, // origin is entered by user
|
||||
};
|
||||
|
||||
private:
|
||||
PCB_EDIT_FRAME* m_parent;
|
||||
wxConfigBase* m_config;
|
||||
bool m_useDrillOrg; // remember last preference for Use Drill Origin
|
||||
bool m_useAuxOrg; // remember last preference for Use Aux Origin
|
||||
bool m_useUserOrg; // remember last preference for Use User Origin
|
||||
// The last preference for STEP Origin:
|
||||
STEP_ORG_OPT m_STEP_org_opt;
|
||||
bool m_noVirtual; // remember last preference for No Virtual Component
|
||||
int m_OrgUnits; // remember last units for User Origin
|
||||
double m_XOrg; // remember last User Origin X value
|
||||
double m_YOrg; // remember last User Origin Y value
|
||||
|
||||
public:
|
||||
DIALOG_EXPORT_STEP( PCB_EDIT_FRAME* parent ) :
|
||||
DIALOG_EXPORT_STEP_BASE( parent )
|
||||
{
|
||||
m_parent = parent;
|
||||
m_config = Kiface().KifaceSettings();
|
||||
SetFocus();
|
||||
m_useDrillOrg = false;
|
||||
m_config->Read( OPTKEY_STEP_USE_DRILL_ORG, &m_useDrillOrg );
|
||||
m_cbDrillOrigin->SetValue( m_useDrillOrg );
|
||||
m_useAuxOrg = false;
|
||||
m_config->Read( OPTKEY_STEP_USE_AUX_ORG, &m_useAuxOrg );
|
||||
m_cbAuxOrigin->SetValue( m_useAuxOrg );
|
||||
m_useUserOrg = false;
|
||||
m_config->Read( OPTKEY_STEP_USE_USER_ORG, &m_useUserOrg );
|
||||
m_cbUserOrigin->SetValue( m_useUserOrg );
|
||||
m_cbUserOrigin->Bind( wxEVT_CHECKBOX, &DIALOG_EXPORT_STEP::OnUserOriginSelect, this );
|
||||
m_config->Read( OPTKEY_STEP_UORG_UNITS, &m_OrgUnits, 0 );
|
||||
m_config->Read( OPTKEY_STEP_UORG_X, &m_XOrg, 0.0 );
|
||||
m_config->Read( OPTKEY_STEP_UORG_Y, &m_YOrg, 0.0 );
|
||||
m_config->Read( OPTKEY_STEP_NOVIRT, &m_noVirtual );
|
||||
m_cbRemoveVirtual->SetValue( m_noVirtual );
|
||||
|
||||
m_STEP_OrgUnitChoice->SetSelection( m_OrgUnits );
|
||||
wxString tmpStr;
|
||||
tmpStr << m_XOrg;
|
||||
m_STEP_Xorg->SetValue( tmpStr );
|
||||
tmpStr = "";
|
||||
tmpStr << m_YOrg;
|
||||
m_STEP_Yorg->SetValue( tmpStr );
|
||||
|
||||
if( m_useUserOrg )
|
||||
{
|
||||
m_STEP_OrgUnitChoice->Enable( true );
|
||||
m_STEP_Xorg->Enable( true );
|
||||
m_STEP_Yorg->Enable( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_STEP_OrgUnitChoice->Enable( false );
|
||||
m_STEP_Xorg->Enable( false );
|
||||
m_STEP_Yorg->Enable( false );
|
||||
}
|
||||
|
||||
m_sdbSizerOK->SetDefault();
|
||||
|
||||
// Now all widgets have the size fixed, call FinishDialogSettings
|
||||
FinishDialogSettings();
|
||||
}
|
||||
DIALOG_EXPORT_STEP( PCB_EDIT_FRAME* parent );
|
||||
|
||||
~DIALOG_EXPORT_STEP()
|
||||
{
|
||||
m_config->Write( OPTKEY_STEP_USE_DRILL_ORG, m_cbDrillOrigin->GetValue() );
|
||||
m_config->Write( OPTKEY_STEP_USE_AUX_ORG, m_cbAuxOrigin->GetValue() );
|
||||
m_config->Write( OPTKEY_STEP_USE_USER_ORG, m_cbUserOrigin->GetValue() );
|
||||
GetOriginOption(); // Update m_STEP_org_opt member.
|
||||
m_config->Write( OPTKEY_STEP_ORIGIN_OPT, (int)m_STEP_org_opt );
|
||||
|
||||
m_config->Write( OPTKEY_STEP_NOVIRT, m_cbRemoveVirtual->GetValue() );
|
||||
|
||||
m_config->Write( OPTKEY_STEP_UORG_UNITS, m_STEP_OrgUnitChoice->GetSelection() );
|
||||
|
@ -141,46 +101,62 @@ public:
|
|||
return DoubleValueFromString( UNSCALED_UNITS, m_STEP_Yorg->GetValue() );
|
||||
}
|
||||
|
||||
bool GetDrillOrgOption()
|
||||
{
|
||||
return m_cbDrillOrigin->GetValue();
|
||||
}
|
||||
|
||||
bool GetAuxOrgOption()
|
||||
{
|
||||
return m_cbAuxOrigin->GetValue();
|
||||
}
|
||||
|
||||
bool GetUserOrgOption()
|
||||
{
|
||||
return m_cbUserOrigin->GetValue();
|
||||
}
|
||||
STEP_ORG_OPT GetOriginOption();
|
||||
|
||||
bool GetNoVirtOption()
|
||||
{
|
||||
return m_cbRemoveVirtual->GetValue();
|
||||
}
|
||||
|
||||
void OnUserOriginSelect( wxCommandEvent& event )
|
||||
{
|
||||
if( GetUserOrgOption() )
|
||||
{
|
||||
m_STEP_OrgUnitChoice->Enable( true );
|
||||
m_STEP_Xorg->Enable( true );
|
||||
m_STEP_Yorg->Enable( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_STEP_OrgUnitChoice->Enable( false );
|
||||
m_STEP_Xorg->Enable( false );
|
||||
m_STEP_Yorg->Enable( false );
|
||||
}
|
||||
bool TransferDataFromWindow() override;
|
||||
void onSelectOrigin( wxCommandEvent& event ) override;
|
||||
};
|
||||
|
||||
event.Skip();
|
||||
DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP( PCB_EDIT_FRAME* parent ) :
|
||||
DIALOG_EXPORT_STEP_BASE( parent )
|
||||
{
|
||||
m_parent = parent;
|
||||
m_config = Kiface().KifaceSettings();
|
||||
SetFocus();
|
||||
|
||||
m_STEP_org_opt = STEP_ORG_0;;
|
||||
int tmp = STEP_ORG_0;
|
||||
|
||||
if( m_config->Read( OPTKEY_STEP_ORIGIN_OPT, &tmp ) )
|
||||
m_STEP_org_opt = (STEP_ORG_OPT) tmp;
|
||||
|
||||
switch( m_STEP_org_opt )
|
||||
{
|
||||
default: break;
|
||||
case STEP_ORG_PLOT_AXIS: m_cbPlotOrigin->SetValue( true ); break;
|
||||
case STEP_ORG_GRID_AXIS: m_cbGridOrigin->SetValue( true ); break;
|
||||
case STEP_ORG_USER: m_cbUserOrigin->SetValue( true ); break;
|
||||
case STEP_ORG_BOARD_CENTER: m_cbBoardCenter->SetValue( true ); break;
|
||||
}
|
||||
|
||||
bool TransferDataFromWindow() override;
|
||||
};
|
||||
m_config->Read( OPTKEY_STEP_UORG_UNITS, &m_OrgUnits, 0 );
|
||||
m_config->Read( OPTKEY_STEP_UORG_X, &m_XOrg, 0.0 );
|
||||
m_config->Read( OPTKEY_STEP_UORG_Y, &m_YOrg, 0.0 );
|
||||
m_config->Read( OPTKEY_STEP_NOVIRT, &m_noVirtual );
|
||||
m_cbRemoveVirtual->SetValue( m_noVirtual );
|
||||
|
||||
m_STEP_OrgUnitChoice->SetSelection( m_OrgUnits );
|
||||
wxString tmpStr;
|
||||
tmpStr << m_XOrg;
|
||||
m_STEP_Xorg->SetValue( tmpStr );
|
||||
tmpStr = "";
|
||||
tmpStr << m_YOrg;
|
||||
m_STEP_Yorg->SetValue( tmpStr );
|
||||
|
||||
m_STEP_OrgUnitChoice->Enable( m_cbUserOrigin->IsChecked() );
|
||||
m_STEP_Xorg->Enable( m_cbUserOrigin->IsChecked() );
|
||||
m_STEP_Yorg->Enable( m_cbUserOrigin->IsChecked() );
|
||||
|
||||
m_sdbSizerOK->SetDefault();
|
||||
|
||||
// Now all widgets have the size fixed, call FinishDialogSettings
|
||||
FinishDialogSettings();
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_EXPORT_STEP::TransferDataFromWindow()
|
||||
|
@ -205,6 +181,47 @@ bool DIALOG_EXPORT_STEP::TransferDataFromWindow()
|
|||
}
|
||||
|
||||
|
||||
void DIALOG_EXPORT_STEP::onSelectOrigin( wxCommandEvent& event )
|
||||
{
|
||||
// If a new checkbox was checked: ensure other options are disabled
|
||||
wxCheckBox* cbList[]
|
||||
{
|
||||
m_cbPlotOrigin, m_cbGridOrigin, m_cbUserOrigin, m_cbBoardCenter, NULL
|
||||
};
|
||||
|
||||
if( event.IsChecked() )
|
||||
{
|
||||
for( int ii = 0; cbList[ii]; ii++ )
|
||||
{
|
||||
if( cbList[ii] != event.GetEventObject() )
|
||||
cbList[ii]->SetValue( false );
|
||||
}
|
||||
}
|
||||
|
||||
// Enable/disable the user origin widgets:
|
||||
m_STEP_OrgUnitChoice->Enable( m_cbUserOrigin->IsChecked() );
|
||||
m_STEP_Xorg->Enable( m_cbUserOrigin->IsChecked() );
|
||||
m_STEP_Yorg->Enable( m_cbUserOrigin->IsChecked() );
|
||||
}
|
||||
|
||||
|
||||
DIALOG_EXPORT_STEP::STEP_ORG_OPT DIALOG_EXPORT_STEP::GetOriginOption()
|
||||
{
|
||||
m_STEP_org_opt = STEP_ORG_0;
|
||||
|
||||
if( m_cbPlotOrigin->IsChecked() )
|
||||
m_STEP_org_opt = STEP_ORG_PLOT_AXIS;
|
||||
else if( m_cbGridOrigin->IsChecked() )
|
||||
m_STEP_org_opt = STEP_ORG_GRID_AXIS;
|
||||
else if( m_cbUserOrigin->IsChecked() )
|
||||
m_STEP_org_opt = STEP_ORG_USER;
|
||||
else if( m_cbBoardCenter->IsChecked() )
|
||||
m_STEP_org_opt = STEP_ORG_BOARD_CENTER;
|
||||
|
||||
return m_STEP_org_opt;
|
||||
}
|
||||
|
||||
|
||||
void PCB_EDIT_FRAME::OnExportSTEP( wxCommandEvent& event )
|
||||
{
|
||||
|
||||
|
@ -242,29 +259,13 @@ void PCB_EDIT_FRAME::OnExportSTEP( wxCommandEvent& event )
|
|||
return;
|
||||
|
||||
wxString outputFile = dlg.FilePicker()->GetPath();
|
||||
|
||||
brdFile.SetExt( brdExt );
|
||||
outputFile.Prepend( "\"" );
|
||||
outputFile.Append( "\"" );
|
||||
bool aUseDrillOrg = dlg.GetDrillOrgOption();
|
||||
bool aUseAuxOrg = dlg.GetAuxOrgOption();
|
||||
bool aUseUserOrg = dlg.GetUserOrgOption();
|
||||
bool aNoVirtual = dlg.GetNoVirtOption();
|
||||
double aXOrg = 0.0;
|
||||
double aYOrg = 0.0;
|
||||
|
||||
if( aUseUserOrg )
|
||||
{
|
||||
aXOrg = dlg.GetXOrg();
|
||||
aYOrg = dlg.GetYOrg();
|
||||
|
||||
if( dlg.GetOrgUnitsChoice() == 1 )
|
||||
{
|
||||
// selected reference unit is in inches
|
||||
aXOrg *= 25.4;
|
||||
aYOrg *= 25.4;
|
||||
}
|
||||
}
|
||||
DIALOG_EXPORT_STEP::STEP_ORG_OPT orgOpt = dlg.GetOriginOption();
|
||||
double xOrg = 0.0;
|
||||
double yOrg = 0.0;
|
||||
|
||||
wxFileName appK2S( wxStandardPaths::Get().GetExecutablePath() );
|
||||
appK2S.SetName( "kicad2step" );
|
||||
|
@ -273,17 +274,49 @@ void PCB_EDIT_FRAME::OnExportSTEP( wxCommandEvent& event )
|
|||
cmdK2S.Append( appK2S.GetFullPath() );
|
||||
cmdK2S.Append( "\"" );
|
||||
|
||||
if( aNoVirtual )
|
||||
if( dlg.GetNoVirtOption() )
|
||||
cmdK2S.Append( " --no-virtual" );
|
||||
|
||||
if( aUseDrillOrg )
|
||||
cmdK2S.Append( " --drill-origin" );
|
||||
switch( orgOpt )
|
||||
{
|
||||
case DIALOG_EXPORT_STEP::STEP_ORG_0:
|
||||
break;
|
||||
|
||||
if( aUseAuxOrg )
|
||||
cmdK2S.Append( " --grid-origin" );
|
||||
case DIALOG_EXPORT_STEP::STEP_ORG_PLOT_AXIS:
|
||||
cmdK2S.Append( " --drill-origin" );
|
||||
break;
|
||||
|
||||
if( aUseUserOrg )
|
||||
cmdK2S.Append( wxString::Format( " --user-origin %.6fx%.6f", aXOrg, aYOrg ) );
|
||||
case DIALOG_EXPORT_STEP::STEP_ORG_GRID_AXIS:
|
||||
cmdK2S.Append( " --grid-origin" );
|
||||
break;
|
||||
|
||||
case DIALOG_EXPORT_STEP::STEP_ORG_USER:
|
||||
{
|
||||
xOrg = dlg.GetXOrg();
|
||||
yOrg = dlg.GetYOrg();
|
||||
|
||||
if( dlg.GetOrgUnitsChoice() == 1 )
|
||||
{
|
||||
// selected reference unit is in inches, and STEP units are mm
|
||||
xOrg *= 25.4;
|
||||
yOrg *= 25.4;
|
||||
}
|
||||
|
||||
LOCALE_IO dummy;
|
||||
cmdK2S.Append( wxString::Format( " --user-origin %.6fx%.6f", xOrg, yOrg ) );
|
||||
}
|
||||
break;
|
||||
|
||||
case DIALOG_EXPORT_STEP::STEP_ORG_BOARD_CENTER:
|
||||
{
|
||||
EDA_RECT bbox = GetBoard()->ComputeBoundingBox( true );
|
||||
xOrg = Iu2Millimeter( bbox.GetCenter().x );
|
||||
yOrg = Iu2Millimeter( bbox.GetCenter().y );
|
||||
LOCALE_IO dummy;
|
||||
cmdK2S.Append( wxString::Format( " --user-origin %.6fx%.6f", xOrg, yOrg ) );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
cmdK2S.Append( " -f -o " );
|
||||
cmdK2S.Append( outputFile );
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2014)
|
||||
// C++ code generated with wxFormBuilder (version Jul 2 2017)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -34,7 +34,7 @@ DIALOG_EXPORT_STEP_BASE::DIALOG_EXPORT_STEP_BASE( wxWindow* parent, wxWindowID i
|
|||
|
||||
m_staticText6 = new wxStaticText( this, wxID_ANY, _("Coordinate origin options:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText6->Wrap( -1 );
|
||||
m_staticText6->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
|
||||
m_staticText6->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
|
||||
|
||||
bSizer7->Add( m_staticText6, 0, wxALL, 5 );
|
||||
|
||||
|
@ -46,18 +46,18 @@ DIALOG_EXPORT_STEP_BASE::DIALOG_EXPORT_STEP_BASE( wxWindow* parent, wxWindowID i
|
|||
|
||||
fgSizer2->Add( 0, 0, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_cbDrillOrigin = new wxCheckBox( this, wxID_ANY, _("Drill and plot axis origin"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_cbDrillOrigin->SetToolTip( _("Use the auxiliary axis origin (used in plot and drill geneation) as STEP coordinates origin.") );
|
||||
m_cbPlotOrigin = new wxCheckBox( this, wxID_ANY, _("Drill and plot axis origin"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_cbPlotOrigin->SetToolTip( _("Use the auxiliary axis origin (used in plot and drill geneation) as STEP coordinates origin.") );
|
||||
|
||||
fgSizer2->Add( m_cbDrillOrigin, 0, wxALL, 5 );
|
||||
fgSizer2->Add( m_cbPlotOrigin, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
fgSizer2->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
m_cbAuxOrigin = new wxCheckBox( this, wxID_ANY, _("Grid origin"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_cbAuxOrigin->SetToolTip( _("Use the grid origin as STEP coordinates origin.") );
|
||||
m_cbGridOrigin = new wxCheckBox( this, wxID_ANY, _("Grid origin"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_cbGridOrigin->SetToolTip( _("Use the grid origin as STEP coordinates origin.") );
|
||||
|
||||
fgSizer2->Add( m_cbAuxOrigin, 0, wxALL, 5 );
|
||||
fgSizer2->Add( m_cbGridOrigin, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
fgSizer2->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
@ -65,7 +65,15 @@ DIALOG_EXPORT_STEP_BASE::DIALOG_EXPORT_STEP_BASE( wxWindow* parent, wxWindowID i
|
|||
m_cbUserOrigin = new wxCheckBox( this, wxID_ANY, _("User defined origin"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_cbUserOrigin->SetToolTip( _("Use this option if you want to define a specific coordinate origin value.") );
|
||||
|
||||
fgSizer2->Add( m_cbUserOrigin, 0, wxALL, 5 );
|
||||
fgSizer2->Add( m_cbUserOrigin, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
fgSizer2->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
m_cbBoardCenter = new wxCheckBox( this, wxID_ANY, _("Board center origin"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_cbBoardCenter->SetToolTip( _("Use this option if you want to define coordinate origin at board center.") );
|
||||
|
||||
fgSizer2->Add( m_cbBoardCenter, 0, wxALL, 5 );
|
||||
|
||||
|
||||
bSizer7->Add( fgSizer2, 1, wxEXPAND, 5 );
|
||||
|
@ -78,7 +86,7 @@ DIALOG_EXPORT_STEP_BASE::DIALOG_EXPORT_STEP_BASE( wxWindow* parent, wxWindowID i
|
|||
|
||||
m_staticText2 = new wxStaticText( this, wxID_ANY, _("User defined origin:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText2->Wrap( -1 );
|
||||
m_staticText2->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
|
||||
m_staticText2->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
|
||||
|
||||
bSizer3->Add( m_staticText2, 0, wxALL, 5 );
|
||||
|
||||
|
@ -108,7 +116,14 @@ DIALOG_EXPORT_STEP_BASE::DIALOG_EXPORT_STEP_BASE( wxWindow* parent, wxWindowID i
|
|||
fgSizer1->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
m_STEP_Xorg = new wxTextCtrl( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_STEP_Xorg->SetMaxLength( 8 );
|
||||
#ifdef __WXGTK__
|
||||
if ( !m_STEP_Xorg->HasFlag( wxTE_MULTILINE ) )
|
||||
{
|
||||
m_STEP_Xorg->SetMaxLength( 8 );
|
||||
}
|
||||
#else
|
||||
m_STEP_Xorg->SetMaxLength( 8 );
|
||||
#endif
|
||||
fgSizer1->Add( m_STEP_Xorg, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
@ -119,7 +134,14 @@ DIALOG_EXPORT_STEP_BASE::DIALOG_EXPORT_STEP_BASE( wxWindow* parent, wxWindowID i
|
|||
fgSizer1->Add( m_staticText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
m_STEP_Yorg = new wxTextCtrl( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_STEP_Yorg->SetMaxLength( 8 );
|
||||
#ifdef __WXGTK__
|
||||
if ( !m_STEP_Yorg->HasFlag( wxTE_MULTILINE ) )
|
||||
{
|
||||
m_STEP_Yorg->SetMaxLength( 8 );
|
||||
}
|
||||
#else
|
||||
m_STEP_Yorg->SetMaxLength( 8 );
|
||||
#endif
|
||||
fgSizer1->Add( m_STEP_Yorg, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
@ -133,7 +155,7 @@ DIALOG_EXPORT_STEP_BASE::DIALOG_EXPORT_STEP_BASE( wxWindow* parent, wxWindowID i
|
|||
|
||||
m_staticText7 = new wxStaticText( this, wxID_ANY, _("Other options:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText7->Wrap( -1 );
|
||||
m_staticText7->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
|
||||
m_staticText7->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
|
||||
|
||||
bSizer8->Add( m_staticText7, 0, wxALL, 5 );
|
||||
|
||||
|
@ -175,8 +197,20 @@ DIALOG_EXPORT_STEP_BASE::DIALOG_EXPORT_STEP_BASE( wxWindow* parent, wxWindowID i
|
|||
bSizerSTEPFile->Fit( this );
|
||||
|
||||
this->Centre( wxBOTH );
|
||||
|
||||
// Connect Events
|
||||
m_cbPlotOrigin->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_STEP_BASE::onSelectOrigin ), NULL, this );
|
||||
m_cbGridOrigin->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_STEP_BASE::onSelectOrigin ), NULL, this );
|
||||
m_cbUserOrigin->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_STEP_BASE::onSelectOrigin ), NULL, this );
|
||||
m_cbBoardCenter->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_STEP_BASE::onSelectOrigin ), NULL, this );
|
||||
}
|
||||
|
||||
DIALOG_EXPORT_STEP_BASE::~DIALOG_EXPORT_STEP_BASE()
|
||||
{
|
||||
// Disconnect Events
|
||||
m_cbPlotOrigin->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_STEP_BASE::onSelectOrigin ), NULL, this );
|
||||
m_cbGridOrigin->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_STEP_BASE::onSelectOrigin ), NULL, this );
|
||||
m_cbUserOrigin->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_STEP_BASE::onSelectOrigin ), NULL, this );
|
||||
m_cbBoardCenter->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_STEP_BASE::onSelectOrigin ), NULL, this );
|
||||
|
||||
}
|
||||
|
|
|
@ -475,7 +475,7 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -514,7 +514,7 @@
|
|||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_cbDrillOrigin</property>
|
||||
<property name="name">m_cbPlotOrigin</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
|
@ -536,7 +536,7 @@
|
|||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckBox"></event>
|
||||
<event name="OnCheckBox">onSelectOrigin</event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
|
@ -573,7 +573,7 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -612,7 +612,7 @@
|
|||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_cbAuxOrigin</property>
|
||||
<property name="name">m_cbGridOrigin</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
|
@ -634,7 +634,7 @@
|
|||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckBox"></event>
|
||||
<event name="OnCheckBox">onSelectOrigin</event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
|
@ -671,7 +671,7 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -732,7 +732,105 @@
|
|||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckBox"></event>
|
||||
<event name="OnCheckBox">onSelectOrigin</event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="spacer" expanded="1">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Board center origin</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_cbBoardCenter</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Use this option if you want to define coordinate origin at board center.</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckBox">onSelectOrigin</event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2014)
|
||||
// C++ code generated with wxFormBuilder (version Jul 2 2017)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -44,9 +44,10 @@ class DIALOG_EXPORT_STEP_BASE : public DIALOG_SHIM
|
|||
wxFilePickerCtrl* m_filePickerSTEP;
|
||||
wxStaticLine* m_staticline2;
|
||||
wxStaticText* m_staticText6;
|
||||
wxCheckBox* m_cbDrillOrigin;
|
||||
wxCheckBox* m_cbAuxOrigin;
|
||||
wxCheckBox* m_cbPlotOrigin;
|
||||
wxCheckBox* m_cbGridOrigin;
|
||||
wxCheckBox* m_cbUserOrigin;
|
||||
wxCheckBox* m_cbBoardCenter;
|
||||
wxStaticText* m_staticText2;
|
||||
wxStaticText* m_staticText5;
|
||||
wxChoice* m_STEP_OrgUnitChoice;
|
||||
|
@ -60,6 +61,10 @@ class DIALOG_EXPORT_STEP_BASE : public DIALOG_SHIM
|
|||
wxStdDialogButtonSizer* m_sdbSizer;
|
||||
wxButton* m_sdbSizerOK;
|
||||
wxButton* m_sdbSizerCancel;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void onSelectOrigin( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
|
Loading…
Reference in New Issue