DGAppendDialogItem broken?
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-01-09
07:52 AM
- last edited on
2023-08-02
03:28 PM
by
Doreena Deng
2013-01-09
07:52 AM
Hi, I am wondering what you need to do to get DGAppendDialogItem to create an item on a modal dialog. I've tried calling it inside and outside DG_MSG_INIT, tried creating different types of controls, and tried on pre-made dialogs and DGBlankModalDialog. And I haven't yet been able to get a new control to appear.
Is there something special you need to do to get this function to work?
Thanks
Is there something special you need to do to get this function to work?
Thanks
Labels:
- Labels:
-
Add-On (C++)
3 REPLIES 3
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-01-09 09:35 AM
2013-01-09
09:35 AM
For example, the following code displays a blank dialog box (the button is not added).
static short DGCALLBACK TestDlgCallBack (short message, short dialId, short itemId, DGUserData /*userData*/, DGMessageData /*msgData*/) { switch (message) { case DG_MSG_INIT: { short newItem = DGAppendDialogItem (dialId, DG_ITM_BUTTON, DG_BT_TEXT, NULL, 5, 5, 20, 20); DBPrintf("new item %d added\n", newItem); } break; case DG_MSG_CLOSE: break; case DG_MSG_CLICK: switch (itemId) { //case 2: // Close button case DG_CLOSEBOX: return(1); break; default: break; } default: break; } return 0; } void openTestDlg() { DGBlankModalDialog (200, 200, DG_DLG_HGROW | DG_DLG_VGROW, 0, DG_DLG_THICKFRAME, TestDlgCallBack, NULL); }

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-01-24 02:09 PM
2013-01-24
02:09 PM
Hi paulk,
After using DGAppendDialogItem, you should call DGShowItem to make the new item visible:
Best,
Tibi
After using DGAppendDialogItem, you should call DGShowItem to make the new item visible:
// add new item: short newItem = DGAppendDialogItem (dialId, DG_ITM_CHECKBOX, DG_BT_TEXT, 0, 206, 7, 60, 18); // set font, text and others: DGSetItemFont (dialId, newItem, DG_IS_EXTRASMALL); DGSetItemText (dialId, newItem, "NEW"); // ... // make it visible: DGShowItem (dialId, newItem);
Best,
Tibi
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-01-30 03:00 AM
2013-01-30
03:00 AM
Thanks Tibi
That info should be added to the API documentation.
Paul
That info should be added to the API documentation.
Paul