Prev | Current Page 706 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"


The Element class has references to two very important types: the IContext and the IView . The first is
an interface for classes capable of rendering the elements on the screen; every class that extends Element
can have a context class that implements IContext . The IView has just one public string variable
packagename . The variable is used to build a convention to retrieve the correct context for each element:
the class Button , when used in a StageView (the Flash 9 implementation of the IView interface), is
rendered by a class with full name ui.flash9.ButtonContext (the package name ui.flash is defined
in the StageView class and the Context keyword is appended to the class name).
Controls
The implemented controls are Button , Label , and TextBox . Out of the rendering context, the three
controls are very similar; all use a text caption and they have the same base events for mouse and
keyboard interaction. Because of their similarities, they all extend a common class TextElement that adds
just a text variable to the base Element class.


Pages:
694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718