From 7159f6e48a3e4ddecb53f92dc0aa7fca9ec18d18 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 10 Jul 2019 23:15:57 +0100 Subject: [PATCH] MRU for page size and orientation, and clearer info that this is all preview data only. Fixes: lp:1662239 * https://bugs.launchpad.net/kicad/+bug/1662239 --- common/dialogs/dialog_page_settings.cpp | 13 + common/dialogs/dialog_page_settings_base.cpp | 8 +- common/dialogs/dialog_page_settings_base.fbp | 4840 ++++++++--------- common/dialogs/dialog_page_settings_base.h | 2 +- common/tool/actions.cpp | 2 +- pagelayout_editor/pl_editor_frame.cpp | 30 +- pagelayout_editor/toolbars_pl_editor.cpp | 14 +- pagelayout_editor/tools/pl_actions.cpp | 5 + pagelayout_editor/tools/pl_actions.h | 1 + pagelayout_editor/tools/pl_editor_control.cpp | 4 +- 10 files changed, 2480 insertions(+), 2439 deletions(-) diff --git a/common/dialogs/dialog_page_settings.cpp b/common/dialogs/dialog_page_settings.cpp index d19c5dddad..2108a77210 100644 --- a/common/dialogs/dialog_page_settings.cpp +++ b/common/dialogs/dialog_page_settings.cpp @@ -96,6 +96,19 @@ DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS( EDA_DRAW_FRAME* parent, wxSize aMa m_PickDate->SetValue( wxDateTime::Now() ); + if( parent->GetName() == PL_EDITOR_FRAME_NAME ) + { + SetTitle( _( "Preview Settings" ) ); + m_staticTextPaper->SetLabel( _( "Preview Paper" ) ); + m_staticTextTitleBlock->SetLabel( _( "Preview Title Block Data" ) ); + } + else + { + SetTitle( _( "Page Settings" ) ); + m_staticTextPaper->SetLabel( _( "Paper" ) ); + m_staticTextTitleBlock->SetLabel( _( "Title Block" ) ); + } + initDialog(); GetSizer()->SetSizeHints( this ); diff --git a/common/dialogs/dialog_page_settings_base.cpp b/common/dialogs/dialog_page_settings_base.cpp index 29e3ff0151..6751eadfbb 100644 --- a/common/dialogs/dialog_page_settings_base.cpp +++ b/common/dialogs/dialog_page_settings_base.cpp @@ -107,7 +107,7 @@ DIALOG_PAGES_SETTINGS_BASE::DIALOG_PAGES_SETTINGS_BASE( wxWindow* parent, wxWind m_staticTextPreview->Wrap( -1 ); bleftSizer->Add( m_staticTextPreview, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 10 ); - m_PageLayoutExampleBitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxFULL_REPAINT_ON_RESIZE|wxSIMPLE_BORDER ); + m_PageLayoutExampleBitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxFULL_REPAINT_ON_RESIZE|wxBORDER_SIMPLE ); m_PageLayoutExampleBitmap->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); m_PageLayoutExampleBitmap->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); @@ -119,9 +119,9 @@ DIALOG_PAGES_SETTINGS_BASE::DIALOG_PAGES_SETTINGS_BASE( wxWindow* parent, wxWind wxBoxSizer* bSizerRight; bSizerRight = new wxBoxSizer( wxVERTICAL ); - m_staticTexttbprm = new wxStaticText( this, wxID_ANY, _("Title Block Parameters"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTexttbprm->Wrap( -1 ); - bSizerRight->Add( m_staticTexttbprm, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + m_staticTextTitleBlock = new wxStaticText( this, wxID_ANY, _("Title Block Parameters"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextTitleBlock->Wrap( -1 ); + bSizerRight->Add( m_staticTextTitleBlock, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bSizerRight->Add( m_staticline3, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); diff --git a/common/dialogs/dialog_page_settings_base.fbp b/common/dialogs/dialog_page_settings_base.fbp index d819581118..3a170fd258 100644 --- a/common/dialogs/dialog_page_settings_base.fbp +++ b/common/dialogs/dialog_page_settings_base.fbp @@ -1,8 +1,8 @@ - + - + C++ 1 source_name @@ -16,9 +16,9 @@ none 1 dialog_page_settings_base - + . - + 1 1 1 @@ -29,65 +29,65 @@ 0 wxAUI_MGR_DEFAULT - - - + + + 1 1 impl_virtual - - - + + + 0 wxID_ANY - - + + DIALOG_PAGES_SETTINGS_BASE - + -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Page Settings - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -1,-1 bMainSizer @@ -98,7 +98,7 @@ wxEXPAND|wxRIGHT|wxLEFT 1 - + bUpperSizerH wxHORIZONTAL none @@ -107,7 +107,7 @@ wxEXPAND|wxRIGHT|wxLEFT 0 - + bleftSizer wxVERTICAL none @@ -120,78 +120,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Paper - + 0 - - + + 0 - + 1 m_staticTextPaper 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -203,76 +203,76 @@ 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 - + 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -284,78 +284,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Size: - + 0 - - + + 0 - + 1 m_staticTextSize 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -367,83 +367,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 "dummy text" 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - + + 0 - + 1 m_paperSizeComboBox 1 - - + + protected 1 - + Resizable 0 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - + + + + + OnPaperSizeChoice - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -455,78 +455,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Orientation: - + 0 - - + + 0 - + 1 m_staticTextOrient 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -538,83 +538,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 "Landscape" "Portrait" 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - + + 0 - + 1 m_orientationComboBox 1 - - + + protected 1 - + Resizable 0 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - + + + + + OnPageOrientationChoice - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -626,78 +626,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Custom paper size: - + 0 - - + + 0 - + 1 m_staticTextCustSize 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -707,10 +707,10 @@ 3 wxBOTH - - + + 0 - + fgSizer1 wxFLEX_GROWMODE_SPECIFIED none @@ -725,78 +725,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Height: - + 0 - - + + 0 - + 1 m_userSizeYLabel 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -808,86 +808,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + -1 - + 0 - + 1 m_userSizeYCtrl 1 - - + + protected 1 - + Resizable 1 - + wxTE_LEFT - + 0 Custom paper height. - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + OnUserPageSizeYTextUpdated - - - - + + + + @@ -899,78 +899,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY unit - + 0 - - + + 0 - + 1 m_userSizeYUnits 1 - - + + protected 1 - + Resizable 1 - - + + ; forward_declare 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -982,78 +982,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Width: - + 0 - - + + 0 - + 1 m_userSizeXLabel 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1065,86 +1065,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + -1 - + 0 - + 1 m_userSizeXCtrl 1 - - + + protected 1 - + Resizable 1 - + wxTE_LEFT - + 0 Custom paper width. - + wxFILTER_NONE wxTextValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + OnUserPageSizeXTextUpdated - - - - + + + + @@ -1156,78 +1156,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY unit - + 0 - - + + 0 - + 1 m_userSizeXUnits 1 - - + + protected 1 - + Resizable 1 - - + + ; forward_declare 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1241,78 +1241,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Layout Preview - + 0 - - + + 0 - + 1 m_staticTextPreview 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1324,18 +1324,18 @@ 1 1 1 - - - - - + + + + + wxSYS_COLOUR_WINDOW Load From Icon Resource; - + 1 0 1 - + 1 0 Dock @@ -1344,56 +1344,56 @@ 1 wxSYS_COLOUR_WINDOW 1 - + 0 0 wxID_ANY - + 0 - - + + 0 -1,-1 1 m_PageLayoutExampleBitmap 1 - - + + protected 1 - + Resizable 1 -1,-1 - + 0 - - - + + + wxFULL_REPAINT_ON_RESIZE|wxBORDER_SIMPLE - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1403,7 +1403,7 @@ wxEXPAND|wxRIGHT|wxLEFT 1 - + bSizerRight wxVERTICAL none @@ -1416,78 +1416,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Title Block Parameters - + 0 - - + + 0 - + 1 - m_staticTexttbprm + m_staticTextTitleBlock 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1499,76 +1499,76 @@ 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 - + 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1576,7 +1576,7 @@ wxLEFT 0 - + SheetInfoSizer wxHORIZONTAL none @@ -1589,78 +1589,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Number of sheets: %d - + 0 - - + + 0 - + 1 m_TextSheetCount 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1682,78 +1682,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Sheet number: %d - + 0 - - + + 0 - + 1 m_TextSheetNumber 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1763,7 +1763,7 @@ wxEXPAND|wxRIGHT|wxLEFT 0 - + bSizerDate wxVERTICAL none @@ -1776,78 +1776,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Issue Date - + 0 - - + + 0 - + 1 m_staticTextDate 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1855,7 +1855,7 @@ wxEXPAND 1 - + bSizerissuedate wxHORIZONTAL none @@ -1868,86 +1868,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 100,-1 1 m_TextDate 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + OnDateTextUpdated - - - - + + + + @@ -1959,17 +1959,17 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -1977,65 +1977,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_ANY <<< - + 0 - - + + 0 - + 1 m_ApplyDate 1 - - + + protected 1 - + Resizable 1 - + wxBU_EXACTFIT - + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnDateApplyClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -2047,81 +2047,81 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - + + 0 - + 1 m_PickDate 1 - - + + protected 1 - + Resizable 1 - + wxDP_DEFAULT - + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2133,83 +2133,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Export to other sheets - + 0 - - + + 0 - + 1 m_DateExport 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2221,7 +2221,7 @@ wxEXPAND|wxRIGHT|wxLEFT 0 - + bSizerRev wxVERTICAL none @@ -2234,78 +2234,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Revision - + 0 - - + + 0 - + 1 m_staticTextRev 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -2313,7 +2313,7 @@ wxEXPAND 1 - + bSizer9 wxHORIZONTAL none @@ -2326,86 +2326,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 100,-1 1 m_TextRevision 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + OnRevisionTextUpdated - - - - + + + + @@ -2417,83 +2417,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Export to other sheets - + 0 - - + + 0 - + 1 m_RevisionExport 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2505,7 +2505,7 @@ wxEXPAND|wxRIGHT|wxLEFT 0 - + bSizerTitle wxVERTICAL none @@ -2518,78 +2518,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Title - + 0 - - + + 0 - + 1 m_staticTextTitle 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -2597,7 +2597,7 @@ wxEXPAND 1 - + bSizer12 wxHORIZONTAL none @@ -2610,86 +2610,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 360,-1 1 m_TextTitle 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + OnTitleTextUpdated - - - - + + + + @@ -2701,83 +2701,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Export to other sheets - + 0 - - + + 0 - + 1 m_TitleExport 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - + + + + + OnCheckboxTitleClick - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -2789,7 +2789,7 @@ wxEXPAND|wxRIGHT|wxLEFT 0 - + bSizerCompany wxVERTICAL none @@ -2802,78 +2802,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Company - + 0 - - + + 0 - + 1 m_staticText13 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -2881,7 +2881,7 @@ wxEXPAND 1 - + bSizer14 wxHORIZONTAL none @@ -2894,86 +2894,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 360,-1 1 m_TextCompany 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + OnCompanyTextUpdated - - - - + + + + @@ -2985,83 +2985,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Export to other sheets - + 0 - - + + 0 - + 1 m_CompanyExport 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3073,7 +3073,7 @@ wxEXPAND|wxRIGHT|wxLEFT 0 - + bSizerComment1 wxVERTICAL none @@ -3086,78 +3086,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Comment1 - + 0 - - + + 0 - + 1 m_staticTextComment1 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -3165,7 +3165,7 @@ wxEXPAND 1 - + bSizercmt1 wxHORIZONTAL none @@ -3178,86 +3178,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 360,-1 1 m_TextComment1 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + OnComment1TextUpdated - - - - + + + + @@ -3269,83 +3269,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Export to other sheets - + 0 - - + + 0 - + 1 m_Comment1Export 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3357,7 +3357,7 @@ wxEXPAND|wxRIGHT|wxLEFT 0 - + bSizerComment2 wxVERTICAL none @@ -3370,78 +3370,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Comment2 - + 0 - - + + 0 - + 1 m_staticTextComment2 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -3449,7 +3449,7 @@ wxEXPAND 1 - + bSizercmt2 wxHORIZONTAL none @@ -3462,86 +3462,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 360,-1 1 m_TextComment2 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + OnComment2TextUpdated - - - - + + + + @@ -3553,83 +3553,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Export to other sheets - + 0 - - + + 0 - + 1 m_Comment2Export 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3641,7 +3641,7 @@ wxEXPAND|wxRIGHT|wxLEFT 0 - + bSizerComment12 wxVERTICAL none @@ -3654,78 +3654,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Comment3 - + 0 - - + + 0 - + 1 m_staticTextComment3 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -3733,7 +3733,7 @@ wxEXPAND 1 - + bSizercmt3 wxHORIZONTAL none @@ -3746,86 +3746,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 360,-1 1 m_TextComment3 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + OnComment3TextUpdated - - - - + + + + @@ -3837,83 +3837,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Export to other sheets - + 0 - - + + 0 - + 1 m_Comment3Export 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3925,7 +3925,7 @@ wxEXPAND|wxRIGHT|wxLEFT 0 - + bSizerComment4 wxVERTICAL none @@ -3938,78 +3938,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Comment4 - + 0 - - + + 0 - + 1 m_staticTextComment4 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -4017,7 +4017,7 @@ wxEXPAND 1 - + bSizercmt4 wxHORIZONTAL none @@ -4030,86 +4030,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 360,-1 1 m_TextComment4 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + OnComment4TextUpdated - - - - + + + + @@ -4121,83 +4121,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Export to other sheets - + 0 - - + + 0 - + 1 m_Comment4Export 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4209,7 +4209,7 @@ wxEXPAND|wxRIGHT|wxLEFT 0 - + bSizerFilename wxVERTICAL none @@ -4222,78 +4222,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Page layout description file - + 0 - - + + 0 - + 1 m_staticTextfilename 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -4301,7 +4301,7 @@ wxEXPAND 1 - + bSizerfileSelection wxHORIZONTAL none @@ -4314,86 +4314,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - - + + + 0 - + 1 m_textCtrlFilePicker 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4405,17 +4405,17 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -4423,65 +4423,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_ANY Browse... - + 0 - - + + 0 - + 1 m_buttonBrowse 1 - - + + protected 1 - + Resizable 1 - + wxBU_EXACTFIT - + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnWksFileSelection - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -4505,17 +4505,17 @@ 1 0 0 - + m_sdbSizer protected - - - - - + + + + + OnOkClick - - + + diff --git a/common/dialogs/dialog_page_settings_base.h b/common/dialogs/dialog_page_settings_base.h index 56be4e8036..fc450b6a53 100644 --- a/common/dialogs/dialog_page_settings_base.h +++ b/common/dialogs/dialog_page_settings_base.h @@ -59,7 +59,7 @@ class DIALOG_PAGES_SETTINGS_BASE : public DIALOG_SHIM wxStaticText* m_userSizeXUnits; wxStaticText* m_staticTextPreview; wxStaticBitmap* m_PageLayoutExampleBitmap; - wxStaticText* m_staticTexttbprm; + wxStaticText* m_staticTextTitleBlock; wxStaticLine* m_staticline3; wxStaticText* m_TextSheetCount; wxStaticText* m_TextSheetNumber; diff --git a/common/tool/actions.cpp b/common/tool/actions.cpp index bd259fb2f0..c9fc1eade7 100644 --- a/common/tool/actions.cpp +++ b/common/tool/actions.cpp @@ -91,7 +91,7 @@ TOOL_ACTION ACTIONS::revert( "common.Control.revert", TOOL_ACTION ACTIONS::pageSettings( "common.Control.pageSettings", AS_GLOBAL, 0, "", - _( "Page Settings..." ), _( "Settings for paper size and frame references" ), + _( "Page Settings..." ), _( "Settings for paper size and title block info" ), sheetset_xpm ); TOOL_ACTION ACTIONS::print( "common.Control.print", diff --git a/pagelayout_editor/pl_editor_frame.cpp b/pagelayout_editor/pl_editor_frame.cpp index e43e660642..68c5267fe0 100644 --- a/pagelayout_editor/pl_editor_frame.cpp +++ b/pagelayout_editor/pl_editor_frame.cpp @@ -376,17 +376,35 @@ double PL_EDITOR_FRAME::BestZoom() static const wxChar propertiesFrameWidthKey[] = wxT( "PropertiesFrameWidth" ); static const wxChar cornerOriginChoiceKey[] = wxT( "CornerOriginChoice" ); static const wxChar blackBgColorKey[] = wxT( "BlackBgColor" ); +static const wxChar lastUsedPaperSizeKey[] = wxT( "LastUsedPaperSize" ); +static const wxChar lastUsedCustomWidthKey[] = wxT( "LastUsedCustomWidth" ); +static const wxChar lastUsedCustomHeightKey[] = wxT( "LastUsedCustomHeight" ); +static const wxChar lastUsedPortraitKey[] = wxT( "LastUsedWasPortrait" ); void PL_EDITOR_FRAME::LoadSettings( wxConfigBase* aCfg ) { EDA_DRAW_FRAME::LoadSettings( aCfg ); - aCfg->Read( propertiesFrameWidthKey, &m_propertiesFrameWidth, 150); + aCfg->Read( propertiesFrameWidthKey, &m_propertiesFrameWidth, 150 ); aCfg->Read( cornerOriginChoiceKey, &m_originSelectChoice ); - bool tmp; - aCfg->Read( blackBgColorKey, &tmp, false ); - SetDrawBgColor( tmp ? BLACK : WHITE ); + + bool flag; + aCfg->Read( blackBgColorKey, &flag, false ); + SetDrawBgColor( flag ? BLACK : WHITE ); + + int i; + aCfg->Read( lastUsedCustomWidthKey, &i, 17000 ); + PAGE_INFO::SetCustomWidthMils( i ); + aCfg->Read( lastUsedCustomHeightKey, &i, 11000 ); + PAGE_INFO::SetCustomHeightMils( i ); + + PAGE_INFO pageInfo = GetPageSettings(); + wxString msg; + aCfg->Read( lastUsedPaperSizeKey, &msg, "A3" ); + aCfg->Read( lastUsedPortraitKey, &flag, false ); + pageInfo.SetType( msg, flag ); + SetPageSettings( pageInfo ); } @@ -399,6 +417,10 @@ void PL_EDITOR_FRAME::SaveSettings( wxConfigBase* aCfg ) aCfg->Write( propertiesFrameWidthKey, m_propertiesFrameWidth); aCfg->Write( cornerOriginChoiceKey, m_originSelectChoice ); aCfg->Write( blackBgColorKey, GetDrawBgColor() == BLACK ); + aCfg->Write( lastUsedPaperSizeKey, GetPageSettings().GetType() ); + aCfg->Write( lastUsedPortraitKey, GetPageSettings().IsPortrait() ); + aCfg->Write( lastUsedCustomWidthKey, PAGE_INFO::GetCustomWidthMils() ); + aCfg->Write( lastUsedCustomHeightKey, PAGE_INFO::GetCustomHeightMils() ); // was: wxGetApp().SaveCurrentSetupValues( GetConfigurationSettings() ); wxConfigSaveSetups( aCfg, GetConfigurationSettings() ); diff --git a/pagelayout_editor/toolbars_pl_editor.cpp b/pagelayout_editor/toolbars_pl_editor.cpp index a3d2d50f58..ab4cd6d9a3 100644 --- a/pagelayout_editor/toolbars_pl_editor.cpp +++ b/pagelayout_editor/toolbars_pl_editor.cpp @@ -43,7 +43,6 @@ void PL_EDITOR_FRAME::ReCreateHToolbar() m_mainToolBar->Add( ACTIONS::save ); KiScaledSeparator( m_mainToolBar, this ); - m_mainToolBar->Add( ACTIONS::pageSettings ); m_mainToolBar->Add( ACTIONS::print ); KiScaledSeparator( m_mainToolBar, this ); @@ -59,18 +58,19 @@ void PL_EDITOR_FRAME::ReCreateHToolbar() KiScaledSeparator( m_mainToolBar, this ); m_mainToolBar->Add( PL_ACTIONS::showInspector ); + m_mainToolBar->Add( PL_ACTIONS::previewSettings ); // Display mode switch KiScaledSeparator( m_mainToolBar, this ); m_mainToolBar->AddTool( ID_SHOW_REAL_MODE, wxEmptyString, KiScaledBitmap( pagelayout_normal_view_mode_xpm, this ), - _( "Show title block like it will be displayed in applications\n" - "texts with format are replaced by the full text"), + _( "Show title block in preview mode:\n" + "text placeholders will be replaced with preview data"), wxITEM_CHECK ); - m_mainToolBar->AddTool( ID_SHOW_PL_EDITOR_MODE, - wxEmptyString, KiScaledBitmap( pagelayout_special_view_mode_xpm, this ), - _( "Show title block in edit mode: texts are shown as is:\n" - "texts with format are displayed with no change"), + m_mainToolBar->AddTool( ID_SHOW_PL_EDITOR_MODE, wxEmptyString, + KiScaledBitmap( pagelayout_special_view_mode_xpm, this ), + _( "Show title block in edit mode:\n" + "text placeholders show as %-tokens"), wxITEM_CHECK ); KiScaledSeparator( m_mainToolBar, this ); diff --git a/pagelayout_editor/tools/pl_actions.cpp b/pagelayout_editor/tools/pl_actions.cpp index feee20d266..b69affd57c 100644 --- a/pagelayout_editor/tools/pl_actions.cpp +++ b/pagelayout_editor/tools/pl_actions.cpp @@ -90,6 +90,11 @@ TOOL_ACTION PL_ACTIONS::showInspector( "plEditor.EditorControl.ShowInspector", _( "Show Design Inspector" ), _( "Show the list of items in page layout" ), spreadsheet_xpm ); +TOOL_ACTION PL_ACTIONS::previewSettings( "plEditor.EditorControl.PreviewSettings", + AS_GLOBAL, 0, "", + _( "Page Preview Settings..." ), _( "Edit preview data for page size and title block" ), + sheetset_xpm ); + // PL_PICKER_TOOL // diff --git a/pagelayout_editor/tools/pl_actions.h b/pagelayout_editor/tools/pl_actions.h index b5429143c5..2dd3463974 100644 --- a/pagelayout_editor/tools/pl_actions.h +++ b/pagelayout_editor/tools/pl_actions.h @@ -74,6 +74,7 @@ public: static TOOL_ACTION refreshPreview; static TOOL_ACTION toggleBackground; static TOOL_ACTION showInspector; + static TOOL_ACTION previewSettings; ///> @copydoc COMMON_ACTIONS::TranslateLegacyId() virtual OPT TranslateLegacyId( int aId ) override { return OPT(); } diff --git a/pagelayout_editor/tools/pl_editor_control.cpp b/pagelayout_editor/tools/pl_editor_control.cpp index ee3e1cac9d..6ad14e54b0 100644 --- a/pagelayout_editor/tools/pl_editor_control.cpp +++ b/pagelayout_editor/tools/pl_editor_control.cpp @@ -183,13 +183,13 @@ void PL_EDITOR_CONTROL::setTransitions() Go( &PL_EDITOR_CONTROL::Open, ACTIONS::open.MakeEvent() ); Go( &PL_EDITOR_CONTROL::Save, ACTIONS::save.MakeEvent() ); Go( &PL_EDITOR_CONTROL::SaveAs, ACTIONS::saveAs.MakeEvent() ); - Go( &PL_EDITOR_CONTROL::PageSetup, ACTIONS::pageSettings.MakeEvent() ); Go( &PL_EDITOR_CONTROL::Print, ACTIONS::print.MakeEvent() ); Go( &PL_EDITOR_CONTROL::Plot, ACTIONS::plot.MakeEvent() ); Go( &PL_EDITOR_CONTROL::Quit, ACTIONS::quit.MakeEvent() ); + Go( &PL_EDITOR_CONTROL::PageSetup, PL_ACTIONS::previewSettings.MakeEvent() ); Go( &PL_EDITOR_CONTROL::ToggleBackgroundColor, PL_ACTIONS::toggleBackground.MakeEvent() ); - Go( &PL_EDITOR_CONTROL::ShowInspector, PL_ACTIONS::showInspector.MakeEvent() ); + Go( &PL_EDITOR_CONTROL::ShowInspector, PL_ACTIONS::showInspector.MakeEvent() ); Go( &PL_EDITOR_CONTROL::UpdateMessagePanel, EVENTS::SelectedEvent ); Go( &PL_EDITOR_CONTROL::UpdateMessagePanel, EVENTS::UnselectedEvent );