Remove bus entry shape

The shape isn't needed anymore, since bus entries can be rotated
and mirrored like other items.

Fixes https://gitlab.com/kicad/code/kicad/issues/4588
This commit is contained in:
Ian McInerney 2020-06-30 02:08:33 +01:00
parent 49c7ba6724
commit bb1afb747a
11 changed files with 37 additions and 156 deletions

View File

@ -42,30 +42,30 @@
#include <default_values.h> // For some default values
SCH_BUS_ENTRY_BASE::SCH_BUS_ENTRY_BASE( KICAD_T aType, const wxPoint& pos, char shape ) :
SCH_BUS_ENTRY_BASE::SCH_BUS_ENTRY_BASE( KICAD_T aType, const wxPoint& pos, bool aFlipY ) :
SCH_ITEM( NULL, aType )
{
m_pos = pos;
m_size.x = Mils2iu( DEFAULT_SCH_ENTRY_SIZE );
m_size.y = Mils2iu( DEFAULT_SCH_ENTRY_SIZE );
if( shape == '/' )
if( aFlipY )
m_size.y *= -1;
m_isDanglingStart = m_isDanglingEnd = true;
}
SCH_BUS_WIRE_ENTRY::SCH_BUS_WIRE_ENTRY( const wxPoint& pos, char shape ) :
SCH_BUS_ENTRY_BASE( SCH_BUS_WIRE_ENTRY_T, pos, shape )
SCH_BUS_WIRE_ENTRY::SCH_BUS_WIRE_ENTRY( const wxPoint& pos, bool aFlipY ) :
SCH_BUS_ENTRY_BASE( SCH_BUS_WIRE_ENTRY_T, pos, aFlipY )
{
m_Layer = LAYER_WIRE;
m_connected_bus_item = nullptr;
}
SCH_BUS_BUS_ENTRY::SCH_BUS_BUS_ENTRY( const wxPoint& pos, char shape ) :
SCH_BUS_ENTRY_BASE( SCH_BUS_BUS_ENTRY_T, pos, shape )
SCH_BUS_BUS_ENTRY::SCH_BUS_BUS_ENTRY( const wxPoint& pos, bool aFlipY ) :
SCH_BUS_ENTRY_BASE( SCH_BUS_BUS_ENTRY_T, pos, aFlipY )
{
m_Layer = LAYER_BUS;
m_connected_bus_items[0] = nullptr;
@ -379,32 +379,6 @@ void SCH_BUS_ENTRY_BASE::Plot( PLOTTER* aPlotter )
}
void SCH_BUS_ENTRY_BASE::SetBusEntryShape( char aShape )
{
switch( aShape )
{
case '\\':
if( m_size.y < 0 )
m_size.y = -m_size.y;
break;
case '/':
if( m_size.y > 0 )
m_size.y = -m_size.y;
break;
}
}
char SCH_BUS_ENTRY_BASE::GetBusEntryShape() const
{
if( GetSize().y < 0 )
return '/';
else
return '\\';
}
void SCH_BUS_ENTRY_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
{
wxString msg;

View File

@ -50,7 +50,7 @@ protected:
STROKE_PARAMS m_stroke;
public:
SCH_BUS_ENTRY_BASE( KICAD_T aType, const wxPoint& pos = wxPoint( 0, 0 ), char shape = '\\' );
SCH_BUS_ENTRY_BASE( KICAD_T aType, const wxPoint& pos = wxPoint( 0, 0 ), bool aFlipY = false );
bool IsDanglingStart() const { return m_isDanglingStart; }
bool IsDanglingEnd() const { return m_isDanglingEnd; }
@ -68,16 +68,6 @@ public:
wxPoint m_End() const;
/**
* @return the shape of the bus entry, as an ascii code '/' or '\'
*/
char GetBusEntryShape() const;
/**
* @param aShape = the shape of the bus entry, as an ascii code '/' or '\'
*/
void SetBusEntryShape( char aShape );
wxSize GetSize() const { return m_size; }
void SetSize( const wxSize& aSize ) { m_size = aSize; }
@ -143,7 +133,7 @@ private:
class SCH_BUS_WIRE_ENTRY : public SCH_BUS_ENTRY_BASE
{
public:
SCH_BUS_WIRE_ENTRY( const wxPoint& pos = wxPoint( 0, 0 ), char shape = '\\' );
SCH_BUS_WIRE_ENTRY( const wxPoint& pos = wxPoint( 0, 0 ), bool aFlipY = false );
~SCH_BUS_WIRE_ENTRY() { }
@ -191,7 +181,7 @@ public:
class SCH_BUS_BUS_ENTRY : public SCH_BUS_ENTRY_BASE
{
public:
SCH_BUS_BUS_ENTRY( const wxPoint& pos = wxPoint( 0, 0 ), char shape = '\\' );
SCH_BUS_BUS_ENTRY( const wxPoint& pos = wxPoint( 0, 0 ), bool aFlipY = false );
~SCH_BUS_BUS_ENTRY() { }

View File

@ -2031,7 +2031,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
linestart + wxPoint( 0, -100 ), busstart, busend, 0 ) )
{
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY(
linestart + wxPoint( -100, 0 ), '/' );
linestart + wxPoint( -100, 0 ), true );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
moveLabels( line, linestart + wxPoint( -100, 0 ) );
@ -2041,7 +2041,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
linestart + wxPoint( 0, 100 ), busstart, busend, 0 ) )
{
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY(
linestart + wxPoint( -100, 0 ), '\\' );
linestart + wxPoint( -100, 0 ), false );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
moveLabels( line, linestart + wxPoint( -100, 0 ) );
@ -2068,7 +2068,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
linestart + wxPoint( 0, -100 ), busstart, busend, 0 ) )
{
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY(
linestart + wxPoint( 0, -100 ), '\\' );
linestart + wxPoint( 0, -100 ), false );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
moveLabels( line, linestart + wxPoint( 100, 0 ) );
@ -2079,7 +2079,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
linestart + wxPoint( 0, 100 ), busstart, busend, 0 ) )
{
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY(
linestart + wxPoint( 0, 100 ), '/' );
linestart + wxPoint( 0, 100 ), true );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
moveLabels( line, linestart + wxPoint( 100, 0 ) );
@ -2110,7 +2110,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
// |
// ___/|
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY(
lineend + wxPoint( -100, 0 ), '\\' );
lineend + wxPoint( -100, 0 ), false );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
moveLabels( line, lineend + wxPoint( -100, 0 ) );
@ -2121,7 +2121,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
lineend + wxPoint( 0, -100 ), busstart, busend, 0 ) )
{
SCH_BUS_WIRE_ENTRY* busEntry =
new SCH_BUS_WIRE_ENTRY( lineend + wxPoint( -100, 0 ), '/' );
new SCH_BUS_WIRE_ENTRY( lineend + wxPoint( -100, 0 ), true );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
moveLabels( line, lineend + wxPoint( -100, 0 ) );
@ -2147,7 +2147,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
lineend + wxPoint( 0, -100 ), busstart, busend, 0 ) )
{
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY(
lineend + wxPoint( 0, -100 ), '\\' );
lineend + wxPoint( 0, -100 ), false );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
moveLabels( line, lineend + wxPoint( 100, 0 ) );
@ -2158,7 +2158,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
lineend + wxPoint( 0, 100 ), busstart, busend, 0 ) )
{
SCH_BUS_WIRE_ENTRY* busEntry =
new SCH_BUS_WIRE_ENTRY( lineend + wxPoint( 0, 100 ), '/' );
new SCH_BUS_WIRE_ENTRY( lineend + wxPoint( 0, 100 ), true );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
moveLabels( line, lineend + wxPoint( 100, 0 ) );
@ -2190,7 +2190,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
linestart + wxPoint( -100, 0 ), busstart, busend, 0 ) )
{
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY(
linestart + wxPoint( -100, 0 ), '/' );
linestart + wxPoint( -100, 0 ), true );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
moveLabels( line, linestart + wxPoint( 0, -100 ) );
@ -2200,7 +2200,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
linestart + wxPoint( 100, 0 ), busstart, busend, 0 ) )
{
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY(
linestart + wxPoint( 0, 100 ), '\\' );
linestart + wxPoint( 0, 100 ), false );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
moveLabels( line, linestart + wxPoint( 0, -100 ) );
@ -2222,7 +2222,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
linestart + wxPoint( -100, 0 ), busstart, busend, 0 ) )
{
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY(
linestart + wxPoint( -100, 0 ), '\\' );
linestart + wxPoint( -100, 0 ), false );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
moveLabels( line, linestart + wxPoint( 0, 100 ) );
@ -2232,7 +2232,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
linestart + wxPoint( 100, 0 ), busstart, busend, 0 ) )
{
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY(
linestart + wxPoint( 100, 0 ), '/' );
linestart + wxPoint( 100, 0 ), true );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
moveLabels( line, linestart + wxPoint( 0, 100 ) );
@ -2261,7 +2261,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
lineend + wxPoint( -100, 0 ), busstart, busend, 0 ) )
{
SCH_BUS_WIRE_ENTRY* busEntry =
new SCH_BUS_WIRE_ENTRY( lineend + wxPoint( -100, 0 ), '/' );
new SCH_BUS_WIRE_ENTRY( lineend + wxPoint( -100, 0 ), true );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
moveLabels( line, lineend + wxPoint( 0, -100 ) );
@ -2271,7 +2271,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
lineend + wxPoint( 100, 0 ), busstart, busend, 0 ) )
{
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY(
lineend + wxPoint( 0, -100 ), '\\' );
lineend + wxPoint( 0, -100 ), false );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
moveLabels( line, lineend + wxPoint( 0, -100 ) );
@ -2293,7 +2293,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
lineend + wxPoint( -100, 0 ), busstart, busend, 0 ) )
{
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY(
lineend + wxPoint( -100, 0 ), '\\' );
lineend + wxPoint( -100, 0 ), false );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
moveLabels( line, lineend + wxPoint( 0, 100 ) );
@ -2303,7 +2303,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
lineend + wxPoint( 100, 0 ), busstart, busend, 0 ) )
{
SCH_BUS_WIRE_ENTRY* busEntry =
new SCH_BUS_WIRE_ENTRY( lineend + wxPoint( 0, 100 ), '/' );
new SCH_BUS_WIRE_ENTRY( lineend + wxPoint( 0, 100 ), true );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
moveLabels( line, lineend + wxPoint( 0, 100 ) );
@ -2336,7 +2336,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
if( wirevector.y > 0 )
{
wxPoint p = linestart + wxPoint( -100, -100 );
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( p, '\\' );
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( p, false );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
moveLabels( line, p );
@ -2354,7 +2354,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
else
{
wxPoint p = linestart + wxPoint( -100, 100 );
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( p, '/' );
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( p, true );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
@ -2375,7 +2375,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
{
if( wirevector.y > 0 )
{
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( linestart, '/' );
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( linestart, true );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
@ -2395,7 +2395,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
else
{
SCH_BUS_WIRE_ENTRY* busEntry =
new SCH_BUS_WIRE_ENTRY( linestart, '\\' );
new SCH_BUS_WIRE_ENTRY( linestart, false );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
moveLabels( line, linestart + wxPoint( 100, 100 ) );
@ -2423,7 +2423,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
if( wirevector.y > 0 )
{
wxPoint p = lineend + wxPoint( 100, 100 );
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( lineend, '\\' );
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( lineend, false );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
@ -2441,7 +2441,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
else
{
wxPoint p = lineend + wxPoint( 100, -100 );
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( lineend, '/' );
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( lineend, true );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
@ -2462,7 +2462,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
if( wirevector.y > 0 )
{
wxPoint p = lineend + wxPoint( -100, 100 );
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( p, '/' );
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( p, true );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
moveLabels( line, p );
@ -2479,7 +2479,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
else
{
wxPoint p = lineend + wxPoint( -100, -100 );
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( p, '\\' );
SCH_BUS_WIRE_ENTRY* busEntry = new SCH_BUS_WIRE_ENTRY( p, false );
busEntry->SetFlags( IS_NEW );
m_currentSheet->GetScreen()->Append( busEntry );
moveLabels( line, p );

View File

@ -2483,10 +2483,6 @@ SCH_BUS_WIRE_ENTRY* SCH_SEXPR_PARSER::parseBusEntry()
size.SetWidth( parseInternalUnits( "bus entry height" ) );
size.SetHeight( parseInternalUnits( "bus entry width" ) );
busEntry->SetSize( size );
if( size.y < 0 )
busEntry->SetBusEntryShape( '/' );
NeedRIGHT();
break;
}

View File

@ -279,12 +279,6 @@ TOOL_ACTION EE_ACTIONS::placeBusWireEntry( "eeschema.InteractiveDrawing.placeBus
_( "Add Wire to Bus Entry" ), _( "Add a wire entry to a bus" ),
add_line2bus_xpm, AF_ACTIVATE, (void*) SCH_BUS_WIRE_ENTRY_T );
TOOL_ACTION EE_ACTIONS::placeBusBusEntry( "eeschema.InteractiveDrawing.placeBusBusEntry",
AS_GLOBAL,
'/', LEGACY_HK_NAME( "Add Bus Entry" ),
_( "Add Bus to Bus Entry" ), _( "Add a bus entry to a bus" ),
add_bus2bus_xpm, AF_ACTIVATE, (void*) SCH_BUS_BUS_ENTRY_T );
TOOL_ACTION EE_ACTIONS::placeLabel( "eeschema.InteractiveDrawing.placeLabel",
AS_GLOBAL,
'L', LEGACY_HK_NAME( "Add Label" ),
@ -417,16 +411,6 @@ TOOL_ACTION EE_ACTIONS::showDeMorganAlternate( "eeschema.InteractiveEdit.showDeM
_( "DeMorgan Alternate" ), _( "Switch to alternate DeMorgan representation" ),
morgan2_xpm );
TOOL_ACTION EE_ACTIONS::toShapeSlash( "eeschema.InteractiveEdit.toShapeSlash",
AS_GLOBAL, 0, "",
_( "Set Bus Entry Shape /" ), _( "Change the bus entry shape to /" ),
change_entry_orient_xpm, AF_NONE, (void*) '/' );
TOOL_ACTION EE_ACTIONS::toShapeBackslash( "eeschema.InteractiveEdit.toShapeBackslash",
AS_GLOBAL, 0, "",
_( "Set Bus Entry Shape \\" ), _( "Change the bus entry shape to \\" ),
change_entry_orient_xpm, AF_NONE, (void*) '\\' );
TOOL_ACTION EE_ACTIONS::toLabel( "eeschema.InteractiveEdit.toLabel",
AS_GLOBAL, 0, "",
_( "Change to Label" ), _( "Change existing item to a label" ),

View File

@ -82,7 +82,6 @@ public:
static TOOL_ACTION placeNoConnect;
static TOOL_ACTION placeJunction;
static TOOL_ACTION placeBusWireEntry;
static TOOL_ACTION placeBusBusEntry;
static TOOL_ACTION placeLabel;
static TOOL_ACTION placeGlobalLabel;
static TOOL_ACTION placeHierLabel;
@ -127,8 +126,6 @@ public:
static TOOL_ACTION showDeMorganStandard;
static TOOL_ACTION showDeMorganAlternate;
static TOOL_ACTION editSymbolUnit;
static TOOL_ACTION toShapeSlash;
static TOOL_ACTION toShapeBackslash;
static TOOL_ACTION toLabel;
static TOOL_ACTION toHLabel;
static TOOL_ACTION toGLabel;

View File

@ -48,7 +48,6 @@
SCH_DRAWING_TOOLS::SCH_DRAWING_TOOLS() :
EE_TOOL_BASE<SCH_EDIT_FRAME>( "eeschema.InteractiveDrawing" ),
m_lastBusEntryShape( '/' ),
m_lastGlobalLabelShape( PINSHEETLABEL_SHAPE::PS_INPUT ),
m_lastTextOrientation( LABEL_SPIN_STYLE::LEFT ),
m_lastTextBold( false ),
@ -462,10 +461,7 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent )
previewItem = new SCH_JUNCTION( cursorPos );
break;
case SCH_BUS_WIRE_ENTRY_T:
previewItem = new SCH_BUS_WIRE_ENTRY( cursorPos, m_lastBusEntryShape );
break;
case SCH_BUS_BUS_ENTRY_T:
previewItem = new SCH_BUS_BUS_ENTRY( cursorPos, m_lastBusEntryShape );
previewItem = new SCH_BUS_WIRE_ENTRY( cursorPos );
break;
default:
wxASSERT_MSG( false, "Unknown item type in SCH_DRAWING_TOOLS::SingleClickPlace" );
@ -542,20 +538,12 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent )
}
else if( evt->Category() == TC_COMMAND )
{
if( ( type == SCH_BUS_BUS_ENTRY_T || type == SCH_BUS_WIRE_ENTRY_T )
if( ( type == SCH_BUS_WIRE_ENTRY_T )
&& ( evt->IsAction( &EE_ACTIONS::rotateCW )
|| evt->IsAction( &EE_ACTIONS::rotateCCW )
|| evt->IsAction( &EE_ACTIONS::mirrorX )
|| evt->IsAction( &EE_ACTIONS::mirrorY )
|| evt->IsAction( &EE_ACTIONS::toShapeBackslash )
|| evt->IsAction( &EE_ACTIONS::toShapeSlash ) ) )
|| evt->IsAction( &EE_ACTIONS::mirrorY ) ) )
{
// Update the shape of the bus entry
if( evt->IsAction( &EE_ACTIONS::toShapeSlash ) )
m_lastBusEntryShape = '/';
else if( evt->IsAction( &EE_ACTIONS::toShapeBackslash ) )
m_lastBusEntryShape = '\\';
SCH_BUS_ENTRY_BASE* busItem = static_cast<SCH_BUS_ENTRY_BASE*>( previewItem );
// The bus entries only rotate in one direction
@ -566,9 +554,6 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent )
busItem->MirrorX( busItem->GetPosition().x );
else if( evt->IsAction( &EE_ACTIONS::mirrorY ) )
busItem->MirrorY( busItem->GetPosition().y );
else if( evt->IsAction( &EE_ACTIONS::toShapeBackslash )
|| evt->IsAction( &EE_ACTIONS::toShapeSlash ) )
busItem->SetBusEntryShape( m_lastBusEntryShape );
m_view->ClearPreview();
m_view->AddToPreview( previewItem->Clone() );

View File

@ -58,8 +58,6 @@ public:
int DrawSheet( const TOOL_EVENT& aEvent );
int PlaceImage( const TOOL_EVENT& aEvent );
void SetLastBusEntryShape( char aShape ) { m_lastBusEntryShape = aShape; }
private:
/**
* Gets the next queued text item
@ -79,8 +77,6 @@ private:
std::vector<COMPONENT_SELECTION> m_symbolHistoryList;
std::vector<COMPONENT_SELECTION> m_powerHistoryList;
char m_lastBusEntryShape;
PINSHEETLABEL_SHAPE m_lastGlobalLabelShape;
LABEL_SPIN_STYLE m_lastTextOrientation;
bool m_lastTextBold;

View File

@ -324,8 +324,6 @@ bool SCH_EDIT_TOOL::Init()
drawMenu.AddItem( EE_ACTIONS::editWithLibEdit, singleComponentCondition && E_C::Idle, 200 );
drawMenu.AddItem( EE_ACTIONS::toShapeSlash, entryCondition, 200 );
drawMenu.AddItem( EE_ACTIONS::toShapeBackslash, entryCondition, 200 );
drawMenu.AddItem( EE_ACTIONS::toLabel, anyTextTool && E_C::Idle, 200 );
drawMenu.AddItem( EE_ACTIONS::toHLabel, anyTextTool && E_C::Idle, 200 );
drawMenu.AddItem( EE_ACTIONS::toGLabel, anyTextTool && E_C::Idle, 200 );
@ -357,8 +355,6 @@ bool SCH_EDIT_TOOL::Init()
selToolMenu.AddItem( EE_ACTIONS::editWithLibEdit, singleComponentCondition && E_C::Idle, 200 );
selToolMenu.AddItem( EE_ACTIONS::toShapeSlash, entryCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::toShapeBackslash, entryCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::toLabel, toLabelCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::toHLabel, toHLabelCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::toGLabel, toGLabelCondition, 200 );
@ -1478,36 +1474,6 @@ int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
}
int SCH_EDIT_TOOL::ChangeShape( const TOOL_EVENT& aEvent )
{
EE_SELECTION& selection = m_selectionTool->GetSelection();
char shape = aEvent.Parameter<char>();
for( unsigned int i = 0; i < selection.GetSize(); ++i )
{
SCH_BUS_ENTRY_BASE* entry = dynamic_cast<SCH_BUS_ENTRY_BASE*>( selection.GetItem( i ) );
if( entry )
{
if( entry->GetEditFlags() == 0 )
m_frame->SaveCopyInUndoList( entry, UR_CHANGED );
entry->SetBusEntryShape( shape );
m_frame->TestDanglingEnds();
m_frame->GetScreen()->Update( entry );
updateView( entry );
m_frame->OnModify( );
}
}
SCH_DRAWING_TOOLS* drawingTool = m_toolMgr->GetTool<SCH_DRAWING_TOOLS>();
drawingTool->SetLastBusEntryShape( shape );
return 0;
}
int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent )
{
KICAD_T convertTo = aEvent.Parameter<KICAD_T>();
@ -1678,8 +1644,6 @@ void SCH_EDIT_TOOL::setTransitions()
Go( &SCH_EDIT_TOOL::ConvertDeMorgan, EE_ACTIONS::showDeMorganStandard.MakeEvent() );
Go( &SCH_EDIT_TOOL::ConvertDeMorgan, EE_ACTIONS::showDeMorganAlternate.MakeEvent() );
Go( &SCH_EDIT_TOOL::ChangeShape, EE_ACTIONS::toShapeSlash.MakeEvent() );
Go( &SCH_EDIT_TOOL::ChangeShape, EE_ACTIONS::toShapeBackslash.MakeEvent() );
Go( &SCH_EDIT_TOOL::ChangeTextType, EE_ACTIONS::toLabel.MakeEvent() );
Go( &SCH_EDIT_TOOL::ChangeTextType, EE_ACTIONS::toHLabel.MakeEvent() );
Go( &SCH_EDIT_TOOL::ChangeTextType, EE_ACTIONS::toGLabel.MakeEvent() );

View File

@ -54,8 +54,6 @@ public:
int UpdateFields( const TOOL_EVENT& aEvent );
int ConvertDeMorgan( const TOOL_EVENT& aEvent );
int ChangeShape( const TOOL_EVENT& aEvent );
/**
* Change a text type to another one.
*

View File

@ -635,13 +635,10 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType
SCH_BUS_WIRE_ENTRY* entry = m_busUnfold.entry;
bool offset = ( cursor_delta.x < 0 );
char shape = ( offset ? ( ( cursor_delta.y >= 0 ) ? '/' : '\\' )
: ( ( cursor_delta.y >= 0 ) ? '\\' : '/' ) );
// Erase and redraw if necessary
if( shape != entry->GetBusEntryShape() || offset != m_busUnfold.offset )
if( offset != m_busUnfold.offset )
{
entry->SetBusEntryShape( shape );
wxPoint entry_pos = m_busUnfold.origin;
if( offset )