Peculiar effect displaying a multi column listbox
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2013-04-26
09:57 PM
- last edited on
‎2024-09-24
09:53 AM
by
Doreena Deng
‎2013-04-26
09:57 PM
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?
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?
1 REPLY 1
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2013-05-22 03:53 PM
‎2013-05-22
03:53 PM
OK. I went back to this and discovered my error. Just a simple coding mistake.
Thanks anyway
Les
Thanks anyway
Les