Page 1 of 1

ComboBoxGadget Height Ignored?

Posted: Wed Sep 24, 2003 2:41 pm
by ebs
I just noticed that the ComboBoxGadget seems to ignore the "Height" parameter.
I created one with a height of 300 and filled it with about 150 items. When I drop it down,
it's about twice the specified height, and it extends past the bottom of the window.
Does Windows adjust the ComboBox height based on the number of items in it?

Posted: Sat Sep 27, 2003 1:31 pm
by Andre
Can you post a (short) example code, please ?

Posted: Sun Sep 28, 2003 12:24 am
by ebs
André,

Here's a simple example. The ComboBoxGadget height is specified as 100, but it drops down to a much larger size. I think I have (part of) the answer: Windows XP. The comboxbox height is correct if I do not use the "Enable XP skin support" compiler option. If I do use it, the ComboBox height is much bigger than it should be. So it has something to do with XP skin support, right?

Eric

Code: Select all

;- fill year combobox
Procedure FillYears()
  ClearGadgetItemList(2)
  
  For Year.l = 1930 To Year(Date())
    AddGadgetItem(2, -1, Str(Year))
  Next
EndProcedure

;- open Add Album window
Procedure.l Window_AddAlbum()
  If OpenWindow(0,0,0,400,365,#PB_Window_ScreenCentered|#PB_Window_SystemMenu|#PB_Window_Invisible,"Add Album to Database")
    If CreateGadgetList(WindowID())
      SetGadgetFont(#PB_Default,LoadFont(1,"Arial", 8)) 
      ComboBoxGadget(2,310,60,55,100)
      FillYears()
      SetGadgetState(2,0)
      HideWindow(0,#False)
      ProcedureReturn WindowID()
    EndIf
  EndIf
EndProcedure

;- main event loop
If Window_AddAlbum() 
  Repeat
    EventID.l = WaitWindowEvent()
  Until EventID = #PB_Event_CloseWindow
EndIf
End

Posted: Sun Sep 28, 2003 10:28 am
by Andre
So it has something to do with XP skin support, right?
I think so. It seems like a WinXP "feature"... :D

Posted: Sun Sep 28, 2003 11:45 am
by merendo
Since I use Windows Operating System, my programmes have no longer bugs... Just hidden features...
Under a non-WinXP os it works fine, both with enabled or disabled WinXP skin support.