[gme-users] icon images and instance images
Kevin Smyth
ksmyth at isis.vanderbilt.edu
Thu Dec 18 08:11:58 CST 2014
Right, the "Instance icon name" attribute refers to archetype/instance/subtype instances.
To get the behavior you want, you could write a decorator. But I think it would be easier to write an addon, and set the "icon" registry on the creation event.
You can try this code:
STDMETHODIMP RawComponent::ObjectEvent(IMgaObject * obj, unsigned long eventmask, VARIANT v) {
if((eventmask & OBJEVENT_CREATED) && !(eventmask & OBJEVENT_DESTROYED)) {
if (obj->ObjType != OBJTYPE_FOLDER) {
IMgaFCOPtr fco = obj;
if (fco) {
auto regnode = fco->RegistryNode[L"icon"];
long status;
regnode->get_Status(&status);
if (status == ATTSTATUS_METADEFAULT || status == ATTSTATUS_UNDEFINED) {
fco->SetRegistryValueDisp(L"icon", L"component.png");
}
}
}
}
return S_OK;
}
Kevin
-----Original Message-----
From: gme-users-bounces at list.isis.vanderbilt.edu on behalf of Deniz Çetinkaya
Sent: Wed 12/17/2014 7:14 AM
To: gme-users
Subject: Re: [gme-users] icon images and instance images
Hello everyone again,
I would like to make it clear that the instances I mean are not the instances in GME.
Please see the image below.
Thank you very much.
Deniz.
From: gme-users-bounces at list.isis.vanderbilt.edu [mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf Of Deniz Çetinkaya
Sent: Monday, December 15, 2014 3:32 PM
To: gme-users at list.isis.vanderbilt.edu
Subject: [gme-users] icon images and instance images
Dear All,
I am trying to define separate images for icons on the menu, and the instances in the model.
I write the icon's address to "icon name", and instance image's address to "instance icon name". As below:
I cannot find what is wrong. It uses the icon image for instances as well. Should I define a Decorator? Or missing sth?
Thank you very much.
Asst.Prof.Dr. Deniz Çetinkaya
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 6938 bytes
Desc: image001.png
Url : http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20141218/88d61fa2/attachment.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 23833 bytes
Desc: image003.jpg
Url : http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20141218/88d61fa2/attachment.jpg
More information about the gme-users
mailing list