More worksheet -> drawing sheet cleanup.

Fixes https://gitlab.com/kicad/code/kicad/issues/8516
This commit is contained in:
Jeff Young 2021-05-30 23:56:24 +01:00
parent 0598c82972
commit c4cabb38d5
60 changed files with 234 additions and 242 deletions

View File

@ -736,15 +736,14 @@ void BM2CMP_FRAME::OnExportLogo()
path = ::wxGetCwd();
wxFileDialog fileDlg( this, _( "Create Logo File" ), path, wxEmptyString,
PageLayoutDescrFileWildcard(),
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
DrawingSheetFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
int diag = fileDlg.ShowModal();
if( diag != wxID_OK )
return;
fn = fileDlg.GetPath();
fn.SetExt( PageLayoutDescrFileExtension );
fn.SetExt( DrawingSheetFileExtension );
m_ConvertedFileName = fn.GetFullPath();
FILE* outfile;

View File

@ -123,8 +123,7 @@ private:
void exportPostScriptFormat();
/**
* Generate a file suitable to be copied into a page layout
* description file (.kicad_wks file
* Generate a file suitable to be copied into a drawing sheet (.kicad_wks) file
*/
void OnExportLogo();

View File

@ -155,7 +155,7 @@ BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxS
m_buttonExportClipboard = new wxButton( m_panelRight, wxID_ANY, _("Export to Clipboard"), wxDefaultPosition, wxDefaultSize, 0 );
brightSizer->Add( m_buttonExportClipboard, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxString m_rbOutputFormatChoices[] = { _("Symbol (.lib file)"), _("Footprint (.kicad_mod file)"), _("Postscript (.ps file)"), _("Worksheet (.kicad_wks file)") };
wxString m_rbOutputFormatChoices[] = { _("Symbol (.lib file)"), _("Footprint (.kicad_mod file)"), _("Postscript (.ps file)"), _("Drawing Sheet (.kicad_wks file)") };
int m_rbOutputFormatNChoices = sizeof( m_rbOutputFormatChoices ) / sizeof( wxString );
m_rbOutputFormat = new wxRadioBox( m_panelRight, wxID_ANY, _("Output Format"), wxDefaultPosition, wxDefaultSize, m_rbOutputFormatNChoices, m_rbOutputFormatChoices, 1, wxRA_SPECIFY_COLS );
m_rbOutputFormat->SetSelection( 0 );

View File

@ -1734,7 +1734,7 @@
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;Symbol (.lib file)&quot; &quot;Footprint (.kicad_mod file)&quot; &quot;Postscript (.ps file)&quot; &quot;Worksheet (.kicad_wks file)&quot;</property>
<property name="choices">&quot;Symbol (.lib file)&quot; &quot;Footprint (.kicad_mod file)&quot; &quot;Postscript (.ps file)&quot; &quot;Drawing Sheet (.kicad_wks file)&quot;</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>

View File

@ -29,7 +29,7 @@
#include <trace_helpers.h>
wxString BASE_SCREEN::m_PageLayoutDescrFileName; // the name of the page layout descr file.
wxString BASE_SCREEN::m_DrawingSheetFileName; // the name of the drawing sheet file.
BASE_SCREEN::BASE_SCREEN( EDA_ITEM* aParent, KICAD_T aType ) :

View File

@ -131,8 +131,8 @@ bool DIALOG_PAGES_SETTINGS::TransferDataToWindow()
m_paperSizeComboBox->Append( wxGetTranslation( pageFmt ) );
}
// initialize the page layout descr filename
SetWksFileName( BASE_SCREEN::m_PageLayoutDescrFileName );
// initialize the drawing sheet filename
SetWksFileName( BASE_SCREEN::m_DrawingSheetFileName );
m_pageInfo = m_parent->GetPageSettings();
SetCurrentPageSizeSelection( m_pageInfo.GetType() );
@ -188,7 +188,7 @@ bool DIALOG_PAGES_SETTINGS::TransferDataToWindow()
onTransferDataToWindow();
GetPageLayoutInfoFromDialog();
UpdatePageLayoutExample();
UpdateDrawingSheetExample();
GetSizer()->SetSizeHints( this );
@ -258,7 +258,7 @@ void DIALOG_PAGES_SETTINGS::OnPaperSizeChoice( wxCommandEvent& event )
}
GetPageLayoutInfoFromDialog();
UpdatePageLayoutExample();
UpdateDrawingSheetExample();
}
@ -267,7 +267,7 @@ void DIALOG_PAGES_SETTINGS::OnUserPageSizeXTextUpdated( wxCommandEvent& event )
if( m_initialized )
{
GetPageLayoutInfoFromDialog();
UpdatePageLayoutExample();
UpdateDrawingSheetExample();
}
}
@ -277,7 +277,7 @@ void DIALOG_PAGES_SETTINGS::OnUserPageSizeYTextUpdated( wxCommandEvent& event )
if( m_initialized )
{
GetPageLayoutInfoFromDialog();
UpdatePageLayoutExample();
UpdateDrawingSheetExample();
}
}
@ -287,7 +287,7 @@ void DIALOG_PAGES_SETTINGS::OnPageOrientationChoice( wxCommandEvent& event )
if( m_initialized )
{
GetPageLayoutInfoFromDialog();
UpdatePageLayoutExample();
UpdateDrawingSheetExample();
}
}
@ -298,7 +298,7 @@ void DIALOG_PAGES_SETTINGS::OnRevisionTextUpdated( wxCommandEvent& event )
{
GetPageLayoutInfoFromDialog();
m_tb.SetRevision( m_TextRevision->GetValue() );
UpdatePageLayoutExample();
UpdateDrawingSheetExample();
}
}
@ -309,7 +309,7 @@ void DIALOG_PAGES_SETTINGS::OnDateTextUpdated( wxCommandEvent& event )
{
GetPageLayoutInfoFromDialog();
m_tb.SetDate( m_TextDate->GetValue() );
UpdatePageLayoutExample();
UpdateDrawingSheetExample();
}
}
@ -320,7 +320,7 @@ void DIALOG_PAGES_SETTINGS::OnTitleTextUpdated( wxCommandEvent& event )
{
GetPageLayoutInfoFromDialog();
m_tb.SetTitle( m_TextTitle->GetValue() );
UpdatePageLayoutExample();
UpdateDrawingSheetExample();
}
}
@ -331,7 +331,7 @@ void DIALOG_PAGES_SETTINGS::OnCompanyTextUpdated( wxCommandEvent& event )
{
GetPageLayoutInfoFromDialog();
m_tb.SetCompany( m_TextCompany->GetValue() );
UpdatePageLayoutExample();
UpdateDrawingSheetExample();
}
}
@ -342,7 +342,7 @@ void DIALOG_PAGES_SETTINGS::OnComment1TextUpdated( wxCommandEvent& event )
{
GetPageLayoutInfoFromDialog();
m_tb.SetComment( 0, m_TextComment1->GetValue() );
UpdatePageLayoutExample();
UpdateDrawingSheetExample();
}
}
@ -353,7 +353,7 @@ void DIALOG_PAGES_SETTINGS::OnComment2TextUpdated( wxCommandEvent& event )
{
GetPageLayoutInfoFromDialog();
m_tb.SetComment( 1, m_TextComment2->GetValue() );
UpdatePageLayoutExample();
UpdateDrawingSheetExample();
}
}
@ -364,7 +364,7 @@ void DIALOG_PAGES_SETTINGS::OnComment3TextUpdated( wxCommandEvent& event )
{
GetPageLayoutInfoFromDialog();
m_tb.SetComment( 2, m_TextComment3->GetValue() );
UpdatePageLayoutExample();
UpdateDrawingSheetExample();
}
}
@ -375,7 +375,7 @@ void DIALOG_PAGES_SETTINGS::OnComment4TextUpdated( wxCommandEvent& event )
{
GetPageLayoutInfoFromDialog();
m_tb.SetComment( 3, m_TextComment4->GetValue() );
UpdatePageLayoutExample();
UpdateDrawingSheetExample();
}
}
@ -386,7 +386,7 @@ void DIALOG_PAGES_SETTINGS::OnComment5TextUpdated( wxCommandEvent& event )
{
GetPageLayoutInfoFromDialog();
m_tb.SetComment( 4, m_TextComment5->GetValue() );
UpdatePageLayoutExample();
UpdateDrawingSheetExample();
}
}
@ -397,7 +397,7 @@ void DIALOG_PAGES_SETTINGS::OnComment6TextUpdated( wxCommandEvent& event )
{
GetPageLayoutInfoFromDialog();
m_tb.SetComment( 5, m_TextComment6->GetValue() );
UpdatePageLayoutExample();
UpdateDrawingSheetExample();
}
}
@ -408,7 +408,7 @@ void DIALOG_PAGES_SETTINGS::OnComment7TextUpdated( wxCommandEvent& event )
{
GetPageLayoutInfoFromDialog();
m_tb.SetComment( 6, m_TextComment7->GetValue() );
UpdatePageLayoutExample();
UpdateDrawingSheetExample();
}
}
@ -419,7 +419,7 @@ void DIALOG_PAGES_SETTINGS::OnComment8TextUpdated( wxCommandEvent& event )
{
GetPageLayoutInfoFromDialog();
m_tb.SetComment( 7, m_TextComment8->GetValue() );
UpdatePageLayoutExample();
UpdateDrawingSheetExample();
}
}
@ -430,7 +430,7 @@ void DIALOG_PAGES_SETTINGS::OnComment9TextUpdated( wxCommandEvent& event )
{
GetPageLayoutInfoFromDialog();
m_tb.SetComment( 8, m_TextComment9->GetValue() );
UpdatePageLayoutExample();
UpdateDrawingSheetExample();
}
}
@ -456,19 +456,19 @@ bool DIALOG_PAGES_SETTINGS::SavePageSettings()
wxString fileName = GetWksFileName();
if( fileName != BASE_SCREEN::m_PageLayoutDescrFileName )
if( fileName != BASE_SCREEN::m_DrawingSheetFileName )
{
wxString fullFileName = DS_DATA_MODEL::MakeFullFileName( fileName, m_projectPath );
if( !fullFileName.IsEmpty() && !wxFileExists( fullFileName ) )
{
wxString msg;
msg.Printf( _( "Page layout description file \"%s\" not found." ), fullFileName );
msg.Printf( _( "Drawing sheet file \"%s\" not found." ), fullFileName );
wxMessageBox( msg );
return false;
}
BASE_SCREEN::m_PageLayoutDescrFileName = fileName;
BASE_SCREEN::m_DrawingSheetFileName = fileName;
DS_DATA_MODEL::GetTheInstance().LoadDrawingSheet( fullFileName );
m_localPrjConfigChanged = true;
}
@ -580,7 +580,7 @@ void DIALOG_PAGES_SETTINGS::SetCurrentPageSizeSelection( const wxString& aPaperS
}
void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample()
void DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample()
{
int lyWidth, lyHeight;
@ -660,8 +660,8 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample()
|| m_parent->IsType( FRAME_SCH_VIEWER )
|| m_parent->IsType( FRAME_SCH_VIEWER_MODAL ) )
{
COLOR4D worksheetColor = renderSettings.GetLayerColor( LAYER_SCHEMATIC_DRAWINGSHEET );
renderSettings.SetLayerColor( LAYER_DRAWINGSHEET, worksheetColor );
COLOR4D color = renderSettings.GetLayerColor( LAYER_SCHEMATIC_DRAWINGSHEET );
renderSettings.SetLayerColor( LAYER_DRAWINGSHEET, color );
}
GRFilledRect( NULL, &memDC, 0, 0, m_layout_size.x, m_layout_size.y, bgColor, bgColor );
@ -778,8 +778,8 @@ void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event )
}
// Display a file picker dialog
wxFileDialog fileDialog( this, _( "Select Page Layout Description File" ),
path, name, PageLayoutDescrFileWildcard(),
wxFileDialog fileDialog( this, _( "Select Drawing Sheet File" ),
path, name, DrawingSheetFileWildcard(),
wxFD_DEFAULT_STYLE | wxFD_FILE_MUST_EXIST );
if( fileDialog.ShowModal() != wxID_OK )
@ -794,7 +794,7 @@ void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event )
// For Win/Linux/macOS compatibility, a relative path is a good idea
if( shortFileName != GetWksFileName() && shortFileName != fileName )
{
wxString msg = wxString::Format( _( "The page layout description file name has changed.\n"
wxString msg = wxString::Format( _( "The drawing sheet file name has changed.\n"
"Do you want to use the relative path:\n"
"\"%s\"\n"
"instead of\n"
@ -820,6 +820,6 @@ void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event )
SetWksFileName( shortFileName );
GetPageLayoutInfoFromDialog();
UpdatePageLayoutExample();
UpdateDrawingSheetExample();
}
}

View File

@ -335,7 +335,7 @@ DIALOG_PAGES_SETTINGS_BASE::DIALOG_PAGES_SETTINGS_BASE( wxWindow* parent, wxWind
wxBoxSizer* bSizerFilename;
bSizerFilename = new wxBoxSizer( wxVERTICAL );
m_staticTextfilename = new wxStaticText( this, wxID_ANY, _("Page layout description file"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextfilename = new wxStaticText( this, wxID_ANY, _("Drawing sheet file"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextfilename->Wrap( -1 );
bSizerFilename->Add( m_staticTextfilename, 0, wxRIGHT|wxLEFT, 5 );

View File

@ -4113,7 +4113,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Page layout description file</property>
<property name="label">Drawing sheet file</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>

View File

@ -23,8 +23,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* keyword used in page layout description are listed
* in drawing_sheet_reader.keywords file
/*
* keyword used in drawing sheet are listed in drawing_sheet_reader.keywords file
*/
/*
@ -118,7 +118,7 @@
// default line width 0.15 mm
// frame ref pitch 50 mm
// Default page layout (sizes are in mm)
// Default drawing sheet (sizes are in mm)
extern const char defaultDrawingSheet[] =
"(drawing_sheet\n"
"(setup (textsize 1.5 1.5) (linewidth 0.15) (textlinewidth 0.15)\n"

View File

@ -760,7 +760,7 @@ double DRAWING_SHEET_READER_PARSER::parseDouble()
return val;
}
// defaultDrawingSheet is the default page layout description using the S expr.
// defaultDrawingSheet is the default drawing sheet using the S expr.
extern const char defaultDrawingSheet[];
void DS_DATA_MODEL::SetDefaultLayout()
@ -774,7 +774,7 @@ wxString DS_DATA_MODEL::DefaultLayout()
return wxString( defaultDrawingSheet );
}
// emptyDrawingSheet is a "empty" page layout description using the S expr.
// emptyDrawingSheet is a "empty" drawing sheet using the S expr.
// there is a 0 length line to fool something somewhere.
extern const char emptyDrawingSheet[];

View File

@ -25,7 +25,7 @@
/*
* the class DS_DATA_ITEM (and derived) defines
* a basic shape of a page layout ( frame references and title block )
* a basic shape of a drawing sheet (frame references and title block)
* Basic shapes are line, rect and texts
* the DS_DATA_ITEM coordinates units is the mm, and are relative to
* one of 4 page corners.
@ -42,10 +42,10 @@
* Items with m_RepeatCount > 1 are created m_RepeatCount times
*
* the DS_DATA_MODEL is created only once.
* the DS_DRAW_ITEM_LIST is created each time the page layout is plot/drawn
* the DS_DRAW_ITEM_LIST is created each time the drawing sheet is plotted/drawn
*
* the DS_DATA_MODEL instance is created from a S expression which
* describes the page layout (can be the default page layout or a custom file).
* describes the drawing sheet (can be the default drawing sheet or a custom file).
*/
#include <gr_text.h>

View File

@ -39,9 +39,9 @@
* The WS_DRAW_ITEM_*s are created and maintained by the PlEditor, but are created each time
* they're needed for drawing by the clients (Eeschema, Pcbnew, etc.)
*
* The DS_DATA_MODEL instance is created from a S expression which describes the page
* layout (can be the default page layout or a custom file). This format is also used
* for undo/redo storage (wrapped in a DS_PROXY_UNDO_ITEM).
* The DS_DATA_MODEL instance is created from a S expression which describes the drawing sheet
* (can be the default drawing sheet or a custom file). This format is also used for undo/redo
* storage (wrapped in a DS_PROXY_UNDO_ITEM).
*/
#include <kiface_i.h>
@ -86,8 +86,8 @@ DS_DATA_MODEL& DS_DATA_MODEL::GetTheInstance()
/**
* static function: Set an alternate instance of DS_DATA_MODEL
* mainly used in page setting dialog
* @param aLayout = the alternate page layout.
* if null, restore the basic page layout
* @param aLayout = the alternate drawing sheet.
* if null, restore the basic drawing sheet
*/
void DS_DATA_MODEL::SetAltInstance( DS_DATA_MODEL* aLayout )
{

View File

@ -46,7 +46,7 @@ static const char* getTokenName( T aTok )
return DRAWING_SHEET_READER_LEXER::TokenName( aTok );
}
// A basic helper class to write a page layout description
// A basic helper class to write a drawing sheet file
// Not used alone, a file writer or a string writer should be derived to use it.
// Therefore the constructor is protected.
class DS_DATA_MODEL_IO
@ -58,7 +58,7 @@ protected:
virtual ~DS_DATA_MODEL_IO() {}
public:
void Format( DS_DATA_MODEL* aModel ) const;
void Format( DS_DATA_MODEL* aDrawingSheet ) const;
void Format( DS_DATA_MODEL* aModel, DS_DATA_ITEM* aItem, int aNestLevel ) const;
@ -74,7 +74,7 @@ private:
};
// A helper class to write a page layout description to a file
// A helper class to write a drawing sheet to a file
class DS_DATA_MODEL_FILEIO : public DS_DATA_MODEL_IO
{
FILE_OUTPUTFORMATTER * m_fileout;
@ -90,7 +90,7 @@ public:
}
catch( const IO_ERROR& ioe )
{
wxMessageBox( ioe.What(), _( "Error writing page layout design file" ) );
wxMessageBox( ioe.What(), _( "Error writing drawing sheet file" ) );
}
}
@ -101,7 +101,7 @@ public:
};
// A helper class to write a page layout description to a string
// A helper class to write a drawing sheet to a string
class DS_DATA_MODEL_STRINGIO : public DS_DATA_MODEL_IO
{
STRING_FORMATTER * m_writer;
@ -118,7 +118,7 @@ public:
}
catch( const IO_ERROR& ioe )
{
wxMessageBox( ioe.What(), _( "Error writing page layout design file" ) );
wxMessageBox( ioe.What(), _( "Error writing drawing sheet file" ) );
}
}
@ -187,7 +187,7 @@ void DS_DATA_MODEL_IO::Format( DS_DATA_MODEL* aModel, DS_DATA_ITEM* aItem, int a
}
void DS_DATA_MODEL_IO::Format( DS_DATA_MODEL* aPageLayout ) const
void DS_DATA_MODEL_IO::Format( DS_DATA_MODEL* aDrawingSheet ) const
{
LOCALE_IO toggle; // switch on/off the locale "C" notation
@ -198,30 +198,30 @@ void DS_DATA_MODEL_IO::Format( DS_DATA_MODEL* aPageLayout ) const
// Write default values:
m_out->Print( nestLevel, "(%s ", getTokenName( T_setup ) );
m_out->Print( 0, "(textsize %s %s)",
double2Str( aPageLayout->m_DefaultTextSize.x ).c_str(),
double2Str( aPageLayout->m_DefaultTextSize.y ).c_str() );
double2Str( aDrawingSheet->m_DefaultTextSize.x ).c_str(),
double2Str( aDrawingSheet->m_DefaultTextSize.y ).c_str() );
m_out->Print( 0, "(linewidth %s)",
double2Str( aPageLayout->m_DefaultLineWidth ).c_str() );
double2Str( aDrawingSheet->m_DefaultLineWidth ).c_str() );
m_out->Print( 0, "(textlinewidth %s)",
double2Str( aPageLayout->m_DefaultTextThickness ).c_str() );
double2Str( aDrawingSheet->m_DefaultTextThickness ).c_str() );
m_out->Print( 0, "\n" );
// Write margin values
m_out->Print( nestLevel, "(%s %s)", getTokenName( T_left_margin ),
double2Str( aPageLayout->GetLeftMargin() ).c_str() );
double2Str( aDrawingSheet->GetLeftMargin() ).c_str() );
m_out->Print( 0, "(%s %s)", getTokenName( T_right_margin ),
double2Str( aPageLayout->GetRightMargin() ).c_str() );
double2Str( aDrawingSheet->GetRightMargin() ).c_str() );
m_out->Print( 0, "(%s %s)", getTokenName( T_top_margin ),
double2Str( aPageLayout->GetTopMargin() ).c_str() );
double2Str( aDrawingSheet->GetTopMargin() ).c_str() );
m_out->Print( 0, "(%s %s)", getTokenName( T_bottom_margin ),
double2Str( aPageLayout->GetBottomMargin() ).c_str() );
double2Str( aDrawingSheet->GetBottomMargin() ).c_str() );
m_out->Print( 0, ")\n" );
// Save the graphical items on the page layout
for( unsigned ii = 0; ii < aPageLayout->GetCount(); ii++ )
// Save the graphical items on the drawing sheet
for( unsigned ii = 0; ii < aDrawingSheet->GetCount(); ii++ )
{
DS_DATA_ITEM* item = aPageLayout->GetItem( ii );
Format( aPageLayout, item, nestLevel );
DS_DATA_ITEM* item = aDrawingSheet->GetItem( ii );
Format( aDrawingSheet, item, nestLevel );
}
m_out->Print( 0, ")\n" );

View File

@ -25,7 +25,7 @@
/*
* the class DS_DATA_ITEM (and DS_DATA_ITEM_TEXT) defines
* a basic shape of a page layout ( frame references and title block )
* a basic shape of a drawing sheet (frame references and title block)
* Basic shapes are line, rect and texts
* the DS_DATA_ITEM coordinates units is the mm, and are relative to
* one of 4 page corners.
@ -42,10 +42,10 @@
* Items with m_RepeatCount > 1 are created m_RepeatCount times
*
* the DS_DATA_MODEL is created only once.
* the DS_DRAW_ITEM_LIST is created each time the page layout is plotted/drawn
* the DS_DRAW_ITEM_LIST is created each time the drawing sheet is plotted/drawn
*
* the DS_DATA_MODEL instance is created from a S expression which
* describes the page layout (can be the default page layout or a custom file).
* describes the drawing sheet (can be the default drawing sheet or a custom file).
*/
#include <eda_rect.h>

View File

@ -115,7 +115,7 @@ void DS_PROXY_VIEW_ITEM::ViewDraw( int aLayer, VIEW* aView ) const
ws_settings->SetBrightenedColor( settings->GetLayerColor( LAYER_BRIGHTENED ) );
ws_settings->SetPageBorderColor( settings->GetLayerColor( m_pageBorderColorLayer ) );
// Draw all the components that make the page layout
// Draw all the components that make the drawing sheet
for( DS_DRAW_ITEM_BASE* item = drawList.GetFirst(); item; item = drawList.GetNext() )
ws_painter.Draw( item, LAYER_DRAWINGSHEET );

View File

@ -61,7 +61,7 @@ PROJECT_FILE::PROJECT_FILE( const wxString& aFullPath ) :
new PARAM_PATH_LIST( "cvpcb.equivalence_files", &m_EquivalenceFiles, {} ) );
m_params.emplace_back(
new PARAM_PATH( "pcbnew.page_layout_descr_file", &m_BoardPageLayoutDescrFile, "" ) );
new PARAM_PATH( "pcbnew.page_layout_descr_file", &m_BoardDrawingSheetFile, "" ) );
m_params.emplace_back(
new PARAM_PATH( "pcbnew.last_paths.netlist", &m_PcbLastPath[LAST_PATH_NETLIST], "" ) );

View File

@ -143,7 +143,7 @@ const std::string ArchiveFileExtension( "zip" );
const std::string LegacyPcbFileExtension( "brd" );
const std::string KiCadPcbFileExtension( "kicad_pcb" );
const std::string PageLayoutDescrFileExtension( "kicad_wks" );
const std::string DrawingSheetFileExtension( "kicad_wks" );
const std::string DesignRulesFileExtension( "kicad_dru" );
const std::string PdfFileExtension( "pdf" );
@ -353,9 +353,9 @@ wxString GedaPcbFootprintLibFileWildcard()
}
wxString PageLayoutDescrFileWildcard()
wxString DrawingSheetFileWildcard()
{
return _( "Page layout design files" ) + AddFileExtListToFilter( { "kicad_wks" } );
return _( "Drawing sheet files" ) + AddFileExtListToFilter( { "kicad_wks" } );
}

View File

@ -89,9 +89,9 @@ bool SCH_EDIT_FRAME::LoadProjectSettings()
LIB_PART::GetSubpartFirstId() );
// Load the drawing sheet description file, from the filename stored in
// BASE_SCREEN::m_PageLayoutDescrFileName, read in config project file
// BASE_SCREEN::m_DrawingSheetFileName, read in config project file
// If empty, or not existing, the default descr is loaded
wxString filename = DS_DATA_MODEL::MakeFullFileName( BASE_SCREEN::m_PageLayoutDescrFileName,
wxString filename = DS_DATA_MODEL::MakeFullFileName( BASE_SCREEN::m_DrawingSheetFileName,
Prj().GetProjectPath() );
if( !DS_DATA_MODEL::GetTheInstance().LoadDrawingSheet( filename ) )

View File

@ -1131,8 +1131,8 @@ bool SCH_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType )
DS_DATA_MODEL& drawingSheet = DS_DATA_MODEL::GetTheInstance();
drawingSheet.SetEmptyLayout();
BASE_SCREEN::m_PageLayoutDescrFileName = "empty.kicad_wks";
wxFileName layoutfn( Prj().GetProjectPath(), BASE_SCREEN::m_PageLayoutDescrFileName );
BASE_SCREEN::m_DrawingSheetFileName = "empty.kicad_wks";
wxFileName layoutfn( Prj().GetProjectPath(), BASE_SCREEN::m_DrawingSheetFileName );
wxFFile layoutfile;
if( layoutfile.Open( layoutfn.GetFullPath(), "wb" ) )

View File

@ -73,7 +73,7 @@ namespace KIGFX
class SCH_VIEW : public KIGFX::VIEW
{
public:
// Note: aFrame is used to know the sheet path name when drawing the page layout.
// Note: aFrame is used to know the sheet path name when drawing the drawing sheet.
// It can be null.
SCH_VIEW( bool aIsDynamic, SCH_BASE_FRAME* aFrame );
~SCH_VIEW();
@ -99,7 +99,7 @@ public:
private:
SCH_BASE_FRAME* m_frame; // The frame using this view. Can be null. Used mainly
// to know the sheet path name when drawing the page layout
// to know the sheet path name when drawing the drawing sheet
std::unique_ptr<DS_PROXY_VIEW_ITEM> m_drawingSheet;
};

