LISTBOX item 'explosion'

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

  • LISTBOX item 'explosion'

    Dear all,
    consider you have a LISTBOX widget and some of the list items actually can be considered a sub-list themselves,
    i.e. list content is something like the following

    Surname1 Name1
    Surname2 Name2
    Nickname2.1
    Nickname2.2
    Surname3 Name3

    I would like to present the list box in this way


    Surname1 Name1
    Surname2 Name2
    Surname3 Name3

    and when the second item is selected I would like to 'explode' it displaying something like


    Surname1 Name1
    Surname2 Name2
    Nickname2.1
    Nickname2.2
    Surname3 Name3

    I am trying to use the LISTBOX owner draw concept, for each item I check if there is a sublist,
    if it there is not I do nothing, if there is a sublist I am trying to draw the sublist items below
    the selected (main) item.

    But I see that functions like GUI_DrawBitmap or GuiDispStringAt work only in the current item area,
    I mean if I issue a command like GUI_DispStringAt ("string", pDrawItemInfo->x0, pDrawItemInfo->y0)
    it got it correctly executed, if I try to write a string in the next area item I do not see anything new
    displayed.

    As if the redraw operations were effective for the current item area only.

    Is there anyone that can confirm it?

    Is there anyone that can suggest another way to implement the display of a listbox item sub-list?

    Thanks in advance,
    Ezio
  • Hello Ezio,

    Yes, this is true. The Window Manager clips the area according to the currently drawn item (owner draw function) or the currently drawn window (callback -> WM_PAINT).

    From my point of view you should do well creating a separate window on top of the LISTBOX widget. The additional window can be used as sub-list.

    Best regards,
    Adrian