License Delivery maintenance is expected to occur on Saturday, November 30, between 8 AM and 11 AM CET. This may cause a short 3-hours outage in which license-related tasks: license key upload, download, update, SSA validation, access to the license pool and Graphisoft ID authentication may not function properly. We apologize for any inconvenience.
Archicad C++ API
About Archicad add-on development using the C++ API.

How are you supposed to set up column headers in ListBox.

Anonymous
Not applicable
I'm trying to make a ListBox that shows multiple columns. I can get that much working but I can only seem to put a header on the first column. Here's my code:

DGListSetHeaderItemCount(dialogID, ResultsList, 2);
DGListSetHeaderFlags(dialogID, ResultsList, true, false, false);
DGListSetHeaderItemFlags(dialogID, ResultsList, 1, DG_IS_LEFT|DG_IS_NOTRUNC, true);
DGListSetHeaderItemText(dialogID, ResultsList, 1, "Property");
DGListSetHeaderItemFlags(dialogID, ResultsList, 2, DG_IS_LEFT|DG_IS_NOTRUNC, true);
DGListSetHeaderItemText(dialogID, ResultsList, 2, "Value");

//set up the columns
w = DGListGetItemWidth(dialogID, ResultsList);
DGListSetTabFieldCount (dialogID, ResultsList, 2); //two columns in the data
DGListSetTabFieldData(dialogID, ResultsList, 1, 0, w/2-1, DG_IS_LEFT, DG_IS_NOTRUNC, true, true);
DGListSetTabFieldData(dialogID, ResultsList, 2, w/2, w, DG_IS_LEFT, DG_IS_NOTRUNC, false, true);

//some test data
DGListInsertItem (dialogID, ResultsList, DG_LIST_BOTTOM);
DGListSetItemText (dialogID, ResultsList, DG_LIST_BOTTOM, "testppty\ttestvalue");

I saw another post that suggested that you have to set the header size, eg
(DGListSetHeaderItemSize(dialogID, ResultsList, 1, 100);
but that doesn't seem to have any effect on the problem.

How do I get the header text on the second column to appear?
2 REPLIES 2
Ralph Wessel
Mentor
LesWoolsey wrote:
I'm trying to make a ListBox that shows multiple columns. I can get that much working but I can only seem to put a header on the first column.
Have you tried setting the number of columns first and then applying the header?
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
That fixed it thanks!