Cleanup.
This commit is contained in:
parent
7235da0979
commit
7cfe19d9fd
|
@ -1048,9 +1048,7 @@ void DIALOG_FIELDS_EDITOR_GLOBAL::OnTableCellClick( wxGridEvent& event )
|
|||
|
||||
void DIALOG_FIELDS_EDITOR_GLOBAL::OnTableItemContextMenu( wxGridEvent& event )
|
||||
{
|
||||
/* TODO
|
||||
* - Option to select footprint if FOOTPRINT column selected
|
||||
*/
|
||||
// TODO: Option to select footprint if FOOTPRINT column selected
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
|
|
@ -169,8 +169,6 @@ public:
|
|||
* create a pseudo reference text. If the base reference field is U,
|
||||
* the string U?A will be returned for unit = 1.
|
||||
*
|
||||
* @todo This should be handled by the field object.
|
||||
*
|
||||
* @param unit - The package unit number. Only effects reference field.
|
||||
* @return Field text.
|
||||
*/
|
||||
|
|
|
@ -705,7 +705,6 @@ void LIB_EDIT_FRAME::CommonSettingsChanged()
|
|||
|
||||
void LIB_EDIT_FRAME::ShowChangedLanguage()
|
||||
{
|
||||
// JEY TODO: push this down into EDA_BASE_FRAME...
|
||||
// call my base class
|
||||
SCH_BASE_FRAME::ShowChangedLanguage();
|
||||
|
||||
|
|
|
@ -99,13 +99,10 @@ int EE_PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
else if( evt->IsClick( BUT_RIGHT ) )
|
||||
{
|
||||
// TODO...
|
||||
// m_menu.ShowContextMenu();
|
||||
m_menu.ShowContextMenu();
|
||||
}
|
||||
else
|
||||
{
|
||||
evt->SetPassEvent();
|
||||
}
|
||||
}
|
||||
|
||||
if( m_finalizeHandler )
|
||||
|
|
|
@ -301,7 +301,7 @@ int EE_POINT_EDITOR::Main( const TOOL_EVENT& aEvent )
|
|||
inDrag = false;
|
||||
}
|
||||
|
||||
else if( evt->IsCancel() )
|
||||
else if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
|
||||
{
|
||||
if( inDrag ) // Restore the last change
|
||||
{
|
||||
|
|
|
@ -294,17 +294,16 @@ static bool deleteItem( SCH_BASE_FRAME* aFrame, const VECTOR2D& aPosition )
|
|||
int LIB_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
m_frame->SetTool( aEvent.GetCommandStr().get() );
|
||||
m_frame->GetCanvas()->SetCurrentCursor( wxCURSOR_BULLSEYE );
|
||||
Activate();
|
||||
|
||||
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
|
||||
wxCHECK( picker, 0 );
|
||||
|
||||
picker->SetClickHandler( std::bind( deleteItem, m_frame, std::placeholders::_1 ) );
|
||||
picker->SetCancelHandler( [this]() { m_frame->ClearToolStack(); } );
|
||||
picker->Activate();
|
||||
Wait();
|
||||
|
||||
m_frame->GetCanvas()->SetCurrentCursor( wxCURSOR_ARROW );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -919,17 +919,16 @@ static bool deleteItem( SCH_BASE_FRAME* aFrame, const VECTOR2D& aPosition )
|
|||
int SCH_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
m_frame->SetTool( aEvent.GetCommandStr().get() );
|
||||
m_frame->GetCanvas()->SetCurrentCursor( wxCURSOR_BULLSEYE );
|
||||
Activate();
|
||||
|
||||
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
|
||||
wxCHECK( picker, 0 );
|
||||
|
||||
picker->SetClickHandler( std::bind( deleteItem, m_frame, std::placeholders::_1 ) );
|
||||
picker->SetCancelHandler( [this]() { m_frame->ClearToolStack(); } );
|
||||
picker->Activate();
|
||||
Wait();
|
||||
|
||||
m_frame->GetCanvas()->SetCurrentCursor( wxCURSOR_ARROW );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -478,18 +478,19 @@ static bool probeSimulation( SCH_EDIT_FRAME* aFrame, const VECTOR2D& aPosition )
|
|||
|
||||
int SCH_EDITOR_CONTROL::SimProbe( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
Activate();
|
||||
|
||||
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
|
||||
assert( picker );
|
||||
|
||||
m_frame->SetToolID( ID_SIM_PROBE, wxCURSOR_DEFAULT, _( "Add a simulator probe" ) );
|
||||
m_frame->GetCanvas()->SetCursor( SIMULATION_CURSORS::GetCursor( SIMULATION_CURSORS::CURSOR::PROBE ) );
|
||||
|
||||
picker->SetClickHandler( std::bind( probeSimulation, m_frame, std::placeholders::_1 ) );
|
||||
picker->Activate();
|
||||
Wait();
|
||||
|
||||
m_frame->PopTool();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -522,18 +523,19 @@ static bool tuneSimulation( SCH_EDIT_FRAME* aFrame, const VECTOR2D& aPosition )
|
|||
|
||||
int SCH_EDITOR_CONTROL::SimTune( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
Activate();
|
||||
|
||||
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
|
||||
assert( picker );
|
||||
|
||||
m_frame->SetToolID( ID_SIM_TUNE, wxCURSOR_DEFAULT, _( "Select a value to be tuned" ) );
|
||||
m_frame->GetCanvas()->SetCursor( SIMULATION_CURSORS::GetCursor( SIMULATION_CURSORS::CURSOR::TUNE ) );
|
||||
|
||||
picker->SetClickHandler( std::bind( tuneSimulation, m_frame, std::placeholders::_1 ) );
|
||||
picker->Activate();
|
||||
Wait();
|
||||
|
||||
m_frame->PopTool();
|
||||
return 0;
|
||||
}
|
||||
#endif /* KICAD_SPICE */
|
||||
|
@ -690,13 +692,14 @@ int SCH_EDITOR_CONTROL::HighlightNetCursor( const TOOL_EVENT& aEvent )
|
|||
if( !ADVANCED_CFG::GetCfg().m_realTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime )
|
||||
m_frame->RecalculateConnections();
|
||||
|
||||
m_frame->SetTool( aEvent.GetCommandStr().get() );
|
||||
Activate();
|
||||
|
||||
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
|
||||
assert( picker );
|
||||
wxCHECK( picker, 0 );
|
||||
|
||||
m_frame->SetTool( aEvent.GetCommandStr().get() );
|
||||
picker->SetClickHandler( std::bind( highlightNet, m_toolMgr, std::placeholders::_1 ) );
|
||||
picker->SetCancelHandler( [this]() { m_frame->ClearToolStack(); } );
|
||||
picker->Activate();
|
||||
Wait();
|
||||
|
||||
|
|
|
@ -179,15 +179,11 @@ private:
|
|||
bool m_listPowerCmpOnly;
|
||||
wxArrayString m_allowedLibs;
|
||||
|
||||
// TODO(hzeller): looks like these members were chosen to be static to survive different
|
||||
// instances of this browser and communicate it to the next instance. This looks like an
|
||||
// ugly hack, and should be solved differently.
|
||||
static wxString m_libraryName;
|
||||
static wxString m_libraryName;
|
||||
static wxString m_entryName;
|
||||
|
||||
static wxString m_entryName;
|
||||
|
||||
static int m_unit;
|
||||
static int m_convert;
|
||||
static int m_unit;
|
||||
static int m_convert;
|
||||
|
||||
/**
|
||||
* Updated to `true` if a list rewrite on GUI activation resulted in the component
|
||||
|
|
|
@ -127,8 +127,7 @@ int PL_PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
else if( evt->IsClick( BUT_RIGHT ) )
|
||||
{
|
||||
// TODO...
|
||||
// m_menu.ShowContextMenu();
|
||||
m_menu.ShowContextMenu();
|
||||
}
|
||||
else
|
||||
evt->SetPassEvent();
|
||||
|
|
|
@ -210,7 +210,7 @@ int PL_POINT_EDITOR::Main( const TOOL_EVENT& aEvent )
|
|||
inDrag = false;
|
||||
}
|
||||
|
||||
else if( evt->IsCancel() )
|
||||
else if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
|
||||
{
|
||||
if( inDrag ) // Restore the last change
|
||||
{
|
||||
|
|
|
@ -217,8 +217,6 @@ int StrToInt1Units( const wxString& aStr )
|
|||
{
|
||||
double num, precision = 10;
|
||||
|
||||
// TODO: Is the following commented string necessary?
|
||||
// if (pos(',',s)>0) then DecimalSeparator:=',' else DecimalSeparator:='.';
|
||||
aStr.ToDouble( &num );
|
||||
return KiROUND( num * precision );
|
||||
}
|
||||
|
|
|
@ -382,7 +382,7 @@ int POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent )
|
|||
m_refill = true;
|
||||
}
|
||||
|
||||
else if( evt->IsCancel() )
|
||||
else if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
|
||||
{
|
||||
if( inDrag ) // Restore the last change
|
||||
commit.Revert();
|
||||
|
|
Loading…
Reference in New Issue