The GUI of CSLib is based one single class CSGrafikElement. This class is the base class of all other elements, widgets, windows, desktop and other entities. The base class keeps track of position, sizing and the like. Also it provides mechanisms for painting and string output and LAF support and children (other CSGrafikElement elements). For a complete list of features and supporting methods see CSGrafikElement.
Each CSGraphicElement constists of:
- an area (CSArea)
- and its children (or direct paint directives)
- a border (CSBorder)
During each painting of a GraphicElement these are drawn on screen in the above order. Usually the area and the border are determined by the currently set LAF. But one can set elements their own special version, the own area's and border's must fullfill the interface defined in the classes CSBorder and CSArea.
As of now their are two different types of borders.
One can define own borders, which (as a thought) include animations, changing colors or the like.
As of now their are several different types of areas.
- CSArea (a normal rectangular area with)
- CSRoundedArea (as above but with rounded corners)
- CSGradientArea (a rectangular area, with two differnt colors, which gradually change from one to the other), horizontally or vertically
- CSPictureArea, which takes a picture as the "background" of an element, stretched, or centered
One can define own areas, which (as a thought) include animations, changing colors or the like.
Each GraphicElement can take a(ny) number of GraphicElements as children. Children can be arranged via a CSLayoutManager.
elements added to another element can have different options:
- autosizing (horizontally, vertically, both)
- viewported
- centered
- space (between itself and other elements)
If something happens -> a message is passed to everyone who is interested. A listener can be added to each element. The message that is sent will be of the type CSMessage in special GuiMessage.
The receiver of Gui-driven events (mouse movement, clicks, etc) will allways be the element that is furthest down the element hierachie.
e.g.
The desktop has a window, the window has a panel, which has a button. If the mouse is hovering above the button and the user clicks the (mouse) button. The CSButton, which is part of the panel, which is part of the window... receives a MOUSE_BUTTON_PRESSED_MESSAGE - message. The innermost element is responsible for the message. If it not interested in it, it should pass the message on to it's parent - element (one up in the hierachy)!
Generated on Wed Jul 14 00:45:34 2004 for CSLib by
1.3.6