[ wxwindows-Bugs-1605633 ] wxMac: ListCtrl behaves differently on OnColumnClick

SourceForge.net noreply at sourceforge.net
Mon May 28 16:48:25 PDT 2007


Bugs item #1605633, was opened at 2006-11-29 21:49
Message generated for change (Comment added) made by ippei
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1605633&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxMac specific
Group: None
Status: Closed
Resolution: None
Priority: 5
Private: No
Submitted By: Ippei UKAI (ippei)
Assigned to: Stefan Csomor (csomor)
Summary: wxMac: ListCtrl behaves differently on OnColumnClick

Initial Comment:
New implementation of List in wxMac 2.8rc1 seems to sort columns holding numbers not numerically but alphabetically. 
(I get the rows sorted into the 1, 10, 11 .... 2, 20... order as the result.)

It was fine till 2.6.* at least. (did not test 2.7 versions)


----------------------------------------------------------------------

>Comment By: Ippei UKAI (ippei)
Date: 2007-05-29 00:48

Message:
Logged In: YES 
user_id=1072623
Originator: YES

New bug:
http://sourceforge.net/tracker/index.php?func=detail&aid=1727170&group_id=9863&atid=109863

----------------------------------------------------------------------

Comment By: Ippei UKAI (ippei)
Date: 2007-05-28 18:00

Message:
Logged In: YES 
user_id=1072623
Originator: YES

I've tried 2.8.4 today. This problem is 'almost' fixed. Thank you very
much for responding to my request. I'll file a separate bug report for the
remaining problem.

----------------------------------------------------------------------

Comment By: Hartwig Wiesmann (hwiesmann)
Date: 2006-12-16 21:22

Message:
Logged In: YES 
user_id=1190438
Originator: NO

wxSystemOptions::SetOptionInt(wxMAC_ALWAYS_USE_GENERIC_LISTCTRL, 1);

cannot be added because wxMAC_ALWAYS_USE_GENERIC_LISTCTRL is declared
inside listctrl_mac.cpp and can therefore not seen from the outside!

Hartwig

----------------------------------------------------------------------

Comment By: Ippei UKAI (ippei)
Date: 2006-12-11 18:47

Message:
Logged In: YES 
user_id=1072623
Originator: YES

I thought you said you have found a way to combine the generic wxWidgets
behaviour with OSX's native control, but not making it default leaving the
native behaviour default. Please correct me if I'm wrong.

Anyway, it's not a big deal if that's the decision by the developer
community.
It's just the matter of philosophy on cross-platformness and version
compatibility with older wxMac releases.

----------------------------------------------------------------------

Comment By: Kevin Ollivier (kollivier)
Date: 2006-12-11 17:15

Message:
Logged In: YES 
user_id=248468
Originator: NO

The problem in my eyes is that if the generic's the default, a number of
devs may never even know a more native alternative exists. On the other
hand, if the native control gives them problems, they'll check the docs or
report it, and then learn how to re-instate the generic version.

If, of course, the native control had serious deficiencies, then I would
have made generic the default. But I think, despite minor inconsistencies
like alphabetical/numerical sort, most devs will want the native control,
and I think the default should be the option the most people want. :-)  

----------------------------------------------------------------------

Comment By: Ippei UKAI (ippei)
Date: 2006-12-11 11:52

Message:
Logged In: YES 
user_id=1072623
Originator: YES

Thanks for the report. It sounds promising!

Just one thing, I don't understand is why the default sorting behaviour
has to be the limited one by native platform. I think the native one should
be used only when it is possible to make the application more native
keeping the functionality compatible with other platforms.

Wouldn't it make more sense to have the more compatible one as the default
and more native one as optional?
I'd love to add platform-specific codes to my project in order to make it
behave more natively, but I don't want to add anything just to get it
behave the same with other platforms.

----------------------------------------------------------------------

Comment By: Kevin Ollivier (kollivier)
Date: 2006-12-07 00:57

Message:
Logged In: YES 
user_id=248468
Originator: NO

I wanted to post an update and let you know that I've been able to get
SortItems to work like it does on other platforms. The *default* sorting
methods will still use the native wxListCtrl's sort routine, which sorts
alphabetically, but if you handle column click and SortItems yourself, you
can change the sort order to sort numbers numerically or whatever you like.
This feature will be in the 2.8 final release.

----------------------------------------------------------------------

Comment By: Kevin Ollivier (kollivier)
Date: 2006-12-01 17:58

Message:
Logged In: YES 
user_id=248468
Originator: NO

Unfortunately, I'm not aware of any way we can steal it, as all we get is
an "after the fact" notification that the click happened. ;-/ In fact, by
the time we get the notification that the click happened, the sort has
already been performed. There's been some talk on wx-dev of adding some
sort of callback so that the list ctrl can notify us when it needs sorted,
but I was never able to get this working myself. 

This is why I introduced the define - there are a few things in wxListCtrl
that simply cannot be made to work with the native control, but on the
other hand, if you don't need any of those particular features the native
control is the way to go.

----------------------------------------------------------------------

Comment By: Ippei UKAI (ippei)
Date: 2006-11-30 22:29

Message:
Logged In: YES 
user_id=1072623
Originator: YES

Thanks for the workaround though I don't think I'd be using 2.8 till most
of the compatibility issues are sorted. I don't really want to mess the
code just for adapting the newest version on only one of the platforms.

I've just played a bit with the ListCtrl sample. It seems clicking the
column header behaves differently with the new implementation.
The 2.6 version interprets the column click and displays an icon in the
header. The new one sorts the list instead.

Would it be possible to steal the clicking event entirely and use the same
implementation for the resulting action?
Hope it can be done with the new native look:) The new one looks much
nicer, so just the details. Good job!

----------------------------------------------------------------------

Comment By: Kevin Ollivier (kollivier)
Date: 2006-11-30 19:18

Message:
Logged In: YES 
user_id=248468
Originator: NO

This is due to a limitation in the native control, which is new in 2.7.
(It only sorts alphabetically.) However, if you want to restore the old
behavior, you can put the following line in your wxApp::OnInit method - 

wxSystemOptions::SetOptionInt(wxMAC_ALWAYS_USE_GENERIC_LISTCTRL, 1);

(you may need to add #include "wx/sysopt.h" at the top of your source file
too.)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1605633&group_id=9863




More information about the wx-dev mailing list