lmi
[Top][All Lists]
Advanced

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

Re: [lmi] switch census view to use wxDataViewCtrl


From: Greg Chicares
Subject: Re: [lmi] switch census view to use wxDataViewCtrl
Date: Wed, 03 Aug 2011 14:22:57 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10

On 2011-08-02 15:53Z, Vadim Zeitlin wrote:
> On Tue, 02 Aug 2011 15:21:47 +0000 Greg Chicares <address@hidden> wrote:
>
> GC> A desirable (IMO) feature of the old wxListCtrl was that at least one row
> GC> was always "selected".
>
>  I believe the standard behaviour is to always have a selected item in a
> single-selection control while allowing absence of selection in the multi-
> selection ones (and using just the focused, or current, item to indicate
> the item that keyboard commands would apply to).

The ms "control spy" listview sample behaves the way you describe, both with
and without LVS_SINGLESEL.

> I am not sure if there is
> a significant enough advantage in going against this standard UI convention
> in LMI case, is there?
>
>  Notice that the above doesn't mean that we shouldn't preselect the first
> item after opening or creating a new document. But this is not the same as
> forbidding having no selection at any moment. Do we really need the latter
> in LMI?

My answer to both questions is that we needn't go against the standard
convention--as long as some row always has "command focus", so that commands
always operate on some row...if that is possible with wxDataViewCtrl, which
I suspect it might not be.

Originally, years ago, class CensusView (or its predecessor) used a single-
selection control. We changed that only to permit deletion of multiple cells;
and deletion is the only operation for which multiple selection matters. But
having zero cells selected makes no sense for deletion, or for any other
operation. For example,
  File | New | Census
  Census | Delete cell(s)
produces this messagebox:
  Confirm deletion
  Irrevocably delete 0 of 1 cells?
  Yes   No
which looks like a logic error. ("Obviously that's a no-op, so why ask me to
confirm whether or not I want to do...nothing?") In that testcase, the first
(and only) cell has the "focus rectangle" but no "selection highlight", and
menu commands do not apply to it: that's the regression I want to fix, and
I'm guessing that to do so we need (at least) one row to have "selection"
as well as "focus".

It was possible (but, importantly, more difficult) to get that "delete nothing?"
messagebox with a wx-2.9.0 version of lmi, by doing Ctrl-left_click on the last
selected row...so this is an old lmi anomaly that's just more likely to arise
with the wxDataViewCtrl implementation. Also, again with an older version, if I
make a census with two cells, select the second, and then unselect so that it
keeps the focus rectangle...and then do "Census | Edit cell", it's the 
(unfocused)
first cell that's edited, not the second; shouldn't the focused cell have been
used in the listview implementation, or do I still misunderstand how this works?



reply via email to

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