I've been attempting to get a multi-select listbox working in a dialog managed by ADM. However there seem to be a couple of issues. LISTBOX seems to only be supported in DIALOGEX resources, while ADM doesn't seem to display DIALOGEX dialogs, only DIALOG. The listbox appears in a DIALOG dialog, but the multi-select functionality is disabled. Has anyone ran into this issue and found a solution? The ADM List Suite includes NumberOfSelectedEntries and makes reference to multi-select lists, but I can't seem to find any further information. Any help would be greatly appreciated.
Multi-Select Listbox with ADM?
Hi,
don't use the vs resource editor to create a listbox. Just define
a dialog resource without a listbox and add the listbox from your
plugin-code using adm.
- first, create the dialog with:
sADMDialog-%26gt;Modal(gPlugInRef, ''A Dialog'', kDAVPluginADMJobQueue,
kADMModalDialogStyle,
DoMyUIInit,
NULL, // No user data
0 //options
);
- then create the list in the dialogs init proc (here: DoMyUIInit)
ASErr ASAPI DoMyUIInit(ADMDialogRef dialog)
{
ASErr error = kSPNoError;
ADMItemRef item;
.
.
.
//list box bounding rect, you have to adjust this to
// your dialogs needs
ADMRect rect;
rect.top=30;
rect.left=10;
rect.bottom=200;
rect.right=200;
#define kADMMultiSelectStyle (1L%26lt;%26lt;0) //see ADM-Doc for this
//create the list:
ADMItemRef item=ADMItem-%26gt;Create(dialog,ADMUniqueItemID,
ADMListBoxType,
%26amp;rect , NULL, NULL );
//set the multi-select style to the listbox
sADMItem-%26gt;SetItemStyle(item, kADMMultiSelectStyle);
.
.
.
}
Multi-Select Listbox with ADM?
Thanks. I tried that, but forgot about using kADMUniqueItemID instead of using the same one I'd had in my enum for the listbox when using a resource. I even remember reading about using it in the reference manual.
Thanks again. :)
You're welcome, I'm glad I could help you a bit.
Subscribe to:
Post Comments
(Atom)
No comments:
Post a Comment