Cleanup.
This commit is contained in:
parent
3b59c6cf0a
commit
6f89b41f18
|
@ -175,21 +175,12 @@ void BLOCK_SELECTOR::Clear()
|
||||||
void DrawAndSizingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
|
void DrawAndSizingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
|
||||||
bool aErase )
|
bool aErase )
|
||||||
{
|
{
|
||||||
BLOCK_SELECTOR* block;
|
BLOCK_SELECTOR* block = &aPanel->GetScreen()->m_BlockLocate;
|
||||||
|
|
||||||
block = &aPanel->GetScreen()->m_BlockLocate;
|
|
||||||
|
|
||||||
block->SetMoveVector( wxPoint( 0, 0 ) );
|
block->SetMoveVector( wxPoint( 0, 0 ) );
|
||||||
|
|
||||||
if( aErase && aDC )
|
|
||||||
block->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode, block->GetColor() );
|
|
||||||
|
|
||||||
block->SetLastCursorPosition( aPanel->GetParent()->GetCrossHairPosition() );
|
block->SetLastCursorPosition( aPanel->GetParent()->GetCrossHairPosition() );
|
||||||
block->SetEnd( aPanel->GetParent()->GetCrossHairPosition() );
|
block->SetEnd( aPanel->GetParent()->GetCrossHairPosition() );
|
||||||
|
|
||||||
if( aDC )
|
|
||||||
block->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode, block->GetColor() );
|
|
||||||
|
|
||||||
if( block->GetState() == STATE_BLOCK_INIT )
|
if( block->GetState() == STATE_BLOCK_INIT )
|
||||||
{
|
{
|
||||||
if( block->GetWidth() || block->GetHeight() )
|
if( block->GetWidth() || block->GetHeight() )
|
||||||
|
|
|
@ -381,8 +381,7 @@ void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component, SYMBOL_LIB
|
||||||
|
|
||||||
if( !Component->GetFlags() )
|
if( !Component->GetFlags() )
|
||||||
{
|
{
|
||||||
msg.Printf( _( "Move %s" ),
|
msg.Printf( _( "Move %s" ), Component->GetField( REFERENCE )->GetText() );
|
||||||
GetChars( Component->GetField( REFERENCE )->GetText() ) );
|
|
||||||
msg = AddHotkeyName( msg, g_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
|
msg = AddHotkeyName( msg, g_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
|
||||||
AddMenuItem( PopMenu, ID_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) );
|
AddMenuItem( PopMenu, ID_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) );
|
||||||
msg = AddHotkeyName( _( "Drag" ), g_Schematic_Hokeys_Descr, HK_DRAG );
|
msg = AddHotkeyName( _( "Drag" ), g_Schematic_Hokeys_Descr, HK_DRAG );
|
||||||
|
@ -598,13 +597,11 @@ void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label )
|
||||||
|
|
||||||
if( !Label->GetFlags() )
|
if( !Label->GetFlags() )
|
||||||
{
|
{
|
||||||
msg = AddHotkeyName( _( "Move" ), g_Schematic_Hokeys_Descr,
|
msg = AddHotkeyName( _( "Move" ), g_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
|
||||||
HK_MOVE_COMPONENT_OR_ITEM );
|
|
||||||
AddMenuItem( PopMenu, ID_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) );
|
AddMenuItem( PopMenu, ID_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) );
|
||||||
msg = AddHotkeyName( _( "Drag" ), g_Schematic_Hokeys_Descr, HK_DRAG );
|
msg = AddHotkeyName( _( "Drag" ), g_Schematic_Hokeys_Descr, HK_DRAG );
|
||||||
AddMenuItem( PopMenu, ID_SCH_DRAG_ITEM, msg, KiBitmap( drag_xpm ) );
|
AddMenuItem( PopMenu, ID_SCH_DRAG_ITEM, msg, KiBitmap( drag_xpm ) );
|
||||||
msg = AddHotkeyName( _( "Duplicate" ), g_Schematic_Hokeys_Descr,
|
msg = AddHotkeyName( _( "Duplicate" ), g_Schematic_Hokeys_Descr, HK_DUPLICATE_ITEM );
|
||||||
HK_DUPLICATE_ITEM );
|
|
||||||
AddMenuItem( PopMenu, ID_POPUP_SCH_DUPLICATE_ITEM, msg, KiBitmap( duplicate_xpm ) );
|
AddMenuItem( PopMenu, ID_POPUP_SCH_DUPLICATE_ITEM, msg, KiBitmap( duplicate_xpm ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -634,11 +631,9 @@ void AddMenusForText( wxMenu* PopMenu, SCH_TEXT* Text )
|
||||||
|
|
||||||
if( !Text->GetFlags() )
|
if( !Text->GetFlags() )
|
||||||
{
|
{
|
||||||
msg = AddHotkeyName( _( "Move" ), g_Schematic_Hokeys_Descr,
|
msg = AddHotkeyName( _( "Move" ), g_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
|
||||||
HK_MOVE_COMPONENT_OR_ITEM );
|
|
||||||
AddMenuItem( PopMenu, ID_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) );
|
AddMenuItem( PopMenu, ID_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) );
|
||||||
msg = AddHotkeyName( _( "Duplicate" ), g_Schematic_Hokeys_Descr,
|
msg = AddHotkeyName( _( "Duplicate" ), g_Schematic_Hokeys_Descr, HK_DUPLICATE_ITEM );
|
||||||
HK_DUPLICATE_ITEM );
|
|
||||||
AddMenuItem( PopMenu, ID_POPUP_SCH_DUPLICATE_ITEM, msg, KiBitmap( duplicate_xpm ) );
|
AddMenuItem( PopMenu, ID_POPUP_SCH_DUPLICATE_ITEM, msg, KiBitmap( duplicate_xpm ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -707,8 +702,7 @@ void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, SCH_EDIT_FRAME* frame )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_new = Wire->IsNew();
|
if( Wire->IsNew() )
|
||||||
if( is_new )
|
|
||||||
{
|
{
|
||||||
msg = AddHotkeyName( _( "Wire End" ), g_Schematic_Hokeys_Descr, HK_END_CURR_LINEWIREBUS );
|
msg = AddHotkeyName( _( "Wire End" ), g_Schematic_Hokeys_Descr, HK_END_CURR_LINEWIREBUS );
|
||||||
AddMenuItem( PopMenu, ID_POPUP_END_LINE, msg, KiBitmap( checked_ok_xpm ) );
|
AddMenuItem( PopMenu, ID_POPUP_END_LINE, msg, KiBitmap( checked_ok_xpm ) );
|
||||||
|
@ -757,8 +751,7 @@ void AddMenusForBus( wxMenu* PopMenu, SCH_LINE* Bus, SCH_EDIT_FRAME* frame )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_new = Bus->IsNew();
|
if( Bus->IsNew() )
|
||||||
if( is_new )
|
|
||||||
{
|
{
|
||||||
msg = AddHotkeyName( _( "Bus End" ), g_Schematic_Hokeys_Descr, HK_END_CURR_LINEWIREBUS );
|
msg = AddHotkeyName( _( "Bus End" ), g_Schematic_Hokeys_Descr, HK_END_CURR_LINEWIREBUS );
|
||||||
AddMenuItem( PopMenu, ID_POPUP_END_LINE, msg, KiBitmap( checked_ok_xpm ) );
|
AddMenuItem( PopMenu, ID_POPUP_END_LINE, msg, KiBitmap( checked_ok_xpm ) );
|
||||||
|
@ -855,16 +848,14 @@ void AddMenusForSheetPin( wxMenu* PopMenu, SCH_SHEET_PIN* PinSheet )
|
||||||
|
|
||||||
if( !PinSheet->GetFlags() )
|
if( !PinSheet->GetFlags() )
|
||||||
{
|
{
|
||||||
msg = AddHotkeyName( _( "Move" ), g_Schematic_Hokeys_Descr,
|
msg = AddHotkeyName( _( "Move" ), g_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
|
||||||
HK_MOVE_COMPONENT_OR_ITEM );
|
|
||||||
AddMenuItem( PopMenu, ID_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) );
|
AddMenuItem( PopMenu, ID_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
AddMenuItem( PopMenu, ID_SCH_EDIT_ITEM, _( "Edit..." ), KiBitmap( edit_xpm ) );
|
AddMenuItem( PopMenu, ID_SCH_EDIT_ITEM, _( "Edit..." ), KiBitmap( edit_xpm ) );
|
||||||
|
|
||||||
if( !PinSheet->GetFlags() )
|
if( !PinSheet->GetFlags() )
|
||||||
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete" ),
|
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete" ), KiBitmap( delete_xpm ) );
|
||||||
KiBitmap( delete_xpm ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -215,8 +215,6 @@ void SCH_EDIT_FRAME::DeleteItem( SCH_ITEM* aItem, bool aAppend )
|
||||||
if( junction && !screen->IsJunctionNeeded( point ) )
|
if( junction && !screen->IsJunctionNeeded( point ) )
|
||||||
DeleteJunction( junction, true );
|
DeleteJunction( junction, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_canvas->RefreshDrawingRect( aItem->GetBoundingBox() );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -270,7 +270,6 @@ void SCH_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
|
||||||
int localbutt = 0;
|
int localbutt = 0;
|
||||||
BASE_SCREEN* screen = GetScreen();
|
BASE_SCREEN* screen = GetScreen();
|
||||||
auto controls = GetViewControls();
|
auto controls = GetViewControls();
|
||||||
auto vcp = VECTOR2I( controls->GetCursorPosition() );
|
|
||||||
auto vmp = VECTOR2I( controls->GetMousePosition() );
|
auto vmp = VECTOR2I( controls->GetMousePosition() );
|
||||||
wxPoint mousePos ( vmp.x, vmp.y );
|
wxPoint mousePos ( vmp.x, vmp.y );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue