Altering the Listbox spawned by a Dropdown Widget

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Altering the Listbox spawned by a Dropdown Widget

    Hi,

    In order to fit the overall visual scheme of my GUI I need to alter the Listboxes that are spawned by my Dropdowns. After an attempt to set a new owner draw function for a listbox failed I tried a sanity check that also doesn't seem to be working. Under WM_INIT_DIALOG I have:

    hItem = WM_GetDialogItem(pMsg->hWin, ID_DROPDOWN_0);
    DROPDOWN_SetListHeight(hItem, 34*DROPDOWN_GetNumItems(hItem));
    DROPDOWN_SetTextHeight(hItem, 40);
    DROPDOWN_Expand(hItem);
    lBox = DROPDOWN_GetListbox(hItem);
    LISTBOX_SetBkColor(lBox, LISTBOX_CI_UNSEL, 0x00201F13);

    with hItem being defined as a WM_HWIN and lBox defined as a LISTBOX_Handle. I have also attempted to set the default background color of all Listbox widgets to no avail. As this Listbox doesn't show up expanded when the GUI is drawn I had thought maybe I was executing this command at a time when it was essentially non-functional, but DROPDOWN_GetListbox(hItem) seems to get a value when called after it. I also wasn't sure if the Handle received persists between each expansion of the Dropdown, or if perhaps a new Listbox widget is created each time.


    These Listboxes are alterable, correct? Am I simply attempting to alter them at the wrong time?

    Thank you,
    Tyler
  • Hi Tyler,

    As already communicated via mail the listbox of a dropdown could be altered like shown in the sample.

    Regards, Jörg
    Files
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.