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
This commit is contained in:
Jeff Young 2019-07-10 23:15:57 +01:00
parent 5c43924338
commit 7159f6e48a
10 changed files with 2480 additions and 2439 deletions

View File

@ -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 );

View File

@ -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 );

File diff suppressed because it is too large Load Diff

View File

@ -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;

View File

@ -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",

View File

@ -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() );

View File

@ -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 );

View File

@ -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
//

View File

@ -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<TOOL_EVENT> TranslateLegacyId( int aId ) override { return OPT<TOOL_EVENT>(); }

View File

@ -183,11 +183,11 @@ 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() );