From 83ee2ffdaba8c7aa874a2c87dae531bd824ffb98 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 16 Nov 2023 11:00:25 +0100 Subject: [PATCH] Pcbnew, dialog import graphics: add tool-tips and minor cosmetic enhancements. --- .../dialog_import_graphics_base.cpp | 31 +++++-- .../dialog_import_graphics_base.fbp | 90 ++++++++++++++++--- .../import_gfx/dialog_import_graphics_base.h | 1 + 3 files changed, 100 insertions(+), 22 deletions(-) diff --git a/pcbnew/import_gfx/dialog_import_graphics_base.cpp b/pcbnew/import_gfx/dialog_import_graphics_base.cpp index 93b990e816..f8b03be7df 100644 --- a/pcbnew/import_gfx/dialog_import_graphics_base.cpp +++ b/pcbnew/import_gfx/dialog_import_graphics_base.cpp @@ -58,6 +58,8 @@ DIALOG_IMPORT_GRAPHICS_BASE::DIALOG_IMPORT_GRAPHICS_BASE( wxWindow* parent, wxWi m_lineWidthLabel = new wxStaticText( this, wxID_ANY, _("DXF default line width:"), wxDefaultPosition, wxDefaultSize, 0 ); m_lineWidthLabel->Wrap( -1 ); + m_lineWidthLabel->SetToolTip( _("Used when the DXF items in file have no line thickness set") ); + fgSizer3->Add( m_lineWidthLabel, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_lineWidthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); @@ -69,6 +71,8 @@ DIALOG_IMPORT_GRAPHICS_BASE::DIALOG_IMPORT_GRAPHICS_BASE( wxWindow* parent, wxWi m_dxfUnitsLabel = new wxStaticText( this, wxID_ANY, _("DXF default units:"), wxDefaultPosition, wxDefaultSize, 0 ); m_dxfUnitsLabel->Wrap( -1 ); + m_dxfUnitsLabel->SetToolTip( _("Used when the DXF file has no unit set") ); + fgSizer3->Add( m_dxfUnitsLabel, 0, wxALIGN_CENTER_VERTICAL, 5 ); wxArrayString m_dxfUnitsChoiceChoices; @@ -87,9 +91,15 @@ DIALOG_IMPORT_GRAPHICS_BASE::DIALOG_IMPORT_GRAPHICS_BASE( wxWindow* parent, wxWi gbSizer2->SetFlexibleDirection( wxBOTH ); gbSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_placeAtCheckbox = new wxCheckBox( this, wxID_ANY, _("Place at X:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_placeAtCheckbox = new wxCheckBox( this, wxID_ANY, _("Place at:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_placeAtCheckbox->SetToolTip( _("If not checked: use interactive placement.") ); + gbSizer2->Add( m_placeAtCheckbox, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); + m_xLabel = new wxStaticText( this, wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_xLabel->Wrap( -1 ); + gbSizer2->Add( m_xLabel, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + m_xCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); #ifdef __WXGTK__ if ( !m_xCtrl->HasFlag( wxTE_MULTILINE ) ) @@ -101,11 +111,11 @@ DIALOG_IMPORT_GRAPHICS_BASE::DIALOG_IMPORT_GRAPHICS_BASE( wxWindow* parent, wxWi #endif m_xCtrl->SetToolTip( _("DXF origin on PCB Grid, X Coordinate") ); - gbSizer2->Add( m_xCtrl, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + gbSizer2->Add( m_xCtrl, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); m_yLabel = new wxStaticText( this, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 ); m_yLabel->Wrap( -1 ); - gbSizer2->Add( m_yLabel, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxLEFT|wxALIGN_CENTER_VERTICAL, 18 ); + gbSizer2->Add( m_yLabel, wxGBPosition( 0, 3 ), wxGBSpan( 1, 1 ), wxLEFT|wxALIGN_CENTER_VERTICAL, 18 ); m_yCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); #ifdef __WXGTK__ @@ -118,23 +128,24 @@ DIALOG_IMPORT_GRAPHICS_BASE::DIALOG_IMPORT_GRAPHICS_BASE( wxWindow* parent, wxWi #endif m_yCtrl->SetToolTip( _("DXF origin on PCB Grid, Y Coordinate") ); - gbSizer2->Add( m_yCtrl, wxGBPosition( 0, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + gbSizer2->Add( m_yCtrl, wxGBPosition( 0, 4 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); m_yUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_yUnits->Wrap( -1 ); - gbSizer2->Add( m_yUnits, wxGBPosition( 0, 4 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); + gbSizer2->Add( m_yUnits, wxGBPosition( 0, 5 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); - m_setLayerCheckbox = new wxCheckBox( this, wxID_ANY, _("Set layer:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_setLayerCheckbox = new wxCheckBox( this, wxID_ANY, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_setLayerCheckbox->SetValue(true); m_setLayerCheckbox->SetToolTip( _("If checked, use the selected layer in this dialog\nIf unchecked, use the Board Editor active layer") ); gbSizer2->Add( m_setLayerCheckbox, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); m_SelLayerBox = new PCB_LAYER_BOX_SELECTOR( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - gbSizer2->Add( m_SelLayerBox, wxGBPosition( 1, 1 ), wxGBSpan( 1, 4 ), wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + gbSizer2->Add( m_SelLayerBox, wxGBPosition( 1, 2 ), wxGBSpan( 1, 3 ), wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - gbSizer2->AddGrowableCol( 1 ); - gbSizer2->AddGrowableCol( 3 ); + gbSizer2->AddGrowableCol( 2 ); + gbSizer2->AddGrowableCol( 4 ); bSizerMain->Add( gbSizer2, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 ); @@ -146,6 +157,8 @@ DIALOG_IMPORT_GRAPHICS_BASE::DIALOG_IMPORT_GRAPHICS_BASE( wxWindow* parent, wxWi m_cbGroupItems = new wxCheckBox( this, wxID_ANY, _("Group imported items"), wxDefaultPosition, wxDefaultSize, 0 ); m_cbGroupItems->SetValue(true); + m_cbGroupItems->SetToolTip( _("Add all imported items to a new group") ); + bSizerGroupOpt->Add( m_cbGroupItems, 0, wxALL, 5 ); m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); diff --git a/pcbnew/import_gfx/dialog_import_graphics_base.fbp b/pcbnew/import_gfx/dialog_import_graphics_base.fbp index 3cb4a25b74..ca5b859323 100644 --- a/pcbnew/import_gfx/dialog_import_graphics_base.fbp +++ b/pcbnew/import_gfx/dialog_import_graphics_base.fbp @@ -477,7 +477,7 @@ 0 - + Used when the DXF items in file have no line thickness set @@ -663,7 +663,7 @@ 0 - + Used when the DXF file has no unit set @@ -801,7 +801,7 @@ wxBOTH - 1,3 + 2,4 3 @@ -845,7 +845,7 @@ 0 0 wxID_ANY - Place at X: + Place at: 0 @@ -866,7 +866,7 @@ ; ; forward_declare 0 - + If not checked: use interactive placement. wxFILTER_NONE wxDefaultValidator @@ -880,6 +880,70 @@ 5 1 1 + wxALL + 0 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + X: + 0 + + 0 + + + 0 + + 1 + m_xLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 1 + 2 wxALIGN_CENTER_VERTICAL|wxEXPAND 0 1 @@ -946,7 +1010,7 @@ 18 1 - 2 + 3 wxLEFT|wxALIGN_CENTER_VERTICAL 0 1 @@ -1010,7 +1074,7 @@ 5 1 - 3 + 4 wxALIGN_CENTER_VERTICAL|wxEXPAND 0 1 @@ -1077,7 +1141,7 @@ 5 1 - 4 + 5 wxALIGN_CENTER_VERTICAL 0 1 @@ -1159,7 +1223,7 @@ 1 0 - 0 + 1 1 1 @@ -1174,7 +1238,7 @@ 0 0 wxID_ANY - Set layer: + Layer: 0 @@ -1207,8 +1271,8 @@ 5 - 4 - 1 + 3 + 2 wxEXPAND|wxALIGN_CENTER_VERTICAL 1 1 @@ -1396,7 +1460,7 @@ ; ; forward_declare 0 - + Add all imported items to a new group wxFILTER_NONE wxDefaultValidator diff --git a/pcbnew/import_gfx/dialog_import_graphics_base.h b/pcbnew/import_gfx/dialog_import_graphics_base.h index e73dfe1fd9..c0e809df04 100644 --- a/pcbnew/import_gfx/dialog_import_graphics_base.h +++ b/pcbnew/import_gfx/dialog_import_graphics_base.h @@ -58,6 +58,7 @@ class DIALOG_IMPORT_GRAPHICS_BASE : public DIALOG_SHIM wxChoice* m_dxfUnitsChoice; wxStaticLine* m_staticline2; wxCheckBox* m_placeAtCheckbox; + wxStaticText* m_xLabel; wxTextCtrl* m_xCtrl; wxStaticText* m_yLabel; wxTextCtrl* m_yCtrl;