ComboBox row/item height

Windows specific forum
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

ComboBox row/item height

Post 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 :(
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8425
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: ComboBox row/item height

Post 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
BERESHEIT
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: ComboBox row/item height

Post by IdeasVacuum »

netmaestro! living up to your exalted reputation once again, thanks for your help 8)
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply