With PBv6.10 you can set the alignment for each column in a ListIconGadget.
Question:
What is the recommendet value for "Item" in SetGadgetItemAttribute()?
Is it #PB_Ignore, #PB_Any or what?
"Item" seems to have no relevance. You can only set alignement for the header.
How do I get the column when I click on header?
This example does always return "0" (tested on Win7 with PB v6.10):
Code: Select all
OpenWindow(1, 10, 10, 640, 480,"")
ListIconGadget(1, 0, 0, WindowWidth(1), WindowHeight(1), "Col 1", 120, #PB_ListIcon_FullRowSelect)
AddGadgetColumn(1, 1, "Col 2", 120)
AddGadgetColumn(1, 2, "Col 3", 120)
AddGadgetColumn(1, 3, "Col 4", 120)
SetGadgetItemAttribute(1, #PB_Ignore, #PB_ListIcon_ColumnAlignment, #PB_ListIcon_Right, 0)
SetGadgetItemAttribute(1, #PB_Ignore, #PB_ListIcon_ColumnAlignment, #PB_ListIcon_Center, 1)
SetGadgetItemAttribute(1, #PB_Ignore, #PB_ListIcon_ColumnAlignment, #PB_ListIcon_Center, 2)
SetGadgetItemAttribute(1, #PB_Ignore, #PB_ListIcon_ColumnAlignment, #PB_ListIcon_Right, 3)
AddGadgetItem(1, -1, "Row 1"+#LF$+"Row 2"+#LF$+"Row 3"+#LF$+"Row 4")
AddGadgetItem(1, -1, "Row 1"+#LF$+"Row 2"+#LF$+"Row 3"+#LF$+"Row 4")
AddGadgetItem(1, -1, "Row 1"+#LF$+"Row 2"+#LF$+"Row 3"+#LF$+"Row 4")
AddGadgetItem(1, -1, "Row 1"+#LF$+"Row 2"+#LF$+"Row 3"+#LF$+"Row 4")
Repeat:
  event=WaitWindowEvent()
  Select event
    Case #PB_Event_Gadget
      Select EventGadget()
        Case 1
          Select EventType()
            Case #PB_EventType_ColumnClick
              Debug GetGadgetAttribute(1, #PB_EventType_ColumnClick)
          EndSelect
      EndSelect
    Case #PB_Event_CloseWindow
      Break
  EndSelect
ForEver 


