Move import graphics dialog to UNIT_BINDER.
Also fixes a bug where the position gets scaled (because we're applying it to the imported values, which are automatically scaled). Fixes https://gitlab.com/kicad/code/kicad/issues/10483
This commit is contained in:
parent
d3d5d0f46e
commit
8ae0ddf09d
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2022 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
|
||||
|
@ -30,7 +30,6 @@
|
|||
#include <locale_io.h>
|
||||
#include <pcb_layer_box_selector.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <board.h>
|
||||
#include <bitmaps.h>
|
||||
#include <map>
|
||||
#include "dxf_import_plugin.h"
|
||||
|
@ -40,29 +39,27 @@
|
|||
#include <memory>
|
||||
|
||||
// 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;
|
||||
bool DIALOG_IMPORT_GFX::m_shouldGroupItems = true;
|
||||
int DIALOG_IMPORT_GFX::m_layer = Dwgs_User;
|
||||
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_dxfLineWidthUnits = 0; // millimeter
|
||||
int DIALOG_IMPORT_GFX::m_dxfUnits = 0; // first entry in the dxfUnits map below
|
||||
bool DIALOG_IMPORT_GFX::m_placementInteractive = true;
|
||||
bool DIALOG_IMPORT_GFX::m_shouldGroupItems = true;
|
||||
double DIALOG_IMPORT_GFX::m_importScale = 1.0; // Do not change the imported items size
|
||||
|
||||
|
||||
const std::map<DXF_IMPORT_UNITS, wxString> dxfUnitsMap = {
|
||||
{ DXF_IMPORT_UNITS::INCHES, _( "Inches" ) },
|
||||
{ DXF_IMPORT_UNITS::INCHES, _( "Inches" ) },
|
||||
{ DXF_IMPORT_UNITS::MILLIMETERS, _( "Millimeters" ) },
|
||||
{ DXF_IMPORT_UNITS::MILS, _( "Mils" ) },
|
||||
{ DXF_IMPORT_UNITS::MILS, _( "Mils" ) },
|
||||
{ DXF_IMPORT_UNITS::CENTIMETERS, _( "Centimeter" ) },
|
||||
{ DXF_IMPORT_UNITS::FEET, _( "Feet" ) },
|
||||
{ DXF_IMPORT_UNITS::FEET, _( "Feet" ) },
|
||||
};
|
||||
|
||||
|
||||
DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX( PCB_BASE_FRAME* aParent, bool aImportAsFootprintGraphic )
|
||||
: DIALOG_IMPORT_GFX_BASE( aParent )
|
||||
DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX( PCB_BASE_FRAME* aParent, bool aImportAsFootprintGraphic ) :
|
||||
DIALOG_IMPORT_GFX_BASE( aParent ),
|
||||
m_parent( aParent ),
|
||||
m_xOrigin( aParent, m_xLabel, m_xCtrl, m_xUnits ),
|
||||
m_yOrigin( aParent, m_yLabel, m_yCtrl, m_yUnits ),
|
||||
m_defaultLineWidth( aParent, m_lineWidthLabel, m_lineWidthCtrl, m_lineWidthUnits )
|
||||
{
|
||||
m_parent = aParent;
|
||||
|
||||
if( aImportAsFootprintGraphic )
|
||||
m_importer = std::make_unique<GRAPHICS_IMPORTER_FOOTPRINT>( m_parent->GetBoard()->GetFirstFootprint() );
|
||||
else
|
||||
|
@ -84,52 +81,33 @@ DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX( PCB_BASE_FRAME* aParent, bool aImportAsFoo
|
|||
m_gfxImportMgr = std::make_unique<GRAPHICS_IMPORT_MGR>( blacklist );
|
||||
}
|
||||
|
||||
m_originUnits = 0;
|
||||
m_origin.x = 0.0; // always in mm
|
||||
m_origin.y = 0.0; // always in mm
|
||||
m_dxfLineWidth = 0.2; // always in mm
|
||||
m_dxfLineWidthUnits = 0;
|
||||
PCBNEW_SETTINGS* cfg = m_parent->GetPcbNewSettings();
|
||||
|
||||
auto cfg = m_parent->GetPcbNewSettings();
|
||||
|
||||
m_layer = cfg->m_ImportGraphics.layer;
|
||||
m_placementInteractive = cfg->m_ImportGraphics.interactive_placement;
|
||||
m_filename = cfg->m_ImportGraphics.last_file;
|
||||
m_dxfLineWidth = cfg->m_ImportGraphics.dxf_line_width;
|
||||
m_dxfLineWidthUnits = cfg->m_ImportGraphics.dxf_line_width_units;
|
||||
m_originUnits = cfg->m_ImportGraphics.origin_units;
|
||||
m_origin.x = cfg->m_ImportGraphics.origin_x;
|
||||
m_origin.y = cfg->m_ImportGraphics.origin_y;
|
||||
m_dxfUnits = cfg->m_ImportGraphics.dxf_units;
|
||||
|
||||
m_choiceUnitLineWidth->SetSelection( m_dxfLineWidthUnits );
|
||||
showDXFDefaultLineWidth();
|
||||
m_xOrigin.SetValue( cfg->m_ImportGraphics.origin_x * IU_PER_MM );
|
||||
m_yOrigin.SetValue( cfg->m_ImportGraphics.origin_y * IU_PER_MM );
|
||||
m_defaultLineWidth.SetValue( cfg->m_ImportGraphics.dxf_line_width * IU_PER_MM );
|
||||
|
||||
m_DxfPcbPositionUnits->SetSelection( m_originUnits );
|
||||
showPcbImportOffsets();
|
||||
|
||||
m_textCtrlFileName->SetValue( m_filename );
|
||||
m_textCtrlFileName->SetValue( cfg->m_ImportGraphics.last_file );
|
||||
m_rbInteractivePlacement->SetValue( m_placementInteractive );
|
||||
m_rbAbsolutePlacement->SetValue( not m_placementInteractive );
|
||||
m_rbAbsolutePlacement->SetValue( !m_placementInteractive );
|
||||
m_groupItems->SetValue( m_shouldGroupItems );
|
||||
|
||||
m_textCtrlImportScale->SetValue( wxString::Format( wxT( "%f" ), m_scaleImport ) );
|
||||
m_importScaleCtrl->SetValue( wxString::Format( wxT( "%f" ), m_importScale ) );
|
||||
|
||||
// Configure the layers list selector
|
||||
m_SelLayerBox->SetLayersHotkeys( false ); // Do not display hotkeys
|
||||
m_SelLayerBox->SetLayersHotkeys( false ); // Do not display hotkeys
|
||||
m_SelLayerBox->SetBoardFrame( m_parent );
|
||||
m_SelLayerBox->Resync();
|
||||
|
||||
if( m_SelLayerBox->SetLayerSelection( m_layer ) < 0 )
|
||||
{
|
||||
m_layer = Dwgs_User;
|
||||
m_SelLayerBox->SetLayerSelection( m_layer );
|
||||
}
|
||||
if( m_SelLayerBox->SetLayerSelection( cfg->m_ImportGraphics.layer ) < 0 )
|
||||
m_SelLayerBox->SetLayerSelection( Dwgs_User );
|
||||
|
||||
for( auto& unitEntry : dxfUnitsMap )
|
||||
for( const std::pair<const DXF_IMPORT_UNITS, wxString>& unitEntry : dxfUnitsMap )
|
||||
m_choiceDxfUnits->Append( unitEntry.second );
|
||||
|
||||
m_choiceDxfUnits->SetSelection( m_dxfUnits );
|
||||
m_choiceDxfUnits->SetSelection( cfg->m_ImportGraphics.dxf_units );
|
||||
|
||||
m_browseButton->SetBitmap( KiBitmap( BITMAPS::small_folder ) );
|
||||
|
||||
|
@ -145,121 +123,53 @@ DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX( PCB_BASE_FRAME* aParent, bool aImportAsFoo
|
|||
|
||||
m_textCtrlFileName->Connect( wxEVT_COMMAND_TEXT_UPDATED,
|
||||
wxCommandEventHandler( DIALOG_IMPORT_GFX::onFilename ),
|
||||
NULL, this );
|
||||
nullptr, this );
|
||||
}
|
||||
|
||||
|
||||
DIALOG_IMPORT_GFX::~DIALOG_IMPORT_GFX()
|
||||
{
|
||||
auto cfg = m_parent->GetPcbNewSettings();
|
||||
PCBNEW_SETTINGS* cfg = m_parent->GetPcbNewSettings();
|
||||
|
||||
cfg->m_ImportGraphics.layer = m_layer;
|
||||
cfg->m_ImportGraphics.layer = m_SelLayerBox->GetLayerSelection();
|
||||
cfg->m_ImportGraphics.interactive_placement = m_placementInteractive;
|
||||
cfg->m_ImportGraphics.last_file = m_filename;
|
||||
cfg->m_ImportGraphics.dxf_line_width = m_dxfLineWidth;
|
||||
cfg->m_ImportGraphics.dxf_line_width_units = m_dxfLineWidthUnits;
|
||||
cfg->m_ImportGraphics.origin_units = m_originUnits;
|
||||
cfg->m_ImportGraphics.origin_x = m_origin.x;
|
||||
cfg->m_ImportGraphics.origin_y = m_origin.y;
|
||||
cfg->m_ImportGraphics.dxf_units = m_dxfUnits;
|
||||
cfg->m_ImportGraphics.last_file = m_textCtrlFileName->GetValue();
|
||||
cfg->m_ImportGraphics.dxf_line_width = Iu2Millimeter( m_defaultLineWidth.GetValue() );
|
||||
cfg->m_ImportGraphics.origin_x = Iu2Millimeter( m_xOrigin.GetValue() );
|
||||
cfg->m_ImportGraphics.origin_y = Iu2Millimeter( m_yOrigin.GetValue() );
|
||||
cfg->m_ImportGraphics.dxf_units = m_choiceDxfUnits->GetSelection();
|
||||
|
||||
m_importScale = DoubleValueFromString( EDA_UNITS::UNSCALED, m_importScaleCtrl->GetValue() );
|
||||
|
||||
m_textCtrlFileName->Disconnect( wxEVT_COMMAND_TEXT_UPDATED,
|
||||
wxCommandEventHandler( DIALOG_IMPORT_GFX::onFilename ),
|
||||
NULL, this );
|
||||
nullptr, this );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_IMPORT_GFX::onFilename( wxCommandEvent& event )
|
||||
{
|
||||
bool enableDXFControls = true;
|
||||
wxString filename = m_textCtrlFileName->GetValue();
|
||||
wxString ext = wxFileName( m_textCtrlFileName->GetValue() ).GetExt();
|
||||
|
||||
if( auto plugin = m_gfxImportMgr->GetPluginByExt( wxFileName( filename ).GetExt() ) )
|
||||
if( std::unique_ptr<GRAPHICS_IMPORT_PLUGIN> plugin = m_gfxImportMgr->GetPluginByExt( ext ) )
|
||||
enableDXFControls = dynamic_cast<DXF_IMPORT_PLUGIN*>( plugin.get() ) != nullptr;
|
||||
|
||||
m_staticTextLineWidth->Enable( enableDXFControls );
|
||||
m_textCtrlLineWidth->Enable( enableDXFControls );
|
||||
m_choiceUnitLineWidth->Enable( enableDXFControls );
|
||||
m_defaultLineWidth.Enable( enableDXFControls );
|
||||
|
||||
m_staticTextLineWidth1->Enable( enableDXFControls );
|
||||
m_choiceDxfUnits->Enable( enableDXFControls );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_IMPORT_GFX::onUnitPositionSelection( wxCommandEvent& event )
|
||||
{
|
||||
// Collect last entered values:
|
||||
updatePcbImportOffsets_mm();
|
||||
|
||||
m_originUnits = m_DxfPcbPositionUnits->GetSelection();;
|
||||
showPcbImportOffsets();
|
||||
}
|
||||
|
||||
|
||||
double DIALOG_IMPORT_GFX::getDXFDefaultLineWidthMM()
|
||||
{
|
||||
double value = DoubleValueFromString( EDA_UNITS::UNSCALED, m_textCtrlLineWidth->GetValue() );
|
||||
|
||||
switch( m_dxfLineWidthUnits )
|
||||
{
|
||||
default:
|
||||
case 0: break; // display units = mm
|
||||
case 1: value *= 25.4 / 1000; break; // display units = mil
|
||||
case 2: value *= 25.4; break; // display units = inch
|
||||
}
|
||||
|
||||
return value; // value is in mm
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_IMPORT_GFX::onUnitWidthSelection( wxCommandEvent& event )
|
||||
{
|
||||
m_dxfLineWidth = getDXFDefaultLineWidthMM();
|
||||
|
||||
// Switch to new units
|
||||
m_dxfLineWidthUnits = m_choiceUnitLineWidth->GetSelection();
|
||||
showDXFDefaultLineWidth();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_IMPORT_GFX::showPcbImportOffsets()
|
||||
{
|
||||
// Display m_origin value according to the unit selection:
|
||||
VECTOR2D offset = m_origin;
|
||||
|
||||
if( m_originUnits ) // Units are inches
|
||||
offset = m_origin / 25.4;
|
||||
|
||||
m_DxfPcbXCoord->SetValue( wxString::Format( wxT( "%f" ), offset.x ) );
|
||||
m_DxfPcbYCoord->SetValue( wxString::Format( wxT( "%f" ), offset.y ) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_IMPORT_GFX::showDXFDefaultLineWidth()
|
||||
{
|
||||
double value;
|
||||
|
||||
switch( m_dxfLineWidthUnits )
|
||||
{
|
||||
default:
|
||||
case 0: value = m_dxfLineWidth; break; // display units = mm
|
||||
case 1: value = m_dxfLineWidth / 25.4 * 1000; break; // display units = mil
|
||||
case 2: value = m_dxfLineWidth / 25.4; break; // display units = inch
|
||||
}
|
||||
|
||||
m_textCtrlLineWidth->SetValue( wxString::Format( wxT( "%f" ), value ) );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_IMPORT_GFX::onBrowseFiles( wxCommandEvent& event )
|
||||
{
|
||||
wxString path;
|
||||
wxString filename;
|
||||
wxString filename = m_textCtrlFileName->GetValue();
|
||||
|
||||
if( !m_filename.IsEmpty() )
|
||||
if( !filename.IsEmpty() )
|
||||
{
|
||||
wxFileName fn( m_filename );
|
||||
wxFileName fn( filename );
|
||||
path = fn.GetPath();
|
||||
filename = fn.GetFullName();
|
||||
}
|
||||
|
@ -282,16 +192,8 @@ void DIALOG_IMPORT_GFX::onBrowseFiles( wxCommandEvent& event )
|
|||
wxFileDialog dlg( m_parent, _( "Open File" ), path, filename, wildcardsDesc,
|
||||
wxFD_OPEN | wxFD_FILE_MUST_EXIST );
|
||||
|
||||
if( dlg.ShowModal() != wxID_OK )
|
||||
return;
|
||||
|
||||
wxString fileName = dlg.GetPath();
|
||||
|
||||
if( fileName.IsEmpty() )
|
||||
return;
|
||||
|
||||
m_filename = fileName;
|
||||
m_textCtrlFileName->SetValue( fileName );
|
||||
if( dlg.ShowModal() == wxID_OK && !dlg.GetPath().IsEmpty() )
|
||||
m_textCtrlFileName->SetValue( dlg.GetPath() );
|
||||
}
|
||||
|
||||
|
||||
|
@ -300,64 +202,49 @@ bool DIALOG_IMPORT_GFX::TransferDataFromWindow()
|
|||
if( !wxDialog::TransferDataFromWindow() )
|
||||
return false;
|
||||
|
||||
m_filename = m_textCtrlFileName->GetValue();
|
||||
|
||||
if( m_filename.IsEmpty() )
|
||||
if( m_textCtrlFileName->GetValue().IsEmpty() )
|
||||
{
|
||||
wxMessageBox( _( "No file selected!" ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
m_originUnits = m_DxfPcbPositionUnits->GetSelection();
|
||||
updatePcbImportOffsets_mm(); // Update m_originX and m_originY;
|
||||
|
||||
m_layer = m_SelLayerBox->GetLayerSelection();
|
||||
|
||||
if( m_layer < 0 )
|
||||
if( m_SelLayerBox->GetLayerSelection() < 0 )
|
||||
{
|
||||
wxMessageBox( _( "Please select a valid layer." ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
m_dxfLineWidthUnits = m_choiceUnitLineWidth->GetSelection();
|
||||
m_dxfLineWidth = getDXFDefaultLineWidthMM();
|
||||
wxString ext = wxFileName( m_textCtrlFileName->GetValue() ).GetExt();
|
||||
double scale = DoubleValueFromString( EDA_UNITS::UNSCALED, m_importScaleCtrl->GetValue() );
|
||||
VECTOR2D origin( m_xOrigin.GetValue() / scale, m_yOrigin.GetValue() / scale );
|
||||
|
||||
m_dxfUnits = m_choiceDxfUnits->GetSelection();
|
||||
|
||||
m_importer->SetLayer( PCB_LAYER_ID( m_layer ) );
|
||||
|
||||
if( auto plugin = m_gfxImportMgr->GetPluginByExt( wxFileName( m_filename ).GetExt() ) )
|
||||
if( std::unique_ptr<GRAPHICS_IMPORT_PLUGIN> plugin = m_gfxImportMgr->GetPluginByExt( ext ) )
|
||||
{
|
||||
DXF_IMPORT_PLUGIN* dxfPlugin = dynamic_cast<DXF_IMPORT_PLUGIN*>( plugin.get() );
|
||||
|
||||
if( dxfPlugin )
|
||||
if( DXF_IMPORT_PLUGIN* dxfPlugin = dynamic_cast<DXF_IMPORT_PLUGIN*>( plugin.get() ) )
|
||||
{
|
||||
auto it = dxfUnitsMap.begin();
|
||||
std::advance( it, m_dxfUnits );
|
||||
std::advance( it, m_choiceDxfUnits->GetSelection() );
|
||||
|
||||
if( it == dxfUnitsMap.end() )
|
||||
dxfPlugin->SetUnit( DXF_IMPORT_UNITS::DEFAULT );
|
||||
else
|
||||
dxfPlugin->SetUnit( it->first );
|
||||
|
||||
m_importer->SetLineWidthMM( m_dxfLineWidth );
|
||||
m_importer->SetLineWidthMM( Iu2Millimeter( m_defaultLineWidth.GetValue() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_importer->SetLineWidthMM( 0.0 );
|
||||
}
|
||||
|
||||
// Set coordinates offset for import (offset is given in mm)
|
||||
m_importer->SetImportOffsetMM( m_origin );
|
||||
m_scaleImport = DoubleValueFromString( EDA_UNITS::UNSCALED,
|
||||
m_textCtrlImportScale->GetValue() );
|
||||
|
||||
m_importer->SetPlugin( std::move( plugin ) );
|
||||
m_importer->SetLayer( PCB_LAYER_ID( m_SelLayerBox->GetLayerSelection() ) );
|
||||
m_importer->SetImportOffsetMM( { Iu2Millimeter( origin.x ), Iu2Millimeter( origin.y ) } );
|
||||
|
||||
LOCALE_IO dummy; // Ensure floats can be read.
|
||||
|
||||
if( m_importer->Load( m_filename ) )
|
||||
m_importer->Import( m_scaleImport );
|
||||
if( m_importer->Load( m_textCtrlFileName->GetValue() ) )
|
||||
m_importer->Import( scale );
|
||||
|
||||
// Get warning messages:
|
||||
wxString warnings = m_importer->GetMessages();
|
||||
|
@ -371,14 +258,14 @@ bool DIALOG_IMPORT_GFX::TransferDataFromWindow()
|
|||
dlg.AddHTML_Text( warnings );
|
||||
dlg.ShowModal();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
wxMessageBox( _( "There is no plugin to handle this file type." ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -388,21 +275,10 @@ void DIALOG_IMPORT_GFX::originOptionOnUpdateUI( wxUpdateUIEvent& event )
|
|||
m_rbInteractivePlacement->SetValue( m_placementInteractive );
|
||||
|
||||
if( m_rbAbsolutePlacement->GetValue() == m_placementInteractive )
|
||||
m_rbAbsolutePlacement->SetValue( not m_placementInteractive );
|
||||
m_rbAbsolutePlacement->SetValue( !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( EDA_UNITS::UNSCALED, m_DxfPcbXCoord->GetValue() );
|
||||
m_origin.y = DoubleValueFromString( EDA_UNITS::UNSCALED, m_DxfPcbYCoord->GetValue() );
|
||||
|
||||
if( m_originUnits ) // Units are inches
|
||||
m_origin = m_origin * 25.4;
|
||||
m_xOrigin.Enable( !m_placementInteractive );
|
||||
m_yOrigin.Enable( !m_placementInteractive );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2022 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
|
||||
|
@ -25,6 +25,7 @@
|
|||
#ifndef __DIALOG_IMPORT_GFX_H__
|
||||
#define __DIALOG_IMPORT_GFX_H__
|
||||
|
||||
#include <widgets/unit_binder.h>
|
||||
#include <pcb_edit_frame.h>
|
||||
#include <pcbnew_settings.h>
|
||||
#include "dialog_import_gfx_base.h"
|
||||
|
@ -32,6 +33,7 @@
|
|||
|
||||
class GRAPHICS_IMPORT_MGR;
|
||||
|
||||
|
||||
class DIALOG_IMPORT_GFX : public DIALOG_IMPORT_GFX_BASE
|
||||
{
|
||||
public:
|
||||
|
@ -51,25 +53,17 @@ public:
|
|||
* 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.
|
||||
*/
|
||||
bool IsPlacementInteractive()
|
||||
{
|
||||
return m_placementInteractive;
|
||||
}
|
||||
bool IsPlacementInteractive() { return m_placementInteractive; }
|
||||
|
||||
/**
|
||||
* @return true if the items should be added into a group when being placed.
|
||||
*/
|
||||
bool ShouldGroupItems()
|
||||
{
|
||||
return m_shouldGroupItems;
|
||||
}
|
||||
bool ShouldGroupItems() { return m_shouldGroupItems; }
|
||||
|
||||
bool TransferDataFromWindow() override;
|
||||
|
||||
private:
|
||||
// Virtual event handlers
|
||||
void onUnitPositionSelection( wxCommandEvent& event ) override;
|
||||
void onUnitWidthSelection( wxCommandEvent& event ) override;
|
||||
void onBrowseFiles( wxCommandEvent& event ) override;
|
||||
void onFilename( wxCommandEvent& event );
|
||||
void originOptionOnUpdateUI( wxUpdateUIEvent& event ) override;
|
||||
|
@ -89,28 +83,19 @@ private:
|
|||
m_shouldGroupItems = m_groupItems->GetValue();
|
||||
}
|
||||
|
||||
void updatePcbImportOffsets_mm();
|
||||
double getDXFDefaultLineWidthMM();
|
||||
void showDXFDefaultLineWidth();
|
||||
void showPcbImportOffsets();
|
||||
|
||||
PCB_BASE_FRAME* m_parent;
|
||||
private:
|
||||
PCB_BASE_FRAME* m_parent;
|
||||
std::unique_ptr<GRAPHICS_IMPORTER_PCBNEW> m_importer;
|
||||
std::unique_ptr<GRAPHICS_IMPORT_MGR> m_gfxImportMgr;
|
||||
static int m_originUnits;
|
||||
VECTOR2D m_origin; // This is the offset to add to imported coordinates
|
||||
// Always in mm
|
||||
|
||||
static wxString m_filename;
|
||||
UNIT_BINDER m_xOrigin;
|
||||
UNIT_BINDER m_yOrigin;
|
||||
UNIT_BINDER m_defaultLineWidth;
|
||||
|
||||
static bool m_shouldGroupItems;
|
||||
static bool m_placementInteractive;
|
||||
static int m_layer;
|
||||
double m_dxfLineWidth; // always in mm: line width when a line width
|
||||
// is not specified
|
||||
static int m_dxfLineWidthUnits;
|
||||
static double m_scaleImport; // a scale factor to change the size of imported
|
||||
// items m_scaleImport =1.0 means keep original size
|
||||
static int m_dxfUnits;
|
||||
static double m_importScale; // a scale factor to change the size of imported
|
||||
// items m_importScale =1.0 means keep original size
|
||||
};
|
||||
|
||||
#endif // __DIALOG_IMPORT_GFX_H__
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Oct 26 2018)
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
@ -21,7 +21,7 @@ DIALOG_IMPORT_GFX_BASE::DIALOG_IMPORT_GFX_BASE( wxWindow* parent, wxWindowID id,
|
|||
wxBoxSizer* bSizerFile;
|
||||
bSizerFile = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_staticTextFile = new wxStaticText( this, wxID_ANY, _("File"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextFile = new wxStaticText( this, wxID_ANY, _("File:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextFile->Wrap( -1 );
|
||||
m_staticTextFile->SetToolTip( _("Only vectors will be imported. Bitmaps and fonts will be ignored.") );
|
||||
|
||||
|
@ -34,7 +34,7 @@ DIALOG_IMPORT_GFX_BASE::DIALOG_IMPORT_GFX_BASE( wxWindow* parent, wxWindowID id,
|
|||
bSizerFile->Add( m_textCtrlFileName, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
|
||||
m_browseButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
|
||||
bSizerFile->Add( m_browseButton, 0, wxALL, 5 );
|
||||
bSizerFile->Add( m_browseButton, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( bSizerFile, 0, wxALL|wxEXPAND, 10 );
|
||||
|
@ -58,51 +58,47 @@ DIALOG_IMPORT_GFX_BASE::DIALOG_IMPORT_GFX_BASE( wxWindow* parent, wxWindowID id,
|
|||
wxBoxSizer* bSizerPosSettings;
|
||||
bSizerPosSettings = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_staticTextXpos = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextXpos->Wrap( -1 );
|
||||
bSizerPosSettings->Add( m_staticTextXpos, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
|
||||
m_xLabel = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_xLabel->Wrap( -1 );
|
||||
bSizerPosSettings->Add( m_xLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_DxfPcbXCoord = new wxTextCtrl( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_xCtrl = new wxTextCtrl( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
#ifdef __WXGTK__
|
||||
if ( !m_DxfPcbXCoord->HasFlag( wxTE_MULTILINE ) )
|
||||
if ( !m_xCtrl->HasFlag( wxTE_MULTILINE ) )
|
||||
{
|
||||
m_DxfPcbXCoord->SetMaxLength( 10 );
|
||||
m_xCtrl->SetMaxLength( 10 );
|
||||
}
|
||||
#else
|
||||
m_DxfPcbXCoord->SetMaxLength( 10 );
|
||||
m_xCtrl->SetMaxLength( 10 );
|
||||
#endif
|
||||
m_DxfPcbXCoord->SetToolTip( _("DXF origin on PCB Grid, X Coordinate") );
|
||||
m_xCtrl->SetToolTip( _("DXF origin on PCB Grid, X Coordinate") );
|
||||
|
||||
bSizerPosSettings->Add( m_DxfPcbXCoord, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
bSizerPosSettings->Add( m_xCtrl, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
|
||||
m_staticTextYpos = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextYpos->Wrap( -1 );
|
||||
bSizerPosSettings->Add( m_staticTextYpos, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
|
||||
m_xUnits = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_xUnits->Wrap( -1 );
|
||||
bSizerPosSettings->Add( m_xUnits, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
m_DxfPcbYCoord = new wxTextCtrl( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_yLabel = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_yLabel->Wrap( -1 );
|
||||
bSizerPosSettings->Add( m_yLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_yCtrl = new wxTextCtrl( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
#ifdef __WXGTK__
|
||||
if ( !m_DxfPcbYCoord->HasFlag( wxTE_MULTILINE ) )
|
||||
if ( !m_yCtrl->HasFlag( wxTE_MULTILINE ) )
|
||||
{
|
||||
m_DxfPcbYCoord->SetMaxLength( 10 );
|
||||
m_yCtrl->SetMaxLength( 10 );
|
||||
}
|
||||
#else
|
||||
m_DxfPcbYCoord->SetMaxLength( 10 );
|
||||
m_yCtrl->SetMaxLength( 10 );
|
||||
#endif
|
||||
m_DxfPcbYCoord->SetToolTip( _("DXF origin on PCB Grid, Y Coordinate") );
|
||||
m_yCtrl->SetToolTip( _("DXF origin on PCB Grid, Y Coordinate") );
|
||||
|
||||
bSizerPosSettings->Add( m_DxfPcbYCoord, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
bSizerPosSettings->Add( m_yCtrl, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
|
||||
m_staticTextUnits = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Units"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextUnits->Wrap( -1 );
|
||||
bSizerPosSettings->Add( m_staticTextUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
wxString m_DxfPcbPositionUnitsChoices[] = { _("mm"), _("inch") };
|
||||
int m_DxfPcbPositionUnitsNChoices = sizeof( m_DxfPcbPositionUnitsChoices ) / sizeof( wxString );
|
||||
m_DxfPcbPositionUnits = new wxChoice( sbSizer2->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_DxfPcbPositionUnitsNChoices, m_DxfPcbPositionUnitsChoices, 0 );
|
||||
m_DxfPcbPositionUnits->SetSelection( 0 );
|
||||
m_DxfPcbPositionUnits->SetToolTip( _("Select PCB grid units") );
|
||||
|
||||
bSizerPosSettings->Add( m_DxfPcbPositionUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
m_yUnits = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_yUnits->Wrap( -1 );
|
||||
bSizerPosSettings->Add( m_yUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
|
||||
|
||||
bSizerUserPos->Add( bSizerPosSettings, 1, wxBOTTOM|wxEXPAND|wxRIGHT|wxTOP, 5 );
|
||||
|
@ -138,12 +134,12 @@ DIALOG_IMPORT_GFX_BASE::DIALOG_IMPORT_GFX_BASE( wxWindow* parent, wxWindowID id,
|
|||
|
||||
fgSizerImportSettings->Add( 0, 0, 0, 0, 5 );
|
||||
|
||||
m_staticTextscale = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Import scale:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextscale->Wrap( -1 );
|
||||
fgSizerImportSettings->Add( m_staticTextscale, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
m_importScaleLabel = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Import scale:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_importScaleLabel->Wrap( -1 );
|
||||
fgSizerImportSettings->Add( m_importScaleLabel, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_textCtrlImportScale = new wxTextCtrl( sbSizer1->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizerImportSettings->Add( m_textCtrlImportScale, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
m_importScaleCtrl = new wxTextCtrl( sbSizer1->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizerImportSettings->Add( m_importScaleCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
fgSizerImportSettings->Add( 0, 0, 0, 0, 5 );
|
||||
|
@ -183,18 +179,16 @@ DIALOG_IMPORT_GFX_BASE::DIALOG_IMPORT_GFX_BASE( wxWindow* parent, wxWindowID id,
|
|||
fgDxfImportSettings->SetFlexibleDirection( wxBOTH );
|
||||
fgDxfImportSettings->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_staticTextLineWidth = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("Default line width:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextLineWidth->Wrap( -1 );
|
||||
fgDxfImportSettings->Add( m_staticTextLineWidth, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
m_lineWidthLabel = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("Default line width:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_lineWidthLabel->Wrap( -1 );
|
||||
fgDxfImportSettings->Add( m_lineWidthLabel, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_textCtrlLineWidth = new wxTextCtrl( sbSizer3->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgDxfImportSettings->Add( m_textCtrlLineWidth, 0, wxEXPAND, 5 );
|
||||
m_lineWidthCtrl = new wxTextCtrl( sbSizer3->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgDxfImportSettings->Add( m_lineWidthCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
wxString m_choiceUnitLineWidthChoices[] = { _("mm"), _("mils"), _("inches") };
|
||||
int m_choiceUnitLineWidthNChoices = sizeof( m_choiceUnitLineWidthChoices ) / sizeof( wxString );
|
||||
m_choiceUnitLineWidth = new wxChoice( sbSizer3->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitLineWidthNChoices, m_choiceUnitLineWidthChoices, 0 );
|
||||
m_choiceUnitLineWidth->SetSelection( 0 );
|
||||
fgDxfImportSettings->Add( m_choiceUnitLineWidth, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
m_lineWidthUnits = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_lineWidthUnits->Wrap( -1 );
|
||||
fgDxfImportSettings->Add( m_lineWidthUnits, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
m_staticTextLineWidth1 = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("Default units:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextLineWidth1->Wrap( -1 );
|
||||
|
@ -239,9 +233,7 @@ DIALOG_IMPORT_GFX_BASE::DIALOG_IMPORT_GFX_BASE( wxWindow* parent, wxWindowID id,
|
|||
m_rbInteractivePlacement->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_IMPORT_GFX_BASE::originOptionOnUpdateUI ), NULL, this );
|
||||
m_rbAbsolutePlacement->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onAbsolutePlacement ), NULL, this );
|
||||
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_groupItems->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onGroupItems ), NULL, this );
|
||||
m_choiceUnitLineWidth->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitWidthSelection ), NULL, this );
|
||||
}
|
||||
|
||||
DIALOG_IMPORT_GFX_BASE::~DIALOG_IMPORT_GFX_BASE()
|
||||
|
@ -252,8 +244,6 @@ DIALOG_IMPORT_GFX_BASE::~DIALOG_IMPORT_GFX_BASE()
|
|||
m_rbInteractivePlacement->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_IMPORT_GFX_BASE::originOptionOnUpdateUI ), NULL, this );
|
||||
m_rbAbsolutePlacement->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onAbsolutePlacement ), NULL, this );
|
||||
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_groupItems->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onGroupItems ), NULL, this );
|
||||
m_choiceUnitLineWidth->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitWidthSelection ), NULL, this );
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="15" />
|
||||
<FileVersion major="1" minor="16" />
|
||||
<object class="Project" expanded="1">
|
||||
<property name="class_decoration"></property>
|
||||
<property name="code_generation">C++</property>
|
||||
|
@ -14,6 +14,7 @@
|
|||
<property name="file">dialog_import_gfx_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="image_path_wrapper_function_name"></property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">dialog_dxf_import</property>
|
||||
|
@ -25,6 +26,7 @@
|
|||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_array_enum">0</property>
|
||||
<property name="use_enum">0</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
|
@ -50,6 +52,7 @@
|
|||
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
|
||||
<property name="title">Import Vector Graphics File</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="two_step_creation">0</property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
|
@ -99,7 +102,7 @@
|
|||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">File</property>
|
||||
<property name="label">File:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
|
@ -194,7 +197,7 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="flag">wxTOP|wxBOTTOM|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -205,6 +208,7 @@
|
|||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
|
@ -279,11 +283,11 @@
|
|||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="parent">1</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="0">
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerOptions</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
|
@ -354,11 +358,11 @@
|
|||
<event name="OnUpdateUI">originOptionOnUpdateUI</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="0">
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerUserPos</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
|
@ -429,11 +433,11 @@
|
|||
<event name="OnUpdateUI">originOptionOnUpdateUI</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND|wxRIGHT|wxTOP</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="0">
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerPosSettings</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
|
@ -479,7 +483,7 @@
|
|||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticTextXpos</property>
|
||||
<property name="name">m_xLabel</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
|
@ -539,7 +543,7 @@
|
|||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_DxfPcbXCoord</property>
|
||||
<property name="name">m_xCtrl</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
|
@ -563,6 +567,67 @@
|
|||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxBOTTOM|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" 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="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">mm</property>
|
||||
<property name="markup">0</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_xUnits</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">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT</property>
|
||||
|
@ -604,7 +669,7 @@
|
|||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticTextYpos</property>
|
||||
<property name="name">m_yLabel</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
|
@ -664,7 +729,7 @@
|
|||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_DxfPcbYCoord</property>
|
||||
<property name="name">m_yCtrl</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
|
@ -690,7 +755,7 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -720,7 +785,7 @@
|
|||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Units</property>
|
||||
<property name="label">mm</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
|
@ -729,7 +794,7 @@
|
|||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticTextUnits</property>
|
||||
<property name="name">m_yUnits</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
|
@ -749,71 +814,6 @@
|
|||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxChoice" expanded="0">
|
||||
<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="choices">"mm" "inch"</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="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_DxfPcbPositionUnits</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="selection">0</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">Select PCB grid units</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="OnChoice">onUnitPositionSelection</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
@ -1036,7 +1036,7 @@
|
|||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticTextscale</property>
|
||||
<property name="name">m_importScaleLabel</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
|
@ -1096,7 +1096,7 @@
|
|||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_textCtrlImportScale</property>
|
||||
<property name="name">m_importScaleCtrl</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
|
@ -1348,7 +1348,7 @@
|
|||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticTextLineWidth</property>
|
||||
<property name="name">m_lineWidthLabel</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
|
@ -1370,7 +1370,7 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxTextCtrl" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -1408,7 +1408,7 @@
|
|||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_textCtrlLineWidth</property>
|
||||
<property name="name">m_lineWidthCtrl</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
|
@ -1434,9 +1434,9 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
|
||||
<property name="flag">wxTOP|wxBOTTOM|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxChoice" expanded="1">
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
|
@ -1450,7 +1450,6 @@
|
|||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="choices">"mm" "mils" "inches"</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
|
@ -1465,6 +1464,8 @@
|
|||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">mm</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
|
@ -1472,7 +1473,7 @@
|
|||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_choiceUnitLineWidth</property>
|
||||
<property name="name">m_lineWidthUnits</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
|
@ -1480,21 +1481,16 @@
|
|||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="selection">0</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></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="OnChoice">onUnitWidthSelection</event>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Oct 26 2018)
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
@ -28,11 +28,11 @@ class PCB_LAYER_BOX_SELECTOR;
|
|||
#include <wx/sizer.h>
|
||||
#include <wx/radiobut.h>
|
||||
#include <wx/valtext.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/statbox.h>
|
||||
#include <wx/bmpcbox.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/dialog.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
@ -51,40 +51,39 @@ class DIALOG_IMPORT_GFX_BASE : public DIALOG_SHIM
|
|||
wxBitmapButton* m_browseButton;
|
||||
wxRadioButton* m_rbInteractivePlacement;
|
||||
wxRadioButton* m_rbAbsolutePlacement;
|
||||
wxStaticText* m_staticTextXpos;
|
||||
wxTextCtrl* m_DxfPcbXCoord;
|
||||
wxStaticText* m_staticTextYpos;
|
||||
wxTextCtrl* m_DxfPcbYCoord;
|
||||
wxStaticText* m_staticTextUnits;
|
||||
wxChoice* m_DxfPcbPositionUnits;
|
||||
wxStaticText* m_xLabel;
|
||||
wxTextCtrl* m_xCtrl;
|
||||
wxStaticText* m_xUnits;
|
||||
wxStaticText* m_yLabel;
|
||||
wxTextCtrl* m_yCtrl;
|
||||
wxStaticText* m_yUnits;
|
||||
wxStaticText* m_staticTextBrdlayer;
|
||||
PCB_LAYER_BOX_SELECTOR* m_SelLayerBox;
|
||||
wxStaticText* m_staticTextscale;
|
||||
wxTextCtrl* m_textCtrlImportScale;
|
||||
wxStaticText* m_importScaleLabel;
|
||||
wxTextCtrl* m_importScaleCtrl;
|
||||
wxStaticLine* m_staticline1;
|
||||
wxCheckBox* m_groupItems;
|
||||
wxStaticText* m_staticTextLineWidth;
|
||||
wxTextCtrl* m_textCtrlLineWidth;
|
||||
wxChoice* m_choiceUnitLineWidth;
|
||||
wxStaticText* m_lineWidthLabel;
|
||||
wxTextCtrl* m_lineWidthCtrl;
|
||||
wxStaticText* m_lineWidthUnits;
|
||||
wxStaticText* m_staticTextLineWidth1;
|
||||
wxChoice* m_choiceDxfUnits;
|
||||
wxStdDialogButtonSizer* m_sdbSizer;
|
||||
wxButton* m_sdbSizerOK;
|
||||
wxButton* m_sdbSizerCancel;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
// Virtual event handlers, override them in your derived class
|
||||
virtual void onBrowseFiles( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onInteractivePlacement( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void originOptionOnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
virtual void onAbsolutePlacement( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onUnitPositionSelection( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onGroupItems( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onUnitWidthSelection( 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( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
|
||||
~DIALOG_IMPORT_GFX_BASE();
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue