[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] F2 in wxGrid checkbox cell

From: Vadim Zeitlin
Subject: Re: [lmi] F2 in wxGrid checkbox cell
Date: Wed, 15 Jul 2020 23:25:34 +0200

On Wed, 15 Jul 2020 18:29:23 +0000 Greg Chicares <gchicares@sbcglobal.net> 

GC> What should happen if I press F2 when a wxGrid checkbox cell is selected?

 Thank you for asking this question, I agonized over it for quite some time
and thought to post here asking about it, but finally decided not to bother
you with this and implemented the current behaviour (which you see with the
latest wx used by the current lmi master, the behaviour was very different
and IMO much worse before).

GC> Observed behavior: the value is toggled.

 Yes, this is the intended effect.

GC> Expected behavior: I don't know.

 I'm not sure neither, but IMO it's either the current one or simply do
nothing. And it seems inconsistent to do nothing for the boolean cells when
F2 does something (== starts editing) for all the other ones.

GC> The observed behavior just seemed surprising, because I expect F2 never
GC> to change a cell's contents. But if it doesn't change anything, then it
GC> can only do nothing, and that's useless,


GC> although (arguably) less surprising.

 Maybe not surprising, but potentially annoying for someone with a habit of
pressing F2 on all the cells.

GC> I see no other sensible option: e.g., popping up a list with "yes" and
GC> "no" choices would be ghastly.

 Me neither, even though I tried really hard to find something better.

 FWIW wxGrid previously "started editing" the boolean cells when F2 was
pressed too, but this was definitely surprising, as the cell being edited
had the same appearance as the cell not being edited, except for the lack
of focus rectangle. And it was especially bad for ending editing, because
you had to "accept" the changes by pressing Enter (or Tab) or clicking
outside the cell, but it was easy to forget to do it because there was no
visual clue that the cell was being edited. I've experimented with ending
editing automatically as soon as the value changed, which was better, but
didn't work well if you started editing with the Space, which showed the
checkbox control, toggled it, and then immediately hid, resulting in
"something" happening but it wasn't clear what. So I've finally implemented
the current solution which never shows the editor (i.e. the actual
wxCheckBox control) at all, as it just seems to work best in practice. And
it also happens to work in the same way as in wxDVC, so should be familiar
to the users of the existing lmi version.

 The handling of F2 was the only drawback and, as I wrote, I'm still not
sure the current solution is the best, but it didn't seem wise to abandon
the current approach just because of it.

GC> do-nothing} is okay, so I'm not asking for any change (unless end users
GC> express some strong opinion, which is unlikely).

 Please let me know if they do express it, but for now I don't plan to
change anything neither, because I don't see anything better to do here.


Attachment: pgp_xXqF2wFOw.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]