gnudatalanguage / gdl

GDL - GNU Data Language
GNU General Public License v2.0
274 stars 61 forks source link

WIDGET_TABLE no longer emits "CELL_SELECT" events upon mouse click since rework #1748

Closed frankmri closed 7 months ago

frankmri commented 7 months ago

Hi, this is probably a super rare case, but believe it or not I was actually using the 'CELL_SELECT' mouse events generated by WIDGET_TABLE to locate user-selected cells. Since the last rework they got swallowed (are no longer generated). I think it is the wxGridGDL::OnTableCellSelection function in the event handler (line 1784). If you want I can send a pull request, but you will probably have a better one (since this is recent).

Let me know

Best Frank

GillesDuvert commented 7 months ago

@frankmri this (CELL_SELECT events) works on my machine (linux). tested with testsuite/interactive_tests/test_widgets.pro called with test_widgets,/col,present="TABLE" What is your OS?

GillesDuvert commented 7 months ago

Ok, nevermind, this should work #1750

frankmri commented 7 months ago

@GillesDuvert thanks and sorry for the late answer, I am on linux, too. My description was, unfortunately, not precise enough. The events are (and probably were) sent correctly, but the structure didn't contain the right values for event.sel_top and event.sel_left. Also now (after #1750, these "coordinate" values are always "-1" when I click on the different table cells.

To get that behavior back I had changed the following:

And the same in the next function.

WIDGET_TABLE_SELECT_EVENTS.txt

frankmri commented 7 months ago

Sorry again @GillesDuvert , this diff is not the right one, I'm unable to find the changes I made in my local stash. They were basically restoring the select event being pushed in the

void wxGridGDL::OnTableCellSelection(wxGridEvent & event) function of gdlwidgeteventhandler.cpp

the corresponding lines were commented before your latest changes.

Thanks again Frank

GillesDuvert commented 7 months ago

@frankmri I'm confused. With the #1750 patch, there are 2 events produced by a (left)click in a cell:

This IMHO corresponds to the IDL behaviour for "normal" mode, the doc says "This means that two WIDGET_TABLE_CELL_SEL events are generated when an existing selection is changed to a new selection. " But, I see that in DISJOINT_SELECTION mode, where clicking when CTRL is held down, is not properly handled.

GillesDuvert commented 7 months ago

should be OK now.

frankmri commented 7 months ago

Probably yes, thanks ! I'll reconfirm after the pull request is merged in ( ! I realize that this is probably why I still saw no change in behavior even previously!)

Sorry for the noise then Frank

frankmri commented 7 months ago

I confirm it works now! Many thanks

GillesDuvert commented 6 months ago

1761 provides correct handling of all (numerous) table-related commands, creation, modification, editing, events but for a few exceptions, and is correct for tables showing structures. PLS open new issues (with small examples) on this topic if neede.