Skip navigation
monarci70
Currently Being Moderated

Can't insert an entry into a hierarchy list

Jun 24, 2012 11:44 PM

Tags: #cs4 #illustrator #cs5 #cs3

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

 
Replies
  • Currently Being Moderated
    Jun 25, 2012 7:04 AM   in reply to monarci70

    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

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points