Preventing unwanted "highlighting" in wxCheckListBox

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Preventing unwanted "highlighting" in wxCheckListBox

kmccarty
Hi list,

Is there any way to prevent lines of a wxCheckListBox from ever appearing to be "highlighted", that is, in "reverse-video" ?  It seems to me that it is not at all useful, and may actively confuse users, for them to have two different ways it appears they may select the lines of this widget:

1) Users can check / uncheck the checkboxes, which lets them mark or unmark items.  This is the intended way for them to use the widget.  (Aside: It would be nice for there to be an easy way for users to mark or unmark all the items at once, but that isn't my main concern right now.)

2) Users can "select" (highlight) each individual line of text in the widget.  (Apparently only one line may be selected at a time.)  As far as I can tell, this functionality has no useful effect.  Is there a way for client code to disable it?

I'd be most interested in the answer with respect to the wxGetSelectedChoices() free function, but if necessary I can drop down and explicitly use a wxMultiChoiceDialog [which is displayed by that function] or a wxCheckListBox [which is contained by that dialog].

This is for WX 3.1.1, for what it's worth.  I observe the same behavior for wxMSW and wxGTK (GTK+ version 2.24.23 on RedHat EL 6.7).

Thanks in advance,

--
Kevin B. McCarty
<[hidden email]>

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Preventing unwanted "highlighting" in wxCheckListBox

Vadim Zeitlin-4
On Thu, 18 Oct 2018 14:44:00 -0700 (PDT)  wrote:

> Is there any way to prevent lines of a wxCheckListBox from ever appearing
> to be "highlighted", that is, in "reverse-video" ?

 No, at least under MSW it's just a wxListBox, after all, and so it will
appear/behave like one. And even wxDataViewCtrl or wxTreeListCtrl, based on
it, still show selection too, even if it's not in reverse video.

> It seems to me that it is not at all useful, and may actively confuse
> users, for them to have two different ways it appears they may select the
> lines of this widget:
>
> 1) Users can check / uncheck the checkboxes, which lets them mark or unmark
> items.  This is the intended way for them to use the widget.  (Aside: It
> would be nice for there to be an easy way for users to mark or unmark all
> the items at once, but that isn't my main concern right now.)

 For the aside, this probably should be provided by a separate control in
the UI near the main control.

> 2) Users can "select" (highlight) each individual line of text in the
> widget.  (Apparently only one line may be selected at a time.)  As far as I
> can tell, this functionality has no useful effect.

 It shows the focused item which is pretty useful when using the UI from
keyboard (believe it or not, there is still a non-empty subset of users for
whom this matters -- and I can prove it empirically by noticing that I
belong to this set).

 In principle, it might be possible to implement some "zero-selection" (in
addition to single- and multi-selection) mode in wxListBox which would just
show the focus rectangle but not the selection itself, but this is going to
require some effort, look weird and I'm not sure it's going to be less
confusing.

 Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/

attachment0 (203 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Preventing unwanted "highlighting" in wxCheckListBox

kmccarty
Hi Vadim,

On Thu, Oct 18, 2018 at 3:29 PM Vadim Zeitlin <[hidden email]> wrote:
On Thu, 18 Oct 2018 14:44:00 -0700 (PDT)  wrote:

> 1) Users can check / uncheck the checkboxes, which lets them mark or unmark
> items.  This is the intended way for them to use the widget.  (Aside: It
> would be nice for there to be an easy way for users to mark or unmark all
> the items at once, but that isn't my main concern right now.)

 For the aside, this probably should be provided by a separate control in
the UI near the main control.

Fair enough.  Would you be open to hypothetical patches to add that functionality (optionally) via additional widgets on the wxMultiChoiceDialog in the future?  I suppose it wouldn't make sense to have it as part of a wxCheckListBox.
 

> 2) Users can "select" (highlight) each individual line of text in the
> widget.  (Apparently only one line may be selected at a time.)  As far as I
> can tell, this functionality has no useful effect.

 It shows the focused item which is pretty useful when using the UI from
keyboard (believe it or not, there is still a non-empty subset of users for
whom this matters -- and I can prove it empirically by noticing that I
belong to this set).

Ah, I see.  Makes sense.
 
  In principle, it might be possible to implement some "zero-selection" (in
addition to single- and multi-selection) mode in wxListBox which would just
show the focus rectangle but not the selection itself, but this is going to
require some effort, look weird and I'm not sure it's going to be less
confusing.

Hmm, by any chance is there already a way that client code could set a wxCheckListBox's "selection" color to be the same as the background color, to achieve a similar effect?  I have a feeling the answer will be "no" since it looks like on wxGTK the selection rectangle is actually two-toned, but doesn't hurt to ask ...

Thanks again,

--
Kevin B. McCarty
<[hidden email]>

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re[2]: Preventing unwanted "highlighting" in wxCheckListBox

Vadim Zeitlin-4
On Thu, 18 Oct 2018 16:13:23 -0700 Kevin B. McCarty wrote:

KBM> Fair enough.  Would you be open to hypothetical patches to add that
KBM> functionality (optionally) via additional widgets on the
KBM> wxMultiChoiceDialog in the future?  I suppose it wouldn't make sense to
KBM> have it as part of a wxCheckListBox.

 I don't think it would make sense to have it as part of wxCheckListBox and
the only other alternative for wxMultiChoiceDialog that I see is to use
just wxCheckBoxes with wxStaticTexts and this risks looking ugly IMO.

KBM> Hmm, by any chance is there already a way that client code could set a
KBM> wxCheckListBox's "selection" color to be the same as the background color,
KBM> to achieve a similar effect?

 No, this is a native control and it will use the selection colour from the
current theme.

 Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/

attachment0 (203 bytes) Download Attachment