[This local archive copy is from the official and canonical URL, http://www.mozilla.org/xpfe/dialogs.html; please refer to the canonical source document if possible.]
|
First Draft This document will (eventually) detail the XML DTD used for
describing the layout of XPFE windows. See the XUI
Language Spec for an overview of language directions. An XPFE
window is a top-level application window containing XPFE widgets (by
"top-level," we mean an OS window on the desktop, rather than
controls and various pieces of top-level windows). The "resource description" by which XPFE windows are built will be
an XML file as outlined in the aforementioned language spec. It will
describe the elements (including controls and layout specifications)
that make up a window; their attributes and interrelationships. This
resource description can be handed to Mozilla for parsing into a W3
compliant DOM, which will subsequently be used as a template to build
the window itself. Windows thus constructed will be addressable and
scriptable through that underlying DOM. Settings for dialog controls,
specifically, can be initialized and queried directly through the DOM
both before and after the window is shown. A window is a conglomeration of individual widgets. A dialog
window can be built from button and text edit widgets. A browser
window can be built from toolbar and HTML display widgets. Widgets'
behaviour is a function of their internal programming, and therefore
outside the scope of this document. This document instead covers
their placement on windows and interactions via JavaScript. The window building code will accept standard XML as described by
the W3, minus unimplemented features. UI designers are free, subject
to the "unimplemented" restriction, to design UIs from any
combination of features of the language. For example, the authors
encourage a separate description of content (in the XML) and form
(applied through XSL and CSS stylesheets) to ease the task of writing
for multiple platforms, which may have their own standards regarding
placement of controls. Suggestions for accomplishing this will be
sprinkled throughout the document. But in the end, the toolkit cares
only that you provide it with valid XML. This spec details an expected direction, and describes design
elements the authors believe will be useful for describing a window
and its contents. It is necessarily incomplete; it will be filled out
as real windows and dialogs are constructed, and shortcomings in the
spec are highlighted through actual use. Two glaring shortcomings in
the current spec are the missing mechanisms for tying JavaScript and
COM objects to dialog elements. The XML presented to the internal DOM builder will necessarily
have platform dependencies. Individual platforms have unique
guidelines about, for instance, the placement of OK and Cancel
buttons. Windows may also contain grouping elements and other details
unique to certain platforms. This is a problem ideally solved by
writing one, cross-platform XUI spec defining the window, and a
series of platform-specific stylesheets to transform the window into
its actual displayable version. Realistically, it will probably often
involve maintaining separate XUI specs. Windows are not designed to be laid out in terms of absolute
positions. They are instead specified by struts and springy elements;
a design borrowed from the Java world which lends itself well to
layouts which work without change in multiple platform
environments. A window specification is nothing more than a list of widgets and
rules for their placement and interactions. Placement and
interactions are both under development at time of writing. Placement
details will depend on details of the NGLayout window layout manager,
as yet unwritten. Interactions will depend on the scripting model,
under development. At this time, there is little to say about windows
but a list of expected widgets. Windows are delineated by a <window> element. The window
will contain widgets, layout rules, and scripts. Attributes suitable
for individual widgets is really a subject for separate papers
describing the widgets themselves. But lacking those, several simple
widgets are described here. The elements of a window, and their legal attributes and possible
children are currently XML Element Allowed Children Attributes window (all but option) Root element for defining a dialog layout elements box (all but dialog, option) Children of this item are displayed as a group
border integer defining width of delineating box (can
be 0) format "horizontal" or"vertical". controls on which
axis child elements are laid out. strut Layout hints which control interelement spacing. The
dimension in which the strut acts is controlled by its
bounding "box" element (and without a bounding box, it is
useless). Thus, the "height" and "width" attributes are
equivalent. tab box A tab widget responsible for managing a multi-paned
dialog. Tab titles are drawn from the child boxes' titles.
format "horizontal" or "vertical" controls on which
axis the tab is built decoration widgets label Static text image Icons and pictures normal URL to the graphic to be displayed under normal
conditions disabled URL for the disabled graphic depressed URL for the depressed graphic disabled URL for the disabled graphic input control widgets button image A command-issuing input control radio A radio button input control. Note that other radio
buttons in the button group are simply the other radio
button siblings in the parent element (which could be a box
with border 0). checkbox A checkbox button input control select option A list of choices lines A special height attribute; it specifies the
number of lines of options displayed in the dialog.
"1" implies a popup menu. Larger values imply a
scrolling list. type "single" or "multiple". Controls the number of
items which can be simultaneously selected. option image An item in a select control. text An editable text box lines A special height attribute; it specifies the
number of lines of text in the control. toolbar button A collection of command buttons web A "web widget," or HTML display area. Some attributes may be applied to (nearly) any object. These are layout attributes expected by the window manager. Other attributes listed above are more a concern of the widgets themselves.
WeaknessesSpec is incompleteGlaring omissions at this point are: the process of creating a window from an XML document, scripting, and loading arbitrary widgets.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Copyright © 1998 The Mozilla Organization. |