Application Model

This description isn't complete, but it's a supplement to the UML diagram ApplicationClasses.gif.

A ResourceBundle is a nested dictionary of key/value pairs and is synonymous with the current Resource class.

An EventListener listens for Events.

A Script process Events, resolving them into method calls on itself.

A Component is an EventListener and is Scriptable. A Component can construct itself from a ResourceBundle, listens for Events, and may contain a Script.

An Application is a Component. An Application contains N Windows.

A Window is a Component. A Window contains N Views. A Window may have a MenuBar.

A MenuBar contains N Menus.

A Menu has a title. A Menu contains N MenuItems.

A MenuItem has a label, may have an Icon and may have a KeyAccelarator. A MenuItem may have a Command.

A Dialog is a Window.

A Document is Scriptable and supports the LoadDocument and SaveDocument events.

A View is a Component. A View contains N Widgets. A View has a Document.

A Widget is a View. A Widget may have a ToolTip and may have a ContextMenu.

Event Model

The EventRelay broadcasts events to any of it's registered EventListeners.

A Component is an EventListener

When a Component receives an Event, it gets it's Script ( because it is Scriptable ), and it tells the Script to execute itself, passing along the Event.

The Script turns that around by asking the Event for the method name that it resolves to. The Script then calls the method on itself, passing along the Event.

Of course, the Script should be smart and not make the call if the method does not exist. Note that this doesn't take into account Script chaining yet.

It's very likely that every Component will have it's own EventRelay, and the EventRelay is the binding to wxPython for our wrapped Components.