#15082 closed defect (wontfix)

Should wxDataViewCtrl unselect items when clicking on a blank area?

Reported by: Christopher Wright Owned by:
Priority: low Milestone:
Component: GUI-generic Version: stable-latest
Keywords: wxDataViewCtrl unselect click Cc:
Blocked By: Blocking:
Patch: no

Description

What happens
Clicking on a 'blank' area (e.g. below all the rows) does not change which items are selected. This can be seen using the standard Data View sample.

What should happen
Under Windows (not sure about other ports) the wxDataViewCtrl should follow the standard behaviour of unselecting items when the mouse is clicked (left or right) on a blank area.

I have attached a patch to fix this.

Attachments (1)

dataview_unselect.patch download (1.1 KB) - added by Christopher Wright 19 months ago.
Patch to fix defect

Download all attachments as: .zip

Change History (7)

Changed 19 months ago by Christopher Wright

Patch to fix defect

comment:1 Changed 19 months ago by VZ

  • Resolution set to fixed
  • Status changed from new to closed

(In [73602]) Unselect all wxDataViewCtrl items when clicking outside of the item area.

This is consistent with Windows behaviour and as the generic wxDataViewCtrl is
mostly used under Windows, it makes sense to follow Windows convention in it.

Closes #15082.

comment:2 follow-up: Changed 19 months ago by rk

  • Resolution fixed deleted
  • Status changed from closed to reopened

Looking at some prominent examples on my windows system it seems that it is not really consistent with Windows behaviour to unselect items this way. The tree view of the Solution Explorer in Visual Studio does not do it. The history pane of the Internet Explorer does not do it either. The only place I could actually see this unselecting was in the right pane of the Windows Explorer. The left pane showing the directory tree does not unselect its items as well. It seems that there is no consistent way in Windows. ;-)

The question now is if the new behaviour is better than the old. It certainly changes my application. I now have to be careful to not click in the empty space and kill my selection by accident.

comment:3 in reply to: ↑ 2 Changed 19 months ago by Christopher Wright

Replying to rk:

Looking at some prominent examples on my windows system it seems that it is not really consistent with Windows behaviour to unselect items this way. The tree view of the Solution Explorer in Visual Studio does not do it. The history pane of the Internet Explorer does not do it either. The only place I could actually see this unselecting was in the right pane of the Windows Explorer. The left pane showing the directory tree does not unselect its items as well. It seems that there is no consistent way in Windows. ;-)

Well I think you have come to the conclusion that Windows is inconsistent, but then asserted that the current behaviour is somehow better. I personally believe that most users experience of Windows is with file icons and possibly list views in the Explorer pane, which do exhibit the unselect behaviour. Additionally, I think that wxListView also has this unselect behaviour.

However, I do agree that changing functionality is a bad thing in general, and also in this specific case I agree that it may break existing applications. That is why I originally suggested to have the behaviour configurable via a style option, with the old behaviour as a default. I did solicit suggestions on my original question on wx-users mailing list (https://groups.google.com/forum/?fromgroups=#!topic/wx-users/m2iVA7qkxSE), but perhaps that was not the correct forum for discussing specifics of patches. I am new to this community so I don't really know what the correct procedure is, and I thought I was following it according to the information in http://wxwidgets.org/develop/.

I am happy to revise the patch to add the behaviour as an option, passed in through the style flag. Please let me know if that will be acceptable.

comment:4 Changed 19 months ago by ChristopherWright

Apparently there is a bug with the Trac email system when a username contains a space, so just posting this to trigger emails that might work.

comment:5 Changed 19 months ago by vadz

  • Patch unset
  • Priority changed from normal to low
  • Summary changed from wxDataViewCtrl should unselect items when clicking on a blank area to Should wxDataViewCtrl unselect items when clicking on a blank area?

I tried to find something about this in Microsoft UI guidelines but failed so I'm still not sure what to do about this. IMHO we should leave the new behaviour on for now as the RHS of the Explorer window does come the closest to what wxDVC is supposed to be but if anybody can find objective arguments against doing it (or for...) I'd be definitely interested.

comment:6 Changed 11 months ago by vaclavslavik

  • Resolution set to wontfix
  • Status changed from reopened to closed

I agree with Vadim that give Windows/MS's utter lack of consistency, Explorer is what wxDVC should be modeled after, both as the most similar and most commonly seen stock control. We already model some behaviors after it (keyboard focus handling IIRC and there was something else that I can't recall now), so we should continue due so for self-consistency as well.

Note: See TracTickets for help on using tickets.