BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!
Archicad C++ API
About Archicad add-on development using the C++ API.

Peculiar effect displaying a multi column listbox

Anonymous
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?


ArchicadDialogIssue.jpg

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

Thanks anyway
Les
Learn and get certified!

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!