New image map component

Lukas Renggli renggli at iam.unibe.ch
Tue Sep 12 17:48:01 MEST 2006


> I am planning to make a new image map component for pier.  Does  
> anyone know
> of anything like this pre-existing?  If not I need a little bit of  
> help:

No, but there are many add-on components available from <http:// 
mc.lukas-renggli.ch/pieraddons.html>. This might be an interesting  
starting point.

> I want my Image map Pier component to be configured from the settings
> command so I need to know how to use Magritte to build the GUI.  My  
> ideal
> representation (at least that I have thought of so far) would be a
> Dictionary.  For every Coordinate string there is an image string  
> (file
> location) to go with it.  It is a direct one to one, but the two  
> members of
> this relationship are both strings.  And I want them to wind up  
> getting
> added to the dictionary.  My preference would be that the ImageMap  
> component
> has a #addCoord:withImage: method that gets called for each entry.

Magritte doesn't know how to add and remove entries from a  
dictionary. Of course, this can be changed, but I think the easiest  
would be the following:

1. Create an Area class with described fields for the coordinate and  
image string (exactly as in the tutorial).

2. Create a subclass of PRStructure with a field to hold the areas.  
Describe the field with something like:

^ (MAToManyRelationDescription selector: #areas label: 'Areas'  
priority: 400 default: OrderedCollection new)
	classes: (OrderedCollection with: Area);
	yourself

That should work (untested).

Cheers,
Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch




More information about the SmallWiki mailing list