Code: Select all
; Bug demonstration: ListView doesn't show items
; with Icon, IconSmall and Tile view modes for list views on
; tabs in Tab3 mode other than first or pre-selected if view mode specified
; in Gui, Add, ListView options
; Preparing icons
ImgListSmall := IL_Create(1, 1, 0)
IL_Add(ImgListSmall, "C:\Windows\system32\shell32.dll")
ImgListBig := IL_Create(1, 1, 1)
IL_Add(ImgListBig, "C:\Windows\system32\shell32.dll")
; Preparing tab widget with pre-selected Tab 2
Gui, Add, Tab3,, Icon View|Icon View (default)||Small Icon View|List View|Tile View|Report View|Icon View (workaround)
; Icon View tab will render as empty
; Multiple selection by mouse will show the elements
Gui, Tab, 1
Gui, Add, ListView, +Icon, Name
LV_SetImageList(ImgListSmall)
LV_SetImageList(ImgListBig)
LV_Add("Icon1", "First item")
; Icon View (default) tab will work fine since it's drawn first
Gui, Tab, 2
Gui, Add, ListView, +Icon, Name
LV_SetImageList(ImgListSmall)
LV_SetImageList(ImgListBig)
LV_Add("Icon1", "Second item")
; Small Icon View tab will render as empty
; Multiple selection by mouse will show the elements
Gui, Tab, 3
Gui, Add, ListView, +IconSmall, Name
LV_SetImageList(ImgListSmall)
LV_SetImageList(ImgListBig)
LV_Add("Icon1", "Third item")
; List View tab will work fine (unaffected)
Gui, Tab, 4
Gui, Add, ListView, +List, Name
LV_SetImageList(ImgListSmall)
LV_SetImageList(ImgListBig)
LV_Add("Icon1", "Fourth item")
; Tile View tab will render as empty
; Multiple selection by mouse will show the elements
Gui, Tab, 5
Gui, Add, ListView, +Tile, Name
LV_SetImageList(ImgListSmall)
LV_SetImageList(ImgListBig)
LV_Add("Icon1", "Fifth item")
; Report View tab will work fine (unaffected)
Gui, Tab, 6
Gui, Add, ListView, +Report, Name
LV_SetImageList(ImgListSmall)
LV_SetImageList(ImgListBig)
LV_Add("Icon1", "Sixth item")
; Icon View (workaround) tab will work fine
; Note that we're using +Report, not +Icon
; and defined a variable for this control
Gui, Tab, 7
Gui, Add, ListView, vIconViewWorkaround +Report, Name
LV_SetImageList(ImgListSmall)
LV_SetImageList(ImgListBig)
LV_Add("Icon1", "Seventh item")
; Workaround itself
; View mode must be different than in Gui, Add, ListView options,
; otherwise it won't work, but you can safely call GuiControl
; before Gui, Show
GuiControl, +Icon, IconViewWorkaround
Gui, Show