7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-07 17:25:33 +00:00

(Slightly) better de-bouncing of grid cell editing.

This commit is contained in:
Jeff Young 2025-01-03 18:31:34 +00:00
parent e73bec504e
commit 21ee64d8f0
4 changed files with 19 additions and 4 deletions

View File

@ -152,7 +152,7 @@ EESCHEMA_JOBS_HANDLER::EESCHEMA_JOBS_HANDLER( KIWAY* aKiway ) :
JOB_SCH_ERC* ercJob = dynamic_cast<JOB_SCH_ERC*>( job );
DIALOG_ERC_JOB_CONFIG dlg( aParent, ercJob );
return dlg.ShowModal() == wxID_SAVE;
return dlg.ShowModal() == wxID_OK;
} );
}

View File

@ -575,7 +575,22 @@ bool JOBS_GRID_TRICKS::handleDoubleClick( wxGridEvent& aEvent )
if( col == 1 && row >= 0 && row < (int) m_parent->GetJobsFile()->GetJobs().size() )
{
m_parent->OpenJobOptionsForListItem( row );
m_doubleClickRow = row;
m_grid->CancelPendingChanges();
CallAfter(
[this]()
{
// Yes, again. CancelShowEditorOnMouseUp() doesn't appear to be 100%
// reliable.
m_grid->CancelPendingChanges();
int row = m_doubleClickRow;
m_doubleClickRow = -1;
if( row >= 0 && row < (int) m_parent->GetJobsFile()->GetJobs().size() )
m_parent->OpenJobOptionsForListItem( row );
} );
return true;
}
@ -594,7 +609,6 @@ PANEL_JOBS::PANEL_JOBS( wxAuiNotebook* aParent, KICAD_MANAGER_FRAME* aFrame,
m_jobsGrid->SetDefaultRowSize( m_jobsGrid->GetDefaultRowSize() + 4 );
m_jobsGrid->OverrideMinSize( 0.6, 0.3 );
m_jobsGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
// 'm' for margins
m_jobsGrid->SetColSize( 0, GetTextExtent( wxT( "99m" ) ).x );

View File

@ -52,6 +52,7 @@ protected:
protected:
PANEL_JOBS* m_parent;
int m_doubleClickRow;
};

View File

@ -235,7 +235,7 @@ PCBNEW_JOBS_HANDLER::PCBNEW_JOBS_HANDLER( KIWAY* aKiway ) :
{
DIALOG_DRC_JOB_CONFIG dlg( aParent, dynamic_cast<JOB_PCB_DRC*>( job ) );
return dlg.ShowModal() == wxID_SAVE;
return dlg.ShowModal() == wxID_OK;
} );
Register( "ipc2581",
std::bind( &PCBNEW_JOBS_HANDLER::JobExportIpc2581, this, std::placeholders::_1 ),