Page 12 of 30
Posted: Wed Mar 28, 2007 2:57 pm
by ABBKlaus
Hi Gnozal,
tried your new lib but it did not solve the problem.
First run is normal like in screenshot 1.
And on the second run the list isn´t updated any more :
Regards Klaus
PS : i edited my example a little bit (delete Button)
Posted: Wed Mar 28, 2007 3:59 pm
by gnozal
ABBKlaus wrote:Hi Gnozal,
tried your new lib but it did not solve the problem.
First run is normal like in screenshot 1.
And on the second run the list isn´t updated any more :
Regards Klaus
PS : i edited my example a little bit (delete Button)
Sorry for this, this subclassing stuff is a bit tricky ...
Please try the beta again.
Posted: Wed Mar 28, 2007 4:07 pm
by klaver
gnozal wrote:my code doesn't work with bitmaps, your code also doesn't work if the bitmap is loaded with CatchImage().
Or am I missing something ?
I'm afraid your bitmaps are not 16x16...
If you want to use 12x12 bitmaps, you have to change the parameters in ImageList_Create.
Code: Select all
hImgList = ImageList_Create_(12, 12, #ILC_MASK | #ILC_COLOR32, 1, 1)
Posted: Wed Mar 28, 2007 4:25 pm
by gnozal
klaver wrote:gnozal wrote:my code doesn't work with bitmaps, your code also doesn't work if the bitmap is loaded with CatchImage().
Or am I missing something ?
I'm afraid your bitmaps are not 16x16...
Yes !!!
I forgot this, the images are included as data ...
Posted: Wed Mar 28, 2007 10:21 pm
by ABBKlaus
thanks Gnozal,
the beta lib works fine now
and the second run is even faster
Regards Klaus
Posted: Thu Mar 29, 2007 8:46 am
by gnozal
Update (both libs)
Changes :
- fixed performance problem posted by ABBKlaus [both libs]
- PureLVSORT_SetUserIcons() now also accepts icons (12x12 bmp or ico) [PB4.0x lib only] Thanks klaver.
Posted: Mon Apr 09, 2007 2:19 pm
by AND51
gnozal, is there a way to assign different userdefined-sorting-callbacks to different columns/listicons or am I stupid?
BTW, I must sort a column containing the amount of players on a game server:
12/32 (twelve of 32 players are online), 16/16 (16 of 16 are online), 0/12 (nobody), and so on.
Which sorting type do you recommend? PureLVSORT_DateMMDDYYYY
I'm already using a userdefined-sorting-callback, but in another listicon. AFAIK, you allow only one callback for all columns/gadgets...
Posted: Mon Apr 09, 2007 2:41 pm
by gnozal
AND51 wrote:is there a way to assign different userdefined-sorting-callbacks to different columns/listicons
No.
But in the user defined sorting callback you get the following information :
ListIconNumber.l, ListIconColumn.l, Item1.s, Item2.s where
ListIconNumber is the purebasic gadget ID
ListIconColumn is the sorted column
Item1 and Item2 are the items to sort.
So you could do something like that :
Code: Select all
Procedure MySortingCallback(ListIconNumber.l, ListIconColumn.l, Item1.s, Item2.s)
Select ListIconNumber
Case #My1stListIcon
Select ListIconColumn
Case #My1stListIcon_Column0
; user defined sorting for 1st Listicon Column 0
Case #My1stListIcon_Column1
; user defined sorting for 1st Listicon Column 1
; etc ...
EndSelect
Case #My2ndListIcon
Select ListIconColumn
Case #My2ndListIcon_Column0
; user defined sorting for 2nd Listicon Column 0
Case #My2ndListIcon_Column1
; user defined sorting for 2nd Listicon Column 1
; etc ...
EndSelect
EndSelect
EndProcedure
AND51 wrote:BTW, I must sort a column containing the amount of players on a game server:
12/32 (twelve of 32 players are online), 16/16 (16 of 16 are online), 0/12 (nobody), and so on.
Which sorting type do you recommend? PureLVSORT_DateMMDDYYYY
I'm already using a userdefined-sorting-callback, but in another listicon. AFAIK, you allow only one callback for all columns/gadgets...
I would use a user defined callback, like the one described in the first part of this post. The default setting (string) would also work if you rset the number of players (05/10 instead of 5/10)
Posted: Sat Apr 14, 2007 9:16 pm
by AND51
Thx for your reply.
The information
> But in the user defined sorting callback you get the following information : ListIconNumber.l, ListIconColumn.l, Item1.s, Item2.s
is very, very useful!
However, it's annoying if you've got a mix of listicons that have to be userdefined-sorted and some that have to be String/Numeric-sorted. Maybe you can add/edit this feature in the next lib version? (This is just a suggestion.)
Posted: Wed Apr 25, 2007 6:41 pm
by AND51
Bug found!
Create a normal window + listicongadget. Set the last column to "AutoResize when listicongadget is resized".
Now: Maximize and restore the window. A horizontal scrollbar appears (when XP skin off AND on)!!
Obviously, you make the last column some pixels too expanded.
Moreover, you forget to calculate a possible (vertical) scrollbar, I think.
Posted: Wed Apr 25, 2007 8:14 pm
by AND51
Bug found!
You know, that you can double click between two headers to resize the specified column depending on its content.
Iif you use the double click method, the last column is not being auto-resized.
Posted: Thu Apr 26, 2007 9:07 am
by gnozal
AND51 wrote:Create a normal window + listicongadget. Set the last column to "AutoResize when listicongadget is resized".
Now: Maximize and restore the window. A horizontal scrollbar appears (when XP skin off AND on)!!
Obviously, you make the last column some pixels too expanded.
Moreover, you forget to calculate a possible (vertical) scrollbar, I think.
Ok, will see
AND51 wrote:You know, that you can double click between two headers to resize the specified column depending on its content.
Iif you use the double click method, the last column is not being auto-resized.
I did not know ... Will see what I can do
Posted: Thu Apr 26, 2007 12:47 pm
by gnozal
Update (Both lib versions)
Changes :
- fixed (hopefully) some 'Last Column Autoresize' glitches
Posted: Sun Apr 29, 2007 2:10 pm
by AND51
Hello gnozal!
I have the slightly feeling that your library is not compatible with set/GetGadgetItemData().
When I scan a directory, I list all found files in a LinkedList
and in a ListIconGadget.
Each entry is being assigned a unique number. Then I know, which entry belongs to which LinkedList-Element.
If I sort the ListIcon now with your lib, you just move the entries, but the Data remains at the entry.
Example:
Before sortingCode: Select all
Entry Data
picture.jpg 1
apple.gif 2
pure.pb 3
Now, I sort by string, for exmaple:
After sorting:
Code: Select all
Entry Data
apple.gif 1
picture.jpg 2
pure.pb 3
Can you correct this? Do you know what I mean?
Posted: Mon Apr 30, 2007 7:47 am
by gnozal
AND51 wrote:I have the slightly feeling that your library is not compatible with Set/GetGadgetItemData().
You are right.
AND51 wrote:Can you correct this?
No.
PureLVSORT uses the Windows #LVM_SORTITEMS message to sort the listicongadget, and this implies using LV_ITEM\lParam (so it is not compatible with Set/GetGadgetItemData(), or the other way round : the Purebasic listicongadget is not 100% Windows API compatible : it's not a simple SysListView32).
Information added to help file.