Page 1 of 1

PB 4.02 Win - ListIconGadget, AddGadgetItem() bug with -1

Posted: Wed Jan 17, 2007 8:39 pm
by Rescator
but only when #LVS_SORTDESCENDING is used as a flag with ListIconGadget

Can anyone else confirm this?
Heck. Can anyone explain why this is happening at all?

Some of the items are missing/not being displayed.

For some reason this example seem to hate -1 (#PB_Any) as the position.
In fact even a positive number seems to mess things up. (position out of valid range?)

And it's not just with this example, but another program of mine as well.
(I first thought it was my program, but after a day of debugging I decided to test the example, and same bug there. doh) :lol:

I can not remember this "conflict" happening in the past! (or am I mistaken?)

Code: Select all

  ; Shows possible flags of ListIconGadget in action...
  If OpenWindow(0, 0, 0, 640, 300, "ListIconGadgets", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
    ; left column
    TextGadget    (6,  10,  10, 300, 20, "ListIcon Standard", #PB_Text_Center)
    ListIconGadget(0,  10,  25, 300, 70, "Column 1", 100,#LVS_SORTDESCENDING)
    TextGadget    (7,  10, 105, 300, 20, "ListIcon with Checkbox", #PB_Text_Center)
    ListIconGadget(1,  10, 120, 300, 70, "Column 1", 100, #PB_ListIcon_CheckBoxes|#LVS_SORTDESCENDING)  ; ListIcon with checkbox
    TextGadget    (8,  10, 200, 300, 20, "ListIcon with Multi-Selection", #PB_Text_Center)
    ListIconGadget(2,  10, 215, 300, 70, "Column 1", 100, #PB_ListIcon_MultiSelect|#LVS_SORTDESCENDING) ; ListIcon with multi-selection
    ; right column
    TextGadget    (9, 330,  10, 300, 20, "ListIcon with separator lines",#PB_Text_Center)
    ListIconGadget(3, 330,  25, 300, 70, "Column 1", 100, #PB_ListIcon_GridLines|#LVS_SORTDESCENDING)
    TextGadget   (10, 330, 105, 300, 20, "ListIcon with FullRowSelect and AlwaysShowSelection",#PB_Text_Center)
    ListIconGadget(4, 330, 120, 300, 70, "Column 1", 100, #PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection|#LVS_SORTDESCENDING)
    For a = 0 To 4            ; add columns to each of the first 5 listicons
      For b = 2 To 4          ; add 3 more columns to each listicon
        AddGadgetColumn(a, b, "Column " + Str(b), 65)
      Next
      For b = 0 To 2          ; add 4 items to each line of the listicons
        AddGadgetItem(a, -1, "Item 1"+Chr(10)+"Item 2"+Chr(10)+"Item 3"+Chr(10)+"Item 4")
      Next
    Next
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf

Posted: Wed Jan 17, 2007 8:54 pm
by Rescator
#LVS_SORTASCENDING seem to have a similar effect as well!

Posted: Thu Apr 05, 2007 8:38 pm
by Fred
We don't officially support mixing PB commands and API constants.

Posted: Tue Apr 10, 2007 6:49 am
by Rescator
Hmm!

Ok, move this to feature requests then.
And consider this a request for PB listview sort flags then :)

For #PB_ListView_SortAscending
and #PB_ListView_SortDescending

I know the windows api activates automatic sort with these so no extra code needed (or is there?),
but is something similar available on the other two platforms?

Posted: Tue Apr 10, 2007 9:21 am
by gnozal
Rescator wrote:I know the windows api activates automatic sort with these so no extra code needed (or is there?)
It only works with a single column listicon imho