Rename enum TypeSheetLabel to PINSHEETLABEL_SHAPE (Better name, and in accordance with our coding style policy)

This commit is contained in:
jean-pierre charras 2016-02-28 19:16:59 +01:00
parent 4b103baa3a
commit 8522b0deb7
8 changed files with 23 additions and 26 deletions

View File

@ -302,7 +302,7 @@ void DIALOG_LABEL_EDITOR::TextPropertiesAccept( wxCommandEvent& aEvent )
if( m_TextShape )
/// @todo move cast to widget
m_CurrentText->SetShape( static_cast<TypeSheetLabel>( m_TextShape->GetSelection() ) );
m_CurrentText->SetShape( static_cast<PINSHEETLABEL_SHAPE>( m_TextShape->GetSelection() ) );
int style = m_TextStyle->GetSelection();

View File

@ -33,9 +33,7 @@
#include <dialog_sch_edit_sheet_pin_base.h>
// enum TypeSheetLabel
#include <sch_text.h>
#include <sch_text.h> // enum PINSHEETLABEL_SHAPE definition
class DIALOG_SCH_EDIT_SHEET_PIN : public DIALOG_SCH_EDIT_SHEET_PIN_BASE
@ -52,9 +50,9 @@ public:
void SetTextWidth( const wxString& aWidth ) { m_textWidth->SetValue( aWidth ); }
wxString GetTextWidth() const { return m_textWidth->GetValue(); }
void SetConnectionType( TypeSheetLabel aType ) { m_choiceConnectionType->SetSelection( aType ); }
void SetConnectionType( PINSHEETLABEL_SHAPE aType ) { m_choiceConnectionType->SetSelection( aType ); }
/// @todo move cast to widget
TypeSheetLabel GetConnectionType() const { return static_cast<TypeSheetLabel>( m_choiceConnectionType->GetCurrentSelection() ); }
PINSHEETLABEL_SHAPE GetConnectionType() const { return static_cast<PINSHEETLABEL_SHAPE>( m_choiceConnectionType->GetCurrentSelection() ); }
void SetTextHeightUnits( const wxString& aUnit ) { m_staticHeightUnits->SetLabel( aUnit ); }
void SetTextWidthUnits( const wxString& aUnit ) { m_staticWidthUnits->SetLabel( aUnit ); }

View File

@ -41,10 +41,10 @@
#include <eeschema_id.h>
static TypeSheetLabel lastGlobalLabelShape = NET_INPUT;
static int lastTextOrientation = 0;
static bool lastTextBold = false;
static bool lastTextItalic = false;
static PINSHEETLABEL_SHAPE lastGlobalLabelShape = NET_INPUT;
static int lastTextOrientation = 0;
static bool lastTextBold = false;
static bool lastTextItalic = false;
void SCH_EDIT_FRAME::ChangeTextOrient( SCH_TEXT* aTextItem, wxDC* aDC )

View File

@ -311,12 +311,12 @@ void LIB_PIN::SetShape( GRAPHIC_PINSHAPE aShape )
void LIB_PIN::SetType( ELECTRICAL_PINTYPE aType )
{
assert( aType >= 0 && aType < (int) PINTYPE_COUNT );
assert( aType >= 0 && aType < (int)PINTYPE_COUNT );
if( aType < PIN_INPUT )
aType = PIN_INPUT;
if( aType >= PINTYPE_COUNT )
if( aType >= (int)PINTYPE_COUNT )
aType = PIN_NC;
if( m_type != aType )

View File

@ -466,7 +466,7 @@ 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
*/
TypeSheetLabel tmp = m_shape;
PINSHEETLABEL_SHAPE tmp = m_shape;
switch( m_shape )
{

View File

@ -40,17 +40,16 @@ class LINE_READER;
class NETLIST_OBJECT_LIST;
/* Type of SCH_HIERLABEL and SCH_GLOBALLABEL
/* Shape/Type of SCH_HIERLABEL and SCH_GLOBALLABEL
* mainly used to handle the graphic associated shape
*/
typedef enum {
enum PINSHEETLABEL_SHAPE {
NET_INPUT,
NET_OUTPUT,
NET_BIDI,
NET_TRISTATE,
NET_UNSPECIFIED,
NET_TMAX /* Last value */
} TypeSheetLabel;
NET_UNSPECIFIED
};
extern const char* SheetLabelType[]; /* names of types of labels */
@ -58,7 +57,7 @@ extern const char* SheetLabelType[]; /* names of types of labels */
class SCH_TEXT : public SCH_ITEM, public EDA_TEXT
{
protected:
TypeSheetLabel m_shape;
PINSHEETLABEL_SHAPE m_shape;
/// True if not connected to another object if the object derive from SCH_TEXT
/// supports connections.
@ -120,9 +119,9 @@ public:
int GetOrientation() { return m_schematicOrientation; }
TypeSheetLabel GetShape() const { return m_shape; }
PINSHEETLABEL_SHAPE GetShape() const { return m_shape; }
void SetShape( TypeSheetLabel aShape ) { m_shape = aShape; }
void SetShape( PINSHEETLABEL_SHAPE aShape ) { m_shape = aShape; }
/**
* Function GetSchematicTextOffset (virtual)

View File

@ -38,7 +38,7 @@
#include <class_sch_screen.h>
#include <sch_collectors.h>
// enum TypeSheetLabel
// enum PINSHEETLABEL_SHAPE
#include <sch_text.h>
class LIB_EDIT_FRAME;
@ -175,9 +175,9 @@ private:
wxArrayString m_componentLibFiles;
*/
static TypeSheetLabel m_lastSheetPinType; ///< Last sheet pin type.
static wxSize m_lastSheetPinTextSize; ///< Last sheet pin text size.
static wxPoint m_lastSheetPinPosition; ///< Last sheet pin position.
static PINSHEETLABEL_SHAPE m_lastSheetPinType; ///< Last sheet pin type.
static wxSize m_lastSheetPinTextSize; ///< Last sheet pin text size.
static wxPoint m_lastSheetPinPosition; ///< Last sheet pin position.
protected:
TEMPLATES m_TemplateFieldNames;

View File

@ -43,7 +43,7 @@
#include <dialogs/dialog_sch_edit_sheet_pin.h>
TypeSheetLabel SCH_EDIT_FRAME::m_lastSheetPinType = NET_INPUT;
PINSHEETLABEL_SHAPE SCH_EDIT_FRAME::m_lastSheetPinType = NET_INPUT;
wxSize SCH_EDIT_FRAME::m_lastSheetPinTextSize( -1, -1 );
wxPoint SCH_EDIT_FRAME::m_lastSheetPinPosition;