We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

Archicad C++ API
About Archicad add-on development using the C++ API.

How to display the headers of the ListBox?

Anonymous
Not applicable
In my ListBox, it has Three headers.

DGListSetHeaderItemCount(dialId, item, 3);
DGListSetHeaderFlags(dialId, item, true, false, false);
DGListSetHeaderItemFlags(dialId, item, 1, DG_IS_CENTER|DG_IS_TRUNCMIDDLE, false);
DGListSetHeaderItemText(dialId, item, 1, "ID");

DGListSetHeaderItemFlags(dialId, item, 2, DG_IS_CENTER|DG_IS_TRUNCMIDDLE, false);
DGListSetHeaderItemText(dialId, item, 2, "Length");

DGListSetHeaderItemFlags(dialId, item, 3, DG_IS_CENTER|DG_IS_TRUNCMIDDLE, false);
DGListSetHeaderItemText(dialId, item, 3, "Has");
But They can not display all.

Why??

ListBoxHeader.jpg
2 REPLIES 2
Akos Somorjai
Graphisoft
Graphisoft
You have to set the header item size as well with DGListSetHeaderItemSize.

Hope this helps,

Akos
ReignBough
Enthusiast
When creating class-based list box with header, the list box is not created. Also when HasHeader() is called, it will return false whether headerFlag is set to Header or NoHeader.

SingleSelListBox (
    const Panel &       panel,
    const Rect &        rect,
    ScrollType          scroll = VScroll,
    PartialItemType     part = PartialItems,
    HeaderFlag          headerFlag = NoHeader,   <------------------
    short               headerSize = 0
);

MultiSelListBox (
    const Panel &       panel,
    const Rect &        rect,
    ScrollType          scroll = VScroll,
    PartialItemType     part = PartialItems,
    HeaderFlag          headerFlag = NoHeader,   <------------------
    short               headerSize = 0);
~ReignBough~
ARCHICAD 26 INT (from AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS