Very minor fixes: add missing const return type to some GetBoundingBox() declarations. Change few functions names to better names in some places (like GetName() to GetPinName() )

This commit is contained in:
jean-pierre charras 2015-01-18 18:28:14 +01:00
parent 8876fdf4af
commit 64925bfc4f
10 changed files with 25 additions and 26 deletions

View File

@ -197,7 +197,7 @@ bool BITMAP_BASE::LoadData( LINE_READER& aLine, wxString& aErrorMsg )
}
EDA_RECT BITMAP_BASE::GetBoundingBox() const
const EDA_RECT BITMAP_BASE::GetBoundingBox() const
{
EDA_RECT rect;

View File

@ -1055,7 +1055,7 @@ bool LIB_PART::LoadFootprints( LINE_READER& aLineReader, wxString& aErrorMsg )
}
EDA_RECT LIB_PART::GetBoundingBox( int aUnit, int aConvert ) const
const EDA_RECT LIB_PART::GetBoundingBox( int aUnit, int aConvert ) const
{
EDA_RECT bBox( wxPoint( 0, 0 ), wxSize( 0, 0 ) );
@ -1080,7 +1080,7 @@ EDA_RECT LIB_PART::GetBoundingBox( int aUnit, int aConvert ) const
}
EDA_RECT LIB_PART::GetBodyBoundingBox( int aUnit, int aConvert ) const
const EDA_RECT LIB_PART::GetBodyBoundingBox( int aUnit, int aConvert ) const
{
EDA_RECT bBox( wxPoint( 0, 0 ), wxSize( 0, 0 ) );

View File

@ -296,7 +296,7 @@ public:
* if aConvert == 0 Convert is non used
* Invisible fields are not taken in account
**/
EDA_RECT GetBoundingBox( int aUnit, int aConvert ) const;
const EDA_RECT GetBoundingBox( int aUnit, int aConvert ) const;
/**
* Function GetBodyBoundingBox
@ -307,7 +307,7 @@ public:
* if aConvert == 0 Convert is non used
* Fields are not taken in account
**/
EDA_RECT GetBodyBoundingBox( int aUnit, int aConvert ) const;
const EDA_RECT GetBodyBoundingBox( int aUnit, int aConvert ) const;
/**
* Function SaveDateAndTime

View File

@ -118,14 +118,14 @@ void DIALOG_LIB_EDIT_PIN::OnPropertiesChange( wxCommandEvent& event )
if( ! IsShown() ) // do nothing at init time
return;
int pinNameSize = ValueFromString( g_UserUnit, GetNameTextSize() );
int pinNameSize = ValueFromString( g_UserUnit, GetPinNameTextSize() );
int pinNumSize = ValueFromString( g_UserUnit, GetPadNameTextSize());
int pinOrient = LIB_PIN::GetOrientationCode( GetOrientation() );
int pinLength = ValueFromString( g_UserUnit, GetLength() );
int pinShape = LIB_PIN::GetStyleCode( GetStyle() );
int pinType = GetElectricalType();
m_dummyPin->SetName( GetName() );
m_dummyPin->SetName( GetPinName() );
m_dummyPin->SetNameTextSize( pinNameSize );
m_dummyPin->SetNumber( GetPadName() );
m_dummyPin->SetNumberTextSize( pinNumSize );

View File

@ -71,19 +71,19 @@ public:
void SetStyle( int style ) { m_choiceStyle->SetSelection( style ); }
int GetStyle( void ) { return m_choiceStyle->GetSelection(); }
void SetName( const wxString& name ) { m_textPinName->SetValue( name ); }
wxString GetName( void ) { return m_textPinName->GetValue(); }
void SetPinName( const wxString& name ) { m_textPinName->SetValue( name ); }
wxString GetPinName( void ) { return m_textPinName->GetValue(); }
void SetNameTextSize( const wxString& size )
void SetPinNameTextSize( const wxString& size )
{
m_textPinNameTextSize->SetValue( size );
}
wxString GetNameTextSize( void )
wxString GetPinNameTextSize( void )
{
return m_textPinNameTextSize->GetValue();
}
void SetNameTextSizeUnits( const wxString& units )
void SetPinNameTextSizeUnits( const wxString& units )
{
m_staticNameTextSizeUnits->SetLabel( units );
}

View File

@ -1,7 +1,7 @@
/*
* 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) 2004 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
*
@ -110,9 +110,9 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
dlg.SetElectricalTypeList( LIB_PIN::GetElectricalTypeNames(),
LIB_PIN::GetElectricalTypeSymbols() );
dlg.SetElectricalType( pin->GetType() );
dlg.SetName( pin->GetName() );
dlg.SetNameTextSize( StringFromValue( g_UserUnit, pin->GetNameTextSize() ) );
dlg.SetNameTextSizeUnits( units );
dlg.SetPinName( pin->GetName() );
dlg.SetPinNameTextSize( StringFromValue( g_UserUnit, pin->GetNameTextSize() ) );
dlg.SetPinNameTextSizeUnits( units );
dlg.SetPadName( pin->GetNumberString() );
dlg.SetPadNameTextSize( StringFromValue( g_UserUnit, pin->GetNumberTextSize() ) );
@ -132,7 +132,6 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
dlg.Layout();
dlg.Fit();
dlg.SetMinSize( dlg.GetSize() );
// dlg.SetLastSizeAndPosition(); // done in DIALOG_SHIM::Show()
if( dlg.ShowModal() == wxID_CANCEL )
{
@ -145,7 +144,7 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
}
// Save the pin properties to use for the next new pin.
LastPinNameSize = ValueFromString( g_UserUnit, dlg.GetNameTextSize() );
LastPinNameSize = ValueFromString( g_UserUnit, dlg.GetPinNameTextSize() );
LastPinNumSize = ValueFromString( g_UserUnit, dlg.GetPadNameTextSize() );
LastPinOrient = LIB_PIN::GetOrientationCode( dlg.GetOrientation() );
LastPinLength = ValueFromString( g_UserUnit, dlg.GetLength() );
@ -156,7 +155,7 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
LastPinVisible = dlg.GetVisible();
pin->EnableEditMode( true, m_editPinsPerPartOrConvert );
pin->SetName( dlg.GetName() );
pin->SetName( dlg.GetPinName() );
pin->SetNameTextSize( GetLastPinNameSize() );
pin->SetNumber( dlg.GetPadName() );
pin->SetNumberTextSize( GetLastPinNumSize() );

View File

@ -140,7 +140,7 @@ public: BITMAP_BASE( const wxPoint& pos = wxPoint( 0, 0 ) );
* schematic coordinate system. It is OK to overestimate the size
* by a few counts.
*/
EDA_RECT GetBoundingBox() const;
const EDA_RECT GetBoundingBox() const;
void DrawBitmap( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPos );

View File

@ -84,7 +84,7 @@ public:
* may be called soon after ComputeBoundingBox() to return the same EDA_RECT,
* as long as the CLASS_PL_EDITOR_LAYOUT has not changed.
*/
EDA_RECT GetBoundingBox() const { return m_BoundingBox; } // override
const EDA_RECT GetBoundingBox() const { return m_BoundingBox; } // override
void SetBoundingBox( const EDA_RECT& aBox ) { m_BoundingBox = aBox; }

View File

@ -611,7 +611,7 @@ int CPolyLine::GetEndContour( int ic )
}
EDA_RECT CPolyLine::GetBoundingBox()
const EDA_RECT CPolyLine::GetBoundingBox()
{
int xmin = INT_MAX;
int ymin = INT_MAX;
@ -634,7 +634,7 @@ EDA_RECT CPolyLine::GetBoundingBox()
}
EDA_RECT CPolyLine::GetBoundingBox( int icont )
const EDA_RECT CPolyLine::GetBoundingBox( int icont )
{
int xmin = INT_MAX;
int ymin = INT_MAX;

View File

@ -355,14 +355,14 @@ public:
/**
* @return the full bounding box of polygons
*/
EDA_RECT GetBoundingBox();
const EDA_RECT GetBoundingBox();
/**
* @return the bounding box of a given polygon
* @param icont = the index of the polygon contour
* (0 = main contour, 1 ... n = other contours, usually holes)
*/
EDA_RECT GetBoundingBox( int icont );
const EDA_RECT GetBoundingBox( int icont );
void Copy( const CPolyLine* src );
bool TestPointInside( int x, int y );