View File

@ -190,7 +190,7 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
// TOOD(JE) get rid of this static
m_params.emplace_back( new PARAM<wxString>( "page_layout_descr_file",
&BASE_SCREEN::m_PageLayoutDescrFileName, "" ) );
&BASE_SCREEN::m_DrawingSheetFileName, "" ) );
m_params.emplace_back( new PARAM<wxString>( "plot_directory",
&m_PlotDirectoryName, "" ) );

View File

@ -60,8 +60,6 @@ public:
wxString m_IntersheetRefsPrefix;
wxString m_IntersheetRefsSuffix;
wxString m_PageLayoutDescrFile;
wxString m_PlotDirectoryName;
wxString m_NetFormatName;

View File

@ -516,7 +516,7 @@ void SCH_EDIT_FRAME::DrawCurrentSheetToClipboard()
dc.SetUserScale( scale, scale );
GetRenderSettings()->SetPrintDC( &dc );
// Init the color of the layer actually used to print the worksheet:
// Init the color of the layer actually used to print the drawing sheet:
GetRenderSettings()->SetLayerColor( LAYER_DRAWINGSHEET,
GetRenderSettings()->GetLayerColor( LAYER_SCHEMATIC_DRAWINGSHEET ) );

View File

@ -107,7 +107,7 @@ int SCH_EDITOR_CONTROL::PageSetup( const TOOL_EVENT& aEvent )
m_frame->SaveCopyInUndoList( undoCmd, UNDO_REDO::PAGESETTINGS, false );
DIALOG_EESCHEMA_PAGE_SETTINGS dlg( m_frame, wxSize( MAX_PAGE_SIZE_MILS, MAX_PAGE_SIZE_MILS ) );
dlg.SetWksFileName( BASE_SCREEN::m_PageLayoutDescrFileName );
dlg.SetWksFileName( BASE_SCREEN::m_DrawingSheetFileName );
if( dlg.ShowModal() != wxID_OK )
m_frame->RollbackSchematicFromUndo();

View File

@ -82,8 +82,8 @@ public:
void Show( int nestLevel, std::ostream& os ) const override;
#endif
static wxString m_PageLayoutDescrFileName; ///< the name of the page layout descr file,
///< or emty to used the default pagelayout
static wxString m_DrawingSheetFileName; ///< the name of the drawing sheet file, or empty
///< to use the default drawing sheet
wxPoint m_DrawOrg; ///< offsets for drawing the circuit on the screen

View File

@ -195,7 +195,7 @@ public:
/**
* Return the bounding box of the view that should be used if model is not valid.
* For example, the worksheet bounding box for an empty PCB
* For example, the drawing sheet bounding box for an empty PCB
*
* @return the default bounding box for the panel.
*/

View File

@ -97,8 +97,8 @@ private:
void SetCurrentPageSizeSelection( const wxString& aPaperSize );
// Update page layout example
void UpdatePageLayoutExample();
// Update drawing sheet example
void UpdateDrawingSheetExample();
// Get page layout info from selected dialog items
void GetPageLayoutInfoFromDialog();
@ -107,7 +107,7 @@ private:
void GetCustomSizeMilsFromDialog();
/// @return true if the local prj config is chande
/// i.e. if the page layout descr file has chnaged
/// i.e. if the drawing sheet file has chnaged
bool LocalPrjConfigChanged() { return m_localPrjConfigChanged; }
protected:
@ -117,14 +117,14 @@ protected:
wxArrayString m_pageFmt; /// list of page sizes (not translated)
bool m_initialized;
bool m_localPrjConfigChanged; /// the page layuout filename was changed
wxBitmap* m_pageBitmap; /// Temporary bitmap for the page layout example.
wxSize m_layout_size; /// Logical page layout size.
wxBitmap* m_pageBitmap; /// Temporary bitmap for the drawing sheet example.
wxSize m_layout_size; /// Logical drawing sheet size.
wxSize m_maxPageSizeMils; /// The max page size allowed by the caller frame
PAGE_INFO m_pageInfo; /// Temporary page info.
bool m_customFmt; /// true if the page selection is custom
TITLE_BLOCK m_tb; /// Temporary title block (basic inscriptions).
DS_DATA_MODEL* m_drawingSheet; // the alternate and temporary page layout shown by the dialog
// when the initial one is replaced by a new one
DS_DATA_MODEL* m_drawingSheet; // the alternate and temporary drawing sheet shown by the
// dialog when the initial one is replaced by a new one
double m_iuPerMils;
private:

View File

@ -32,7 +32,7 @@
class DS_DRAW_ITEM_TEXT; // Forward declaration
#define TB_DEFAULT_TEXTSIZE 1.5 // default worksheet text size in mm
#define TB_DEFAULT_TEXTSIZE 1.5 // default drawing sheet text size in mm
namespace KIGFX
{
@ -203,15 +203,13 @@ protected:
std::vector<DS_DRAW_ITEM_BASE*> m_drawItems;
public:
wxString m_Name; // a item name used in page layout
// editor to identify items
wxString m_Name; // a name used in drawing sheet editor to identify items
wxString m_Info; // a comment, only useful in drawing sheet editor
POINT_COORD m_Pos;
POINT_COORD m_End;
double m_LineWidth;
int m_RepeatCount; // repeat count for duplicate items
DPOINT m_IncrementVector; // For duplicate items: move vector
// for position increment
DPOINT m_IncrementVector; // for duplicate items: move vector for position increment
int m_IncrementLabel;
};

View File

@ -53,7 +53,7 @@ public:
/**
* Set an alternate instance of DS_DATA_MODEL.
*
* @param aLayout the alternate page layout; if null restore the basic page layout
* @param aLayout the alternate drawing sheet; if null restore the default drawing sheet
*/
static void SetAltInstance( DS_DATA_MODEL* aLayout = NULL );
@ -72,9 +72,8 @@ public:
void SetupDrawEnvironment( const PAGE_INFO& aPageInfo, double aMilsToIU );
/**
* In KiCad applications, a page layout description is needed
* So if the list is empty, a default description is loaded,
* the first time a page layout is drawn.
* In KiCad applications, a drawing sheet is needed
* So if the list is empty, a default drawing sheet is loaded, the first time it is drawn.
* However, in drawing sheet editor an empty list is acceptable.
* AllowVoidList allows or not the empty list
*/
@ -149,9 +148,9 @@ public:
* Populates the list with a custom layout or the default layout if no custom layout
* is available.
*
* @param aFullFileName is the custom page layout description file. If empty, load the
* file defined by KICAD_WKSFILE and if its is not defined use the
* default internal description.
* @param aFullFileName is the custom drawing sheet file. If empty, load the file defined by
* KICAD_WKSFILE and if its not defined, the default internal drawing
* sheet.
* @param Append if true: do not delete old layout, and load only \a aFullFileName.
*/
bool LoadDrawingSheet( const wxString& aFullFileName = wxEmptyString, bool Append = false );
@ -206,9 +205,9 @@ public:
private:
std::vector <DS_DATA_ITEM*> m_list;
bool m_allowVoidList; // If false, the default page layout will be loaded the
// first time DS_DRAW_ITEM_LIST::BuildDrawItemsList
// is run (useful mainly for drawing sheet editor)
bool m_allowVoidList; // If false, the default drawing sheet will be loaded the
// first time DS_DRAW_ITEM_LIST::BuildDrawItemsList is run
// (useful mainly for drawing sheet editor)
double m_leftMargin; // the left page margin in mm
double m_rightMargin; // the right page margin in mm
double m_topMargin; // the top page margin in mm

View File

