Page 1 of 1

ComboBox row/item height

Posted: Thu Jul 13, 2017 5:09 pm
by IdeasVacuum
Although you can define the height of the ComboBox gadget, this does not follow through to Item (Row) height.

Code: Select all

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: Select all

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))
[/size]
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 :(

Re: ComboBox row/item height

Posted: Thu Jul 13, 2017 5:25 pm
by netmaestro

Code: Select all

 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

Re: ComboBox row/item height

Posted: Thu Jul 13, 2017 8:14 pm
by IdeasVacuum
netmaestro! living up to your exalted reputation once again, thanks for your help 8)