From b109aba66374b3e7bb419cea4f96a5908885401d Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 26 Aug 2019 00:45:10 +0100 Subject: [PATCH] Add a file browser to the Sheet Properties dialog. Fixes: lp:1840459 * https://bugs.launchpad.net/kicad/+bug/1840459 --- eeschema/dialogs/dialog_netlist_base.fbp | 1036 ++++++++--------- eeschema/dialogs/dialog_sch_sheet_props.cpp | 40 +- eeschema/dialogs/dialog_sch_sheet_props.h | 2 + .../dialogs/dialog_sch_sheet_props_base.cpp | 125 +- .../dialogs/dialog_sch_sheet_props_base.fbp | 492 ++------ .../dialogs/dialog_sch_sheet_props_base.h | 37 +- eeschema/tools/sch_drawing_tools.cpp | 4 +- pcbnew/dialogs/dialog_gendrill.h | 82 +- 8 files changed, 797 insertions(+), 1021 deletions(-) diff --git a/eeschema/dialogs/dialog_netlist_base.fbp b/eeschema/dialogs/dialog_netlist_base.fbp index 2b828c8a95..d454adcf83 100644 --- a/eeschema/dialogs/dialog_netlist_base.fbp +++ b/eeschema/dialogs/dialog_netlist_base.fbp @@ -1,8 +1,8 @@ - + - + C++ 0 source_name @@ -16,9 +16,9 @@ none 1 dialog_netlist_base - + . - + 1 1 1 @@ -29,67 +29,67 @@ 0 wxAUI_MGR_DEFAULT - + wxBOTH - + 1 1 impl_virtual - - - + + + 0 wxID_ANY - - + + NETLIST_DIALOG_BASE - + -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Export Netlist - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + bMainSizer wxVERTICAL none @@ -98,7 +98,7 @@ wxEXPAND 1 - + bUpperSizer wxVERTICAL none @@ -111,79 +111,79 @@ 1 1 1 - - - - - - - - + + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 ID_CHANGE_NOTEBOOK_PAGE - + 0 - - + + 0 540,-1 1 m_NoteBook 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + OnNetlistTypeSelection - - - - - - - - + + + + + + + + @@ -193,7 +193,7 @@ wxEXPAND|wxTOP|wxBOTTOM|wxLEFT 0 - + m_buttonSizer wxHORIZONTAL protected @@ -206,17 +206,17 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -224,65 +224,65 @@ 0 Left 1 - + 1 - + 0 0 ID_ADD_PLUGIN Add Generator... - + 0 - - + + 0 - + 1 m_buttonAddGenerator 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnAddGenerator - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -294,17 +294,17 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -312,65 +312,65 @@ 0 Left 1 - + 1 - + 0 0 ID_DEL_PLUGIN Remove Generator - + 0 - - + + 0 - + 1 m_buttonDelGenerator 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnDelGenerator - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -386,17 +386,17 @@ 1 0 0 - + m_sdbSizer2 protected - - - - - - - - + + + + + + + + @@ -406,67 +406,67 @@ 0 wxAUI_MGR_DEFAULT - + wxBOTH - + 1 1 impl_virtual - - - + + + 0 wxID_ANY - - + + NETLIST_DIALOG_ADD_GENERATOR_BASE - + -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Script Generator Properties - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + bSizerMain wxVERTICAL none @@ -475,7 +475,7 @@ wxEXPAND|wxALL 1 - + bSizerTop wxVERTICAL none @@ -488,78 +488,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Name: - + 0 - - + + 0 - + 1 m_staticTextName 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -571,86 +571,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 - + 1 m_textCtrlName 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -662,78 +662,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Command line to run the generator: - + 0 - - + + 0 - + 1 m_staticTextCmd 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -745,86 +745,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 500,-1 1 m_textCtrlCommand 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -834,7 +834,7 @@ wxEXPAND|wxTOP|wxBOTTOM|wxLEFT 0 - + bSizerBottom wxHORIZONTAL none @@ -847,17 +847,17 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -865,65 +865,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_BROWSE_PLUGINS Browse Generators... - + 0 - - + + 0 - + 1 m_buttonGenerator 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnBrowseGenerators - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -939,17 +939,17 @@ 1 0 0 - + m_sdbSizer protected - + OnCancelClick - - - + + + OnOKClick - - + + diff --git a/eeschema/dialogs/dialog_sch_sheet_props.cpp b/eeschema/dialogs/dialog_sch_sheet_props.cpp index d7df5f36c7..be39acaef5 100644 --- a/eeschema/dialogs/dialog_sch_sheet_props.cpp +++ b/eeschema/dialogs/dialog_sch_sheet_props.cpp @@ -23,18 +23,15 @@ */ #include - +#include #include - #include #include #include - #include - #include #include - +#include DIALOG_SCH_SHEET_PROPS::DIALOG_SCH_SHEET_PROPS( SCH_EDIT_FRAME* parent, SCH_SHEET* aSheet ) : DIALOG_SCH_SHEET_PROPS_BASE( parent ), @@ -46,8 +43,9 @@ DIALOG_SCH_SHEET_PROPS::DIALOG_SCH_SHEET_PROPS( SCH_EDIT_FRAME* parent, SCH_SHEE m_textFileName->SetFocus(); m_sdbSizer1OK->SetDefault(); - // Normally, the file and sheet name are the "main" edited fields - // so put them first + m_browseButton->SetBitmap( KiBitmap( folder_xpm ) ); + + // Normally, the file and sheet name are the "main" edited fields so put them first KIUI::SetControlsTabOrder( { m_textFileName, m_textSheetName, @@ -60,11 +58,10 @@ DIALOG_SCH_SHEET_PROPS::DIALOG_SCH_SHEET_PROPS( SCH_EDIT_FRAME* parent, SCH_SHEE // Now all widgets have the size fixed, call FinishDialogSettings FinishDialogSettings(); - /* This ugly hack fixes a bug in wxWidgets 2.8.7 and likely earlier - * versions for the flex grid sizer in wxGTK that prevents the last - * column from being sized correctly. It doesn't cause any problems - * on win32 so it doesn't need to wrapped in ugly #ifdef __WXGTK__ - * #endif. + /* + * This ugly hack fixes a bug in wxWidgets 2.8.7 and likely earlier versions for the flex + * grid sizer in wxGTK that prevents the last column from being sized correctly. It doesn't + * appear to cause any problems on other platforms so we don't use conditional compilation. * Still present in wxWidgets 3.0.2 */ Layout(); @@ -122,6 +119,25 @@ bool DIALOG_SCH_SHEET_PROPS::TransferDataFromWindow() } +void DIALOG_SCH_SHEET_PROPS::OnBrowseClicked( wxCommandEvent& event ) +{ + // Build the absolute path of current sheet to preselect it when opening the dialog. + wxString path = Prj().AbsolutePath( m_textFileName->GetValue() ); + wxFileName fn( path ); + + wxFileDialog fileDialog( this, _( "Sheet File" ), fn.GetPath(), fn.GetFullName(), + SchematicFileExtension, wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + + if( fileDialog.ShowModal() == wxID_OK ) + { + fn.Assign( fileDialog.GetPath() ); + fn.MakeRelativeTo( Prj().GetProjectPath() ); + + m_textFileName->ChangeValue( fn.GetFullPath() ); + } +} + + const wxString DIALOG_SCH_SHEET_PROPS::GetFileName() { // Filenames are stored using unix notation diff --git a/eeschema/dialogs/dialog_sch_sheet_props.h b/eeschema/dialogs/dialog_sch_sheet_props.h index 87c65a29e1..6feaaf317d 100644 --- a/eeschema/dialogs/dialog_sch_sheet_props.h +++ b/eeschema/dialogs/dialog_sch_sheet_props.h @@ -48,6 +48,8 @@ public: bool TransferDataToWindow() override; bool TransferDataFromWindow() override; + void OnBrowseClicked( wxCommandEvent& event ) override; + const wxString GetFileName(); wxString GetSheetName() { return m_textSheetName->GetValue(); } int GetFileNameTextSize() { return m_filenameTextSize.GetValue(); } diff --git a/eeschema/dialogs/dialog_sch_sheet_props_base.cpp b/eeschema/dialogs/dialog_sch_sheet_props_base.cpp index f400fb465f..d407a6ba49 100644 --- a/eeschema/dialogs/dialog_sch_sheet_props_base.cpp +++ b/eeschema/dialogs/dialog_sch_sheet_props_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -9,114 +9,129 @@ /////////////////////////////////////////////////////////////////////////// +BEGIN_EVENT_TABLE( DIALOG_SCH_SHEET_PROPS_BASE, DIALOG_SHIM ) + EVT_BUTTON( ID_BUTTON_BROWSE_SHEET, DIALOG_SCH_SHEET_PROPS_BASE::_wxFB_OnBrowseClicked ) +END_EVENT_TABLE() + DIALOG_SCH_SHEET_PROPS_BASE::DIALOG_SCH_SHEET_PROPS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) { this->SetSizeHints( wxSize( 500,150 ), wxDefaultSize ); - + wxBoxSizer* mainSizer; mainSizer = new wxBoxSizer( wxVERTICAL ); - + wxBoxSizer* bupperSizer; bupperSizer = new wxBoxSizer( wxVERTICAL ); - + wxFlexGridSizer* fgSizer1; - fgSizer1 = new wxFlexGridSizer( 0, 6, 0, 0 ); + fgSizer1 = new wxFlexGridSizer( 0, 7, 0, 0 ); fgSizer1->AddGrowableCol( 1 ); fgSizer1->SetFlexibleDirection( wxBOTH ); fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - + m_filenameLabel = new wxStaticText( this, wxID_ANY, _("&File name:"), wxDefaultPosition, wxDefaultSize, 0 ); m_filenameLabel->Wrap( -1 ); - fgSizer1->Add( m_filenameLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - + fgSizer1->Add( m_filenameLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + m_textFileName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_textFileName->SetMinSize( wxSize( 200,-1 ) ); - - fgSizer1->Add( m_textFileName, 5, wxEXPAND|wxTOP, 5 ); - - + m_textFileName->SetMinSize( wxSize( 240,-1 ) ); + + fgSizer1->Add( m_textFileName, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + m_browseButton = new wxBitmapButton( this, ID_BUTTON_BROWSE_SHEET, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); + m_browseButton->SetMinSize( wxSize( 30,28 ) ); + + fgSizer1->Add( m_browseButton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 2 ); + + fgSizer1->Add( 0, 0, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 10 ); - + m_filenameSizeLabel = new wxStaticText( this, wxID_ANY, _("Text size:"), wxDefaultPosition, wxDefaultSize, 0 ); m_filenameSizeLabel->Wrap( -1 ); - fgSizer1->Add( m_filenameSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - + fgSizer1->Add( m_filenameSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + m_filenameSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_filenameSizeCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP, 5 ); - + fgSizer1->Add( m_filenameSizeCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 ); + m_filenameSizeUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 ); m_filenameSizeUnits->Wrap( -1 ); - fgSizer1->Add( m_filenameSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - + fgSizer1->Add( m_filenameSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + m_sheetnameLabel = new wxStaticText( this, wxID_ANY, _("&Sheet name:"), wxDefaultPosition, wxDefaultSize, 0 ); m_sheetnameLabel->Wrap( -1 ); - fgSizer1->Add( m_sheetnameLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - + fgSizer1->Add( m_sheetnameLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + m_textSheetName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_textSheetName, 5, wxEXPAND|wxTOP, 5 ); - - + fgSizer1->Add( m_textSheetName, 5, wxEXPAND|wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 ); + + fgSizer1->Add( 0, 0, 0, wxALIGN_CENTER_VERTICAL|wxALL, 10 ); - + + + fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); + m_sheetnameSizeLabel = new wxStaticText( this, wxID_ANY, _("Text size:"), wxDefaultPosition, wxDefaultSize, 0 ); m_sheetnameSizeLabel->Wrap( -1 ); - fgSizer1->Add( m_sheetnameSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - + fgSizer1->Add( m_sheetnameSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + m_sheetnameSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_sheetnameSizeCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP, 5 ); - + fgSizer1->Add( m_sheetnameSizeCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 ); + m_sheetnameSizeUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 ); m_sheetnameSizeUnits->Wrap( -1 ); - fgSizer1->Add( m_sheetnameSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - - + fgSizer1->Add( m_sheetnameSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + fgSizer1->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - - + + fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); - - + + fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); - - + + fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); - - + + fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); - - + + fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); - + + + fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); + m_staticTextTimeStamp = new wxStaticText( this, wxID_ANY, _("Unique timestamp:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextTimeStamp->Wrap( -1 ); fgSizer1->Add( m_staticTextTimeStamp, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - + m_textCtrlTimeStamp = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); fgSizer1->Add( m_textCtrlTimeStamp, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - - + + bupperSizer->Add( fgSizer1, 1, wxALL|wxEXPAND, 5 ); - - + + mainSizer->Add( bupperSizer, 0, wxEXPAND|wxTOP, 5 ); - + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); mainSizer->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - + m_sdbSizer1 = new wxStdDialogButtonSizer(); m_sdbSizer1OK = new wxButton( this, wxID_OK ); m_sdbSizer1->AddButton( m_sdbSizer1OK ); m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); m_sdbSizer1->Realize(); - + mainSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 5 ); - - + + this->SetSizer( mainSizer ); this->Layout(); mainSizer->Fit( this ); - + this->Centre( wxBOTH ); } diff --git a/eeschema/dialogs/dialog_sch_sheet_props_base.fbp b/eeschema/dialogs/dialog_sch_sheet_props_base.fbp index f7d195c9a4..dd318761e7 100644 --- a/eeschema/dialogs/dialog_sch_sheet_props_base.fbp +++ b/eeschema/dialogs/dialog_sch_sheet_props_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,6 +14,7 @@ dialog_sch_sheet_props_base 1000 none + 1 dialog_sch_sheet_props @@ -52,42 +53,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - mainSizer @@ -107,7 +72,7 @@ wxALL|wxEXPAND 1 - 6 + 7 wxBOTH 1 @@ -120,7 +85,7 @@ 0 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxALL 0 1 @@ -151,6 +116,7 @@ 0 wxID_ANY &File name: + 0 0 @@ -176,35 +142,12 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxTOP - 5 + wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM + 0 1 1 @@ -239,7 +182,7 @@ 0 0 - 200,-1 + 240,-1 1 m_textFileName 1 @@ -263,33 +206,79 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + 2 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + ID_BUTTON_BROWSE_SHEET + Browse... + + 0 + + 0 + + + 0 + 30,28 + 1 + m_browseButton + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnBrowseClicked @@ -304,7 +293,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxALL 0 1 @@ -335,6 +324,7 @@ 0 wxID_ANY Text size: + 0 0 @@ -360,34 +350,11 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxTOP + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM 0 1 @@ -447,38 +414,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxALL 0 1 @@ -509,6 +449,7 @@ 0 wxID_ANY units + 0 0 @@ -534,34 +475,11 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxALL 0 1 @@ -592,6 +510,7 @@ 0 wxID_ANY &Sheet name: + 0 0 @@ -617,34 +536,11 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxTOP + wxEXPAND|wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL 5 1 @@ -704,33 +600,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -745,7 +614,17 @@ 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALL 0 1 @@ -776,6 +655,7 @@ 0 wxID_ANY Text size: + 0 0 @@ -801,34 +681,11 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxTOP + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM 0 1 @@ -888,38 +745,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxALL 0 1 @@ -950,6 +780,7 @@ 0 wxID_ANY units + 0 0 @@ -975,29 +806,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -1060,6 +868,16 @@ 0 + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + 5 wxALL|wxALIGN_CENTER_VERTICAL @@ -1093,6 +911,7 @@ 0 wxID_ANY Unique timestamp: + 0 0 @@ -1118,29 +937,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -1205,33 +1001,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1294,29 +1063,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -1335,14 +1081,6 @@ m_sdbSizer1 protected - - - - - - - - diff --git a/eeschema/dialogs/dialog_sch_sheet_props_base.h b/eeschema/dialogs/dialog_sch_sheet_props_base.h index ddff1bcafb..d04172811c 100644 --- a/eeschema/dialogs/dialog_sch_sheet_props_base.h +++ b/eeschema/dialogs/dialog_sch_sheet_props_base.h @@ -1,12 +1,11 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __DIALOG_SCH_SHEET_PROPS_BASE_H__ -#define __DIALOG_SCH_SHEET_PROPS_BASE_H__ +#pragma once #include #include @@ -19,9 +18,13 @@ #include #include #include +#include +#include +#include +#include +#include #include #include -#include #include /////////////////////////////////////////////////////////////////////////// @@ -31,11 +34,22 @@ /////////////////////////////////////////////////////////////////////////////// class DIALOG_SCH_SHEET_PROPS_BASE : public DIALOG_SHIM { + DECLARE_EVENT_TABLE() private: - + + // Private event handlers + void _wxFB_OnBrowseClicked( wxCommandEvent& event ){ OnBrowseClicked( event ); } + + protected: + enum + { + ID_BUTTON_BROWSE_SHEET = 1000 + }; + wxStaticText* m_filenameLabel; wxTextCtrl* m_textFileName; + wxBitmapButton* m_browseButton; wxStaticText* m_filenameSizeLabel; wxTextCtrl* m_filenameSizeCtrl; wxStaticText* m_filenameSizeUnits; @@ -50,12 +64,15 @@ class DIALOG_SCH_SHEET_PROPS_BASE : public DIALOG_SHIM wxStdDialogButtonSizer* m_sdbSizer1; wxButton* m_sdbSizer1OK; wxButton* m_sdbSizer1Cancel; - + + // Virtual event handlers, overide them in your derived class + virtual void OnBrowseClicked( wxCommandEvent& event ) { event.Skip(); } + + public: - - DIALOG_SCH_SHEET_PROPS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Schematic Sheet Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + + DIALOG_SCH_SHEET_PROPS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Schematic Sheet Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_SCH_SHEET_PROPS_BASE(); - + }; -#endif //__DIALOG_SCH_SHEET_PROPS_BASE_H__ diff --git a/eeschema/tools/sch_drawing_tools.cpp b/eeschema/tools/sch_drawing_tools.cpp index 3700a12044..e2945d54a2 100644 --- a/eeschema/tools/sch_drawing_tools.cpp +++ b/eeschema/tools/sch_drawing_tools.cpp @@ -778,6 +778,8 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent ) || evt->IsAction( &EE_ACTIONS::finishSheet ) ) ) { m_view->ClearPreview(); + getViewControls()->SetAutoPan( false ); + getViewControls()->CaptureCursor( false ); if( m_frame->EditSheet( (SCH_SHEET*)sheet, g_CurrentSheet, nullptr ) ) { @@ -812,7 +814,7 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent ) // Enable autopanning and cursor capture only when there is a sheet to be placed getViewControls()->SetAutoPan( sheet != nullptr ); - getViewControls()->CaptureCursor( sheet != nullptr); + getViewControls()->CaptureCursor( sheet != nullptr ); } return 0; diff --git a/pcbnew/dialogs/dialog_gendrill.h b/pcbnew/dialogs/dialog_gendrill.h index 2b45526fac..377d663563 100644 --- a/pcbnew/dialogs/dialog_gendrill.h +++ b/pcbnew/dialogs/dialog_gendrill.h @@ -1,7 +1,3 @@ -/** - *@file dialog_gendrill.h - */ - /* * This program source code file is part of KiCad, a free EDA CAD application. * @@ -46,56 +42,54 @@ public: /** * Update board drill/plot parameters */ - void UpdateDrillParams( void ); - + void UpdateDrillParams(); static int m_UnitDrillIsInch; static int m_ZerosFormat; static bool m_MinimalHeader; static bool m_Mirror; static bool m_Merge_PTH_NPTH; - DRILL_PRECISION m_Precision; /// Selected precision for drill files, in non decimal format - wxPoint m_FileDrillOffset; /// Drill offset: 0,0 for absolute coordinates, - /// or origin of the auxiliary axis - static bool m_UseRouteModeForOvalHoles; /// True to use a G00 route command for oval holes - /// False to use a G85 canned mode for oval holes - + DRILL_PRECISION m_Precision; // Precision for drill files, in non decimal format + wxPoint m_FileDrillOffset; // Drill offset: 0,0 for absolute coordinates, + // or origin of the auxiliary axis + static bool m_UseRouteModeForOvalHoles; // True to use a G00 route command for oval holes + // False to use a G85 canned mode for oval holes private: - PCB_EDIT_FRAME* m_pcbEditFrame; - wxConfigBase* m_config; - BOARD* m_board; - PCB_PLOT_PARAMS m_plotOpts; - bool m_drillOriginIsAuxAxis; // Axis selection (main / auxiliary) - // for drill origin coordinates - int m_platedPadsHoleCount; - int m_notplatedPadsHoleCount; - int m_throughViasCount; - int m_microViasCount; - int m_blindOrBuriedViasCount; + PCB_EDIT_FRAME* m_pcbEditFrame; + wxConfigBase* m_config; + BOARD* m_board; + PCB_PLOT_PARAMS m_plotOpts; + bool m_drillOriginIsAuxAxis; // Axis selection (main / auxiliary) + // for drill origin coordinates + int m_platedPadsHoleCount; + int m_notplatedPadsHoleCount; + int m_throughViasCount; + int m_microViasCount; + int m_blindOrBuriedViasCount; - static int m_mapFileType; // format of map file: HPGL, PS ... - static int m_drillFileType; // for Excellon, Gerber + static int m_mapFileType; // format of map file: HPGL, PS ... + static int m_drillFileType; // for Excellon, Gerber - - void initDialog(); - void InitDisplayParams( void ); + void initDialog(); + void InitDisplayParams(); // event functions - void OnSelDrillUnitsSelected( wxCommandEvent& event ) override; - void OnSelZerosFmtSelected( wxCommandEvent& event ) override; - void OnGenDrillFile( wxCommandEvent& event ) override; - void OnGenMapFile( wxCommandEvent& event ) override; - void onFileFormatSelection( wxCommandEvent& event ) override; + void OnSelDrillUnitsSelected( wxCommandEvent& event ) override; + void OnSelZerosFmtSelected( wxCommandEvent& event ) override; + void OnGenDrillFile( wxCommandEvent& event ) override; + void OnGenMapFile( wxCommandEvent& event ) override; + void onFileFormatSelection( wxCommandEvent& event ) override; // Called when closing the dialog: Update config. - // This is not done in Dtor, because the dtor call is often delayed - // and the update could happen too late for the caller. + // This is not done in Dtor, because the dtor call is often delayed and the update + // could happen too late for the caller. void onCloseDlg( wxCloseEvent& event ) override { UpdateConfig(); event.Skip(); } + void onQuitDlg( wxCommandEvent& event ) override { UpdateConfig(); @@ -107,9 +101,9 @@ private: * for through holes, oblong holes, and for buried vias, * drill values and drill count per layer pair */ - void OnGenReportFile( wxCommandEvent& event ) override; + void OnGenReportFile( wxCommandEvent& event ) override; - void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) override; + void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) override; // Specific functions: /** @@ -122,18 +116,10 @@ private: * through holes, already in the first file. * one file for all Not Plated through holes */ - void GenDrillAndMapFiles( bool aGenDrill, bool aGenMap ); + void GenDrillAndMapFiles( bool aGenDrill, bool aGenMap ); - void UpdatePrecisionOptions(); - void UpdateConfig(); - int Create_Drill_File_EXCELLON( FILE* aFile, wxPoint aOffset ); - int Gen_Liste_Tools( std::vector& buffer, - bool print_header ); - - /** - * Return the selected format for coordinates, if not decimal - */ - DRILL_PRECISION GetPrecison(); + void UpdatePrecisionOptions(); + void UpdateConfig(); }; #endif // DIALOG_GENDRILL_H_