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:
parent
8876fdf4af
commit
64925bfc4f
|
@ -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;
|
EDA_RECT rect;
|
||||||
|
|
||||||
|
|
|
@ -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 ) );
|
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 ) );
|
EDA_RECT bBox( wxPoint( 0, 0 ), wxSize( 0, 0 ) );
|
||||||
|
|
||||||
|
|
|
@ -296,7 +296,7 @@ public:
|
||||||
* if aConvert == 0 Convert is non used
|
* if aConvert == 0 Convert is non used
|
||||||
* Invisible fields are not taken in account
|
* 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
|
* Function GetBodyBoundingBox
|
||||||
|
@ -307,7 +307,7 @@ public:
|
||||||
* if aConvert == 0 Convert is non used
|
* if aConvert == 0 Convert is non used
|
||||||
* Fields are not taken in account
|
* 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
|
* Function SaveDateAndTime
|
||||||
|
|
|
@ -118,14 +118,14 @@ void DIALOG_LIB_EDIT_PIN::OnPropertiesChange( wxCommandEvent& event )
|
||||||
if( ! IsShown() ) // do nothing at init time
|
if( ! IsShown() ) // do nothing at init time
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int pinNameSize = ValueFromString( g_UserUnit, GetNameTextSize() );
|
int pinNameSize = ValueFromString( g_UserUnit, GetPinNameTextSize() );
|
||||||
int pinNumSize = ValueFromString( g_UserUnit, GetPadNameTextSize());
|
int pinNumSize = ValueFromString( g_UserUnit, GetPadNameTextSize());
|
||||||
int pinOrient = LIB_PIN::GetOrientationCode( GetOrientation() );
|
int pinOrient = LIB_PIN::GetOrientationCode( GetOrientation() );
|
||||||
int pinLength = ValueFromString( g_UserUnit, GetLength() );
|
int pinLength = ValueFromString( g_UserUnit, GetLength() );
|
||||||
int pinShape = LIB_PIN::GetStyleCode( GetStyle() );
|
int pinShape = LIB_PIN::GetStyleCode( GetStyle() );
|
||||||
int pinType = GetElectricalType();
|
int pinType = GetElectricalType();
|
||||||
|
|
||||||
m_dummyPin->SetName( GetName() );
|
m_dummyPin->SetName( GetPinName() );
|
||||||
m_dummyPin->SetNameTextSize( pinNameSize );
|
m_dummyPin->SetNameTextSize( pinNameSize );
|
||||||
m_dummyPin->SetNumber( GetPadName() );
|
m_dummyPin->SetNumber( GetPadName() );
|
||||||
m_dummyPin->SetNumberTextSize( pinNumSize );
|
m_dummyPin->SetNumberTextSize( pinNumSize );
|
||||||
|
|
|
@ -71,19 +71,19 @@ public:
|
||||||
void SetStyle( int style ) { m_choiceStyle->SetSelection( style ); }
|
void SetStyle( int style ) { m_choiceStyle->SetSelection( style ); }
|
||||||
int GetStyle( void ) { return m_choiceStyle->GetSelection(); }
|
int GetStyle( void ) { return m_choiceStyle->GetSelection(); }
|
||||||
|
|
||||||
void SetName( const wxString& name ) { m_textPinName->SetValue( name ); }
|
void SetPinName( const wxString& name ) { m_textPinName->SetValue( name ); }
|
||||||
wxString GetName( void ) { return m_textPinName->GetValue(); }
|
wxString GetPinName( void ) { return m_textPinName->GetValue(); }
|
||||||
|
|
||||||
void SetNameTextSize( const wxString& size )
|
void SetPinNameTextSize( const wxString& size )
|
||||||
{
|
{
|
||||||
m_textPinNameTextSize->SetValue( size );
|
m_textPinNameTextSize->SetValue( size );
|
||||||
}
|
}
|
||||||
wxString GetNameTextSize( void )
|
wxString GetPinNameTextSize( void )
|
||||||
{
|
{
|
||||||
return m_textPinNameTextSize->GetValue();
|
return m_textPinNameTextSize->GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetNameTextSizeUnits( const wxString& units )
|
void SetPinNameTextSizeUnits( const wxString& units )
|
||||||
{
|
{
|
||||||
m_staticNameTextSizeUnits->SetLabel( units );
|
m_staticNameTextSizeUnits->SetLabel( units );
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* 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) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||||
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
|
* 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(),
|
dlg.SetElectricalTypeList( LIB_PIN::GetElectricalTypeNames(),
|
||||||
LIB_PIN::GetElectricalTypeSymbols() );
|
LIB_PIN::GetElectricalTypeSymbols() );
|
||||||
dlg.SetElectricalType( pin->GetType() );
|
dlg.SetElectricalType( pin->GetType() );
|
||||||
dlg.SetName( pin->GetName() );
|
dlg.SetPinName( pin->GetName() );
|
||||||
dlg.SetNameTextSize( StringFromValue( g_UserUnit, pin->GetNameTextSize() ) );
|
dlg.SetPinNameTextSize( StringFromValue( g_UserUnit, pin->GetNameTextSize() ) );
|
||||||
dlg.SetNameTextSizeUnits( units );
|
dlg.SetPinNameTextSizeUnits( units );
|
||||||
dlg.SetPadName( pin->GetNumberString() );
|
dlg.SetPadName( pin->GetNumberString() );
|
||||||
dlg.SetPadNameTextSize( StringFromValue( g_UserUnit, pin->GetNumberTextSize() ) );
|
dlg.SetPadNameTextSize( StringFromValue( g_UserUnit, pin->GetNumberTextSize() ) );
|
||||||
|
|
||||||
|
@ -132,7 +132,6 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
|
||||||
dlg.Layout();
|
dlg.Layout();
|
||||||
dlg.Fit();
|
dlg.Fit();
|
||||||
dlg.SetMinSize( dlg.GetSize() );
|
dlg.SetMinSize( dlg.GetSize() );
|
||||||
// dlg.SetLastSizeAndPosition(); // done in DIALOG_SHIM::Show()
|
|
||||||
|
|
||||||
if( dlg.ShowModal() == wxID_CANCEL )
|
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.
|
// 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() );
|
LastPinNumSize = ValueFromString( g_UserUnit, dlg.GetPadNameTextSize() );
|
||||||
LastPinOrient = LIB_PIN::GetOrientationCode( dlg.GetOrientation() );
|
LastPinOrient = LIB_PIN::GetOrientationCode( dlg.GetOrientation() );
|
||||||
LastPinLength = ValueFromString( g_UserUnit, dlg.GetLength() );
|
LastPinLength = ValueFromString( g_UserUnit, dlg.GetLength() );
|
||||||
|
@ -156,7 +155,7 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
|
||||||
LastPinVisible = dlg.GetVisible();
|
LastPinVisible = dlg.GetVisible();
|
||||||
|
|
||||||
pin->EnableEditMode( true, m_editPinsPerPartOrConvert );
|
pin->EnableEditMode( true, m_editPinsPerPartOrConvert );
|
||||||
pin->SetName( dlg.GetName() );
|
pin->SetName( dlg.GetPinName() );
|
||||||
pin->SetNameTextSize( GetLastPinNameSize() );
|
pin->SetNameTextSize( GetLastPinNameSize() );
|
||||||
pin->SetNumber( dlg.GetPadName() );
|
pin->SetNumber( dlg.GetPadName() );
|
||||||
pin->SetNumberTextSize( GetLastPinNumSize() );
|
pin->SetNumberTextSize( GetLastPinNumSize() );
|
||||||
|
|
|
@ -140,9 +140,9 @@ public: BITMAP_BASE( const wxPoint& pos = wxPoint( 0, 0 ) );
|
||||||
* schematic coordinate system. It is OK to overestimate the size
|
* schematic coordinate system. It is OK to overestimate the size
|
||||||
* by a few counts.
|
* by a few counts.
|
||||||
*/
|
*/
|
||||||
EDA_RECT GetBoundingBox() const;
|
const EDA_RECT GetBoundingBox() const;
|
||||||
|
|
||||||
void DrawBitmap( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPos );
|
void DrawBitmap( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPos );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function ReadImageFile
|
* Function ReadImageFile
|
||||||
|
|
|
@ -84,7 +84,7 @@ public:
|
||||||
* may be called soon after ComputeBoundingBox() to return the same EDA_RECT,
|
* may be called soon after ComputeBoundingBox() to return the same EDA_RECT,
|
||||||
* as long as the CLASS_PL_EDITOR_LAYOUT has not changed.
|
* 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; }
|
void SetBoundingBox( const EDA_RECT& aBox ) { m_BoundingBox = aBox; }
|
||||||
|
|
||||||
|
|
|
@ -611,7 +611,7 @@ int CPolyLine::GetEndContour( int ic )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
EDA_RECT CPolyLine::GetBoundingBox()
|
const EDA_RECT CPolyLine::GetBoundingBox()
|
||||||
{
|
{
|
||||||
int xmin = INT_MAX;
|
int xmin = INT_MAX;
|
||||||
int ymin = 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 xmin = INT_MAX;
|
||||||
int ymin = INT_MAX;
|
int ymin = INT_MAX;
|
||||||
|
|
|
@ -355,14 +355,14 @@ public:
|
||||||
/**
|
/**
|
||||||
* @return the full bounding box of polygons
|
* @return the full bounding box of polygons
|
||||||
*/
|
*/
|
||||||
EDA_RECT GetBoundingBox();
|
const EDA_RECT GetBoundingBox();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the bounding box of a given polygon
|
* @return the bounding box of a given polygon
|
||||||
* @param icont = the index of the polygon contour
|
* @param icont = the index of the polygon contour
|
||||||
* (0 = main contour, 1 ... n = other contours, usually holes)
|
* (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 );
|
void Copy( const CPolyLine* src );
|
||||||
bool TestPointInside( int x, int y );
|
bool TestPointInside( int x, int y );
|
||||||
|
|
Loading…
Reference in New Issue