I'm working on a quick little plug-in with the Illustrator CS3 SDK and am having some troubles inserting a single entry into the hierarchy list. I have confirmed that my suites file is correctly calling in the ADMHierarchyListSuite5 class and am able to do everything I try to do in the following code except for add a new entry.
ASErr NewDialog::Init() {
ASErr rslt;
if(rslt = BaseADMDialog::Init()) {
return(rslt);
}
this->SetThisPointer(this);
IADMItem itmBtnCreate = this->GetItem(kNew_BtnCreateIndex);
itmBtnCreate.SetTipString(kNew_BtnCreateTips);
itmBtnCreate.SetNotifyProc(this->CreateButtonNotifyProc);
IADMItem itmTboxName = this->GetItem(kNew_TboxNameIndex);
itmTboxName.SetTextW(mUniSetText.as_ASUnicode().c_str());
IADMItem itmListLayer = this->GetItem(kNew_ListLayerIndex);
itmListLayer.SetItemStyle(kADMMultiSelectListBoxStyle | kADMDividedListBoxStyle);
IADMList lstLayer = itmListLayer.GetList();
lstLayer.SetEntryHeight(kNew_ListLayer_LineHeight);
IADMRect rctList(2, 0, 206, kNew_ListLayer_LineHeight);
lstLayer.SetEntryTextRect(rctList);
long cntList;
sAILayer->CountLayers(&cntList);
if(cntList <= 0) {
return(kNoErr);
}
IADMEntry entryLayer;
ai::UnicodeString UniBuf;
AILayerHandle tempHandle = NULL;
AIBoolean visible;
sAILayer->GetFirstLayer(&tempHandle);
sAILayer->GetLayerTitle(tempHandle, UniBuf);
sAILayer->GetLayerVisible(tempHandle, &visible);
if(entryLayer = lstLayer.IndexEntry(-1)) {
exit(670);
} else {
exit(671);
}
entryLayer.SetText("entryLayer");
return(kNoErr);
}
I set up a quick test with the above if else statement to pinpoint that that is where the problem originates as it always exits on signal 671. I can't seem to figure out why it fails though. Is there something that I might be forgetting or is there some way for me to figure out the details as to why it's quitting? I'm building this in Visual Studio 2008.
Thanks in advance ![]()
I'll see what I can do, but first: do you want a hierarchy list or a regular list? Because you're using classes & item constants for a normal list, not a hierarchy list. IADMList & IADMEntry are for listboxes, IADMHierarchyList & IADMListEntry are for hiearchy lists. The two sets of classes are not interchangeable ![]()
Wow, you just made me realize how stupid of a mistake this might me.
What I want is just a regular list, but in my resource file (.rc), I have:
// new dialog
kNew_DialogID DIALOG DISCARDABLE 0, 0, 245, 210
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "New Set"
FONT 8, "MS Sans Serif"
BEGIN
PUSHBUTTON "Create",kNew_BtnCreateIndex,80,185,40,15
PUSHBUTTON "Cancel",kNew_BtnCancelIndex,130,185,40,15
LTEXT "Create a new set?",-1,14,5,200,20
CONTROL "",kNew_ListLayerIndex,"ADM Hierarchy List Box Type",0x1,13,20,220,140
LTEXT "Name",14,14,163,30,20
EDITTEXT kNew_TboxNameIndex,40,160,192,15,ES_AUTOHSCROLL
END
Now, if you notice, I have a "ADM Hierarchy List Box Type" define above (4th from the top).
So, obviously if I define it as a hierarchy list in the resource file, but try to set it as a regular list in the code, I'll run into problems.
What would a regular list be defined as again? I'll check the examples, try it out, and see what happens.
EDIT: Just tried it and it works! Such a small mistake that caused me headaches for days... Oh well, can't thank you enough for pointing it out! ![]()
Message was edited by: monarci70
North America
Europe, Middle East and Africa
Asia Pacific