diff --git a/pcbnew/import_gfx/dialog_import_gfx.cpp b/pcbnew/import_gfx/dialog_import_gfx.cpp index d1bfc5117a..cd533086ca 100644 --- a/pcbnew/import_gfx/dialog_import_gfx.cpp +++ b/pcbnew/import_gfx/dialog_import_gfx.cpp @@ -41,22 +41,28 @@ #include #include -// Keys to store setup in config -#define IMPORT_GFX_LAYER_OPTION_KEY "GfxImportBrdLayer" -#define IMPORT_GFX_PLACEMENT_INTERACTIVE_KEY "GfxImportPlacementInteractive" -#define IMPORT_GFX_LAST_FILE_KEY "GfxImportLastFile" -#define IMPORT_GFX_POSITION_UNITS_KEY "GfxImportPositionUnits" -#define IMPORT_GFX_POSITION_X_KEY "GfxImportPositionX" -#define IMPORT_GFX_POSITION_Y_KEY "GfxImportPositionY" -#define IMPORT_GFX_LINEWIDTH_UNITS_KEY "GfxImportLineWidthUnits" -#define IMPORT_GFX_LINEWIDTH_KEY "GfxImportLineWidth" +// Configuration path (group) to store entry keys below. +#define IMPORT_GFX_GROUP "ImportGraphics" -// Static members of DIALOG_IMPORT_GFX, to remember -// the user's choices during the session +// Entry keys to store setup in config +#define IMPORT_GFX_LAYER_OPTION_KEY "BoardLayer" +#define IMPORT_GFX_PLACEMENT_INTERACTIVE_KEY "InteractivePlacement" +#define IMPORT_GFX_LAST_FILE_KEY "LastFile" +#define IMPORT_GFX_POSITION_UNITS_KEY "PositionUnits" +#define IMPORT_GFX_POSITION_X_KEY "PositionX" +#define IMPORT_GFX_POSITION_Y_KEY "PositionY" +#define IMPORT_GFX_LINEWIDTH_UNITS_KEY "LineWidthUnits" +#define IMPORT_GFX_LINEWIDTH_KEY "LineWidth" + + +// Static members of DIALOG_IMPORT_GFX, to remember the user's choices during the session wxString DIALOG_IMPORT_GFX::m_filename; bool DIALOG_IMPORT_GFX::m_placementInteractive = true; LAYER_NUM DIALOG_IMPORT_GFX::m_layer = Dwgs_User; -double DIALOG_IMPORT_GFX::m_scaleImport = 1.0; // Do not change the imported items size +double DIALOG_IMPORT_GFX::m_scaleImport = 1.0; // Do not change the imported items size +int DIALOG_IMPORT_GFX::m_originUnits = 0; // millimeter +int DIALOG_IMPORT_GFX::m_lineWidthUnits = 0; // millimeter + DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX( PCB_BASE_FRAME* aParent, bool aImportAsFootprintGraphic ) : DIALOG_IMPORT_GFX_BASE( aParent ) @@ -85,27 +91,31 @@ DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX( PCB_BASE_FRAME* aParent, bool aImportAsFoo } m_config = Kiface().KifaceSettings(); - m_originImportUnits = 0; - m_importOrigin.x = 0.0; // always in mm - m_importOrigin.y = 0.0; // always in mm - m_default_lineWidth = 0.2; // always in mm - m_lineWidthImportUnits = 0; + m_originUnits = 0; + m_origin.x = 0.0; // always in mm + m_origin.y = 0.0; // always in mm + m_lineWidth = 0.2; // always in mm + m_lineWidthUnits = 0; if( m_config ) { + wxString tmp = m_config->GetPath(); + m_config->SetPath( IMPORT_GFX_GROUP ); m_layer = m_config->Read( IMPORT_GFX_LAYER_OPTION_KEY, (long)Dwgs_User ); m_placementInteractive = m_config->Read( IMPORT_GFX_PLACEMENT_INTERACTIVE_KEY, true ); m_filename = m_config->Read( IMPORT_GFX_LAST_FILE_KEY, wxEmptyString ); - m_config->Read( IMPORT_GFX_LINEWIDTH_KEY, &m_default_lineWidth, 0.2 ); - m_config->Read( IMPORT_GFX_POSITION_UNITS_KEY, &m_originImportUnits, 0 ); - m_config->Read( IMPORT_GFX_POSITION_X_KEY, &m_importOrigin.x, 0.0 ); - m_config->Read( IMPORT_GFX_POSITION_Y_KEY, &m_importOrigin.y, 0.0 ); + m_config->Read( IMPORT_GFX_LINEWIDTH_KEY, &m_lineWidth, 0.2 ); + m_config->Read( IMPORT_GFX_LINEWIDTH_UNITS_KEY, &m_lineWidthUnits, 0 ); + m_config->Read( IMPORT_GFX_POSITION_UNITS_KEY, &m_originUnits, 0 ); + m_config->Read( IMPORT_GFX_POSITION_X_KEY, &m_origin.x, 0.0 ); + m_config->Read( IMPORT_GFX_POSITION_Y_KEY, &m_origin.y, 0.0 ); + m_config->SetPath( tmp ); } - m_choiceUnitLineWidth->SetSelection( m_lineWidthImportUnits ); + m_choiceUnitLineWidth->SetSelection( m_lineWidthUnits ); showPCBdefaultLineWidth(); - m_DxfPcbPositionUnits->SetSelection( m_originImportUnits ); + m_DxfPcbPositionUnits->SetSelection( m_originUnits ); showPcbImportOffsets(); m_textCtrlFileName->SetValue( m_filename ); @@ -115,8 +125,8 @@ DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX( PCB_BASE_FRAME* aParent, bool aImportAsFoo m_textCtrlImportScale->SetValue( wxString::Format( "%f", m_scaleImport ) ); // Configure the layers list selector - m_SelLayerBox->SetLayersHotkeys( false ); // Do not display hotkeys - m_SelLayerBox->SetNotAllowedLayerSet( LSET::AllCuMask() ); // Do not use copper layers + m_SelLayerBox->SetLayersHotkeys( false ); // Do not display hotkeys + m_SelLayerBox->SetNotAllowedLayerSet( LSET::AllCuMask() ); // Do not use copper layers m_SelLayerBox->SetBoardFrame( m_parent ); m_SelLayerBox->Resync(); @@ -126,6 +136,7 @@ DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX( PCB_BASE_FRAME* aParent, bool aImportAsFoo m_SelLayerBox->SetLayerSelection( m_layer ); } + SetInitialFocus( m_textCtrlFileName ); m_sdbSizerOK->SetDefault(); GetSizer()->Fit( this ); GetSizer()->SetSizeHints( this ); @@ -135,22 +146,21 @@ DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX( PCB_BASE_FRAME* aParent, bool aImportAsFoo DIALOG_IMPORT_GFX::~DIALOG_IMPORT_GFX() { - updatePcbImportOffsets_mm(); - m_layer = m_SelLayerBox->GetLayerSelection(); - if( m_config ) { + wxString tmp = m_config->GetPath(); + m_config->SetPath( IMPORT_GFX_GROUP ); m_config->Write( IMPORT_GFX_LAYER_OPTION_KEY, (long)m_layer ); m_config->Write( IMPORT_GFX_PLACEMENT_INTERACTIVE_KEY, m_placementInteractive ); m_config->Write( IMPORT_GFX_LAST_FILE_KEY, m_filename ); - m_config->Write( IMPORT_GFX_POSITION_UNITS_KEY, m_originImportUnits ); - m_config->Write( IMPORT_GFX_POSITION_X_KEY, m_importOrigin.x ); - m_config->Write( IMPORT_GFX_POSITION_Y_KEY, m_importOrigin.y ); + m_config->Write( IMPORT_GFX_POSITION_UNITS_KEY, m_originUnits ); + m_config->Write( IMPORT_GFX_POSITION_X_KEY, m_origin.x ); + m_config->Write( IMPORT_GFX_POSITION_Y_KEY, m_origin.y ); - m_lineWidthImportUnits = getPCBdefaultLineWidthMM(); - m_config->Write( IMPORT_GFX_LINEWIDTH_KEY, m_default_lineWidth ); - m_config->Write( IMPORT_GFX_LINEWIDTH_UNITS_KEY, m_lineWidthImportUnits ); + m_config->Write( IMPORT_GFX_LINEWIDTH_KEY, m_lineWidth ); + m_config->Write( IMPORT_GFX_LINEWIDTH_UNITS_KEY, m_lineWidthUnits ); + m_config->SetPath( tmp ); } } @@ -160,7 +170,7 @@ void DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX::onUnitPositionSelection( wxCommandEve // Collect last entered values: updatePcbImportOffsets_mm(); - m_originImportUnits = m_DxfPcbPositionUnits->GetSelection();; + m_originUnits = m_DxfPcbPositionUnits->GetSelection();; showPcbImportOffsets(); } @@ -169,19 +179,19 @@ double DIALOG_IMPORT_GFX::getPCBdefaultLineWidthMM() { double value = DoubleValueFromString( UNSCALED_UNITS, m_textCtrlLineWidth->GetValue() ); - switch( m_lineWidthImportUnits ) + switch( m_lineWidthUnits ) { - default: - case 0: // display units = mm - break; + default: + case 0: // display units = mm + break; - case 1: // display units = mil - value *= 25.4 / 1000; - break; + case 1: // display units = mil + value *= 25.4 / 1000; + break; - case 2: // display units = inch - value *= 25.4; - break; + case 2: // display units = inch + value *= 25.4; + break; } return value; // value is in mm @@ -190,21 +200,21 @@ double DIALOG_IMPORT_GFX::getPCBdefaultLineWidthMM() void DIALOG_IMPORT_GFX::onUnitWidthSelection( wxCommandEvent& event ) { - m_default_lineWidth = getPCBdefaultLineWidthMM(); + m_lineWidth = getPCBdefaultLineWidthMM(); // Switch to new units - m_lineWidthImportUnits = m_choiceUnitLineWidth->GetSelection(); + m_lineWidthUnits = m_choiceUnitLineWidth->GetSelection(); showPCBdefaultLineWidth(); } void DIALOG_IMPORT_GFX::showPcbImportOffsets() { - // Display m_importOrigin value according to the unit selection: - VECTOR2D offset = m_importOrigin; + // Display m_origin value according to the unit selection: + VECTOR2D offset = m_origin; - if( m_originImportUnits ) // Units are inches - offset = m_importOrigin / 25.4; + if( m_originUnits ) // Units are inches + offset = m_origin / 25.4; m_DxfPcbXCoord->SetValue( wxString::Format( "%f", offset.x ) ); m_DxfPcbYCoord->SetValue( wxString::Format( "%f", offset.y ) ); @@ -216,20 +226,20 @@ void DIALOG_IMPORT_GFX::showPCBdefaultLineWidth() { double value; - switch( m_lineWidthImportUnits ) + switch( m_lineWidthUnits ) { - default: - case 0: // display units = mm - value = m_default_lineWidth; - break; + default: + case 0: // display units = mm + value = m_lineWidth; + break; - case 1: // display units = mil - value = m_default_lineWidth / 25.4 * 1000; - break; + case 1: // display units = mil + value = m_lineWidth / 25.4 * 1000; + break; - case 2: // display units = inch - value = m_default_lineWidth / 25.4; - break; + case 2: // display units = inch + value = m_lineWidth / 25.4; + break; } m_textCtrlLineWidth->SetValue( wxString::Format( "%f", value ) ); @@ -261,10 +271,10 @@ void DIALOG_IMPORT_GFX::onBrowseFiles( wxCommandEvent& event ) allWildcards += wildcards + ";"; } - wildcardsDesc = "All supported formats|" + allWildcards + wildcardsDesc; + wildcardsDesc = _( "All supported formats|" ) + allWildcards + wildcardsDesc; wxFileDialog dlg( m_parent, _( "Open File" ), path, filename, - wildcardsDesc, wxFD_OPEN|wxFD_FILE_MUST_EXIST ); + wildcardsDesc, wxFD_OPEN|wxFD_FILE_MUST_EXIST ); if( dlg.ShowModal() != wxID_OK ) return; @@ -279,28 +289,34 @@ void DIALOG_IMPORT_GFX::onBrowseFiles( wxCommandEvent& event ) } -void DIALOG_IMPORT_GFX::onOKClick( wxCommandEvent& event ) +bool DIALOG_IMPORT_GFX::TransferDataFromWindow() { + if( !wxDialog::TransferDataFromWindow() ) + return false; + m_filename = m_textCtrlFileName->GetValue(); if( m_filename.IsEmpty() ) { - wxMessageBox( _( "Error: No DXF filename!" ) ); - return; + wxMessageBox( _( "No file selected!" ) ); + return false; } - updatePcbImportOffsets_mm(); // Update m_importOriginX and m_importOriginY; + m_originUnits = m_DxfPcbPositionUnits->GetSelection(); + updatePcbImportOffsets_mm(); // Update m_originX and m_originY; m_layer = m_SelLayerBox->GetLayerSelection(); if( m_layer < 0 ) { - wxMessageBox( _( "Please, select a valid layer" ) ); - return; + wxMessageBox( _( "Please select a valid layer." ) ); + return false; } - m_default_lineWidth = getPCBdefaultLineWidthMM(); + m_lineWidthUnits = m_choiceUnitLineWidth->GetSelection(); + m_lineWidth = getPCBdefaultLineWidthMM(); + wxLogDebug( "Default line width = %fmm", m_lineWidth ); m_importer->SetLayer( PCB_LAYER_ID( m_layer ) ); auto plugin = m_gfxImportMgr->GetPluginByExt( wxFileName( m_filename ).GetExt() ); @@ -308,10 +324,10 @@ void DIALOG_IMPORT_GFX::onOKClick( wxCommandEvent& event ) if( plugin ) { // Set coordinates offset for import (offset is given in mm) - m_importer->SetImportOffsetMM( m_importOrigin ); + m_importer->SetImportOffsetMM( m_origin ); m_scaleImport = DoubleValueFromString( UNSCALED_UNITS, m_textCtrlImportScale->GetValue() ); - m_importer->SetLineWidthMM( m_default_lineWidth ); + m_importer->SetLineWidthMM( m_lineWidth ); m_importer->SetPlugin( std::move( plugin ) ); LOCALE_IO dummy; // Ensure floats can be read. @@ -322,15 +338,45 @@ void DIALOG_IMPORT_GFX::onOKClick( wxCommandEvent& event ) // Get warning messages: const std::string& warnings = m_importer->GetMessages(); + // This isn't a fatal error so allow the dialog to close with wxID_OK. if( !warnings.empty() ) - wxMessageBox( warnings.c_str(), _( "Not Handled Items" ) ); - - event.Skip(); + wxMessageBox( warnings.c_str(), _( "Items Not Handled" ) ); } else { - wxMessageBox( _( "There is no plugin to handle this file type" ) ); + wxMessageBox( _( "There is no plugin to handle this file type." ) ); + return false; } + + return true; +} + + +void DIALOG_IMPORT_GFX::originOptionOnUpdateUI( wxUpdateUIEvent& event ) +{ + if( m_rbInteractivePlacement->GetValue() != m_placementInteractive ) + m_rbInteractivePlacement->SetValue( m_placementInteractive ); + + if( m_rbAbsolutePlacement->GetValue() == m_placementInteractive ) + m_rbAbsolutePlacement->SetValue( not m_placementInteractive ); + + m_DxfPcbPositionUnits->Enable( not m_placementInteractive ); + m_DxfPcbXCoord->Enable( not m_placementInteractive ); + m_DxfPcbYCoord->Enable( not m_placementInteractive ); +} + + +void DIALOG_IMPORT_GFX::updatePcbImportOffsets_mm() +{ + m_origin.x = DoubleValueFromString( UNSCALED_UNITS, m_DxfPcbXCoord->GetValue() ); + m_origin.y = DoubleValueFromString( UNSCALED_UNITS, m_DxfPcbYCoord->GetValue() ); + + if( m_originUnits ) // Units are inches + { + m_origin = m_origin * 25.4; + } + + return; } @@ -347,7 +393,7 @@ bool InvokeDialogImportGfxBoard( PCB_BASE_FRAME* aCaller ) // Ensure the list is not empty: if( list.empty() ) { - wxMessageBox( _( "No graphic items found in file to import") ); + wxMessageBox( _( "No graphic items found in file to import." ) ); return false; } @@ -362,7 +408,7 @@ bool InvokeDialogImportGfxBoard( PCB_BASE_FRAME* aCaller ) BLOCK_SELECTOR& blockmove = aCaller->GetScreen()->m_BlockLocate; if( dlg.IsPlacementInteractive() ) - aCaller->HandleBlockBegin( NULL, BLOCK_PRESELECT_MOVE, wxPoint( 0, 0) ); + aCaller->HandleBlockBegin( NULL, BLOCK_PRESELECT_MOVE, wxPoint( 0, 0 ) ); PICKED_ITEMS_LIST& blockitemsList = blockmove.GetItems(); @@ -424,7 +470,7 @@ bool InvokeDialogImportGfxModule( PCB_BASE_FRAME* aCaller, MODULE* aModule ) // Ensure the list is not empty: if( list.empty() ) { - wxMessageBox( _( "No graphic items found in file to import") ); + wxMessageBox( _( "No graphic items found in file to import" ) ); return false; } @@ -440,7 +486,7 @@ bool InvokeDialogImportGfxModule( PCB_BASE_FRAME* aCaller, MODULE* aModule ) BLOCK_SELECTOR& blockmove = aCaller->GetScreen()->m_BlockLocate; if( dlg.IsPlacementInteractive() ) - aCaller->HandleBlockBegin( nullptr, BLOCK_PRESELECT_MOVE, wxPoint( 0, 0) ); + aCaller->HandleBlockBegin( nullptr, BLOCK_PRESELECT_MOVE, wxPoint( 0, 0 ) ); PICKED_ITEMS_LIST& blockitemsList = blockmove.GetItems(); @@ -478,31 +524,3 @@ bool InvokeDialogImportGfxModule( PCB_BASE_FRAME* aCaller, MODULE* aModule ) return true; } - - -void DIALOG_IMPORT_GFX::originOptionOnUpdateUI( wxUpdateUIEvent& event ) -{ - if( m_rbInteractivePlacement->GetValue() != m_placementInteractive ) - m_rbInteractivePlacement->SetValue( m_placementInteractive ); - - if( m_rbAbsolutePlacement->GetValue() == m_placementInteractive ) - m_rbAbsolutePlacement->SetValue( not m_placementInteractive ); - - m_DxfPcbPositionUnits->Enable( not m_placementInteractive ); - m_DxfPcbXCoord->Enable( not m_placementInteractive ); - m_DxfPcbYCoord->Enable( not m_placementInteractive ); -} - - -void DIALOG_IMPORT_GFX::updatePcbImportOffsets_mm() -{ - m_importOrigin.x = DoubleValueFromString( UNSCALED_UNITS, m_DxfPcbXCoord->GetValue() ); - m_importOrigin.y = DoubleValueFromString( UNSCALED_UNITS, m_DxfPcbYCoord->GetValue() ); - - if( m_originImportUnits ) // Units are inches - { - m_importOrigin = m_importOrigin * 25.4; - } - - return; -} diff --git a/pcbnew/import_gfx/dialog_import_gfx.h b/pcbnew/import_gfx/dialog_import_gfx.h index f4eb3079ce..980f784747 100644 --- a/pcbnew/import_gfx/dialog_import_gfx.h +++ b/pcbnew/import_gfx/dialog_import_gfx.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2019 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 @@ -22,6 +22,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#ifndef __DIALOG_IMPORT_GFX_H__ +#define __DIALOG_IMPORT_GFX_H__ + #include #include "dialog_import_gfx_base.h" #include @@ -34,9 +37,7 @@ public: DIALOG_IMPORT_GFX( PCB_BASE_FRAME* aParent, bool aUseModuleItems = false ); ~DIALOG_IMPORT_GFX(); - /** - * Function GetImportedItems() * @return a list of items imported from a vector graphics file. */ std::list>& GetImportedItems() @@ -44,7 +45,8 @@ public: return m_importer->GetItems(); } - /** @return true if the placement is interactive, i.e. all imported + /** + * @return true if the placement is interactive, i.e. all imported * items must be moved by the mouse cursor to the final position * false means the imported items are placed to the final position after import. */ @@ -53,33 +55,37 @@ public: return m_placementInteractive; } + bool TransferDataFromWindow() override; + private: PCB_BASE_FRAME* m_parent; wxConfigBase* m_config; // Current config std::unique_ptr m_importer; std::unique_ptr m_gfxImportMgr; - int m_originImportUnits; - VECTOR2D m_importOrigin; // This is the offset to add to imported coordinates + static int m_originUnits; + VECTOR2D m_origin; // This is the offset to add to imported coordinates // Always in mm static wxString m_filename; static bool m_placementInteractive; static LAYER_NUM m_layer; - double m_default_lineWidth; // always in mm: line width when a line width is not specified - int m_lineWidthImportUnits; - static double m_scaleImport; // a scale factor to change the size of imported items - // m_scaleImport =1.0 means keep original size + double m_lineWidth; // always in mm: line width when a line width + // is not specified + static int m_lineWidthUnits; + static double m_scaleImport; // a scale factor to change the size of imported + // items m_scaleImport =1.0 means keep original size // Virtual event handlers - void onOKClick( wxCommandEvent& event ) override; void onUnitPositionSelection( wxCommandEvent& event ) override; void onUnitWidthSelection( wxCommandEvent& event ) override; void onBrowseFiles( wxCommandEvent& event ) override; void originOptionOnUpdateUI( wxUpdateUIEvent& event ) override; + void onInteractivePlacement( wxCommandEvent& event ) override { m_placementInteractive = true; } + void onAbsolutePlacement( wxCommandEvent& event ) override { m_placementInteractive = false; @@ -90,3 +96,5 @@ private: void showPCBdefaultLineWidth(); void showPcbImportOffsets(); }; + +#endif // __DIALOG_IMPORT_GFX_H__ diff --git a/pcbnew/import_gfx/dialog_import_gfx_base.cpp b/pcbnew/import_gfx/dialog_import_gfx_base.cpp index 20b7297133..72d0ec5119 100644 --- a/pcbnew/import_gfx/dialog_import_gfx_base.cpp +++ b/pcbnew/import_gfx/dialog_import_gfx_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 23 2018) +// C++ code generated with wxFormBuilder (version Mar 20 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -23,15 +23,15 @@ DIALOG_IMPORT_GFX_BASE::DIALOG_IMPORT_GFX_BASE( wxWindow* parent, wxWindowID id, m_staticTextFile = new wxStaticText( this, wxID_ANY, _("File:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextFile->Wrap( -1 ); - bSizerFile->Add( m_staticTextFile, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizerFile->Add( m_staticTextFile, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_textCtrlFileName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textCtrlFileName->SetMinSize( wxSize( 300,-1 ) ); - bSizerFile->Add( m_textCtrlFileName, 1, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxTOP, 5 ); + bSizerFile->Add( m_textCtrlFileName, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_buttonBrowse = new wxButton( this, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerFile->Add( m_buttonBrowse, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxTOP, 5 ); + bSizerFile->Add( m_buttonBrowse, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); bSizerMain->Add( bSizerFile, 0, wxALL|wxEXPAND, 5 ); @@ -46,27 +46,27 @@ DIALOG_IMPORT_GFX_BASE::DIALOG_IMPORT_GFX_BASE( wxWindow* parent, wxWindowID id, m_staticTextPlacement->Wrap( -1 ); m_staticTextPlacement->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); - bSizerPlacement->Add( m_staticTextPlacement, 0, wxALL, 5 ); + bSizerPlacement->Add( m_staticTextPlacement, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); wxBoxSizer* bSizerOptions; bSizerOptions = new wxBoxSizer( wxVERTICAL ); - m_rbInteractivePlacement = new wxRadioButton( this, wxID_ANY, _("Interactive placement"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); + m_rbInteractivePlacement = new wxRadioButton( this, wxID_ANY, _("Interactive placement"), wxDefaultPosition, wxDefaultSize, wxRB_SINGLE ); m_rbInteractivePlacement->SetValue( true ); - bSizerOptions->Add( m_rbInteractivePlacement, 0, wxALL, 5 ); + bSizerOptions->Add( m_rbInteractivePlacement, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 ); wxBoxSizer* bSizerUserPos; bSizerUserPos = new wxBoxSizer( wxHORIZONTAL ); - m_rbAbsolutePlacement = new wxRadioButton( this, wxID_ANY, _("At"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerUserPos->Add( m_rbAbsolutePlacement, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_rbAbsolutePlacement = new wxRadioButton( this, wxID_ANY, _("At"), wxDefaultPosition, wxDefaultSize, wxRB_SINGLE ); + bSizerUserPos->Add( m_rbAbsolutePlacement, 0, wxALIGN_CENTER_VERTICAL, 5 ); wxBoxSizer* bSizerPosSettings; bSizerPosSettings = new wxBoxSizer( wxHORIZONTAL ); m_staticTextXpos = new wxStaticText( this, wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextXpos->Wrap( -1 ); - bSizerPosSettings->Add( m_staticTextXpos, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); + bSizerPosSettings->Add( m_staticTextXpos, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); m_DxfPcbXCoord = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); #ifdef __WXGTK__ @@ -79,11 +79,11 @@ DIALOG_IMPORT_GFX_BASE::DIALOG_IMPORT_GFX_BASE( wxWindow* parent, wxWindowID id, #endif m_DxfPcbXCoord->SetToolTip( _("DXF origin on PCB Grid, X Coordinate") ); - bSizerPosSettings->Add( m_DxfPcbXCoord, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizerPosSettings->Add( m_DxfPcbXCoord, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_staticTextYpos = new wxStaticText( this, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextYpos->Wrap( -1 ); - bSizerPosSettings->Add( m_staticTextYpos, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); + bSizerPosSettings->Add( m_staticTextYpos, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); m_DxfPcbYCoord = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); #ifdef __WXGTK__ @@ -96,11 +96,11 @@ DIALOG_IMPORT_GFX_BASE::DIALOG_IMPORT_GFX_BASE( wxWindow* parent, wxWindowID id, #endif m_DxfPcbYCoord->SetToolTip( _("DXF origin on PCB Grid, Y Coordinate") ); - bSizerPosSettings->Add( m_DxfPcbYCoord, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizerPosSettings->Add( m_DxfPcbYCoord, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_staticTextUnits = new wxStaticText( this, wxID_ANY, _("Units:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextUnits->Wrap( -1 ); - bSizerPosSettings->Add( m_staticTextUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizerPosSettings->Add( m_staticTextUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); wxString m_DxfPcbPositionUnitsChoices[] = { _("mm"), _("inch") }; int m_DxfPcbPositionUnitsNChoices = sizeof( m_DxfPcbPositionUnitsChoices ) / sizeof( wxString ); @@ -108,10 +108,10 @@ DIALOG_IMPORT_GFX_BASE::DIALOG_IMPORT_GFX_BASE( wxWindow* parent, wxWindowID id, m_DxfPcbPositionUnits->SetSelection( 0 ); m_DxfPcbPositionUnits->SetToolTip( _("Select PCB grid units") ); - bSizerPosSettings->Add( m_DxfPcbPositionUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + bSizerPosSettings->Add( m_DxfPcbPositionUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - bSizerUserPos->Add( bSizerPosSettings, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + bSizerUserPos->Add( bSizerPosSettings, 1, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxTOP, 5 ); bSizerOptions->Add( bSizerUserPos, 0, wxEXPAND, 5 ); @@ -132,7 +132,7 @@ DIALOG_IMPORT_GFX_BASE::DIALOG_IMPORT_GFX_BASE( wxWindow* parent, wxWindowID id, m_staticTextPrms->Wrap( -1 ); m_staticTextPrms->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); - bSizerLayer->Add( m_staticTextPrms, 0, wxALL, 5 ); + bSizerLayer->Add( m_staticTextPrms, 0, wxALL|wxEXPAND, 5 ); wxBoxSizer* bSizer7; bSizer7 = new wxBoxSizer( wxHORIZONTAL ); @@ -141,58 +141,58 @@ DIALOG_IMPORT_GFX_BASE::DIALOG_IMPORT_GFX_BASE( wxWindow* parent, wxWindowID id, bSizer7->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 ); wxFlexGridSizer* fgSizerImportSettings; - fgSizerImportSettings = new wxFlexGridSizer( 0, 3, 0, 0 ); + fgSizerImportSettings = new wxFlexGridSizer( 0, 3, 5, 5 ); fgSizerImportSettings->AddGrowableCol( 1 ); fgSizerImportSettings->SetFlexibleDirection( wxBOTH ); fgSizerImportSettings->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); m_staticTextLineWidth = new wxStaticText( this, wxID_ANY, _("Line width (DXF import):"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextLineWidth->Wrap( -1 ); - fgSizerImportSettings->Add( m_staticTextLineWidth, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizerImportSettings->Add( m_staticTextLineWidth, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_textCtrlLineWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizerImportSettings->Add( m_textCtrlLineWidth, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizerImportSettings->Add( m_textCtrlLineWidth, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); wxString m_choiceUnitLineWidthChoices[] = { _("mm"), _("mils"), _("inches") }; int m_choiceUnitLineWidthNChoices = sizeof( m_choiceUnitLineWidthChoices ) / sizeof( wxString ); m_choiceUnitLineWidth = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitLineWidthNChoices, m_choiceUnitLineWidthChoices, 0 ); m_choiceUnitLineWidth->SetSelection( 0 ); - fgSizerImportSettings->Add( m_choiceUnitLineWidth, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizerImportSettings->Add( m_choiceUnitLineWidth, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_staticTextBrdlayer = new wxStaticText( this, wxID_ANY, _("Graphic layer:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextBrdlayer->Wrap( -1 ); - fgSizerImportSettings->Add( m_staticTextBrdlayer, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP, 5 ); + fgSizerImportSettings->Add( m_staticTextBrdlayer, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_SelLayerBox = new PCB_LAYER_BOX_SELECTOR( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - fgSizerImportSettings->Add( m_SelLayerBox, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 ); + fgSizerImportSettings->Add( m_SelLayerBox, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); fgSizerImportSettings->Add( 0, 0, 0, 0, 5 ); m_staticTextscale = new wxStaticText( this, wxID_ANY, _("Import scale:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextscale->Wrap( -1 ); - fgSizerImportSettings->Add( m_staticTextscale, 0, wxALL, 5 ); + fgSizerImportSettings->Add( m_staticTextscale, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_textCtrlImportScale = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizerImportSettings->Add( m_textCtrlImportScale, 0, wxALL|wxEXPAND, 5 ); + fgSizerImportSettings->Add( m_textCtrlImportScale, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); fgSizerImportSettings->Add( 0, 0, 0, 0, 5 ); - bSizer7->Add( fgSizerImportSettings, 1, wxEXPAND, 5 ); + bSizer7->Add( fgSizerImportSettings, 1, wxEXPAND|wxRIGHT|wxTOP, 5 ); bSizerLayer->Add( bSizer7, 1, wxEXPAND, 5 ); - bSizerMain->Add( bSizerLayer, 0, wxALL|wxEXPAND, 5 ); + bSizerMain->Add( bSizerLayer, 0, wxBOTTOM|wxEXPAND, 5 ); - bSizerMain->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizerMain->Add( 0, 0, 0, wxEXPAND, 5 ); m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizerMain->Add( m_staticline, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + bSizerMain->Add( m_staticline, 0, wxALL|wxEXPAND, 5 ); m_sdbSizer = new wxStdDialogButtonSizer(); m_sdbSizerOK = new wxButton( this, wxID_OK ); @@ -206,6 +206,7 @@ DIALOG_IMPORT_GFX_BASE::DIALOG_IMPORT_GFX_BASE( wxWindow* parent, wxWindowID id, this->SetSizer( bSizerMain ); this->Layout(); + bSizerMain->Fit( this ); this->Centre( wxBOTH ); @@ -217,7 +218,6 @@ DIALOG_IMPORT_GFX_BASE::DIALOG_IMPORT_GFX_BASE( wxWindow* parent, wxWindowID id, m_rbAbsolutePlacement->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_IMPORT_GFX_BASE::originOptionOnUpdateUI ), NULL, this ); m_DxfPcbPositionUnits->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitPositionSelection ), NULL, this ); m_choiceUnitLineWidth->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitWidthSelection ), NULL, this ); - m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onOKClick ), NULL, this ); } DIALOG_IMPORT_GFX_BASE::~DIALOG_IMPORT_GFX_BASE() @@ -230,6 +230,5 @@ DIALOG_IMPORT_GFX_BASE::~DIALOG_IMPORT_GFX_BASE() m_rbAbsolutePlacement->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_IMPORT_GFX_BASE::originOptionOnUpdateUI ), NULL, this ); m_DxfPcbPositionUnits->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitPositionSelection ), NULL, this ); m_choiceUnitLineWidth->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitWidthSelection ), NULL, this ); - m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onOKClick ), NULL, this ); } diff --git a/pcbnew/import_gfx/dialog_import_gfx_base.fbp b/pcbnew/import_gfx/dialog_import_gfx_base.fbp index fd65bb90a4..64d9de20b8 100644 --- a/pcbnew/import_gfx/dialog_import_gfx_base.fbp +++ b/pcbnew/import_gfx/dialog_import_gfx_base.fbp @@ -2,7 +2,7 @@ - + C++ 1 source_name @@ -14,96 +14,49 @@ dialog_import_gfx_base 1000 none - + + 1 dialog_dxf_import - + . - + 1 1 1 1 UI + 0 0 0 0 wxAUI_MGR_DEFAULT - + wxBOTH - + 1 1 impl_virtual - - - + + + 0 wxID_ANY - - + + DIALOG_IMPORT_GFX_BASE - - 476,373 + + -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h - Import vector graphics file - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Import Vector Graphics File + + + + - + bSizerMain wxVERTICAL none @@ -112,300 +65,206 @@ wxALL|wxEXPAND 0 - + bSizerFile wxHORIZONTAL none 5 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY File: 0 - + 0 - - + + 0 - + 1 m_staticTextFile 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxTOP + wxALIGN_CENTER_VERTICAL|wxRIGHT 1 1 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - - + + + 0 300,-1 1 m_textCtrlFileName 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxTOP + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 1 1 1 - - - - - - - - + + + + + + + + 1 0 1 - + 1 - + 0 0 - + Dock 0 Left 1 - + 1 - - + + 0 0 wxID_ANY Browse - + 0 - + 0 - - + + 0 - + 1 m_buttonBrowse 1 - - + + protected 1 - - - + + + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - + + + + onBrowseFiles - - - - - - - - - - - - - - - - - - - - - - - - @@ -419,83 +278,53 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - + + 0 - + 1 m_staticline2 1 - - + + protected 1 - + Resizable 1 - + wxLI_HORIZONTAL ; forward_declare 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -503,37 +332,37 @@ wxEXPAND 1 - + bSizerPlacement wxVERTICAL none 5 - wxALL + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT 0 1 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 ,90,92,-1,70,0 0 @@ -541,61 +370,31 @@ wxID_ANY Placement: 0 - + 0 - - + + 0 - + 1 m_staticTextPlacement 1 - - + + protected 1 - + Resizable 1 - - + + ; forward_declare 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -603,102 +402,73 @@ wxEXPAND|wxLEFT 1 - + bSizerOptions wxVERTICAL none 5 - wxALL + wxBOTTOM|wxEXPAND|wxTOP 0 1 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Interactive placement - + 0 - - + + 0 - + 1 m_rbInteractivePlacement 1 - - + + protected 1 - + Resizable 1 - + wxRB_SINGLE ; forward_declare 0 - - + + wxFILTER_NONE wxDefaultValidator - + 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + onInteractivePlacement - - - - - originOptionOnUpdateUI @@ -707,676 +477,459 @@ wxEXPAND 0 - + bSizerUserPos wxHORIZONTAL none 5 - wxALL|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL 0 1 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY At - + 0 - - + + 0 - + 1 m_rbAbsolutePlacement 1 - - + + protected 1 - + Resizable 1 - + wxRB_SINGLE ; forward_declare 0 - - + + wxFILTER_NONE wxDefaultValidator - + 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + onAbsolutePlacement - - - - - originOptionOnUpdateUI 5 - wxEXPAND|wxTOP|wxBOTTOM + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxTOP 1 - + bSizerPosSettings wxHORIZONTAL none 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT 0 1 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY X: 0 - + 0 - - + + 0 - + 1 m_staticTextXpos 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxRIGHT 1 1 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 10 - + 0 - + 1 m_DxfPcbXCoord 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 DXF origin on PCB Grid, X Coordinate - + wxFILTER_NUMERIC wxTextValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT 0 1 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Y: 0 - + 0 - - + + 0 - + 1 m_staticTextYpos 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 10 - + 0 - + 1 m_DxfPcbYCoord 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 DXF origin on PCB Grid, Y Coordinate - + wxFILTER_NUMERIC wxTextValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + 5 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT 0 1 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Units: 0 - + 0 - - + + 0 - + 1 m_staticTextUnits 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 1 1 1 - - - - - - - + + + + + + + 1 0 "mm" "inch" 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - + + 0 - + 1 m_DxfPcbPositionUnits 1 - - + + protected 1 - + Resizable 0 1 - - - + + + 0 Select PCB grid units - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - + + + + onUnitPositionSelection - - - - - - - - - - - - - - - - - - - - - - @@ -1396,121 +949,91 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - + + 0 - + 1 m_staticline3 1 - - + + protected 1 - + Resizable 1 - + wxLI_HORIZONTAL ; forward_declare 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + 5 - wxALL|wxEXPAND + wxBOTTOM|wxEXPAND 0 - + bSizerLayer wxVERTICAL none 5 - wxALL + wxALL|wxEXPAND 0 1 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 ,90,92,-1,70,0 0 @@ -1518,61 +1041,31 @@ wxID_ANY Import parameters: 0 - + 0 - - + + 0 - + 1 m_staticTextPrms 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1580,7 +1073,7 @@ wxEXPAND 1 - + bSizer7 wxHORIZONTAL none @@ -1596,496 +1089,339 @@ 5 - wxEXPAND + wxEXPAND|wxRIGHT|wxTOP 1 3 wxBOTH 1 - - 0 - + + 5 + fgSizerImportSettings wxFLEX_GROWMODE_SPECIFIED none 0 - 0 + 5 5 - wxALL|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL 0 1 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Line width (DXF import): 0 - + 0 - - + + 0 - + 1 m_staticTextLineWidth 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxEXPAND 0 1 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - - + + + 0 - + 1 m_textCtrlLineWidth 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + 5 - wxALL|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL 0 1 1 1 1 - - - - - - - + + + + + + + 1 0 "mm" "mils" "inches" 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - + + 0 - + 1 m_choiceUnitLineWidth 1 - - + + protected 1 - + Resizable 0 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - + + + + onUnitWidthSelection - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP + wxALIGN_CENTER_VERTICAL 0 1 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Graphic layer: 0 - + 0 - - + + 0 - + 1 m_staticTextBrdlayer 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND + wxALIGN_CENTER_VERTICAL|wxEXPAND 0 1 1 1 1 - - - - - - - + + + + + + + 1 0 - + 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - + + 0 - + 1 m_SelLayerBox 1 - - + + protected 1 - + Resizable -1 1 - - + + PCB_LAYER_BOX_SELECTOR; pcb_layer_box_selector.h 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + 5 - + 0 0 @@ -2095,196 +1431,132 @@ 5 - wxALL + wxALIGN_CENTER_VERTICAL 0 1 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Import scale: 0 - + 0 - - + + 0 - + 1 m_staticTextscale 1 - - + + protected 1 - + Resizable 1 - - + + ; forward_declare 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND + wxALIGN_CENTER_VERTICAL|wxEXPAND 0 1 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - - + + + 0 - + 1 m_textCtrlImportScale 1 - - + + protected 1 - + Resizable 1 - - + + ; forward_declare 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + 5 - + 0 0 @@ -2301,7 +1573,7 @@ 5 wxEXPAND - 1 + 0 0 protected @@ -2310,90 +1582,60 @@ 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + wxALL|wxEXPAND 0 1 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - + + 0 - + 1 m_staticline 1 - - + + protected 1 - + Resizable 1 - + wxLI_HORIZONTAL - + 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -2409,17 +1651,9 @@ 1 0 0 - + m_sdbSizer protected - - - - - - onOKClick - - diff --git a/pcbnew/import_gfx/dialog_import_gfx_base.h b/pcbnew/import_gfx/dialog_import_gfx_base.h index c2c10cb8fe..5f63109e19 100644 --- a/pcbnew/import_gfx/dialog_import_gfx_base.h +++ b/pcbnew/import_gfx/dialog_import_gfx_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 23 2018) +// C++ code generated with wxFormBuilder (version Mar 20 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -77,12 +77,11 @@ class DIALOG_IMPORT_GFX_BASE : public DIALOG_SHIM virtual void onAbsolutePlacement( wxCommandEvent& event ) { event.Skip(); } virtual void onUnitPositionSelection( wxCommandEvent& event ) { event.Skip(); } virtual void onUnitWidthSelection( wxCommandEvent& event ) { event.Skip(); } - virtual void onOKClick( wxCommandEvent& event ) { event.Skip(); } public: - DIALOG_IMPORT_GFX_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Import vector graphics file"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,500 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_IMPORT_GFX_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Import Vector Graphics File"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_IMPORT_GFX_BASE(); };