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 )
|
void DIALOG_FIELDS_EDITOR_GLOBAL::OnTableItemContextMenu( wxGridEvent& event )
|
||||||
{
|
{
|
||||||
/* TODO
|
// TODO: Option to select footprint if FOOTPRINT column selected
|
||||||
* - Option to select footprint if FOOTPRINT column selected
|
|
||||||
*/
|
|
||||||
|
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,8 +169,6 @@ public:
|
||||||
* create a pseudo reference text. If the base reference field is U,
|
* create a pseudo reference text. If the base reference field is U,
|
||||||
* the string U?A will be returned for unit = 1.
|
* 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.
|
* @param unit - The package unit number. Only effects reference field.
|
||||||
* @return Field text.
|
* @return Field text.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -705,7 +705,6 @@ void LIB_EDIT_FRAME::CommonSettingsChanged()
|
||||||
|
|
||||||
void LIB_EDIT_FRAME::ShowChangedLanguage()
|
void LIB_EDIT_FRAME::ShowChangedLanguage()
|
||||||
{
|
{
|
||||||
// JEY TODO: push this down into EDA_BASE_FRAME...
|
|
||||||
// call my base class
|
// call my base class
|
||||||
SCH_BASE_FRAME::ShowChangedLanguage();
|
SCH_BASE_FRAME::ShowChangedLanguage();
|
||||||
|
|
||||||
|
|
|
@ -99,13 +99,10 @@ int EE_PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
else if( evt->IsClick( BUT_RIGHT ) )
|
else if( evt->IsClick( BUT_RIGHT ) )
|
||||||
{
|
{
|
||||||
// TODO...
|
m_menu.ShowContextMenu();
|
||||||
// m_menu.ShowContextMenu();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
evt->SetPassEvent();
|
evt->SetPassEvent();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_finalizeHandler )
|
if( m_finalizeHandler )
|
||||||
|
|
|
@ -301,7 +301,7 @@ int EE_POINT_EDITOR::Main( const TOOL_EVENT& aEvent )
|
||||||
inDrag = false;
|
inDrag = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( evt->IsCancel() )
|
else if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
|
||||||
{
|
{
|
||||||
if( inDrag ) // Restore the last change
|
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 )
|
int LIB_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
m_frame->SetTool( aEvent.GetCommandStr().get() );
|
m_frame->SetTool( aEvent.GetCommandStr().get() );
|
||||||
m_frame->GetCanvas()->SetCurrentCursor( wxCURSOR_BULLSEYE );
|
|
||||||
Activate();
|
Activate();
|
||||||
|
|
||||||
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
|
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
|
||||||
wxCHECK( picker, 0 );
|
wxCHECK( picker, 0 );
|
||||||
|
|
||||||
picker->SetClickHandler( std::bind( deleteItem, m_frame, std::placeholders::_1 ) );
|
picker->SetClickHandler( std::bind( deleteItem, m_frame, std::placeholders::_1 ) );
|
||||||
|
picker->SetCancelHandler( [this]() { m_frame->ClearToolStack(); } );
|
||||||
picker->Activate();
|
picker->Activate();
|
||||||
Wait();
|
Wait();
|
||||||
|
|
||||||
m_frame->GetCanvas()->SetCurrentCursor( wxCURSOR_ARROW );
|
|
||||||
return 0;
|
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 )
|
int SCH_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
m_frame->SetTool( aEvent.GetCommandStr().get() );
|
m_frame->SetTool( aEvent.GetCommandStr().get() );
|
||||||
m_frame->GetCanvas()->SetCurrentCursor( wxCURSOR_BULLSEYE );
|
|
||||||
Activate();
|
Activate();
|
||||||
|
|
||||||
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
|
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
|
||||||
wxCHECK( picker, 0 );
|
wxCHECK( picker, 0 );
|
||||||
|
|
||||||
picker->SetClickHandler( std::bind( deleteItem, m_frame, std::placeholders::_1 ) );
|
picker->SetClickHandler( std::bind( deleteItem, m_frame, std::placeholders::_1 ) );
|
||||||
|
picker->SetCancelHandler( [this]() { m_frame->ClearToolStack(); } );
|
||||||
picker->Activate();
|
picker->Activate();
|
||||||
Wait();
|
Wait();
|
||||||
|
|
||||||
m_frame->GetCanvas()->SetCurrentCursor( wxCURSOR_ARROW );
|
|
||||||
return 0;
|
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 )
|
int SCH_EDITOR_CONTROL::SimProbe( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
|
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||||
Activate();
|
Activate();
|
||||||
|
|
||||||
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
|
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
|
||||||
assert( picker );
|
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 ) );
|
m_frame->GetCanvas()->SetCursor( SIMULATION_CURSORS::GetCursor( SIMULATION_CURSORS::CURSOR::PROBE ) );
|
||||||
|
|
||||||
picker->SetClickHandler( std::bind( probeSimulation, m_frame, std::placeholders::_1 ) );
|
picker->SetClickHandler( std::bind( probeSimulation, m_frame, std::placeholders::_1 ) );
|
||||||
picker->Activate();
|
picker->Activate();
|
||||||
Wait();
|
Wait();
|
||||||
|
|
||||||
|
m_frame->PopTool();
|
||||||
return 0;
|
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 )
|
int SCH_EDITOR_CONTROL::SimTune( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
|
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||||
Activate();
|
Activate();
|
||||||
|
|
||||||
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
|
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
|
||||||
assert( picker );
|
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 ) );
|
m_frame->GetCanvas()->SetCursor( SIMULATION_CURSORS::GetCursor( SIMULATION_CURSORS::CURSOR::TUNE ) );
|
||||||
|
|
||||||
picker->SetClickHandler( std::bind( tuneSimulation, m_frame, std::placeholders::_1 ) );
|
picker->SetClickHandler( std::bind( tuneSimulation, m_frame, std::placeholders::_1 ) );
|
||||||
picker->Activate();
|
picker->Activate();
|
||||||
Wait();
|
Wait();
|
||||||
|
|
||||||
|
m_frame->PopTool();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* KICAD_SPICE */
|
#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 )
|
if( !ADVANCED_CFG::GetCfg().m_realTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime )
|
||||||
m_frame->RecalculateConnections();
|
m_frame->RecalculateConnections();
|
||||||
|
|
||||||
|
m_frame->SetTool( aEvent.GetCommandStr().get() );
|
||||||
Activate();
|
Activate();
|
||||||
|
|
||||||
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
|
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->SetClickHandler( std::bind( highlightNet, m_toolMgr, std::placeholders::_1 ) );
|
||||||
|
picker->SetCancelHandler( [this]() { m_frame->ClearToolStack(); } );
|
||||||
picker->Activate();
|
picker->Activate();
|
||||||
Wait();
|
Wait();
|
||||||
|
|
||||||
|
|
|
@ -179,15 +179,11 @@ private:
|
||||||
bool m_listPowerCmpOnly;
|
bool m_listPowerCmpOnly;
|
||||||
wxArrayString m_allowedLibs;
|
wxArrayString m_allowedLibs;
|
||||||
|
|
||||||
// TODO(hzeller): looks like these members were chosen to be static to survive different
|
static wxString m_libraryName;
|
||||||
// instances of this browser and communicate it to the next instance. This looks like an
|
static wxString m_entryName;
|
||||||
// ugly hack, and should be solved differently.
|
|
||||||
static wxString m_libraryName;
|
|
||||||
|
|
||||||
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
|
* 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 ) )
|
else if( evt->IsClick( BUT_RIGHT ) )
|
||||||
{
|
{
|
||||||
// TODO...
|
m_menu.ShowContextMenu();
|
||||||
// m_menu.ShowContextMenu();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
evt->SetPassEvent();
|
evt->SetPassEvent();
|
||||||
|
|
|
@ -210,7 +210,7 @@ int PL_POINT_EDITOR::Main( const TOOL_EVENT& aEvent )
|
||||||
inDrag = false;
|
inDrag = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( evt->IsCancel() )
|
else if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
|
||||||
{
|
{
|
||||||
if( inDrag ) // Restore the last change
|
if( inDrag ) // Restore the last change
|
||||||
{
|
{
|
||||||
|
|
|
@ -217,8 +217,6 @@ int StrToInt1Units( const wxString& aStr )
|
||||||
{
|
{
|
||||||
double num, precision = 10;
|
double num, precision = 10;
|
||||||
|
|
||||||
// TODO: Is the following commented string necessary?
|
|
||||||
// if (pos(',',s)>0) then DecimalSeparator:=',' else DecimalSeparator:='.';
|
|
||||||
aStr.ToDouble( &num );
|
aStr.ToDouble( &num );
|
||||||
return KiROUND( num * precision );
|
return KiROUND( num * precision );
|
||||||
}
|
}
|
||||||
|
|
|
@ -382,7 +382,7 @@ int POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent )
|
||||||
m_refill = true;
|
m_refill = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( evt->IsCancel() )
|
else if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
|
||||||
{
|
{
|
||||||
if( inDrag ) // Restore the last change
|
if( inDrag ) // Restore the last change
|
||||||
commit.Revert();
|
commit.Revert();
|
||||||
|
|
Loading…
Reference in New Issue