PureBasic Forum
https://www.purebasic.fr/english/

ComboBox row/item height
https://www.purebasic.fr/english/viewtopic.php?f=5&t=68763
Page 1 of 1

Author:  IdeasVacuum [ Thu Jul 13, 2017 5:09 pm ]
Post subject:  ComboBox row/item height

Although you can define the height of the ComboBox gadget, this does not follow through to Item (Row) height.
Code:
ComboBoxGadget(#Combo, 5, 10, 380, 60)

On my bog-standard 96dpi screen, in the drop-down, the Item height is 28pix when using a regular 18pt font. More than adequate. Different story though on a high-res tablet! The Item height needs to be much greater so that people with chubby fingers like mine can make an accurate selection.

Is there a simple way to increase the Item height? At the moment, I'm looking at popping-up a tool window that contains a ListIcon instead, since there is a simple way to increase the Item height of a ListIcon:
Code:
iFlags.i = #PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_FullRowSelect|#PB_ListIcon_GridLines|#LVS_NOSORTHEADER
iRowH.i = 60
ListIconGadget(#MyList, 5, 10, 380, 400, "Col 0", 380, iFlags)
SendMessage_(GadgetID(#MyList), #LVM_SETIMAGELIST, #LVSIL_SMALL, ImageList_Create_(1, iRowH, #ILC_COLORDDB, 0, 0))

Of course, increasing the Font Size makes a difference, but that is (a) ugly and (b) increases the width too much. Although I really don't need or want icons (#PB_ComboBox_Image), I tried the Items with 60pix high icons - Windows 7 shrinks them down to 14pix :(

Author:  netmaestro [ Thu Jul 13, 2017 5:25 pm ]
Post subject:  Re: ComboBox row/item height

Code:
 If OpenWindow(0, 0, 0, 270, 180, "ComboBoxGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

   ComboBoxGadget(2, 10, 70, 250, 21)
   SendMessage_(GadgetID(2), #CB_SETITEMHEIGHT, 0, 30) ; <----------------------------------
      For a = 1 To 5
        AddGadgetItem(2, -1,"ComboBox item " + Str(a))
      Next

    SetGadgetState(2, 2)    ; set (beginning with 0) the third item as active one
   
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf

Author:  IdeasVacuum [ Thu Jul 13, 2017 8:14 pm ]
Post subject:  Re: ComboBox row/item height

netmaestro! living up to your exalted reputation once again, thanks for your help 8)

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/