KiCad PCB EDA Suite
sheet.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2004-2019 KiCad Developers, see change_log.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #include <fctsys.h>
26 #include <sch_draw_panel.h>
27 #include <confirm.h>
28 #include <kiface_i.h>
29 #include <project.h>
31 #include <tool/tool_manager.h>
32 #include <wx/clipbrd.h>
33 #include <sch_edit_frame.h>
34 #include <sch_legacy_plugin.h>
35 #include <sch_sheet.h>
36 #include <sch_sheet_path.h>
37 #include <sch_view.h>
40 #include <tool/actions.h>
41 
42 void SCH_EDIT_FRAME::InitSheet( SCH_SHEET* aSheet, const wxString& aNewFilename )
43 {
44  aSheet->SetScreen( new SCH_SCREEN( &Kiway() ) );
45  aSheet->GetScreen()->SetModify();
47  aSheet->GetScreen()->SetFileName( aNewFilename );
48 }
49 
50 
52  const wxString& aExistingFilename )
53 {
54  SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_LEGACY ) );
55 
56  wxFileName fileName( aExistingFilename );
57 
58  if( !fileName.IsAbsolute() )
59  {
60  const SCH_SCREEN* currentScreen = aHierarchy->LastScreen();
61  wxFileName currentSheetFileName = currentScreen->GetFileName();
62  fileName.Normalize( wxPATH_NORM_ALL, currentSheetFileName.GetPath() );
63  }
64 
65  wxString fullFilename = fileName.GetFullPath();
66 
67  try
68  {
69  pi->Load( fullFilename, &Kiway(), aSheet );
70 
71  if( !pi->GetError().IsEmpty() )
72  {
73  DisplayErrorMessage( this, _( "The entire schematic could not be loaded.\n"
74  "Errors occurred loading hierarchical sheets." ),
75  pi->GetError() );
76  }
77  }
78  catch( const IO_ERROR& ioe )
79  {
80  wxString msg;
81 
82  msg.Printf( _( "Error occurred loading schematic file \"%s\"." ), fullFilename );
83  DisplayErrorMessage( this, msg, ioe.What() );
84 
85  msg.Printf( _( "Failed to load schematic \"%s\"" ), fullFilename );
86  AppendMsgPanel( wxEmptyString, msg, CYAN );
87 
88  return;
89  }
90 
91  SCH_SCREEN* screen = aSheet->GetScreen();
92 
93  if( screen )
94  screen->UpdateSymbolLinks( true );
95 }
96 
97 
99  bool* aClearAnnotationNewItems )
100 {
101  if( aSheet == NULL || aHierarchy == NULL )
102  return false;
103 
104  SCH_SHEET_LIST hierarchy( g_RootSheet ); // This is the schematic sheet hierarchy.
105 
106  // Get the new texts
107  DIALOG_SCH_SHEET_PROPS dlg( this, aSheet );
108 
109  if( dlg.ShowModal() == wxID_CANCEL )
110  return false;
111 
112  wxFileName fileName = dlg.GetFileName();
113  fileName.SetExt( SchematicFileExtension );
114 
115  wxString msg;
116  bool loadFromFile = false;
117  bool clearAnnotation = false;
118  SCH_SCREEN* useScreen = NULL;
119 
120  // Relative file names are relative to the path of the current sheet. This allows for
121  // nesting of schematic files in subfolders.
122  if( !fileName.IsAbsolute() )
123  {
124  const SCH_SCREEN* currentScreen = aHierarchy->LastScreen();
125 
126  wxCHECK_MSG( currentScreen, false, "Invalid sheet path object." );
127 
128  wxFileName currentSheetFileName = currentScreen->GetFileName();
129 
130  wxCHECK_MSG( fileName.Normalize( wxPATH_NORM_ALL, currentSheetFileName.GetPath() ), false,
131  "Cannot normalize new sheet schematic file path." );
132  }
133 
134  wxString newFilename = fileName.GetFullPath( wxPATH_UNIX );
135 
136  // Search for a schematic file having the same filename already in use in the hierarchy
137  // or on disk, in order to reuse it.
138  if( !g_RootSheet->SearchHierarchy( newFilename, &useScreen ) )
139  {
140  loadFromFile = wxFileExists( newFilename );
141  wxLogDebug( "Sheet requested file \"%s\", %s",
142  newFilename,
143  ( loadFromFile ) ? "found" : "not found" );
144  }
145 
146  // Inside Eeschema, filenames are stored using unix notation
147  newFilename.Replace( wxT( "\\" ), wxT( "/" ) );
148 
149  if( aSheet->GetScreen() == NULL ) // New sheet.
150  {
151  if( useScreen || loadFromFile ) // Load from existing file.
152  {
153  clearAnnotation = true;
154 
155  wxString existsMsg;
156  wxString linkMsg;
157  existsMsg.Printf( _( "\"%s\" already exists." ), fileName.GetFullName() );
158  linkMsg.Printf( _( "Link \"%s\" to this file?" ), dlg.GetSheetName() );
159  msg.Printf( wxT( "%s\n\n%s" ), existsMsg, linkMsg );
160 
161  if( !IsOK( this, msg ) )
162  return false;
163 
164  }
165  else // New file.
166  {
167  InitSheet( aSheet, newFilename );
168  }
169  }
170  else // Existing sheet.
171  {
172  bool isUndoable = true;
173  bool renameFile = false;
174  wxString replaceMsg;
175  wxString newMsg;
176  wxString noUndoMsg;
177 
178  // Changing the filename of a sheet can modify the full hierarchy structure
179  // and can be not always undoable.
180  // So prepare messages for user notifications:
181  replaceMsg.Printf( _( "Change \"%s\" link from \"%s\" to \"%s\"?" ),
182  dlg.GetSheetName(), aSheet->GetFileName(), fileName.GetFullName() );
183  newMsg.Printf( _( "Create new file \"%s\" with contents of \"%s\"?" ),
184  fileName.GetFullName(), aSheet->GetFileName() );
185  noUndoMsg = _( "This action cannot be undone." );
186 
187  // We are always using here a case insensitive comparison
188  // to avoid issues under Windows, although under Unix
189  // filenames are case sensitive.
190  // But many users create schematic under both Unix and Windows
191  // **
192  // N.B. 1: aSheet->GetFileName() will return a relative path
193  // aSheet->GetScreen()->GetFileName() returns a full path
194  //
195  // N.B. 2: newFilename uses the unix notation for separator.
196  // so we must use it also to compare the old filename to the new filename
197  wxString oldFilename = aSheet->GetScreen()->GetFileName();
198  oldFilename.Replace( wxT( "\\" ), wxT( "/" ) );
199 
200  if( newFilename.CmpNoCase( oldFilename ) != 0 )
201  {
202  // Sheet file name changes cannot be undone.
203  isUndoable = false;
204 
205  if( useScreen || loadFromFile ) // Load from existing file.
206  {
207  clearAnnotation = true;
208 
209  msg.Printf( wxT( "%s\n\n%s" ), replaceMsg, noUndoMsg );
210 
211  if( !IsOK( this, msg ) )
212  return false;
213 
214  if( loadFromFile )
215  aSheet->SetScreen( NULL );
216  }
217  else // Save to new file name.
218  {
219  if( aSheet->GetScreenCount() > 1 )
220  {
221  msg.Printf( wxT( "%s\n\n%s" ), newMsg, noUndoMsg );
222 
223  if( !IsOK( this, msg ) )
224  return false;
225  }
226 
227  renameFile = true;
228  }
229  }
230 
231  if( isUndoable )
232  SaveCopyInUndoList( aSheet, UR_CHANGED );
233 
234  if( renameFile )
235  {
236  SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_LEGACY ) );
237 
238  // If the the associated screen is shared by more than one sheet, do not
239  // change the filename of the corresponding screen here.
240  // (a new screen will be created later)
241  // if it is not shared, update the filename
242  if( aSheet->GetScreenCount() <= 1 )
243  aSheet->GetScreen()->SetFileName( newFilename );
244 
245  try
246  {
247  pi->Save( newFilename, aSheet->GetScreen(), &Kiway() );
248  }
249  catch( const IO_ERROR& ioe )
250  {
251  msg.Printf( _( "Error occurred saving schematic file \"%s\"." ), newFilename );
252  DisplayErrorMessage( this, msg, ioe.What() );
253 
254  msg.Printf( _( "Failed to save schematic \"%s\"" ), newFilename );
255  AppendMsgPanel( wxEmptyString, msg, CYAN );
256 
257  return false;
258  }
259 
260  // If the the associated screen is shared by more than one sheet, remove the
261  // screen and reload the file to a new screen. Failure to do this will trash
262  // the screen reference counting in complex hierarchies.
263  if( aSheet->GetScreenCount() > 1 )
264  {
265  aSheet->SetScreen( NULL );
266  loadFromFile = true;
267  }
268  }
269  }
270 
271  wxFileName userFileName = dlg.GetFileName();
272  userFileName.SetExt( SchematicFileExtension );
273  aSheet->SetFileName( userFileName.GetFullPath( wxPATH_UNIX ) );
274 
275  if( useScreen )
276  {
277  aSheet->SetScreen( useScreen );
278  }
279  else if( loadFromFile )
280  {
281  LoadSheetFromFile( aSheet, aHierarchy, newFilename );
282  }
283 
284  aSheet->SetFileNameSize( dlg.GetFileNameTextSize() );
285  aSheet->SetName( dlg.GetSheetName() );
286  aSheet->SetSheetNameSize( dlg.GetSheetNameTextSize() );
287 
288  if( aSheet->GetName().IsEmpty() )
289  aSheet->SetName( wxString::Format( wxT( "Sheet%8.8lX" ),
290  (long unsigned) aSheet->GetTimeStamp() ) );
291 
292  // Make sure the sheet changes do not cause any recursion.
293  SCH_SHEET_LIST sheetHierarchy( aSheet );
294 
295  // Make sure files have fully qualified path and file name.
296  wxFileName destFn = aHierarchy->Last()->GetFileName();
297 
298  if( destFn.IsRelative() )
299  destFn.MakeAbsolute( Prj().GetProjectPath() );
300 
301  if( hierarchy.TestForRecursion( sheetHierarchy, destFn.GetFullPath( wxPATH_UNIX ) ) )
302  {
303  msg.Printf( _( "The sheet changes cannot be made because the destination sheet already "
304  "has the sheet \"%s\" or one of it's subsheets as a parent somewhere in "
305  "the schematic hierarchy." ),
306  newFilename );
307  DisplayError( this, msg );
308  return false;
309  }
310 
311  // Check to make sure the symbols have been remapped to the symbol library table.
312  SCH_SCREENS newScreens( aSheet );
313 
314  if( newScreens.HasNoFullyDefinedLibIds() )
315  {
316  msg.Printf(_( "The schematic \"%s\" has not been remapped to the symbol\nlibrary table. "
317  " The project this schematic belongs to must first be remapped\nbefore it "
318  "can be imported into the current project." ), fileName.GetFullName() );
319 
320  DisplayInfoMessage( this, msg );
321  return false;
322  }
323 
324  if( aClearAnnotationNewItems )
325  *aClearAnnotationNewItems = clearAnnotation;
326 
327  GetCanvas()->GetView()->Update( aSheet );
328 
329  OnModify();
330 
331  return true;
332 }
333 
334 
338 
340 {
341  // Delayed initialization (need the preferences to be loaded)
342  if( m_lastSheetPinTextSize.x == -1 )
343  {
346  }
347  return m_lastSheetPinTextSize;
348 }
349 
350 
352 {
353  wxString text;
354  SCH_SHEET_PIN* sheetPin;
355 
356  if( aLabel )
357  {
358  text = aLabel->GetText();
359  m_lastSheetPinType = aLabel->GetShape();
360  }
361 
362  sheetPin = new SCH_SHEET_PIN( aSheet, wxPoint( 0, 0 ), text );
363  sheetPin->SetFlags( IS_NEW );
364  sheetPin->SetTextSize( GetLastSheetPinTextSize() );
365  sheetPin->SetShape( m_lastSheetPinType );
366 
367  if( !aLabel )
368  {
369  DIALOG_SCH_EDIT_SHEET_PIN dlg( this, sheetPin );
370 
371  if( dlg.ShowModal() != wxID_OK || sheetPin->GetText().IsEmpty() )
372  {
373  delete sheetPin;
374  return nullptr;
375  }
376  }
377 
378  m_lastSheetPinType = sheetPin->GetShape();
379  m_lastSheetPinTextSize = sheetPin->GetTextSize();
380 
381  sheetPin->SetPosition( (wxPoint) GetCanvas()->GetViewControls()->GetCursorPosition() );
382 
383  return sheetPin;
384 }
385 
386 
388 {
389  if( !aSheet->GetScreen() )
390  return NULL;
391 
392  for( EDA_ITEM* item = aSheet->GetScreen()->GetDrawItems(); item != NULL; item = item->Next() )
393  {
394  if( item->Type() != SCH_HIER_LABEL_T )
395  continue;
396 
397  SCH_HIERLABEL* label = (SCH_HIERLABEL*) item;
398 
399  /* A global label has been found: check if there a corresponding sheet label. */
400  if( !aSheet->HasPin( label->GetText() ) )
401  return label;
402  }
403 
404  return nullptr;
405 }
406 
407 
408 /*
409  * Copy the current page or block to the clipboard, to export drawings to other applications
410  * (word processing ...) This is not suitable for copy command within Eeschema or Pcbnew.
411  */
413 {
414  wxRect DrawArea;
415  BASE_SCREEN* screen = GetScreen();
416 
417  DrawArea.SetSize( GetPageSizeIU() );
418 
419  // Calculate a reasonable dc size, in pixels, and the dc scale to fit
420  // the drawings into the dc size
421  // scale is the ratio resolution (in PPI) / internal units
422  double ppi = 300; // Use 300 pixels per inch to create bitmap images on start
423  double inch2Iu = 1000.0 * IU_PER_MILS;
424  double scale = ppi / inch2Iu;
425 
426  wxSize dcsize = DrawArea.GetSize();
427 
428  int maxdim = std::max( dcsize.x, dcsize.y );
429 
430  // the max size in pixels of the bitmap used to byuild the sheet copy
431  const int maxbitmapsize = 3000;
432 
433  while( int( maxdim * scale ) > maxbitmapsize )
434  {
435  ppi = ppi / 1.5;
436  scale = ppi / inch2Iu;
437  }
438 
439  dcsize.x *= scale;
440  dcsize.y *= scale;
441 
442  // Set draw offset, zoom... to values needed to draw in the memory DC
443  // after saving initial values:
444  wxPoint tmp_startvisu = screen->m_StartVisu;
445  double tmpzoom = screen->GetZoom();
446  wxPoint old_org = screen->m_DrawOrg;
447  screen->m_DrawOrg.x = screen->m_DrawOrg.y = 0;
448  screen->m_StartVisu.x = screen->m_StartVisu.y = 0;
449 
450  screen->SetZoom( 1 ); // we use zoom = 1 in draw functions.
451 
452  wxMemoryDC dc;
453  wxBitmap image( dcsize );
454  dc.SelectObject( image );
455 
456  GRResetPenAndBrush( &dc );
457  GRForceBlackPen( false );
458  screen->m_IsPrinting = true;
459  dc.SetUserScale( scale, scale );
460 
461  dc.Clear();
462  PrintPage( &dc );
463  screen->m_IsPrinting = false;
464 
465  if( wxTheClipboard->Open() )
466  {
467  // This data objects are held by the clipboard, so do not delete them in the app.
468  wxBitmapDataObject* clipbrd_data = new wxBitmapDataObject( image );
469  wxTheClipboard->SetData( clipbrd_data );
470  wxTheClipboard->Close();
471  }
472 
473  // Deselect Bitmap from DC in order to delete the MemoryDC
474  dc.SelectObject( wxNullBitmap );
475 
476  GRForceBlackPen( false );
477 
478  screen->m_StartVisu = tmp_startvisu;
479  screen->m_DrawOrg = old_org;
480  screen->SetZoom( tmpzoom );
481 }
482 
483 
Class SCH_SHEET_LIST.
KIGFX::SCH_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
void GRResetPenAndBrush(wxDC *DC)
Definition: gr_basic.cpp:120
void SetShape(PINSHEETLABEL_SHAPE aShape)
Definition: sch_text.h:123
const wxString & GetFileName() const
Definition: sch_screen.h:118
void SetFileNameSize(int aSize)
Definition: sch_sheet.h:266
bool SearchHierarchy(const wxString &aFilename, SCH_SCREEN **aScreen)
Search the existing hierarchy for an instance of screen loaded from aFileName.
Definition: sch_sheet.cpp:541
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_holder.h:56
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:258
SCH_SHEET * Last() const
Function Last returns a pointer to the last sheet of the list One can see the others sheet as the "pa...
This file is part of the common library.
void SetFileName(const wxString &aFilename)
Definition: sch_sheet.h:454
SCH_ITEM * Next() const
Definition: sch_item.h:153
double GetZoom() const
Function GetZoom returns the current "zoom factor", which is a measure of "internal units per device ...
Definition: base_screen.h:240
static wxSize m_lastSheetPinTextSize
Last sheet pin text size.
void UpdateSymbolLinks(bool aForce=false)
Initialize or reinitialize the weak reference to the LIB_PART for each SCH_COMPONENT found in m_drawL...
Definition: sch_screen.cpp:499
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
Definition: sch_sheet.cpp:104
void InitSheet(SCH_SHEET *aSheet, const wxString &aNewFilename)
Definition: sheet.cpp:42
void DrawCurrentSheetToClipboard()
Use the wxWidgets print code to draw an image of the current sheet onto the clipboard.
Definition: sheet.cpp:412
void SetTextSize(const wxSize &aNewSize)
Definition: eda_text.h:208
SCH_SCREEN * GetScreen()
Definition: sch_sheet.h:268
bool EditSheet(SCH_SHEET *aSheet, SCH_SHEET_PATH *aHierarchy, bool *aClearAnnotationNewItems)
Edit an existing sheet or add a new sheet to the schematic.
Definition: sheet.cpp:98
const wxSize GetPageSizeIU() const override
Works off of GetPageSettings() to return the size of the paper page in the internal units of this par...
Subclass of DIALOG_SCH_EDIT_SHEET_PIN_BASE, which is generated by wxFormBuilder.
#define IS_NEW
New item, just created.
Definition: base_struct.h:107
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
int GetScreenCount() const
Return the number of times the associated screen for the sheet is being used.
Definition: sch_sheet.cpp:127
wxPoint m_StartVisu
Coordinates in drawing units of the current view position (upper left corner of device)
Definition: base_screen.h:117
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:252
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:47
wxString GetName() const
Definition: sch_sheet.h:259
static PINSHEETLABEL_SHAPE m_lastSheetPinType
Last sheet pin type.
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
void GRForceBlackPen(bool flagforce)
Function GRForceBlackPen.
Definition: gr_basic.cpp:201
void SetSheetNameSize(int aSize)
Definition: sch_sheet.h:263
void SetName(const wxString &aName)
Definition: sch_sheet.h:260
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:74
const wxSize & GetTextSize() const
Definition: eda_text.h:209
const std::string SchematicFileExtension
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: colors.h:59
void SaveCopyInUndoList(SCH_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, bool aAppend=false, const wxPoint &aTransformPoint=wxPoint(0, 0))
Create a copy of the current schematic item, and put it in the undo list.
Definition of file extensions used in Kicad.
timestamp_t GetTimeStamp() const
Definition: base_struct.h:203
const wxSize & GetLastSheetPinTextSize()
Initializing accessor for the pin text size.
Definition: sheet.cpp:339
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:75
bool HasNoFullyDefinedLibIds()
Test all of the schematic symbols to see if all LIB_ID objects library nickname is not set.
virtual bool SetZoom(double iu_per_du)
Function SetZoom adjusts the current zoom factor.
Definition: base_screen.cpp:86
int m_UndoRedoCountMax
default Undo/Redo command Max depth, to be handed
Class SCH_SHEET_PATH.
virtual void Update(VIEW_ITEM *aItem, int aUpdateFlags)
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1539
#define _(s)
bool m_IsPrinting
Definition: base_screen.h:139
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:201
wxString GetFileName(void) const
Return the filename corresponding to this sheet.
Definition: sch_sheet.cpp:628
Helper object to release a SCH_PLUGIN in the context of a potential thrown exception through its dest...
Definition: sch_io_mgr.h:520
void AppendMsgPanel(const wxString &textUpper, const wxString &textLower, COLOR4D color, int pad=6)
Append a message to the message panel.
void SetPosition(const wxPoint &aPosition) override
Function SetPosition set the schematic item position to aPosition.
Definition: sch_sheet.h:187
virtual void PrintPage(wxDC *aDC) override
Plot or print the current sheet to the clipboard.
void LoadSheetFromFile(SCH_SHEET *aSheet, SCH_SHEET_PATH *aHierarchy, const wxString &aExistingFilename)
Definition: sheet.cpp:51
PINSHEETLABEL_SHAPE
Definition: sch_text.h:47
const int scale
SCH_HIERLABEL * ImportHierLabel(SCH_SHEET *aSheet)
Import a hierarchical label with no attached sheet pin.
Definition: sheet.cpp:387
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
#define max(a, b)
Definition: auxiliary.h:86
Implementing DIALOG_SCH_SHEET_PROPS_BASE.
wxPoint m_DrawOrg
offsets for drawing the circuit on the screen
Definition: base_screen.h:112
void SetMaxUndoItems(int aMax)
Definition: base_screen.h:213
#define IU_PER_MILS
Definition: plotter.cpp:134
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:150
bool HasPin(const wxString &aName)
Checks if the sheet already has a sheet pin named aName.
Definition: sch_sheet.cpp:209
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
void SetFileName(const wxString &aFileName)
Definition: sch_screen.h:116
void SetModify()
Definition: base_screen.h:224
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
static wxPoint m_lastSheetPinPosition
Last sheet pin position.
bool TestForRecursion(const SCH_SHEET_LIST &aSrcSheetHierarchy, const wxString &aDestFileName) const
Function TestForRecursion.
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
Definition: confirm.cpp:276
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:243
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:294
SCH_SHEET_PIN * CreateSheetPin(SCH_SHEET *aSheet, SCH_HIERLABEL *aLabel)
Create a new SCH_SHEET_PIN object and add it to aSheet at the current cursor position.
Definition: sheet.cpp:351
virtual const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:124
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:486
SCH_SCREEN * LastScreen() const
Function LastScreen.
int GetDefaultTextSize()
Default size for text in general.
PINSHEETLABEL_SHAPE GetShape() const
Definition: sch_text.h:121
SCH_ITEM * GetDrawItems() const
Definition: sch_screen.h:147