Hi all. Had to switch to an older PC with Win XP today and noticed that the ComboBoxGadget drop-down size is weird
when resized. Check out the snippet below... if you use either 22*dpi or 24*dpi to resize the ComboBoxGadget height, then the drop-down list shows all items. But for some wacky reason, using 23*dpi (the middle number) shows only two items in the list?
However, if you don't use ResizeGadget (see second snippet), then 23*dpi works as expected, like 22 and 24 does. So, a bug with ResizeGadget?
Code:
; For Windows XP using 5.70 beta 2 (32-bit).
If OpenWindow(0, 0, 0, 270, 40, "ComboBoxGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
dpi.d=0.96
;h=22*dpi ; Works! Shows all 10 drop-down items.
h=23*dpi ; FAILS: Only shows 2 drop-down items. Why?
;h=24*dpi ; Works! Shows all 10 drop-down items.
ComboBoxGadget(0, 10, 10, 0, h)
For a = 1 To 10
AddGadgetItem(0, -1,"ComboBox item " + Str(a))
Next
SetGadgetState(0, 0)
ResizeGadget(0, #PB_Ignore, #PB_Ignore, 250, #PB_Ignore)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Code:
; For Windows XP using 5.70 beta 2 (32-bit).
If OpenWindow(0, 0, 0, 270, 40, "ComboBoxGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
dpi.d=0.96
h=23*dpi ; Works now because ResizeGadget is NOT used!
ComboBoxGadget(0, 10, 10, 250, h)
For a = 1 To 10
AddGadgetItem(0, -1,"ComboBox item " + Str(a))
Next
SetGadgetState(0, 0)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf