Added GetBoundingBox() for DrawSheetStruct. Minor beautification.
This commit is contained in:
parent
6d5a764e04
commit
cc103ad317
|
@ -262,6 +262,20 @@ void DrawSheetStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& of
|
|||
}
|
||||
}
|
||||
|
||||
EDA_Rect DrawSheetStruct::GetBoundingBox(){
|
||||
int dx, dy;
|
||||
// Determine length of texts
|
||||
wxString Text1 = wxT( "Sheet: " ) + m_SheetName;
|
||||
wxString Text2 = wxT( "File: " ) + m_FileName;
|
||||
int textlen1 = 10 * Text1.Len() * m_SheetNameSize / 9;
|
||||
int textlen2 = 10 * Text2.Len() * m_FileNameSize / 9;
|
||||
textlen1 = MAX(textlen1, textlen2);
|
||||
dx = MAX(m_Size.x, textlen1 );
|
||||
dy = m_Size.y+m_SheetNameSize+m_FileNameSize+16;
|
||||
|
||||
EDA_Rect box(wxPoint(m_Pos.x,m_Pos.y-m_SheetNameSize-8), wxSize(dx,dy) );
|
||||
return box;
|
||||
}
|
||||
|
||||
/**************************************************************************************/
|
||||
void DrawSheetStruct::DeleteAnnotation( bool recurse )
|
||||
|
|
|
@ -130,6 +130,7 @@ public:
|
|||
void CleanupSheet( WinEDA_SchematicFrame* frame, wxDC* DC );
|
||||
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
|
||||
int draw_mode, int Color = -1 );
|
||||
EDA_Rect GetBoundingBox();
|
||||
void SwapData( DrawSheetStruct* copyitem );
|
||||
void DeleteAnnotation( bool recurse );
|
||||
int ComponentCount();
|
||||
|
@ -137,9 +138,9 @@ public:
|
|||
bool SearchHierarchy( wxString filename, SCH_SCREEN** screen );
|
||||
bool LocatePathOfScreen( SCH_SCREEN* screen, DrawSheetPath* list );
|
||||
int CountSheets();
|
||||
wxString GetFileName(void);
|
||||
void SetFileName(const wxString & aFilename); // Set a new filename without changing anything else
|
||||
bool ChangeFileName(WinEDA_SchematicFrame * aFrame, const wxString & aFileName); // Set a new filename and manage data and associated screen
|
||||
wxString GetFileName(void);
|
||||
void SetFileName(const wxString & aFilename); // Set a new filename without changing anything else
|
||||
bool ChangeFileName(WinEDA_SchematicFrame * aFrame, const wxString & aFileName); // Set a new filename and manage data and associated screen
|
||||
|
||||
//void RemoveSheet(DrawSheetStruct* sheet);
|
||||
//to remove a sheet, just delete it
|
||||
|
|
Loading…
Reference in New Issue