| View previous topic :: View next topic |
| Author |
Message |
evl
Joined: 24 Aug 2005 Posts: 1238
|
Posted: Mon Apr 10, 2006 4:56 pm Post subject: Listview - show sort direction arrow on header? |
|
|
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 |
|
 |
Veovis
Joined: 13 Feb 2006 Posts: 390 Location: Utah
|
Posted: Tue Apr 11, 2006 5:36 am Post subject: |
|
|
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!!!!  _________________
"Power can be given overnight, but responsibility must be taught. Long years go into its making." |
|
| Back to top |
|
 |
evl
Joined: 24 Aug 2005 Posts: 1238
|
Posted: Tue Apr 11, 2006 2:04 pm Post subject: |
|
|
| 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 |
|
 |
shimanov
Joined: 25 Sep 2005 Posts: 612
|
Posted: Tue Apr 11, 2006 5:57 pm Post subject: |
|
|
| You could try LV_ModifyCol with the the Icon and/or IconRight options. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10464
|
Posted: Wed Apr 12, 2006 12:18 am Post subject: |
|
|
| 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 |
|
 |
neyon
Joined: 29 May 2005 Posts: 34 Location: The Netherlands
|
Posted: Wed Apr 12, 2006 2:26 pm Post subject: |
|
|
Use ascii character 24 (↑) or 25 (↓).
They look nicer than ^ e.g. _________________ Greetz,
Neyon |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Wed Apr 12, 2006 3:18 pm Post subject: |
|
|
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 |
|
 |
evl
Joined: 24 Aug 2005 Posts: 1238
|
Posted: Sat Apr 15, 2006 11:08 pm Post subject: |
|
|
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 |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10464
|
Posted: Mon Apr 17, 2006 2:55 am Post subject: |
|
|
| 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 |
|
 |
|