kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #42135
Re: [PATCH] Grid Control: Cells selecting fix.
Hi Seth.
The problem is illustrated on the gif bellow:
[image: screencast.gif]
Please notice, no modifier keys are used.
The patch is attached.
ср, 25 сент. 2019 г. в 23:27, Seth Hillbrand <seth@xxxxxxxxxxxxx>:
> Hi Konstantin-
>
> This makes sense. Can you send as a patch?
>
> -Seth
>
> On 2019-09-24 10:38, Konstantin Baranovskiy wrote:
> > If *editable* cells had been selected by holding and dragging the
> > mouse's left
> > button, the previous selection were not clearing.
> > ---
> > common/grid_tricks.cpp | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/common/grid_tricks.cpp b/common/grid_tricks.cpp
> > index 832b704db..509cdbcc8 100644
> > --- a/common/grid_tricks.cpp
> > +++ b/common/grid_tricks.cpp
> > @@ -63,6 +63,7 @@ bool GRID_TRICKS::toggleCell( int aRow, int aCol )
> >
> > if( isCheckbox )
> > {
> > + m_grid->ClearSelection();
> > m_grid->SetGridCursor( aRow, aCol );
> >
> > wxGridTableBase* model = m_grid->GetTable();
> > @@ -102,6 +103,8 @@ bool GRID_TRICKS::showEditor( int aRow, int aCol )
> >
> > if( m_grid->IsEditable() && !m_grid->IsReadOnly( aRow, aCol ) )
> > {
> > + m_grid->ClearSelection();
> > +
> > if( m_grid->GetSelectionMode() == wxGrid::wxGridSelectRows )
> > {
> > wxArrayInt rows = m_grid->GetSelectedRows();
>
From 8532a7bffdd44efb36b32c519bec69c1717f51ab Mon Sep 17 00:00:00 2001
From: Konstantin Baranovskiy <baranovskiykonstantin@xxxxxxxxx>
Date: Tue, 24 Sep 2019 20:11:19 +0300
Subject: [PATCH] Grid Control: Cells selecting fix.
If *editable* cells had been selected by holding and dragging the mouse's left
button, the previous selection were not clearing.
---
common/grid_tricks.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/common/grid_tricks.cpp b/common/grid_tricks.cpp
index 832b704db..509cdbcc8 100644
--- a/common/grid_tricks.cpp
+++ b/common/grid_tricks.cpp
@@ -63,6 +63,7 @@ bool GRID_TRICKS::toggleCell( int aRow, int aCol )
if( isCheckbox )
{
+ m_grid->ClearSelection();
m_grid->SetGridCursor( aRow, aCol );
wxGridTableBase* model = m_grid->GetTable();
@@ -102,6 +103,8 @@ bool GRID_TRICKS::showEditor( int aRow, int aCol )
if( m_grid->IsEditable() && !m_grid->IsReadOnly( aRow, aCol ) )
{
+ m_grid->ClearSelection();
+
if( m_grid->GetSelectionMode() == wxGrid::wxGridSelectRows )
{
wxArrayInt rows = m_grid->GetSelectedRows();
--
2.23.0
Follow ups
References