Skip to content

Commit

Permalink
Rename enum TypeSheetLabel to PINSHEETLABEL_SHAPE (Better name, and i…
Browse files Browse the repository at this point in the history
…n accordance with our coding style policy)
  • Loading branch information
jp-charras committed Feb 28, 2016
1 parent 4b103ba commit 8522b0d
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 26 deletions.
2 changes: 1 addition & 1 deletion eeschema/dialogs/dialog_edit_label.cpp
Expand Up @@ -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();

Expand Down
8 changes: 3 additions & 5 deletions eeschema/dialogs/dialog_sch_edit_sheet_pin.h
Expand Up @@ -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
Expand All @@ -52,9 +50,9 @@ class DIALOG_SCH_EDIT_SHEET_PIN : public DIALOG_SCH_EDIT_SHEET_PIN_BASE
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 ); }
Expand Down
8 changes: 4 additions & 4 deletions eeschema/edit_label.cpp
Expand Up @@ -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 )
Expand Down
4 changes: 2 additions & 2 deletions eeschema/lib_pin.cpp
Expand Up @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion eeschema/sch_sheet_pin.cpp
Expand Up @@ -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 )
{
Expand Down
15 changes: 7 additions & 8 deletions eeschema/sch_text.h
Expand Up @@ -40,25 +40,24 @@ 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 */

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.
Expand Down Expand Up @@ -120,9 +119,9 @@ class SCH_TEXT : public SCH_ITEM, public EDA_TEXT

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)
Expand Down
8 changes: 4 additions & 4 deletions eeschema/schframe.h
Expand Up @@ -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;
Expand Down Expand Up @@ -175,9 +175,9 @@ class SCH_EDIT_FRAME : public SCH_BASE_FRAME
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;
Expand Down
2 changes: 1 addition & 1 deletion eeschema/sheetlab.cpp
Expand Up @@ -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;

Expand Down

0 comments on commit 8522b0d

Please sign in to comment.