Update: I worked out that it's do with the #LVM_SETVIEW message. But it still spans over multiple columns. Assuming my window has to be 700 pixels wide (and that each item text is long), then how do I make these one row only for each item?
I think the answer is here somewhere: http://www.cplusplus.com/forum/windows/169984/
Code: Select all
If OpenWindow(0, 300, 200, 700, 200, "Food", #PB_Window_SystemMenu)
icon = LoadImage(0, #PB_Compiler_Home + "Examples\Sources\Data\CdPlayer.ico")
ListIconGadget(0, 5, 5, 690, 190, "Name", 690, #PB_ListIcon_FullRowSelect)
AddGadgetItem(0, -1, "Apple", icon)
AddGadgetItem(0, -1, "Banana", icon)
AddGadgetItem(0, -1, "Carrot", icon)
AddGadgetItem(0, -1, "Donut", icon)
AddGadgetItem(0, -1, "Egg", icon)
SendMessage_(GadgetID(0), #LVM_SETVIEW, #LV_VIEW_TILE, 0)
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf
I'm not getting far with this, either:
Code: Select all
If OpenWindow(0, 300, 200, 600, 200, "Food", #PB_Window_SystemMenu)
icon = LoadImage(0, #PB_Compiler_Home + "Examples\Sources\Data\CdPlayer.ico")
ListIconGadget(0, 5, 5, 590, 190, "Name", 590, #PB_ListIcon_FullRowSelect)
AddGadgetItem(0, -1, "Apple", icon)
AddGadgetItem(0, -1, "Banana", icon)
AddGadgetItem(0, -1, "Carrot", icon)
AddGadgetItem(0, -1, "Donut", icon)
AddGadgetItem(0, -1, "Egg", icon)
hWnd = GadgetID(0)
SendMessage_(hWnd, #LVM_SETVIEW, #LV_VIEW_TILE, 0)
LVTILEVIEWINFO.tvi = 0
tvi\cbSize = SizeOf(LVTILEVIEWINFO)
tvi\dwMask = #LVTVIM_COLUMNS
tvi\cLines = 1
SendMessage(hWnd, #LVM_SETTILEVIEWINFO, 0, tvi)
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf