[gme-users] icon images and instance images

Deniz Çetinkaya dcetinkaya at thk.edu.tr
Thu Dec 18 08:30:30 CST 2014


Thank you very much. Are there any tutorials to add add-ons?
Deniz.

-----Original Message-----
From: gme-users-bounces at list.isis.vanderbilt.edu [mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf Of Kevin Smyth
Sent: Thursday, December 18, 2014 4:12 PM
To: gme-users; gme-users
Subject: Re: [gme-users] icon images and instance images

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




More information about the gme-users mailing list