[gme-users] Decorator mouse events and draw functions

Kevin Smyth kevin.m.smyth at gmail.com
Mon Feb 12 16:33:33 CST 2018


Hi Cinthya,

I'd follow the "delegation pattern" for Draw, GetPreferredSize et al

The default decorator in GME is the "box decorator" which you can create in
C# like:
var delegate =
(IMgaDecorator)Activator.CreateInstance(Type.GetTypeFromProgID("MGA.BoxDecorator"));

Be sure to call Initialize

Kevin

On Mon, Feb 12, 2018 at 1:58 PM, Cinthya Lopez <Cinthya_K_Lopez at raytheon.com
> wrote:

> Hi,
>
>
>
> I am trying to implement a Decorator. I used the SampleDecorator.cs file
> that comes with GME install. I was able to run the decorator and catch the
> MouseLeftButtonDoubleClick event, which is the event I am interested in.
> This sample decorator is doing some drawing functionality that is currently
> overwriting the icon/appearance I had set for my Atom in my metamodel. The
> only thing I am interested in doing with the Decorator at this point is to
> catch the mouse event, but the MgaElementDecorator interface seems to
> require the implementation of certain functions such as Draw,
> GetPreferredSize, SetLocation, GetLocation. My question is, is there a way
> to have the decorator take a default implementation for these functions?
> Basically I don’t want the decorator to chance anything about the
> appearance of my Atom, I just want to be able to catch the mouse event and
> perform some functionality from there.
>
>
>
> Thanks,
>
> Cinthya
>
> _______________________________________________
> gme-users mailing list
> gme-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/cgi-bin/mailman/listinfo/gme-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20180212/a56bbe1b/attachment.html>


More information about the gme-users mailing list