Page 1 of 1

Images in ComboBox

Posted: Thu Jan 08, 2015 6:19 am
by IdeasVacuum
Has anyone successfully created a combobox() with 16x16pix images?
No complaints from the compiler, my images are loaded, but not displayed (png).

(Also note that the dropped-down text is reduced quality?)

Code: Select all

Enumeration
#Win
#Combo
#Img000
#Img001
#Img002
#Img003
#Img004
EndEnumeration

LoadImage(#Img000,"http://www.professorcad.co.uk/combo/c000.png")
LoadImage(#Img001,"http://www.professorcad.co.uk/combo/c001.png")
LoadImage(#Img002,"http://www.professorcad.co.uk/combo/c002.png")
LoadImage(#Img003,"http://www.professorcad.co.uk/combo/c003.png")
LoadImage(#Img004,"http://www.professorcad.co.uk/combo/c004.png")

Procedure CloseWindowEvent()
;---------------------------
              CloseWindow(EventWindow())
EndProcedure

If OpenWindow(#Win, 0, 0, 210, 100, "Combo Images", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

          ComboBoxGadget(#Combo, 5, 5, 200, 20, #PB_ComboBox_Image)

           AddGadgetItem(#Combo, -1, "Image000", ImageID(#Img000))
           AddGadgetItem(#Combo, -1, "Image001", ImageID(#Img001))
           AddGadgetItem(#Combo, -1, "Image002", ImageID(#Img002))
           AddGadgetItem(#Combo, -1, "Image003", ImageID(#Img003))
           AddGadgetItem(#Combo, -1, "Image004", ImageID(#Img004))

          SetGadgetState(#Combo, 0)

               BindEvent(#PB_Event_CloseWindow, @CloseWindowEvent())
EndIf

Re: Images in ComboBox

Posted: Thu Jan 08, 2015 10:25 am
by Fred
I don't think it's supported for now..

Re: Images in ComboBox

Posted: Thu Jan 08, 2015 10:51 pm
by IdeasVacuum
:( It should be possible to load the images from a folder, just as the rest of the website does.

Re: Images in ComboBox

Posted: Thu May 28, 2020 2:23 pm
by Paul
Since it's been 6 years, any chance we can have image support in the ComboBoxGadget now?

Or at least update the help file to show it is not supported.
Help file for ComboBoxGadget shows picture of ComboBoxGadget containing an image.
SetGadgetItemImage() says universal function that works with ComboBoxGadget