Panels and Forms

From HLKitWiki
Revision as of 01:22, 22 November 2008 by Rob (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Context: HL KitBasic Concepts and Terminology … Visual Building Blocks 

Panels and forms are the top-level visual element used on-screen. Panels define the contents of pre-defined regions within HL. This includes the various tab-based panels used within the interface, as well as the summary panels shown on the right. Forms behave very similarly to panels and are used to define the contents of standalone windows that HL manages. These include the Configure Hero form, the Tactical Console, and forms for editing the contents of gizmos (e.g. custom magic weapons within the d20 System).

Panels and forms have a few important behavioral differences, which is why they are kept distinct. Besides their usage, the most important difference is their sizing behavior. In the case panels, the HL engine tells the panel what its available dimensions are, after which the panel sizes and positions its contents accordingly within those dimensions. For forms, however, the dimensions are dictated by the form itself. Once the dimensions are specified by the form (via its Position script), the HL engine will construct a suitable window that encompasses the form and display it.

Both panels and forms contain one or more layouts and represent a rectangular region comprising the panel/form. The panel/form is responsible for coordinating the position of its contained layouts within its boundaries.

IMPORTANT! Unlike most other visual elements, panels and forms share the same namespace. This means that the unique ids assigned to panels are not distinct from the unique ids assigned to forms. You may not define a panel with the same unique id as a form, and vice versa. All of the ids assigned to panels and forms must be distinct from one another.