Commit 1047e60e authored by Wayne Stambaugh's avatar Wayne Stambaugh

Encapsulate SCH_POLYLINE, SCH_SHEET, and SCH_TEXT classes.

parent eb52f4ba
/////////////////////////////////////////////////////////////////////////////
// Name: build_BOM.cpp
// Author: jean-pierre Charras
// License: GPL license
/////////////////////////////////////////////////////////////////////////////
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file build_BOM.cpp
* @brief Code used to generate bill of materials.
*/
#include <algorithm> // to use sort vector
#include <vector>
......@@ -159,7 +183,7 @@ int PrintListeGLabel( FILE* f, LABEL_OBJECT_LIST& aList )
case SCH_SHEET_PIN_T:
{
pinsheet = (SCH_SHEET_PIN*) aList[ii].m_Label;
int jj = pinsheet->m_Shape;
int jj = pinsheet->GetShape();
if( jj < 0 )
jj = NET_TMAX;
......
......@@ -424,18 +424,18 @@ void SCH_EDIT_FRAME::DeleteCurrentSegment( wxDC* DC )
endpos = screen->GetCrossHairPosition();
int idx = polyLine->GetCornerCount() - 1;
wxPoint pt = (*polyLine)[idx];
if( g_HVLines )
{
/* Coerce the line to vertical or horizontal one: */
if( ABS( endpos.x - polyLine->m_PolyPoints[idx].x ) <
ABS( endpos.y - polyLine->m_PolyPoints[idx].y ) )
endpos.x = polyLine->m_PolyPoints[idx].x;
if( ABS( endpos.x - pt.x ) < ABS( endpos.y - pt.y ) )
endpos.x = pt.x;
else
endpos.y = polyLine->m_PolyPoints[idx].y;
endpos.y = pt.y;
}
polyLine->m_PolyPoints[idx] = endpos;
polyLine->SetPoint( idx, endpos );
polyLine->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
}
else
......
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_edit_label.cpp
// Author: jean-pierre Charras
// Modified by:
// Created: 18/12/2008 15:46:26
// Licence: GPL
/////////////////////////////////////////////////////////////////////////////
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2008 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file sch_text.h
* @brief Implementation of the label properties dialog.
*/
#include "fctsys.h"
#include "wx/valgen.h"
......@@ -98,6 +120,7 @@ void DialogLabelEditor::InitDialog()
int MINTEXTWIDTH = 40; // M's are big characters, a few establish a lot of width
int max_len = 0;
if ( !multiLine )
{
max_len =m_CurrentText->m_Text.Length();
......@@ -108,6 +131,7 @@ void DialogLabelEditor::InitDialog()
// we cannot use the length of the entire text that has no meaning
int curr_len = MINTEXTWIDTH;
int imax = m_CurrentText->m_Text.Len();
for( int count = 0; count < imax; count++ )
{
if( m_CurrentText->m_Text[count] == '\n' ||
......@@ -118,11 +142,13 @@ void DialogLabelEditor::InitDialog()
else
{
curr_len++;
if ( max_len < curr_len )
max_len = curr_len;
}
}
}
if( max_len < MINTEXTWIDTH )
max_len = MINTEXTWIDTH;
......@@ -132,11 +158,13 @@ void DialogLabelEditor::InitDialog()
// Set validators
m_TextOrient->SetSelection( m_CurrentText->GetOrientation() );
m_TextShape->SetSelection( m_CurrentText->m_Shape );
m_TextShape->SetSelection( m_CurrentText->GetShape() );
int style = 0;
if( m_CurrentText->m_Italic )
style = 1;
if( m_CurrentText->m_Bold )
style += 2;
......@@ -203,6 +231,7 @@ void DialogLabelEditor::TextPropertiesAccept( wxCommandEvent& aEvent )
m_Parent->DrawPanel->RefreshDrawingRect( m_CurrentText->GetBoundingBox() );
text = m_textLabel->GetValue();
if( !text.IsEmpty() )
m_CurrentText->m_Text = text;
else if( (m_CurrentText->m_Flags & IS_NEW) == 0 )
......@@ -212,10 +241,12 @@ void DialogLabelEditor::TextPropertiesAccept( wxCommandEvent& aEvent )
text = m_TextSize->GetValue();
value = ReturnValueFromString( g_UserUnit, text, m_Parent->m_InternalUnits );
m_CurrentText->m_Size.x = m_CurrentText->m_Size.y = value;
if( m_TextShape )
m_CurrentText->m_Shape = m_TextShape->GetSelection();
m_CurrentText->SetShape( m_TextShape->GetSelection() );
int style = m_TextStyle->GetSelection();
if( ( style & 1 ) )
m_CurrentText->m_Italic = 1;
else
......
......@@ -87,12 +87,12 @@ SCH_TEXT* SCH_EDIT_FRAME::CreateNewText( wxDC* aDC, int aType )
case LAYER_HIERLABEL:
textItem = new SCH_HIERLABEL( GetScreen()->GetCrossHairPosition() );
textItem->m_Shape = lastGlobalLabelShape;
textItem->SetShape( lastGlobalLabelShape );
break;
case LAYER_GLOBLABEL:
textItem = new SCH_GLOBALLABEL( GetScreen()->GetCrossHairPosition() );
textItem->m_Shape = lastGlobalLabelShape;
textItem->SetShape( lastGlobalLabelShape );
break;
default:
......@@ -121,7 +121,7 @@ SCH_TEXT* SCH_EDIT_FRAME::CreateNewText( wxDC* aDC, int aType )
if( (aType == SCH_GLOBAL_LABEL_T) || (aType == SCH_HIERARCHICAL_LABEL_T) )
{
lastGlobalLabelShape = textItem->m_Shape;
lastGlobalLabelShape = textItem->GetShape();
}
textItem->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
......@@ -207,7 +207,7 @@ void SCH_EDIT_FRAME::OnConvertTextType( wxCommandEvent& aEvent )
* text item type.
*/
newtext->SetFlags( text->GetFlags() );
newtext->m_Shape = text->m_Shape;
newtext->SetShape( text->GetShape() );
newtext->SetOrientation( text->GetOrientation() );
newtext->m_Size = text->m_Size;
newtext->m_Thickness = text->m_Thickness;
......
......@@ -197,8 +197,8 @@ int TestDuplicateSheetNames( bool aCreateMarker )
continue;
// We have found a second sheet: compare names
if( ( (SCH_SHEET*) item )->m_SheetName.CmpNoCase(
( ( SCH_SHEET* ) test_item )-> m_SheetName ) == 0 )
if( ( (SCH_SHEET*) item )->GetName().CmpNoCase(
( ( SCH_SHEET* ) test_item )->GetName() ) == 0 )
{
if( aCreateMarker )
{
......@@ -206,9 +206,9 @@ int TestDuplicateSheetNames( bool aCreateMarker )
SCH_MARKER* marker = new SCH_MARKER();
marker->m_TimeStamp = GetNewTimeStamp();
marker->SetData( ERCE_DUPLICATE_SHEET_NAME,
( (SCH_SHEET*) test_item )->m_Pos,
( (SCH_SHEET*) test_item )->GetPosition(),
_( "Duplicate sheet name" ),
( (SCH_SHEET*) test_item )->m_Pos );
( (SCH_SHEET*) test_item )->GetPosition() );
marker->SetMarkerType( MARK_ERC );
marker->SetErrorLevel( ERR );
marker->SetNext( screen->GetDrawItems() );
......
......@@ -197,7 +197,7 @@ void HIERARCHY_NAVIG_DLG::BuildSheetsTree( SCH_SHEET_PATH* list, wxTreeItemId*
{
SCH_SHEET* sheet = (SCH_SHEET*) schitem;
m_nbsheets++;
menu = m_Tree->AppendItem( *previousmenu, sheet->m_SheetName, 0, 1 );
menu = m_Tree->AppendItem( *previousmenu, sheet->GetName(), 0, 1 );
list->Push( sheet );
m_Tree->SetItemData( menu, new TreeItemData( *list ) );
int ll = m_Tree->GetItemText( menu ).Len();
......
/**********************/
/* Class SCH_POLYLINE */
/**********************/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file sch_polyline.cpp
*/
#include "fctsys.h"
#include "gr_basic.h"
......@@ -18,7 +43,7 @@
SCH_POLYLINE::SCH_POLYLINE( int layer ) :
SCH_ITEM( NULL, SCH_POLYLINE_T )
{
m_Width = 0;
m_width = 0;
switch( layer )
{
......@@ -38,8 +63,8 @@ SCH_POLYLINE::SCH_POLYLINE( int layer ) :
SCH_POLYLINE::SCH_POLYLINE( const SCH_POLYLINE& aPolyLine ) :
SCH_ITEM( aPolyLine )
{
m_Width = aPolyLine.m_Width;
m_PolyPoints = aPolyLine.m_PolyPoints;
m_width = aPolyLine.m_width;
m_points = aPolyLine.m_points;
}
......@@ -74,7 +99,7 @@ bool SCH_POLYLINE::Save( FILE* aFile ) const
for( unsigned ii = 0; ii < GetCornerCount(); ii++ )
{
if( fprintf( aFile, "\t%-4d %-4d\n", m_PolyPoints[ii ].x, m_PolyPoints[ii].y ) == EOF )
if( fprintf( aFile, "\t%-4d %-4d\n", m_points[ii ].x, m_points[ii].y ) == EOF )
{
success = false;
break;
......@@ -133,7 +158,7 @@ bool SCH_POLYLINE::Load( LINE_READER& aLine, wxString& aErrorMsg )
int SCH_POLYLINE::GetPenSize() const
{
int pensize = ( m_Width == 0 ) ? g_DrawDefaultLineThickness : m_Width;
int pensize = ( m_width == 0 ) ? g_DrawDefaultLineThickness : m_width;
return pensize;
}
......@@ -157,19 +182,19 @@ void SCH_POLYLINE::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffs
width *= 3;
}
GRMoveTo( m_PolyPoints[0].x, m_PolyPoints[0].y );
GRMoveTo( m_points[0].x, m_points[0].y );
if( m_Layer == LAYER_NOTES )
{
for( unsigned i = 1; i < GetCornerCount(); i++ )
GRDashedLineTo( &aPanel->m_ClipBox, aDC, m_PolyPoints[i].x + aOffset.x,
m_PolyPoints[i].y + aOffset.y, width, color );
GRDashedLineTo( &aPanel->m_ClipBox, aDC, m_points[i].x + aOffset.x,
m_points[i].y + aOffset.y, width, color );
}
else
{
for( unsigned i = 1; i < GetCornerCount(); i++ )
GRLineTo( &aPanel->m_ClipBox, aDC, m_PolyPoints[i].x + aOffset.x,
m_PolyPoints[i].y + aOffset.y, width, color );
GRLineTo( &aPanel->m_ClipBox, aDC, m_points[i].x + aOffset.x,
m_points[i].y + aOffset.y, width, color );
}
}
......@@ -178,9 +203,9 @@ void SCH_POLYLINE::Mirror_X( int aXaxis_position )
{
for( unsigned ii = 0; ii < GetCornerCount(); ii++ )
{
m_PolyPoints[ii].y -= aXaxis_position;
NEGATE( m_PolyPoints[ii].y );
m_PolyPoints[ii].y = aXaxis_position;
m_points[ii].y -= aXaxis_position;
NEGATE( m_points[ii].y );
m_points[ii].y = aXaxis_position;
}
}
......@@ -189,9 +214,9 @@ void SCH_POLYLINE::Mirror_Y( int aYaxis_position )
{
for( unsigned ii = 0; ii < GetCornerCount(); ii++ )
{
m_PolyPoints[ii].x -= aYaxis_position;
NEGATE( m_PolyPoints[ii].x );
m_PolyPoints[ii].x = aYaxis_position;
m_points[ii].x -= aYaxis_position;
NEGATE( m_points[ii].x );
m_points[ii].x = aYaxis_position;
}
}
......@@ -200,7 +225,7 @@ void SCH_POLYLINE::Rotate( wxPoint rotationPoint )
{
for( unsigned ii = 0; ii < GetCornerCount(); ii++ )
{
RotatePoint( &m_PolyPoints[ii], rotationPoint, 900 );
RotatePoint( &m_points[ii], rotationPoint, 900 );
}
}
......@@ -227,7 +252,7 @@ wxString SCH_POLYLINE::GetSelectMenuText() const
fmt = _( "Polyline on Unkown Layer with %d Points" );
}
menuText.Printf( fmt, m_PolyPoints.size() );
menuText.Printf( fmt, m_points.size() );
return menuText;
}
......@@ -246,9 +271,9 @@ BITMAP_DEF SCH_POLYLINE::GetMenuImage() const
bool SCH_POLYLINE::doHitTest( const wxPoint& aPoint, int aAccuracy ) const
{
for( size_t i = 0; i < m_PolyPoints.size() - 1; i++ )
for( size_t i = 0; i < m_points.size() - 1; i++ )
{
if( TestSegmentHit( aPoint, m_PolyPoints[i], m_PolyPoints[i + 1], aAccuracy ) )
if( TestSegmentHit( aPoint, m_points[i], m_points[i + 1], aAccuracy ) )
return true;
}
......@@ -271,9 +296,9 @@ bool SCH_POLYLINE::doHitTest( const EDA_RECT& aRect, bool aContained, int aAccur
void SCH_POLYLINE::doSetPosition( const wxPoint& aPosition )
{
wxPoint offset = m_PolyPoints[0] - aPosition;
wxPoint offset = m_points[0] - aPosition;
for( size_t i = 0; i < m_PolyPoints.size(); i++ )
m_PolyPoints[i] = m_PolyPoints[i] - offset;
for( size_t i = 0; i < m_points.size(); i++ )
m_points[i] = m_points[i] - offset;
}
......@@ -37,9 +37,8 @@
class SCH_POLYLINE : public SCH_ITEM
{
public:
int m_Width; /* Thickness */
std::vector<wxPoint> m_PolyPoints; // list of points (>= 2)
int m_width; /* Thickness */
std::vector<wxPoint> m_points; // list of points (>= 2)
public:
SCH_POLYLINE( int layer = LAYER_NOTES );
......@@ -77,19 +76,36 @@ public:
/**
* Function AddPoint
* add a corner to m_PolyPoints
* add a corner to m_points
*/
void AddPoint( const wxPoint& point )
{
m_PolyPoints.push_back( point );
m_points.push_back( point );
}
/**
* Function SetPoint
* sets the point at \a aIndex in the list to \a aPoint.
*
* @param aIndex The index in the point list.
* @param aPoint The new point value.
*/
void SetPoint( int aIndex, const wxPoint& aPoint )
{
// (unsigned) excludes aIndex<0 also
wxCHECK_RET( (unsigned)aIndex < m_points.size(),
wxT( "Invalid SCH_POLYLINE point list index." ) );
m_points[ aIndex ] = aPoint;
}
/**
* Function GetCornerCount
* @return the number of corners
*/
unsigned GetCornerCount() const { return m_PolyPoints.size(); }
unsigned GetCornerCount() const { return m_points.size(); }
/**
* Function GetPenSize
......@@ -105,7 +121,7 @@ public:
virtual void Move( const wxPoint& aMoveVector )
{
for( unsigned ii = 0; ii < GetCornerCount(); ii++ )
m_PolyPoints[ii] += aMoveVector;
m_points[ii] += aMoveVector;
}
/**
......@@ -123,11 +139,26 @@ public:
virtual BITMAP_DEF GetMenuImage() const;
/**
* Function operator[]
* is used for read only access and returns the point at \a aIndex.
* @param aIndex The index of the list of points to return.
* @return A wxPoint object containing the point at \a aIndex.
*/
wxPoint operator[]( int aIndex ) const
{
// (unsigned) excludes aIndex<0 also
wxCHECK_MSG( (unsigned)aIndex < m_points.size(), wxDefaultPosition,
wxT( "Invalid SCH_POLYLINE point list index." ) );
return m_points[ aIndex ];
}
private:
virtual bool doHitTest( const wxPoint& aPoint, int aAccuracy ) const;
virtual bool doHitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const;
virtual EDA_ITEM* doClone() const;
virtual wxPoint doGetPosition() const { return m_PolyPoints[0]; }
virtual wxPoint doGetPosition() const { return m_points[0]; }
virtual void doSetPosition( const wxPoint& aPosition );
};
......
......@@ -720,7 +720,7 @@ SCH_SHEET* SCH_SCREEN::GetSheet( const wxString& aName )
SCH_SHEET* sheet = (SCH_SHEET*) item;
if( aName.CmpNoCase( sheet->m_SheetName ) == 0 )
if( aName.CmpNoCase( sheet->GetName() ) == 0 )
return sheet;
}
......
This diff is collapsed.
......@@ -28,8 +28,8 @@
* @brief Definition of the SCH_SHEET class for Eeschema.
*/
#ifndef CLASS_DRAWSHEET_H
#define CLASS_DRAWSHEET_H
#ifndef SCH_SHEEET_H
#define SCH_SHEEET_H
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/foreach.hpp>
......@@ -50,7 +50,8 @@ class SCH_EDIT_FRAME;
/**
* Pin (label) used in sheets to create hierarchical schematics.
* Class SCH_SHEET_PIN
* defines a sheet pin (label) used in sheets to create hierarchical schematics.
*
* A SCH_SHEET_PIN is used to create a hierarchical sheet in the same way a
* pin is used in a component. It connects the objects in the sheet object
......@@ -59,23 +60,24 @@ class SCH_EDIT_FRAME;
* connected to a wire, bus, or label. In the schematic page represented by
* the sheet, it corresponds to a hierarchical label.
*/
class SCH_SHEET_PIN : public SCH_HIERLABEL
{
private:
int m_Number; ///< Label number use for saving sheet label to file.
int m_number; ///< Label number use for saving sheet label to file.
///< Sheet label numbering begins at 2.
///< 0 is reserved for the sheet name.
///< 1 is reserve for the sheet file name.
int m_Edge; /* For pin labels only: sheet edge (0 to 3) of the pin
* m_Edge define on which edge the pin is positioned:
/**
* Defines the edge of the sheet that the sheet pin is positioned
* 0: pin on left side
* 1: pin on right side
* 2: pin on top side
* 3: pin on bottom side
* for compatibility reasons, this does not follow same values as text
* orientation.
*
* For compatibility reasons, this does not follow same values as text orientation.
*/
int m_edge;
virtual EDA_ITEM* doClone() const;
......@@ -118,7 +120,7 @@ public:
*
* @return Number of the sheet label.
*/
int GetNumber() const { return m_Number; }
int GetNumber() const { return m_number; }
/**
* Set the sheet label number.
......@@ -202,15 +204,7 @@ public:
virtual void Mirror_X( int aXaxis_position );
/**
* Function Matches
* Compare hierarchical pin name against search string.
*
* @param aSearchData - Criteria to search against.
* @param aAuxData - a pointer on auxiliary data, if needed.
* When searching string in REFERENCE field we must know the sheet path
* This param is used in this case
* @param aFindLocation - a wxPoint where to put the location of matched item. can be NULL.
* @return True if this item matches the search criteria.
* @copydoc EDA_ITEM::Matches(wxFindReplaceData&,void*,wxPoint*)
*/
virtual bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation );
......@@ -233,33 +227,40 @@ private:
typedef boost::ptr_vector<SCH_SHEET_PIN> SCH_SHEET_PINS;
/* class SCH_SHEET
* This class is the sheet symbol placed in a schematic, and is the entry point
* for a sub schematic
/**
* Class SCH_SHEET
* is the sheet symbol placed in a schematic, and is the entry point for a sub schematic.
*/
class SCH_SHEET : public SCH_ITEM
{
SCH_SCREEN* m_AssociatedScreen; ///< Screen that contains the physical data for
///< the sheet. In complex hierarchies multiple
///< sheets can share a common screen.
SCH_SHEET_PINS m_pins; ///< List of sheet connection points.
wxString m_FileName; /* also in SCH_SCREEN (redundant),
* but need it here for loading after
* reading the sheet description from
* file. */
/// Screen that contains the physical data for the sheet. In complex hierarchies
/// multiple sheets can share a common screen.
SCH_SCREEN* m_screen;
public:
wxString m_SheetName; /* this is equivalent to C101 for
* components: it is stored in F0 ...
* of the file. */
public:
int m_SheetNameSize; /* Size (height) of the text, used to
* draw the sheet name */
int m_FileNameSize; /* Size (height) of the text, used to
* draw the file name */
wxPoint m_Pos;
wxSize m_Size; /* Position and Size of *sheet symbol */
/// The list of sheet connection points.
SCH_SHEET_PINS m_pins;
/// The file name is also in the #SCH_SCREEN object associated with the sheet. It is
/// also needed here for loading after reading the sheet description from file.
wxString m_fileName;
/// This is equivalent to the reference designator for components and is stored in F0
/// sheet pin in the schematic file.
wxString m_name;
/// The height of the text used to draw the sheet name.
int m_sheetNameSize;
/// The height of the text used to draw the file name.
int m_fileNameSize;
/// The position of the sheet.
wxPoint m_pos;
/// The size of the sheet.
wxSize m_size;
friend class SCH_SHEET_PIN;
public:
SCH_SHEET( const wxPoint& pos = wxPoint( 0, 0 ) );
......@@ -273,7 +274,24 @@ public:
return wxT( "SCH_SHEET" );
}
SCH_SCREEN* GetScreen() { return m_AssociatedScreen; }
wxString GetName() const { return m_name; }
void SetName( const wxString& aName ) { m_name = aName; }
int GetSheetNameSize() const { return m_sheetNameSize; }
void SetSheetNameSize( int aSize ) { m_sheetNameSize = aSize; }
int GetFileNameSize() const { return m_fileNameSize; }
void SetFileNameSize( int aSize ) { m_fileNameSize = aSize; }
SCH_SCREEN* GetScreen() { return m_screen; }
wxSize GetSize() { return m_size; }
void SetSize( const wxSize& aSize ) { m_size = aSize; }
/**
* Function SetScreen
......@@ -462,9 +480,9 @@ public:
/**
* Function Load.
* for the sheet: load the file m_FileName
* for the sheet: load the file m_fileName
* if a screen already exists, the file is already read.
* m_AssociatedScreen point on the screen, and its m_RefCount is
* m_screen point on the screen, and its m_RefCount is
* incremented
* else creates a new associated screen and load the data file.
* @param aFrame = a SCH_EDIT_FRAME pointer to the maim schematic frame
......@@ -485,9 +503,9 @@ public:
* Function LocatePathOfScreen
* search the existing hierarchy for an instance of screen "FileName".
* don't bother looking at the root sheet - it must be unique,
* no other references to its m_AssociatedScreen otherwise there would be
* loops
* in the hierarchy.
* no other references to its m_screen otherwise there would be
* loops in the hierarchy.
*
* @param aScreen = the SCH_SCREEN* screen that we search for
* @param aList = the SCH_SHEET_PATH* that must be used
* @return true if found
......@@ -512,7 +530,7 @@ public:
// Set a new filename without changing anything else
void SetFileName( const wxString& aFilename )
{
m_FileName = aFilename;
m_fileName = aFilename;
}
bool ChangeFileName( SCH_EDIT_FRAME* aFrame, const wxString& aFileName );
......@@ -529,7 +547,7 @@ public:
*/
virtual void Move( const wxPoint& aMoveVector )
{
m_Pos += aMoveVector;
m_pos += aMoveVector;
BOOST_FOREACH( SCH_SHEET_PIN& pin, m_pins )
{
......@@ -546,15 +564,7 @@ public:
virtual void Rotate( wxPoint rotationPoint );
/**
* Compare schematic sheet file and sheet name against search string.
*
* @param aSearchData - Criteria to search against.
* @param aAuxData - a pointer on auxiliary data, if needed.
* When searching string in REFERENCE field we must know the sheet path
* This param is used in this case
* @param aFindLocation - a wxPoint where to put the location of matched item. can be NULL.
*
* @return True if this item matches the search criteria.
* @copydoc EDA_ITEM::Matches(wxFindReplaceData&,void*,wxPoint*)
*/
virtual bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation );
......@@ -627,11 +637,11 @@ private:
virtual bool doHitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const;
virtual EDA_ITEM* doClone() const;
virtual void doPlot( PLOTTER* aPlotter );
virtual wxPoint doGetPosition() const { return m_Pos; }
virtual void doSetPosition( const wxPoint& aPosition ) { m_Pos = aPosition; }
virtual wxPoint doGetPosition() const { return m_pos; }
virtual void doSetPosition( const wxPoint& aPosition ) { m_pos = aPosition; }
};
typedef std::vector< SCH_SHEET* > SCH_SHEETS;
#endif /* CLASS_DRAWSHEET_H */
#endif /* SCH_SHEEET_H */
......@@ -217,7 +217,7 @@ wxString SCH_SHEET_PATH::PathHumanReadable() const
// start at 1 to avoid the root sheet, as above.
for( unsigned i = 1; i< m_numSheets; i++ )
{
s = s + m_sheets[i]->m_SheetName + wxT( "/" );
s = s + m_sheets[i]->GetName() + wxT( "/" );
}
return s;
......
......@@ -43,16 +43,6 @@
#include "kicad_string.h"
/* m_Edge define on which edge the pin is positioned:
*
* 0: pin on left side
* 1: pin on right side
* 2: pin on top side
* 3: pin on bottom side
* for compatibility reasons, this does not follow same values as text
* orientation.
*/
SCH_SHEET_PIN::SCH_SHEET_PIN( SCH_SHEET* parent, const wxPoint& pos, const wxString& text ) :
SCH_HIERLABEL( pos, text, SCH_SHEET_PIN_T )
{
......@@ -66,17 +56,17 @@ SCH_SHEET_PIN::SCH_SHEET_PIN( SCH_SHEET* parent, const wxPoint& pos, const wxStr
else
SetEdge( 0 );
m_Shape = NET_INPUT;
m_IsDangling = true;
m_Number = 2;
m_shape = NET_INPUT;
m_isDangling = true;
m_number = 2;
}
SCH_SHEET_PIN::SCH_SHEET_PIN( const SCH_SHEET_PIN& aSheetLabel ) :
SCH_HIERLABEL( aSheetLabel )
{
m_Number = aSheetLabel.m_Number;
m_Edge = aSheetLabel.m_Edge;
m_number = aSheetLabel.m_number;
m_edge = aSheetLabel.m_edge;
}
......@@ -132,7 +122,7 @@ void SCH_SHEET_PIN::SetNumber( int aNumber )
{
wxASSERT( aNumber >= 2 );
m_Number = aNumber;
m_number = aNumber;
}
......@@ -168,27 +158,27 @@ void SCH_SHEET_PIN::SetEdge( int aEdge )
/* use -1 to adjust text orientation without changing edge*/
if( aEdge > -1 )
m_Edge = aEdge;
m_edge = aEdge;
switch( m_Edge )
switch( m_edge )
{
case 0: /* pin on left side*/
m_Pos.x = Sheet->m_Pos.x;
m_Pos.x = Sheet->m_pos.x;
SetOrientation( 2 ); /* Orientation horiz inverse */
break;
case 1: /* pin on right side*/
m_Pos.x = Sheet->m_Pos.x + Sheet->m_Size.x;
m_Pos.x = Sheet->m_pos.x + Sheet->m_size.x;
SetOrientation( 0 ); /* Orientation horiz normal */
break;
case 2: /* pin on top side*/
m_Pos.y = Sheet->m_Pos.y;
m_Pos.y = Sheet->m_pos.y;
SetOrientation( 3 ); /* Orientation vert BOTTOM */
break;
case 3: /* pin on bottom side*/
m_Pos.y = Sheet->m_Pos.y + Sheet->m_Size.y;
m_Pos.y = Sheet->m_pos.y + Sheet->m_size.y;
SetOrientation( 1 ); /* Orientation vert UP */
break;
}
......@@ -197,7 +187,7 @@ void SCH_SHEET_PIN::SetEdge( int aEdge )
int SCH_SHEET_PIN::GetEdge() const
{
return m_Edge;
return m_edge;
}
......@@ -208,9 +198,9 @@ void SCH_SHEET_PIN::ConstrainOnEdge( wxPoint Pos )
if( Sheet == NULL )
return;
if( m_Edge<2 ) /*horizontal sheetpin*/
if( m_edge<2 ) /*horizontal sheetpin*/
{
if( Pos.x > ( Sheet->m_Pos.x + ( Sheet->m_Size.x / 2 ) ) )
if( Pos.x > ( Sheet->m_pos.x + ( Sheet->m_size.x / 2 ) ) )
{
SetEdge( 1 );
}
......@@ -221,15 +211,15 @@ void SCH_SHEET_PIN::ConstrainOnEdge( wxPoint Pos )
m_Pos.y = Pos.y;
if( m_Pos.y < Sheet->m_Pos.y )
m_Pos.y = Sheet->m_Pos.y;
if( m_Pos.y < Sheet->m_pos.y )
m_Pos.y = Sheet->m_pos.y;
if( m_Pos.y > (Sheet->m_Pos.y + Sheet->m_Size.y) )
m_Pos.y = Sheet->m_Pos.y + Sheet->m_Size.y;
if( m_Pos.y > (Sheet->m_pos.y + Sheet->m_size.y) )
m_Pos.y = Sheet->m_pos.y + Sheet->m_size.y;
}
else /* vertical sheetpin*/
{
if( Pos.y > ( Sheet->m_Pos.y + ( Sheet->m_Size.y / 2 ) ) )
if( Pos.y > ( Sheet->m_pos.y + ( Sheet->m_size.y / 2 ) ) )
{
SetEdge( 3 ); //bottom
}
......@@ -240,11 +230,11 @@ void SCH_SHEET_PIN::ConstrainOnEdge( wxPoint Pos )
m_Pos.x = Pos.x;
if( m_Pos.x < Sheet->m_Pos.x )
m_Pos.x = Sheet->m_Pos.x;
if( m_Pos.x < Sheet->m_pos.x )
m_Pos.x = Sheet->m_pos.x;
if( m_Pos.x > (Sheet->m_Pos.x + Sheet->m_Size.x) )
m_Pos.x = Sheet->m_Pos.x + Sheet->m_Size.x;
if( m_Pos.x > (Sheet->m_pos.x + Sheet->m_size.x) )
m_Pos.x = Sheet->m_pos.x + Sheet->m_size.x;
}
}
......@@ -256,7 +246,7 @@ bool SCH_SHEET_PIN::Save( FILE* aFile ) const
if( m_Text.IsEmpty() )
return true;
switch( m_Edge )
switch( m_edge )
{
case 0: //pin on left side
side = 'L';
......@@ -275,7 +265,7 @@ bool SCH_SHEET_PIN::Save( FILE* aFile ) const
break;
}
switch( m_Shape )
switch( m_shape )
{
case NET_INPUT:
type = 'I'; break;
......@@ -293,7 +283,7 @@ bool SCH_SHEET_PIN::Save( FILE* aFile ) const
type = 'U'; break;
}
if( fprintf( aFile, "F%d %s %c %c %-3d %-3d %-3d\n", m_Number,
if( fprintf( aFile, "F%d %s %c %c %-3d %-3d %-3d\n", m_number,
EscapedUTF8( m_Text ).c_str(), // supplies wrapping quotes
type, side, m_Pos.x, m_Pos.y,
m_Size.x ) == EOF )
......@@ -359,23 +349,23 @@ bool SCH_SHEET_PIN::Load( LINE_READER& aLine, wxString& aErrorMsg )
switch( connectType[0] )
{
case 'I':
m_Shape = NET_INPUT;
m_shape = NET_INPUT;
break;
case 'O':
m_Shape = NET_OUTPUT;
m_shape = NET_OUTPUT;
break;
case 'B':
m_Shape = NET_BIDI;
m_shape = NET_BIDI;
break;
case 'T':
m_Shape = NET_TRISTATE;
m_shape = NET_TRISTATE;
break;
case 'U':
m_Shape = NET_UNSPECIFIED;
m_shape = NET_UNSPECIFIED;
break;
}
......@@ -429,7 +419,7 @@ void SCH_SHEET_PIN::Mirror_X( int aXaxis_position )
m_Pos.y = aXaxis_position - p;
switch( m_Edge )
switch( m_edge )
{
case 2:
SetEdge( 3 );
......@@ -448,7 +438,7 @@ void SCH_SHEET_PIN::Mirror_Y( int aYaxis_position )
m_Pos.x = aYaxis_position - p;
switch( m_Edge )
switch( m_edge )
{
case 0:
SetEdge( 1 );
......@@ -465,7 +455,7 @@ void SCH_SHEET_PIN::Rotate( wxPoint rotationPoint )
{
RotatePoint( &m_Pos, rotationPoint, 900 );
switch( m_Edge )
switch( m_edge )
{
case 0: //pin on left side
SetEdge( 3 );
......@@ -493,16 +483,16 @@ void SCH_SHEET_PIN::CreateGraphicShape( std::vector <wxPoint>& aPoints, const wx
* for INPUT type the icon is the OUTPUT shape of SCH_HIERLABEL
* for OUTPUT type the icon is the INPUT shape of SCH_HIERLABEL
*/
int tmp = m_Shape;
int tmp = m_shape;
switch( m_Shape )
switch( m_shape )
{
case NET_INPUT:
m_Shape = NET_OUTPUT;
m_shape = NET_OUTPUT;
break;
case NET_OUTPUT:
m_Shape = NET_INPUT;
m_shape = NET_INPUT;
break;
default:
......@@ -510,7 +500,7 @@ void SCH_SHEET_PIN::CreateGraphicShape( std::vector <wxPoint>& aPoints, const wx
}
SCH_HIERLABEL::CreateGraphicShape( aPoints, aPos );
m_Shape = tmp;
m_shape = tmp;
}
......
This diff is collapsed.
......@@ -56,27 +56,23 @@ extern const char* SheetLabelType[]; /* names of types of labels */
class SCH_TEXT : public SCH_ITEM, public EDA_TEXT
{
public:
int m_Shape;
bool m_IsDangling; // true if not connected (used to draw the "not
// connected" symbol
protected:
int m_SchematicOrientation; /* orientation of texts (comments) and
* labels in schematic
* 0 = normal (horizontal, left
* justified).
* 1 = up (vertical)
* 2 = (horizontal, right justified).
* This can be seen as the mirrored
* position of 0
* 3 = bottom . This can be seen as the
* mirrored position of up
* this is perhaps a duplicate of m_Orient
* and m_HJustified or m_VJustified,
* but is more easy to handle that 3
* parameters in editions, Reading and
* Saving file
int m_shape;
/// True if not connected to another object if the object derive from SCH_TEXT
/// supports connections.
bool m_isDangling;
/**
* The orientation of text and any associated drawing elements of derived objects.
* 0 is the horizontal and left justified.
* 1 is vertical and top justified.
* 2 is horizontal and right justified. It is the equivalent of the mirrored 0 orentation.
* 3 is veritcal and bottom justifiend. It is the equivalent of the mirrored 1 orentation.
* This is a duplicattion of m_Orient, m_HJustified, and m_VJustified in #EDA_TEXT but is
* easier to handle that 3 parameters when editing and reading and saving files.
*/
int m_schematicOrientation;
public:
SCH_TEXT( const wxPoint& pos = wxPoint( 0, 0 ),
......@@ -100,10 +96,10 @@ public:
/**
* Function SetOrientation
* Set m_SchematicOrientation, and initialize
* Set m_schematicOrientation, and initialize
* m_orient,m_HJustified and m_VJustified, according to the value of
* m_SchematicOrientation (for a text )
* must be called after changing m_SchematicOrientation
* m_schematicOrientation (for a text )
* must be called after changing m_schematicOrientation
* @param aSchematicOrientation =
* 0 = normal (horizontal, left justified).
* 1 = up (vertical)
......@@ -113,15 +109,18 @@ public:
*/
virtual void SetOrientation( int aSchematicOrientation );
int GetOrientation() { return m_SchematicOrientation; }
int GetOrientation() { return m_schematicOrientation; }
int GetShape() const { return m_shape; }
void SetShape( int aShape ) { m_shape = aShape; }
/**
* Function GetSchematicTextOffset (virtual)
* @return the offset between the SCH_TEXT position and the text itself
* position
* This offset depend on orientation, and the type of text
* (room to draw an associated graphic symbol, or put the text above a
* wire)
* @return the offset between the SCH_TEXT position and the text itself position
*
* This offset depends on the orientation, the type of text, and the area required to
* draw the associated graphic symbol or to put the text above a wire.
*/
virtual wxPoint GetSchematicTextOffset() const;
......@@ -203,12 +202,7 @@ public:
virtual void Mirror_X( int aXaxis_position );
/**
* Compare schematic text entry against search string.
*
* @param aSearchData - Criterial to search against.
* @param aAuxData - a pointer on auxiliary data, if needed. Can be null
* @param aFindLocation - a wxPoint where to put the location of matched item. can be NULL.
* @return True if this schematic text item matches the search criteria.
* @copydoc EDA_ITEM::Matches(wxFindReplaceData&,void*,wxPoint*)
*/
virtual bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation );
......@@ -216,7 +210,7 @@ public:
virtual bool IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemList );
virtual bool IsDangling() const { return m_IsDangling; }
virtual bool IsDangling() const { return m_isDangling; }
virtual bool IsSelectStateChanged( const wxRect& aRect );
......@@ -267,10 +261,10 @@ public:
/**
* Function SetOrientation
* Set m_SchematicOrientation, and initialize
* Set m_schematicOrientation, and initialize
* m_orient,m_HJustified and m_VJustified, according to the value of
* m_SchematicOrientation (for a label)
* must be called after changing m_SchematicOrientation
* m_schematicOrientation (for a label)
* must be called after changing m_schematicOrientation
* @param aSchematicOrientation =
* 0 = normal (horizontal, left justified).
* 1 = up (vertical)
......@@ -362,10 +356,10 @@ public:
/**
* Function SetOrientation
* Set m_SchematicOrientation, and initialize
* Set m_schematicOrientation, and initialize
* m_orient,m_HJustified and m_VJustified, according to the value of
* m_SchematicOrientation
* must be called after changing m_SchematicOrientation
* m_schematicOrientation
* must be called after changing m_schematicOrientation
* @param aSchematicOrientation =
* 0 = normal (horizontal, left justified).
* 1 = up (vertical)
......@@ -468,10 +462,10 @@ public:
/**
* Function SetOrientation
* Set m_SchematicOrientation, and initialize
* Set m_schematicOrientation, and initialize
* m_orient,m_HJustified and m_VJustified, according to the value of
* m_SchematicOrientation
* must be called after changing m_SchematicOrientation
* m_schematicOrientation
* must be called after changing m_schematicOrientation
* @param aSchematicOrientation =
* 0 = normal (horizontal, left justified).
* 1 = up (vertical)
......
......@@ -50,12 +50,12 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC )
wxString units = GetUnitsLabel( g_UserUnit );
dlg.SetFileName( aSheet->GetFileName() );
dlg.SetFileNameTextSize( ReturnStringFromValue( g_UserUnit,
aSheet->m_FileNameSize,
aSheet->GetFileNameSize(),
m_InternalUnits ) );
dlg.SetFileNameTextSizeUnits( units );
dlg.SetSheetName( aSheet->m_SheetName );
dlg.SetSheetName( aSheet->GetName() );
dlg.SetSheetNameTextSize( ReturnStringFromValue( g_UserUnit,
aSheet->m_SheetNameSize,
aSheet->GetSheetNameSize(),
m_InternalUnits ) );
dlg.SetSheetNameTextSizeUnits( units );
......@@ -192,16 +192,16 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC )
else if( loadFromFile )
aSheet->Load( this );
aSheet->m_FileNameSize = ReturnValueFromString( g_UserUnit,
aSheet->SetFileNameSize( ReturnValueFromString( g_UserUnit,
dlg.GetFileNameTextSize(),
m_InternalUnits );
aSheet->m_SheetName = dlg.GetSheetName();
aSheet->m_SheetNameSize = ReturnValueFromString( g_UserUnit,
m_InternalUnits ) );
aSheet->SetName( dlg.GetSheetName() );
aSheet->SetSheetNameSize( ReturnValueFromString( g_UserUnit,
dlg.GetSheetNameTextSize(),
m_InternalUnits );
m_InternalUnits ) );
if( aSheet->m_SheetName.IsEmpty() )
aSheet->m_SheetName.Printf( wxT( "Sheet%8.8lX" ), aSheet->GetTimeStamp() );
if( aSheet->GetName().IsEmpty() )
aSheet->SetName( wxString::Format( wxT( "Sheet%8.8lX" ), aSheet->GetTimeStamp() ) );
DrawPanel->MoveCursorToCrossHair();
DrawPanel->m_IgnoreMouseEvents = false;
......@@ -225,10 +225,12 @@ static void MoveOrResizeSheet( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
if( aErase )
sheet->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode );
wxPoint pos = sheet->GetPosition();
if( sheet->IsResized() )
{
int width = screen->GetCrossHairPosition().x - sheet->m_Pos.x;
int height = screen->GetCrossHairPosition().y - sheet->m_Pos.y;
int width = screen->GetCrossHairPosition().x - sheet->GetPosition().x;
int height = screen->GetCrossHairPosition().y - sheet->GetPosition().y;
// If the sheet doesn't have any pins, clamp the minimum size to the default values.
width = ( width < MIN_SHEET_WIDTH ) ? MIN_SHEET_WIDTH : width;
......@@ -246,13 +248,12 @@ static void MoveOrResizeSheet( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
sheet->GetMinWidth() + gridSizeX : width;
}
wxPoint grid = screen->GetNearestGridPosition( wxPoint( sheet->m_Pos.x + width,
sheet->m_Pos.y + height ) );
sheet->Resize( wxSize( grid.x - sheet->m_Pos.x, grid.y - sheet->m_Pos.y ) );
wxPoint grid = screen->GetNearestGridPosition( wxPoint( pos.x + width, pos.y + height ) );
sheet->Resize( wxSize( grid.x - pos.x, grid.y - pos.y ) );
}
else if( sheet->IsMoving() )
{
moveVector = screen->GetCrossHairPosition() - sheet->m_Pos;
moveVector = screen->GetCrossHairPosition() - pos;
sheet->Move( moveVector );
}
......@@ -361,7 +362,7 @@ void SCH_EDIT_FRAME::StartMoveSheet( SCH_SHEET* aSheet, wxDC* aDC )
return;
DrawPanel->CrossHairOff( aDC );
GetScreen()->SetCrossHairPosition( aSheet->m_Pos );
GetScreen()->SetCrossHairPosition( aSheet->GetPosition() );
DrawPanel->MoveCursorToCrossHair();
if( !aSheet->IsNew() )
......
......@@ -60,7 +60,7 @@ int SCH_EDIT_FRAME::EditSheetPin( SCH_SHEET_PIN* aSheetPin, wxDC* aDC )
dlg.SetTextHeightUnits( GetUnitsLabel( g_UserUnit ) );
dlg.SetTextWidth( ReturnStringFromValue( g_UserUnit, aSheetPin->m_Size.x, m_InternalUnits ) );
dlg.SetTextWidthUnits( GetUnitsLabel( g_UserUnit ) );
dlg.SetConnectionType( aSheetPin->m_Shape );
dlg.SetConnectionType( aSheetPin->GetShape() );
/* This ugly hack fixes a bug in wxWidgets 2.8.7 and likely earlier versions for
* the flex grid sizer in wxGTK that prevents the last column from being sized
......@@ -86,7 +86,7 @@ int SCH_EDIT_FRAME::EditSheetPin( SCH_SHEET_PIN* aSheetPin, wxDC* aDC )
aSheetPin->m_Text = dlg.GetLabelName();
aSheetPin->m_Size.y = ReturnValueFromString( g_UserUnit, dlg.GetTextHeight(), m_InternalUnits );
aSheetPin->m_Size.x = ReturnValueFromString( g_UserUnit, dlg.GetTextWidth(), m_InternalUnits );
aSheetPin->m_Shape = dlg.GetConnectionType();
aSheetPin->SetShape( dlg.GetConnectionType() );
if( aDC )
aSheetPin->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
......@@ -103,7 +103,7 @@ SCH_SHEET_PIN* SCH_EDIT_FRAME::CreateSheetPin( SCH_SHEET* aSheet, wxDC* aDC )
sheetPin = new SCH_SHEET_PIN( aSheet, wxPoint( 0, 0 ), line );
sheetPin->SetFlags( IS_NEW );
sheetPin->m_Size = m_lastSheetPinTextSize;
sheetPin->m_Shape = m_lastSheetPinType;
sheetPin->SetShape( m_lastSheetPinType );
int response = EditSheetPin( sheetPin, NULL );
......@@ -113,7 +113,7 @@ SCH_SHEET_PIN* SCH_EDIT_FRAME::CreateSheetPin( SCH_SHEET* aSheet, wxDC* aDC )
return NULL;
}
m_lastSheetPinType = sheetPin->m_Shape;
m_lastSheetPinType = sheetPin->GetShape();
m_lastSheetPinTextSize = sheetPin->m_Size;
MoveItem( (SCH_ITEM*) sheetPin, aDC );
......@@ -157,7 +157,8 @@ SCH_SHEET_PIN* SCH_EDIT_FRAME::ImportSheetPin( SCH_SHEET* aSheet, wxDC* aDC )
sheetPin = new SCH_SHEET_PIN( aSheet, wxPoint( 0, 0 ), label->m_Text );
sheetPin->SetFlags( IS_NEW );
sheetPin->m_Size = m_lastSheetPinTextSize;
m_lastSheetPinType = sheetPin->m_Shape = label->m_Shape;
m_lastSheetPinType = label->GetShape();
sheetPin->SetShape( label->GetShape() );
MoveItem( (SCH_ITEM*) sheetPin, aDC );
......
......@@ -162,16 +162,16 @@ public:
/**
* Function Inspect
* is the examining function within the INSPECTOR which is passed to the
* Iterate function. It is used primarily for searching, but not limited
* to that. It can also collect or modify the scanned objects.
* EDA_ITEM::Iterate() function. It is used primarily for searching, but
* not limited to that. It can also collect or modify the scanned objects.
*
* @param testItem An EDA_ITEM to examine.
* @param testData is arbitrary data needed by the inspector to determine
* @param aItem An EDA_ITEM to examine.
* @param aTestData is arbitrary data needed by the inspector to determine
* if the EDA_ITEM under test meets its match criteria.
* @return SEARCH_RESULT SEARCH_QUIT if the Iterator is to stop the scan,
* else SCAN_CONTINUE;
* @return A #SEARCH_RESULT type #SEARCH_QUIT if the iterator function is to
* stop the scan, else #SEARCH_CONTINUE;
*/
SEARCH_RESULT virtual Inspect( EDA_ITEM* testItem, const void* testData ) = 0;
SEARCH_RESULT virtual Inspect( EDA_ITEM* aItem, const void* aTestData ) = 0;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment