AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Listview - show sort direction arrow on header?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
evl



Joined: 24 Aug 2005
Posts: 1238

PostPosted: Mon Apr 10, 2006 4:56 pm    Post subject: Listview - show sort direction arrow on header? Reply with quote

Is there a way to show which column a listview is being sorted by (and its direction) with an arrow in the column header like in Windows Explorer?

It can get a bit confusing trying to remember which column you last sorted a listview by sometimes.

I suppose it's possible to overlay an image to indicate the direction, but that's rather messy.
Back to top
View user's profile Send private message
Veovis



Joined: 13 Feb 2006
Posts: 390
Location: Utah

PostPosted: Tue Apr 11, 2006 5:36 am    Post subject: Reply with quote

If you really wanted it, rather than trying to overlay images (which as you said, could get rather messy, since columns can be resized and all...) anyways, you could use LV_ModifyCol(ColumnNum,Options,New Title) and change it to things like:

File Name v
File Name ^

Size v
Size ^

to represent which one is sorted and which direction.

Just a thought

*edit* 100th post YAY!!!! Laughing
_________________

"Power can be given overnight, but responsibility must be taught. Long years go into its making."
Back to top
View user's profile Send private message Send e-mail Visit poster's website
evl



Joined: 24 Aug 2005
Posts: 1238

PostPosted: Tue Apr 11, 2006 2:04 pm    Post subject: Reply with quote

Thanks Veovis, that'll probably be sufficient (although not as good as the proper arrows of course) and it's certainly "nicer" than trying to overlay a graphic.
Back to top
View user's profile Send private message
shimanov



Joined: 25 Sep 2005
Posts: 612

PostPosted: Tue Apr 11, 2006 5:57 pm    Post subject: Reply with quote

You could try LV_ModifyCol with the the Icon and/or IconRight options.
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10464

PostPosted: Wed Apr 12, 2006 12:18 am    Post subject: Reply with quote

Having built-in sort-direction arrows was originally planned but deferred due to code complexity. It may still happen someday, but until then, I think shimanov's suggestion above is the best if you want genuine arrow icons.
Back to top
View user's profile Send private message Send e-mail
neyon



Joined: 29 May 2005
Posts: 34
Location: The Netherlands

PostPosted: Wed Apr 12, 2006 2:26 pm    Post subject: Reply with quote

Use ascii character 24 (↑) or 25 (↓).

They look nicer than ^ e.g.
_________________
Greetz,
Neyon
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Wed Apr 12, 2006 3:18 pm    Post subject: Reply with quote

Question These are control characters! They display OK in Firefox, but not in a text editor or in the GUI. Now, perhaps one can use Unicode chars.
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
evl



Joined: 24 Aug 2005
Posts: 1238

PostPosted: Sat Apr 15, 2006 11:08 pm    Post subject: Reply with quote

I've been trying to figure out if it's possible to show a small icon in the listview header while displaying large icons in the rest of the listview. It seems that the listview always uses the most recently attached image list and it isn't possible to make proper use of the 2 image lists.

I constructed the following code, which displays correctly until the window is redrawn by an event such as minimizing the window or clicking on the header. Is there a proper work-around?

Code:

Gui, Add, ListView, r20 w700, A|B

ImageList1 := IL_Create(1) ; small
ImageList2 := IL_Create(1, 1, 1) ; large
IL_Add(ImageList1, "shell32.dll", 1)
IL_Add(ImageList2, "shell32.dll", 1)
LV_SetImageList(ImageList1, 1)
LV_ModifyCol(1, "Icon1 IconRight AutoHdr")
Gui, show

LV_SetImageList(ImageList2, 1)
LV_Add("Icon1", "1", "2")

esc::Exitapp
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10464

PostPosted: Mon Apr 17, 2006 2:55 am    Post subject: Reply with quote

Good question; this is beyond the limits of my current ListView knowledge. Maybe if you prowl around MSDN a while, or hopefully there is ListView expert who will soon read this and give advice.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group