AutoHotkey Community

It is currently May 27th, 2012, 8:35 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: April 10th, 2006, 4:56 pm 
Offline

Joined: August 24th, 2005, 5:17 pm
Posts: 1237
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2006, 5:36 am 
Offline

Joined: February 13th, 2006, 10:40 pm
Posts: 389
Location: Utah
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!!!! :lol:

_________________
Image
"Power can be given overnight, but responsibility must be taught. Long years go into its making."


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2006, 2:04 pm 
Offline

Joined: August 24th, 2005, 5:17 pm
Posts: 1237
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2006, 5:57 pm 
Offline

Joined: September 25th, 2005, 4:31 pm
Posts: 610
You could try LV_ModifyCol with the the Icon and/or IconRight options.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2006, 12:18 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2006, 2:26 pm 
Offline

Joined: May 29th, 2005, 11:20 am
Posts: 34
Location: The Netherlands
Use ascii character 24 (↑) or 25 (↓).

They look nicer than ^ e.g.

_________________
Greetz,
Neyon


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2006, 3:18 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
:?: 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.

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 15th, 2006, 11:08 pm 
Offline

Joined: August 24th, 2005, 5:17 pm
Posts: 1237
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 17th, 2006, 2:55 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
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.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Exabot [Bot], sjc1000, specter333, Yahoo [Bot] and 66 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group