Widget-based Approach

Everything in the GUI system is a widget: a button is a widget, a checkbox is a widget, the window is a widget, even the screen itself is a widget.

The master widget is the screen. It is an implicit widget and does not need to be defined.

All other widgets are children of other widgets. If the screen has a window on it and that window has one button, then the implicit screen widget has one child, a window, which in turn as one child, a button.

Events such as mouse focus, mouse down and up and key down and up, and unfocus, are handled through a parent widget class in the UI called Widget.

All specific widgets, such as windows and buttons, derive from Widget, mostly for the purposes of implementing their specialities, such as Draw().

Widgets have attributes too, which communicate various characteristics of the widget to it's parent. One such attribute is draggable. This information is stored as an attribution, because dragging requires the parent to know where the widget was and where it now is.

All methods, such as Focus and Unfocus, are available to be overridden, but their generic counterpart _must_ always be called at the end of the override to handle all the generic logic associated with that action.

Widgets in Epiar

Window

A window is a draggable widget. It performs no action other than to serve as a common parent to a variety of widgets (e.g. a form).

Button

A button is a non-draggable widget which responds to mouse focus (act touched) and unfocus, and mouse click. Clicking performs an action. Buttons may have text, a picture, or nothing on them to indicate purpose.

Text Input

Text Box

Picture

Checkbox

Radio Button

Tab Strip

A tab strip is a non-draggable horizontal strip of picture buttons, usually put at the top of a window. They generally indicate when multiple forms are related, and serve the function of binder tabs, showing and hiding entire groups of widgets (forms) depending on its highlighted tab.

Scrollbar

Table