[fusion-users] Fusion classes and operability.

Tómas Guðmundsson tomas at snertill.is
Thu Jul 17 11:02:03 EDT 2008


Thanks mike,

Thanks for that link, I hadn't found it in the cookbook yet. That closures 
thing is also smart but I just took an easy example of containers to refer
my problem to classes. In general coding sense I am thinking of a static 
class that is initiated by Fusion and accessible to all other classes 
(widgets). Just like the function "this.getMap()" is accessible to all.

Regards,
Tómas.

-----Original Message-----
From: Mike Adair [mailto:madair at dmsolutions.ca] 
Sent: 17. júlí 2008 14:43
To: Tómas Guðmundsson
Cc: fusion-users at lists.osgeo.org
Subject: Re: [fusion-users] Fusion classes and operability.

Tomas,

There is some documentation on using/extending Fusion events on the 
wiki: http://trac.osgeo.org/fusion/wiki/Cookbook/Fusion/Events

For your other question, I think you are asking about 2 different widget 
instances that inherit from the same base class, sharing some form of 
storage defined in the base class? If so, you may be able to use 
JavaScript closures? http://www.jibbering.com/faq/faq_notes/closures.html

Mike

Tómas Guðmundsson wrote:
>
> Hi all.
>
> I might have asked this before but I'm keen on knowing how to perform 
> some things. How do I pass on functions between two fusion classes? I 
> know about the inheritance, like a widget can inherit from a 
> ButtonBase tool. But if I would like to maintain some kind of data 
> structure of data in a class, let's say called Fusion.Tool.Container. 
> How, if two seperate widget's would use the inherit method, could the 
> call methods that would effect the same instance of the Container?
>
> Let's say one would call
>
> this.containerWrite('mystring');
>
> And the other
>
> this.containerRead();
>
> Given that containerWrite would write to the place where conatinerRead 
> reads, would I get back 'mystring'?
>
> Also, does anyone know of a good place where I can see how event's are 
> written (i.e. in the code) ? That is, how to create a new Event within 
> Fusion.Event ?
>
> Kind regards,
>
> Tómas.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> fusion-users mailing list
> fusion-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fusion-users
>   


More information about the fusion-users mailing list