Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 
2024 Technology Preview Program

2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations

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

Peculiar effect displaying a multi column listbox

Not applicable
I am creating a modal dialog with a listbox with a number of columns in it. Here is how I initialize the listbox:

DGListDisableDraw(dialogID, UpdatesList);
w = DGListGetItemWidth(dialogID, UpdatesList);
cw = w / NoteColumn;
DGListSetTabFieldCount (dialogID, UpdatesList, NoteColumn); //number columns in the data
// The headers
DGListSetHeaderItemCount(dialogID, UpdatesList, NoteColumn);
DGListSetHeaderFlags(dialogID, UpdatesList, true, false, false);
char ch[256];
short lc;
for (short i=1; i<=NoteColumn; i++)
lc = i==NoteColumn ? w : cw*i-1;
DGListSetTabFieldData(dialogID, UpdatesList, i, (cw-1)*i, lc, DG_IS_LEFT, DG_IS_NOTRUNC, true, true);
DGListSetHeaderItemFlags(dialogID, UpdatesList, i, DG_IS_LEFT|DG_IS_NOTRUNC, true);
ACAPI_Resource_GetLocStr (ch, 32501, i);
DGListSetHeaderItemText(dialogID, UpdatesList, i, ch);
fill in the data into the columns
DGListEnableDraw(dialogID, UpdatesList);
DGInvalidateItem (dialogID, UpdatesList);

The dialog is getting built correctly but when it displays it looks like the image here. As you can see
a) the first column of text is not shown.
b) the remaining columns (except the last) are center justified when they should be left justified.
c) Only about 1/2 of the first letter of each value is visible.

All I have to do it resize any of the columns by any amount and suddenly everything is redisplayed and shown properly.

Any ideas why?


Not applicable
OK. I went back to this and discovered my error. Just a simple coding mistake.

Thanks anyway

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!