Disable icon in ComboBoxGadget when DisableGadget used

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Disable icon in ComboBoxGadget when DisableGadget used

Post by c4s »

Please make the icon in ComboBoxGadget() and ListIconGadget() disabled when DisableGadget() is used - similar as it already works for ButtonImageGadget().

Example code:

Code: Select all

UsePNGImageDecoder()
LoadImage(0, #PB_Compiler_Home + "examples/sources/Data/world.png")

If OpenWindow(0, 0, 0, 270, 180, "ComboBoxGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
	ListIconGadget(0, 10, 10, 250, 50, "Title", 245)
		AddGadgetItem(0, -1, "ListIcon item with image", ImageID(0))

	ComboBoxGadget(1, 10, 70, 250, 21, #PB_ComboBox_Image)
		AddGadgetItem(1, -1, "ComboBox item with image", ImageID(0))

	ButtonImageGadget(2, 10, 100, 250, 20, ImageID(0), #PB_Button_Toggle)

	ButtonGadget(3, 30, 140, 210, 30, "< Disable all gadgets above >")


	SetGadgetState(0, 0)
	SetGadgetState(1, 0)
	;SetGadgetState(2, 1)    ; Toggled button

	Repeat
		Select WaitWindowEvent()
			Case #PB_Event_Gadget
				If EventGadget() = 3
					state = state XOr #True
					DisableGadget(0, state)
					DisableGadget(1, state)
					DisableGadget(2, state)
				EndIf
			Case #PB_Event_CloseWindow
				Break
		EndSelect
	ForEver
EndIf
And if possible please disable the item texts of the ListIconGadget() as well because it looks kind of irritating (see example).
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!