@ -392,7 +392,7 @@ public:
~DS_DRAW_ITEM_LIST()
{
// Items in the m_graphicList are owned by their respective WORKSHEET_DATAITEMs.
// Items in the m_graphicList are owned by their respective DS_DATA_ITEMs.
// for( DS_DRAW_ITEM_BASE* item : m_graphicList )
// delete item;
}
@ -512,7 +512,7 @@ public:
void Print( const RENDER_SETTINGS* aSettings );
/**
* Drawing or plot the page layout.
* Drawing or plot the drawing sheet.
*
* Before calling this function, some parameters should be initialized by calling:
* SetPenSize( aPenWidth );

View File

@ -93,7 +93,7 @@ private:
/**
* Methods for drawing worksheet items.
* Methods for painting drawing sheet items.
*/
class DS_PAINTER : public PAINTER
{
@ -140,9 +140,9 @@ private:
* @param aIsFirstPage True when this is the first page. This only has meaning for schematics.
*
* Parameters used in aPageInfo
* - the size of the page layout.
* - the LTmargin The left top margin of the page layout.
* - the RBmargin The right bottom margin of the page layout.
* - the size of the drawing sheet.
* - the LTmargin The left top margin of the drawing sheet.
* - the RBmargin The right bottom margin of the drawing sheet.
*/
void PrintDrawingSheet( const RENDER_SETTINGS* aSettings, const PAGE_INFO& aPageInfo,
const wxString& aFullSheetName, const wxString& aFileName,

View File

@ -36,9 +36,9 @@ public:
DS_PROXY_UNDO_ITEM( const EDA_DRAW_FRAME* aFrame );
/*
* Restores the saved worksheet layout to the global worksheet record, and the saved
* page info and title blocks to the given frame. The WS_DRAW_ITEMs are rehydrated
* and installed in aView if it is not null (ie: if we're in the PageLayout Editor).
* Restores the saved drawing sheet layout to the global drawing sheet record, and the saved
* page info and title blocks to the given frame. The WS_DRAW_ITEMs are rehydrated and
* installed in aView if it is not null (ie: if we're in the PageLayout Editor).
*/
void Restore( EDA_DRAW_FRAME* aFrame, KIGFX::VIEW* aView = nullptr );

View File

@ -79,7 +79,7 @@ public:
void SetIsFirstPage( bool aIsFirstPage ) { m_isFirstPage = aIsFirstPage; }
/**
* Can be used to override which layer ID is used for worksheet item colors
* Can be used to override which layer ID is used for drawing sheet item colors
* @param aLayerId is the color to use (defaults to LAYER_DRAWINGSHEET if this is not called)
*/
void SetColorLayer( int aLayerId )
@ -114,7 +114,7 @@ public:
#endif
/** Get class name
* @return string "WORKSHEET_VIEWITEM"
* @return string "DS_PROXY_VIEW_ITEM"
*/
virtual wxString GetClass() const override
{
@ -126,7 +126,7 @@ public:
protected:
void buildDrawList( KIGFX::VIEW* aView, DS_DRAW_ITEM_LIST* aDrawList ) const;
/// the factor between mils (units used in worksheet and internal units)
/// the factor between mils (units used in drawing sheet and internal units)
/// it is the value IU_PER_MILS used in the caller
int m_mils2IUscalefactor;
@ -139,7 +139,7 @@ protected:
bool m_isFirstPage;
const PROJECT* m_project;
/// Layer that is used for worksheet color (LAYER_DRAWINGSHEET is always used for visibility)
/// Layer that is used for drawing sheet color (LAYER_DRAWINGSHEET is always used for visibility)
int m_colorLayer;
/// Layer that is used for page border color

View File

@ -438,11 +438,10 @@ public:
/**
* Returns bbox of document with option to not include some items.
*
* Used most commonly by "Zoom to Fit" and "Zoom to Objects". In Eeschema
* for "Zoom to Fit", it's passed "true" to include worksheet border. It's
* passed false by "Zoom To Objects" to ignore worksheet border. In Pcbnew,
* false makes it ignore any items outside the PCB edge such as fabrication
* notes.
* Used most commonly by "Zoom to Fit" and "Zoom to Objects". In Eeschema for "Zoom to Fit"
* it's passed "true" to include drawing sheet border, and "false" by "Zoom To Objects" to
* ignore drawing sheet border. In Pcbnew, false makes it ignore any items outside the PCB
* edge such as fabrication notes.
*
* @param aIncludeAllVisible True to include everything visible in bbox calculations,
* false to ignore some visible items (program dependent).
@ -500,7 +499,7 @@ protected:
// to screens
bool m_polarCoords; // For those frames that support polar coordinates
bool m_showBorderAndTitleBlock; // Show the worksheet (border and title block).
bool m_showBorderAndTitleBlock; // Show the drawing sheet (border & title block).
long m_firstRunDialogSetting; // Show first run dialog on startup
wxChoice* m_gridSelectBox;

View File

@ -155,8 +155,8 @@ public:
* PcbNew params
*/
/// Page layout description file
wxString m_BoardPageLayoutDescrFile;
/// Drawing sheet file
wxString m_BoardDrawingSheetFile;
/// MRU path storage
wxString m_PcbLastPath[LAST_PATH_SIZE];

View File

@ -271,7 +271,7 @@ public:
void SetSelectFactor( float aFactor ) { m_selectFactor = aFactor; }
void SetHighContrastFactor( float aFactor ) { m_hiContrastFactor = aFactor; }
// TODO: these can go away once the worksheet is moved to Cairo-based printing
// TODO: these can go away once the drawing sheet is moved to Cairo-based printing
wxDC* GetPrintDC() const { return m_printDC; }
void SetPrintDC( wxDC* aDC ) { m_printDC = aDC; }
@ -312,7 +312,7 @@ protected:
bool m_showPageLimits;
bool m_isPrinting;
wxDC* m_printDC; // This can go away once the worksheet is moved to
wxDC* m_printDC; // This can go away once the drawing sheet is moved to
// Cairo-based printing.
};

View File

@ -133,7 +133,7 @@ extern const std::string LegacyPcbFileExtension;
extern const std::string KiCadPcbFileExtension;
#define PcbFileExtension KiCadPcbFileExtension // symlink choice
extern const std::string KiCadSymbolLibFileExtension;
extern const std::string PageLayoutDescrFileExtension;
extern const std::string DrawingSheetFileExtension;
extern const std::string DesignRulesFileExtension;
extern const std::string LegacyFootprintLibPathExtension;
@ -149,7 +149,7 @@ extern const std::string KiCadFootprintLibPathExtension;
extern const std::string GedaPcbFootprintLibFileExtension;
extern const std::string EagleFootprintLibPathExtension;
extern const std::string ComponentFileExtension;
extern const std::string PageLayoutDescrFileExtension;
extern const std::string DrawingSheetFileExtension;
extern const std::string SpecctraDsnFileExtension;
extern const std::string IpcD356FileExtension;
@ -177,7 +177,7 @@ bool IsProtelExtension( const wxString& ext );
extern wxString AllFilesWildcard();
extern wxString ComponentFileWildcard();
extern wxString PageLayoutDescrFileWildcard();
extern wxString DrawingSheetFileWildcard();
extern wxString SchematicSymbolFileWildcard();
extern wxString KiCadSymbolLibFileWildcard();
extern wxString LegacySymbolLibFileWildcard();

View File

@ -195,7 +195,7 @@ bool PROJECT_TEMPLATE::CreateProject( wxFileName& aNewProjectPath, wxString* aEr
// Do not rename project specific symbol libraries. This will break the symbol library
// table which will cause broken symbol library links in the schematic.
if( !( destFile.GetExt() == PageLayoutDescrFileExtension ) && !( destFile.GetExt() == "dcm"
if( !( destFile.GetExt() == DrawingSheetFileExtension ) && !( destFile.GetExt() == "dcm"
|| ( destFile.GetExt() == "lib" && !destFile.GetName().EndsWith( "-cache" ) ) ) )
{
currname.Replace( basename, aNewProjectPath.GetName() );

View File

@ -214,7 +214,7 @@ void PROJECT_TREE_ITEM::Activate( PROJECT_TREE_PANE* aTreePrjFrame )
toolMgr->RunAction( KICAD_MANAGER_ACTIONS::openTextEditor, true, &fullFileName );
break;
case TREE_FILE_TYPE::PAGE_LAYOUT_DESCR:
case TREE_FILE_TYPE::DRAWING_SHEET:
toolMgr->RunAction( KICAD_MANAGER_ACTIONS::editDrawingSheet, true, &fullFileName );
break;

View File

@ -72,7 +72,7 @@ static const wxChar* s_allowedExtensionsToList[] = {
wxT( "^[^$].*\\.brd$" ), // Legacy Pcbnew files
wxT( "^[^$].*\\.kicad_pcb$" ), // S format Pcbnew board files
wxT( "^[^$].*\\.kicad_dru$" ), // Design rule files
wxT( "^[^$].*\\.kicad_wks$" ), // S format kicad page layout help_textr files
wxT( "^[^$].*\\.kicad_wks$" ), // S format kicad drawing sheet files
wxT( "^[^$].*\\.kicad_mod$" ), // S format kicad footprint files, currently not listed
wxT( "^.*\\.net$" ), // pcbnew netlist file
wxT( "^.*\\.cir$" ), // Spice netlist file
@ -289,7 +289,7 @@ wxString PROJECT_TREE_PANE::GetFileExt( TREE_FILE_TYPE type )
case TREE_FILE_TYPE::DRILL_NC: return "nc";
case TREE_FILE_TYPE::DRILL_XNC: return "xnc";
case TREE_FILE_TYPE::SVG: return SVGFileExtension;
case TREE_FILE_TYPE::PAGE_LAYOUT_DESCR: return PageLayoutDescrFileExtension;
case TREE_FILE_TYPE::DRAWING_SHEET: return DrawingSheetFileExtension;
case TREE_FILE_TYPE::FOOTPRINT_FILE: return KiCadFootprintFileExtension;
case TREE_FILE_TYPE::SCHEMATIC_LIBFILE: return LegacySymbolLibFileExtension;
case TREE_FILE_TYPE::SEXPR_SYMBOL_LIB_FILE: return KiCadSymbolLibFileExtension;

View File

@ -393,7 +393,7 @@ public:
pcbnew->SaveFileAs( m_projectDirPath, m_projectName, m_newProjectDirPath,
m_newProjectName, aSrcFilePath, m_errors );
}
else if( ext == PageLayoutDescrFileExtension )
else if( ext == DrawingSheetFileExtension )
{
KIFACE* pleditor = m_frame->Kiway().KiFACE( KIWAY::FACE_PL_EDITOR );
pleditor->SaveFileAs( m_projectDirPath, m_projectName, m_newProjectDirPath,

View File

@ -54,7 +54,7 @@ enum class TREE_FILE_TYPE
DRILL_NC, // Similar Excellon drill file (.nc)
DRILL_XNC, // Similar Excellon drill file (.xnc)
SVG, // SVG file (.svg)
PAGE_LAYOUT_DESCR, // Page layout and title block descr file (.kicad_wks)
DRAWING_SHEET, // Drawing sheet file (.kicad_wks)
FOOTPRINT_FILE, // footprint file (.kicad_mod)
SCHEMATIC_LIBFILE, // schematic library file (.lib)
SEXPR_SYMBOL_LIB_FILE, // s-expression symbol library file (.kicad_sym)

View File

@ -213,7 +213,7 @@ void DIALOG_INSPECTOR::ReCreateDesignList()
wxFileName fn( static_cast<PL_EDITOR_FRAME*>( GetParent() )->GetCurrentFileName() );
if( fn.GetName().IsEmpty() )
SetTitle( "<default page layout>" );
SetTitle( "<default drawing sheet>" );
else
SetTitle( fn.GetName() );
@ -318,7 +318,7 @@ void DIALOG_INSPECTOR::SelectRow( DS_DATA_ITEM* aItem )
}
}
//return the page layout item managed by the cell
//return the drawing sheet item managed by the cell
DS_DATA_ITEM* DIALOG_INSPECTOR::GetDrawingSheetDataItem( int aRow ) const
{
return ( aRow >= 0 && aRow < (int)m_itemsList.size() ) ? m_itemsList[aRow]: nullptr;

View File

@ -43,7 +43,7 @@ private:
wxGrid* GetGridList() const { return m_gridListItems; }
void onCellClicked( wxGridEvent& event ) override;
// The list of DS_DATA_ITEM found in page layout
// The list of DS_DATA_ITEM found in drawing sheet
std::vector<DS_DATA_ITEM*> m_itemsList;
PL_EDITOR_FRAME* m_editorFrame;

View File

@ -216,7 +216,7 @@ void PLEDITOR_PRINTOUT::PrintPage( int aPageNum )
// PrintDrawingSheet clears the current display list when calling BuildDrawItemsList()
// So rebuild and redraw it.
m_parent->GetCanvas()->DisplayWorksheet();
m_parent->GetCanvas()->DisplayDrawingSheet();
}
@ -232,12 +232,12 @@ int InvokeDialogPrint( PL_EDITOR_FRAME* aCaller, wxPrintData* aPrintData,
printDialogData.EnablePageNumbers( true );
wxPrinter printer( &printDialogData );
PLEDITOR_PRINTOUT printout( aCaller, _( "Print Page Layout" ) );
PLEDITOR_PRINTOUT printout( aCaller, _( "Print Drawing Sheet" ) );
if( !printer.Print( aCaller, &printout, true ) )
{
if( wxPrinter::GetLastError() == wxPRINTER_ERROR )
wxMessageBox( _( "An error occurred attempting to print the page layout." ),
wxMessageBox( _( "An error occurred attempting to print the drawing sheet." ),
_( "Printing" ), wxOK );
return 0;
}

View File

@ -358,7 +358,7 @@ void PROPERTIES_FRAME::OnAcceptPrms( wxCommandEvent& event )
m_parent->OnModify();
// Rebuild the draw list with the new parameters
m_parent->GetCanvas()->DisplayWorksheet();
m_parent->GetCanvas()->DisplayDrawingSheet();
m_parent->GetCanvas()->Refresh();
}
@ -374,7 +374,7 @@ void PROPERTIES_FRAME::OnSetDefaultValues( wxCommandEvent& event )
CopyPrmsFromGeneralToPanel();
// Rebuild the draw list with the new parameters
m_parent->GetCanvas()->DisplayWorksheet();
m_parent->GetCanvas()->DisplayDrawingSheet();
m_parent->GetCanvas()->Refresh();
}

View File

@ -51,13 +51,13 @@ void PL_EDITOR_FRAME::OnFileHistory( wxCommandEvent& event )
{
wxString filename;
filename = GetFileFromHistory( event.GetId(), _( "Page Layout Description File" ) );
filename = GetFileFromHistory( event.GetId(), _( "Drawing Sheet File" ) );
if( filename != wxEmptyString )
{
if( IsContentModified() )
{
if( !HandleUnsavedChanges( this, _( "The current page layout has been modified. "
if( !HandleUnsavedChanges( this, _( "The current drawing sheet has been modified. "
"Save changes?" ),
[&]()->bool { return saveCurrentPageLayout(); } ) )
{
@ -67,14 +67,14 @@ void PL_EDITOR_FRAME::OnFileHistory( wxCommandEvent& event )
::wxSetWorkingDirectory( ::wxPathOnly( filename ) );
if( LoadPageLayoutDescrFile( filename ) )
if( LoadDrawingSheetFile( filename ) )
{
wxString msg;
msg.Printf( _( "File \"%s\" loaded"), filename );
SetStatusText( msg );
}
OnNewPageLayout();
OnNewDrawingSheet();
}
}
@ -98,7 +98,7 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event )
if( ( id == wxID_NEW || id == wxID_OPEN ) && IsContentModified() )
{
if( !HandleUnsavedChanges( this, _( "The current page layout has been modified. "
if( !HandleUnsavedChanges( this, _( "The current drawing sheet has been modified. "
"Save changes?" ),
[&]()->bool { return saveCurrentPageLayout(); } ) )
{
@ -112,21 +112,21 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event )
pglayout.AllowVoidList( true );
SetCurrentFileName( wxEmptyString );
pglayout.ClearList();
OnNewPageLayout();
OnNewDrawingSheet();
break;
case ID_APPEND_DESCR_FILE:
{
wxFileDialog openFileDialog( this, _( "Append Existing Drawing Sheet" ),
wxEmptyString, wxEmptyString,
PageLayoutDescrFileWildcard(), wxFD_OPEN );
DrawingSheetFileWildcard(), wxFD_OPEN );
if( openFileDialog.ShowModal() == wxID_CANCEL )
return;
filename = openFileDialog.GetPath();
if( ! InsertPageLayoutDescrFile( filename ) )
if( !InsertDrawingSheetFile( filename ) )
{
msg.Printf( _( "Unable to load %s file" ), filename );
DisplayErrorMessage( this, msg );
@ -144,21 +144,21 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event )
case wxID_OPEN:
{
wxFileDialog openFileDialog( this, _( "Open" ), wxEmptyString, wxEmptyString,
PageLayoutDescrFileWildcard(), wxFD_OPEN );
DrawingSheetFileWildcard(), wxFD_OPEN );
if( openFileDialog.ShowModal() == wxID_CANCEL )
return;
filename = openFileDialog.GetPath();
if( ! LoadPageLayoutDescrFile( filename ) )
if( !LoadDrawingSheetFile( filename ) )
{
msg.Printf( _( "Unable to load %s file" ), filename );
DisplayErrorMessage( this, msg );
}
else
{
OnNewPageLayout();
OnNewDrawingSheet();
msg.Printf( _( "File \"%s\" saved." ), filename );
SetStatusText( msg );
}
@ -166,7 +166,7 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event )
break;
case wxID_SAVE:
if( !SavePageLayoutDescrFile( filename ) )
if( !SaveDrawingSheetFile( filename ) )
{
msg.Printf( _( "Unable to write \"%s\"" ), filename );
DisplayErrorMessage( this, msg );
@ -182,7 +182,7 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event )
{
wxString dir = PATHS::GetUserTemplatesPath();
wxFileDialog openFileDialog( this, _( "Save As" ), dir, wxEmptyString,
PageLayoutDescrFileWildcard(),
DrawingSheetFileWildcard(),
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
if( openFileDialog.ShowModal() == wxID_CANCEL )
@ -195,10 +195,10 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event )
// extension
wxFileName fn(filename);
if( fn.GetExt() != PageLayoutDescrFileExtension )
filename << wxT(".") << PageLayoutDescrFileExtension;
if( fn.GetExt() != DrawingSheetFileExtension )
filename << wxT(".") << DrawingSheetFileExtension;
if( !SavePageLayoutDescrFile( filename ) )
if( !SaveDrawingSheetFile( filename ) )
{
msg.Printf( _( "Unable to create \"%s\"" ), filename );
DisplayErrorMessage( this, msg );
@ -221,7 +221,7 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event )
}
bool PL_EDITOR_FRAME::LoadPageLayoutDescrFile( const wxString& aFullFileName )
bool PL_EDITOR_FRAME::LoadDrawingSheetFile( const wxString& aFullFileName )
{
if( wxFileExists( aFullFileName ) )
{
@ -254,7 +254,7 @@ bool PL_EDITOR_FRAME::LoadPageLayoutDescrFile( const wxString& aFullFileName )
}
bool PL_EDITOR_FRAME::InsertPageLayoutDescrFile( const wxString& aFullFileName )
bool PL_EDITOR_FRAME::InsertDrawingSheetFile( const wxString& aFullFileName )
{
if( wxFileExists( aFullFileName ) )
{
@ -268,7 +268,7 @@ bool PL_EDITOR_FRAME::InsertPageLayoutDescrFile( const wxString& aFullFileName )
}
bool PL_EDITOR_FRAME::SavePageLayoutDescrFile( const wxString& aFullFileName )
bool PL_EDITOR_FRAME::SaveDrawingSheetFile( const wxString& aFullFileName )
{
if( !aFullFileName.IsEmpty() )
{

View File

@ -140,7 +140,7 @@ void PL_EDITOR_FRAME::ReCreateMenuBar()
placeMenu->Add( PL_ACTIONS::placeImage );
placeMenu->AppendSeparator();
placeMenu->Add( PL_ACTIONS::appendImportedWorksheet );
placeMenu->Add( PL_ACTIONS::appendImportedDrawingSheet );
//-- Inspector menu -------------------------------------------------------
//

View File

@ -83,7 +83,7 @@ void PL_DRAW_PANEL_GAL::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame,
}
void PL_DRAW_PANEL_GAL::DisplayWorksheet()
void PL_DRAW_PANEL_GAL::DisplayDrawingSheet()
{
PL_SELECTION_TOOL* selTool = m_edaFrame->GetToolManager()->GetTool<PL_SELECTION_TOOL>();
DS_DATA_MODEL& model = DS_DATA_MODEL::GetTheInstance();
@ -124,7 +124,7 @@ void PL_DRAW_PANEL_GAL::DisplayWorksheet()
// Gives a reasonable boundary to the view area
// Otherwise scroll bars are not usable
// A full size = 2 * page size allows a margin around the worksheet.
// A full size = 2 * page size allows a margin around the drawing sheet.
// (Note: no need to have a large working area: nothing can be drawn outside th page size).
double size_x = m_edaFrame->GetPageSizeIU().x;
double size_y = m_edaFrame->GetPageSizeIU().y;

View File

@ -41,7 +41,7 @@ public:
/**
* Build and update the list of WS_DRAW_ITEM_xxx showing the frame layout
*/
void DisplayWorksheet();
void DisplayDrawingSheet();
///< @copydoc EDA_DRAW_PANEL_GAL::SwitchBackend
bool SwitchBackend( GAL_TYPE aGalType ) override;
@ -53,8 +53,8 @@ protected:
///< Set rendering targets & dependencies for layers.
void setDefaultLayerDeps();
///< Currently used worksheet
std::unique_ptr<DS_PROXY_VIEW_ITEM> m_worksheet;
///< Currently used drawing sheet
std::unique_ptr<DS_PROXY_VIEW_ITEM> m_drawingSheet;
std::unique_ptr<DS_DRAW_ITEM_PAGE> m_pageDrawItem;
};

View File

@ -194,14 +194,14 @@ PL_EDITOR_FRAME::PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
wxPoint originCoord = ReturnCoordOriginCorner();
SetGridOrigin( originCoord );
// Initialize the current page layout
// Initialize the current drawing sheet
#if 0 //start with empty layout
DS_DATA_MODEL::GetTheInstance().AllowVoidList( true );
DS_DATA_MODEL::GetTheInstance().ClearList();
#else // start with the default Kicad layout
DS_DATA_MODEL::GetTheInstance().LoadDrawingSheet();
#endif
OnNewPageLayout();
OnNewDrawingSheet();
// Ensure the window is on top
Raise();
@ -289,7 +289,7 @@ void PL_EDITOR_FRAME::setupUIConditions()
mgr->SetConditions( PL_ACTIONS::placeImage, CHECK( cond.CurrentTool( PL_ACTIONS::placeImage ) ) );
// Not a tool, just a way to activate the action
mgr->SetConditions( PL_ACTIONS::appendImportedWorksheet, CHECK( SELECTION_CONDITIONS::ShowNever ) );
mgr->SetConditions( PL_ACTIONS::appendImportedDrawingSheet, CHECK( SELECTION_CONDITIONS::ShowNever ) );
auto titleBlockNormalMode =
[] ( const SELECTION& )
@ -315,14 +315,14 @@ bool PL_EDITOR_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, i
{
wxString fn = aFileSet[0];
if( !LoadPageLayoutDescrFile( fn ) )
if( !LoadDrawingSheetFile( fn ) )
{
wxMessageBox( wxString::Format( _( "Error when loading file \"%s\"" ), fn ) );
return false;
}
else
{
OnNewPageLayout();
OnNewDrawingSheet();
return true;
}
}
@ -406,7 +406,7 @@ void PL_EDITOR_FRAME::OnSelectCoordOriginCorner( wxCommandEvent& event )
{
m_originSelectChoice = m_originSelectBox->GetSelection();
UpdateStatusBar(); // Update grid origin
GetCanvas()->DisplayWorksheet();
GetCanvas()->DisplayDrawingSheet();
GetCanvas()->Refresh();
}
@ -544,13 +544,13 @@ void PL_EDITOR_FRAME::UpdateTitleAndInfo()
wxString PL_EDITOR_FRAME::GetCurrentFileName() const
{
return BASE_SCREEN::m_PageLayoutDescrFileName;
return BASE_SCREEN::m_DrawingSheetFileName;
}
void PL_EDITOR_FRAME::SetCurrentFileName( const wxString& aName )
{
BASE_SCREEN::m_PageLayoutDescrFileName = aName;
BASE_SCREEN::m_DrawingSheetFileName = aName;
}
@ -770,7 +770,7 @@ void PL_EDITOR_FRAME::PrintPage( const RENDER_SETTINGS* aSettings )
PrintDrawingSheet( aSettings, GetScreen(), IU_PER_MILS, wxEmptyString );
GetCanvas()->DisplayWorksheet();
GetCanvas()->DisplayDrawingSheet();
GetCanvas()->Refresh();
}
@ -789,7 +789,7 @@ SELECTION& PL_EDITOR_FRAME::GetCurrentSelection()
void PL_EDITOR_FRAME::HardRedraw()
{
GetCanvas()->DisplayWorksheet();
GetCanvas()->DisplayDrawingSheet();
PL_SELECTION_TOOL* selTool = m_toolManager->GetTool<PL_SELECTION_TOOL>();
PL_SELECTION& selection = selTool->GetSelection();
@ -804,7 +804,7 @@ void PL_EDITOR_FRAME::HardRedraw()
}
DS_DATA_ITEM* PL_EDITOR_FRAME::AddPageLayoutItem( int aType )
DS_DATA_ITEM* PL_EDITOR_FRAME::AddDrawingSheetItem( int aType )
{
DS_DATA_ITEM * item = NULL;
@ -869,11 +869,11 @@ DS_DATA_ITEM* PL_EDITOR_FRAME::AddPageLayoutItem( int aType )
}
void PL_EDITOR_FRAME::OnNewPageLayout()
void PL_EDITOR_FRAME::OnNewDrawingSheet()
{
ClearUndoRedoList();
GetScreen()->SetContentModified( false );
GetCanvas()->DisplayWorksheet();
GetCanvas()->DisplayDrawingSheet();
m_propertiesPagelayout->CopyPrmsFromItemToPanel( nullptr );
m_propertiesPagelayout->CopyPrmsFromGeneralToPanel();
@ -885,11 +885,11 @@ void PL_EDITOR_FRAME::OnNewPageLayout()
if( GetCurrentFileName().IsEmpty() )
{
// Default shutdown reason until a file is loaded
KIPLATFORM::APP::SetShutdownBlockReason( this, _( "New page layout file is unsaved" ) );
KIPLATFORM::APP::SetShutdownBlockReason( this, _( "New drawing sheet file is unsaved" ) );
}
else
{
KIPLATFORM::APP::SetShutdownBlockReason( this, _( "Page layout changes are unsaved" ) );
KIPLATFORM::APP::SetShutdownBlockReason( this, _( "Drawing sheet changes are unsaved" ) );
}
}

View File

@ -76,28 +76,28 @@ public:
bool OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl ) override;
/**
* Function LoadPageLayoutDescrFile
* Loads a .kicad_wks page layout descr file
* Function LoadDrawingSheetFile
* Loads a .kicad_wks drawing sheet file
* @param aFullFileName = the filename.
*/
bool LoadPageLayoutDescrFile( const wxString& aFullFileName );
bool LoadDrawingSheetFile( const wxString& aFullFileName );
/**
* Function SavePageLayoutDescrFile
* Save the current layout in a .kicad_wks page layout descr file
* Function SaveDrawingSheetFile
* Save the current layout in a .kicad_wks drawing sheet file
* @param aFullFileName = the filename.
*/
bool SavePageLayoutDescrFile( const wxString& aFullFileName );
bool SaveDrawingSheetFile( const wxString& aFullFileName );
/**
* Function InsertPageLayoutDescrFile
* Loads a .kicad_wks page layout descr file, and add items to the current layout list
* Function InsertDrawingSheetFile
* Loads a .kicad_wks drawing sheet file, and add items to the current layout list
* @param aFullFileName = the filename.
*/
bool InsertPageLayoutDescrFile( const wxString& aFullFileName );
bool InsertDrawingSheetFile( const wxString& aFullFileName );
/**
* Get if the page layout has been modified but not saved.
* Get if the drawing sheet has been modified but not saved.
*
* @return true if the any changes have not been saved
*/
@ -145,9 +145,9 @@ public:
void UpdateStatusBar() override;
/**
* Must be called to initialize parameters when a new page layout description is loaded
* Must be called to initialize parameters when a new drawing sheet is loaded
*/
void OnNewPageLayout();
void OnNewDrawingSheet();
/**
* creates or updates the right vertical toolbar.
@ -241,14 +241,14 @@ public:
void HardRedraw() override;
/**
* Function AddPageLayoutItem
* Add a new item to the page layout item list.
* Function AddDrawingSheetItem
* Add a new item to the drawing sheet item list.
* @param aType = the type of item:
* DS_TEXT, DS_SEGMENT, DS_RECT, DS_POLYPOLYGON
* @param aIdx = the position in list to insert the new item.
* @return a reference to the new item
*/
DS_DATA_ITEM* AddPageLayoutItem( int aType );
DS_DATA_ITEM* AddDrawingSheetItem( int aType );
/**
* Must be called after a change in order to set the "modify" flag

View File

@ -147,7 +147,7 @@ void PL_EDITOR_FRAME::ReCreateVToolbar()
m_drawToolBar->Add( PL_ACTIONS::drawRectangle, ACTION_TOOLBAR::TOGGLE );
m_drawToolBar->Add( PL_ACTIONS::placeText, ACTION_TOOLBAR::TOGGLE );
m_drawToolBar->Add( PL_ACTIONS::placeImage, ACTION_TOOLBAR::TOGGLE );
m_drawToolBar->Add( PL_ACTIONS::appendImportedWorksheet, ACTION_TOOLBAR::TOGGLE );
m_drawToolBar->Add( PL_ACTIONS::appendImportedDrawingSheet, ACTION_TOOLBAR::TOGGLE );
m_drawToolBar->AddScaledSeparator( this );
m_drawToolBar->Add( ACTIONS::deleteTool, ACTION_TOOLBAR::TOGGLE );

View File

@ -68,7 +68,7 @@ TOOL_ACTION PL_ACTIONS::move( "plEditor.InteractiveMove.move",
_( "Move" ), _( "Moves the selected item(s)" ),
BITMAPS::move, AF_ACTIVATE );
TOOL_ACTION PL_ACTIONS::appendImportedWorksheet( "plEditor.InteractiveEdit.appendWorksheet",
TOOL_ACTION PL_ACTIONS::appendImportedDrawingSheet( "plEditor.InteractiveEdit.appendWorksheet",
AS_GLOBAL, 0, "",
_( "Append Existing Drawing Sheet..." ),
_( "Append an existing drawing sheet file to current file" ),
@ -79,7 +79,7 @@ TOOL_ACTION PL_ACTIONS::appendImportedWorksheet( "plEditor.InteractiveEdit.appen
//
TOOL_ACTION PL_ACTIONS::showInspector( "plEditor.EditorControl.ShowInspector",
AS_GLOBAL, 0, "",
_( "Show Design Inspector" ), _( "Show the list of items in page layout" ),
_( "Show Design Inspector" ), _( "Show the list of items in the drawing sheet" ),
BITMAPS::spreadsheet );
TOOL_ACTION PL_ACTIONS::previewSettings( "plEditor.EditorControl.PreviewSettings",

View File

@ -63,7 +63,7 @@ public:
static TOOL_ACTION placeImage;
static TOOL_ACTION drawRectangle;
static TOOL_ACTION drawLine;
static TOOL_ACTION appendImportedWorksheet;
static TOOL_ACTION appendImportedDrawingSheet;
// Editing
static TOOL_ACTION move;

View File

@ -151,7 +151,7 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent )
// First click creates...
if( !item )
{
DS_DATA_ITEM* dataItem = m_frame->AddPageLayoutItem( type );
DS_DATA_ITEM* dataItem = m_frame->AddDrawingSheetItem( type );
if( dataItem ) // dataItem = nullptr can happens if the command was cancelled
{
@ -279,7 +279,7 @@ int PL_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
m_frame->SaveCopyInUndoList();
m_toolMgr->RunAction( PL_ACTIONS::clearSelection, true );
DS_DATA_ITEM* dataItem = m_frame->AddPageLayoutItem( type );
DS_DATA_ITEM* dataItem = m_frame->AddDrawingSheetItem( type );
dataItem->MoveToUi( (wxPoint) cursorPos );
item = dataItem->GetDrawItems()[0];

View File

@ -305,7 +305,7 @@ bool PL_EDIT_TOOL::updateModificationPoint( PL_SELECTION& aSelection )
}
int PL_EDIT_TOOL::ImportWorksheetContent( const TOOL_EVENT& aEvent )
int PL_EDIT_TOOL::ImportDrawingSheetContent( const TOOL_EVENT& aEvent )
{
m_toolMgr->RunAction( ACTIONS::cancelInteractive, true );
@ -517,7 +517,7 @@ void PL_EDIT_TOOL::setTransitions()
{
Go( &PL_EDIT_TOOL::Main, PL_ACTIONS::move.MakeEvent() );
Go( &PL_EDIT_TOOL::ImportWorksheetContent, PL_ACTIONS::appendImportedWorksheet.MakeEvent() );
Go( &PL_EDIT_TOOL::ImportDrawingSheetContent, PL_ACTIONS::appendImportedDrawingSheet.MakeEvent() );
Go( &PL_EDIT_TOOL::Undo, ACTIONS::undo.MakeEvent() );
Go( &PL_EDIT_TOOL::Redo, ACTIONS::redo.MakeEvent() );

View File

@ -55,7 +55,7 @@ public:
int Copy( const TOOL_EVENT& aEvent );
int Paste( const TOOL_EVENT& aEvent );
int ImportWorksheetContent( const TOOL_EVENT& aEvent );
int ImportDrawingSheetContent( const TOOL_EVENT& aEvent );
/**
* Delete the selected items, or the item under the cursor.

View File

@ -69,12 +69,12 @@ bool PCB_EDIT_FRAME::LoadProjectSettings()
PROJECT_FILE& project = Prj().GetProjectFile();
PROJECT_LOCAL_SETTINGS& localSettings = Prj().GetLocalSettings();
BASE_SCREEN::m_PageLayoutDescrFileName = project.m_BoardPageLayoutDescrFile;
BASE_SCREEN::m_DrawingSheetFileName = project.m_BoardDrawingSheetFile;
// Load the drawing sheet description file, from the filename stored in
// BASE_SCREEN::m_PageLayoutDescrFileName, read in config project file
// BASE_SCREEN::m_DrawingSheetFileName, read in config project file
// If empty, or not existing, the default descr is loaded
wxString filename = DS_DATA_MODEL::MakeFullFileName( BASE_SCREEN::m_PageLayoutDescrFileName,
wxString filename = DS_DATA_MODEL::MakeFullFileName( BASE_SCREEN::m_DrawingSheetFileName,
Prj().GetProjectPath() );
if( !DS_DATA_MODEL::GetTheInstance().LoadDrawingSheet( filename ) )
@ -166,7 +166,7 @@ void PCB_EDIT_FRAME::SaveProjectSettings()
PROJECT_LOCAL_SETTINGS& localSettings = Prj().GetLocalSettings();
// TODO: Can this be pulled out of BASE_SCREEN?
project.m_BoardPageLayoutDescrFile = BASE_SCREEN::m_PageLayoutDescrFileName;
project.m_BoardDrawingSheetFile = BASE_SCREEN::m_DrawingSheetFileName;
project.m_LayerPresets = m_appearancePanel->GetUserLayerPresets();

View File

@ -332,7 +332,7 @@ int BOARD_EDITOR_CONTROL::PageSettings( const TOOL_EVENT& aEvent )
DIALOG_PAGES_SETTINGS dlg( m_frame, IU_PER_MILS,
wxSize( MAX_PAGE_SIZE_PCBNEW_MILS, MAX_PAGE_SIZE_PCBNEW_MILS ) );
dlg.SetWksFileName( BASE_SCREEN::m_PageLayoutDescrFileName );
dlg.SetWksFileName( BASE_SCREEN::m_DrawingSheetFileName );
if( dlg.ShowModal() != wxID_OK )
m_frame->RollbackFromUndo();