index Zimbu documentation

MODULE ZWT @public

summary

     

Zimbu Web Toolkit. A GUI in a web browser.

CLASS  Element @public  Lowest level object, an HTML element.
CLASS  JsEvent @public  Lowest level object, a Javascript event.
CLASS  UIObject @public  Lowest level ZWT object. Wraps an HTML Element. Cannot handle events.
CLASS  Widget @public  A UIObject that handles events and can be added to panels.
CLASS  Event @public  An event that can be triggered and acted upon.
ENUM  EventType @public  Used in the Event class.
CLASS  Panel @public  A Widget that contains one or more other widgets. How they are ordered is defined by subclasses.
CLASS  HorizontalPanel @public  A panel that stacks its children horizontally: a row of Widgets.
CLASS  ScrollPanel @public  A panel that provides control over scrollbars.
CLASS  PopupPanel @public  A panel that goes on top of other panels.
CLASS  VerticalPanel @public  A panel that stacks its children vertically: a column of Widgets.
CLASS  NoButtonDialog @public  A dialog with one Widget only. It has a background that covers the whole page, only interaction with the dialog is possible.
CLASS  SimpleDialog @public  A Dialog with one Widget and an OK button.
CLASS  OkCancelDialog @public  A Dialog with one Widget and two buttons: OK and Cancel.
CLASS  TableCell @public  A cell in a Table.
CLASS  TableRow @public  A row in the table.
CLASS  Table @public  A table can hold a Widget in each cell. The number of columns and rows is adjusted dynamically.
CLASS  Label @public  A Label is a simple widget that contains text, a HTML SPAN.
CLASS  TextBlock @public  A TextBlock is a simple widget that contains text, a HTML DIV.
CLASS  Button @public  A simple button that can call a procedure when clicked.
CLASS  Code @public  A Code is a widget that contains preformatted text.
CLASS  Input @public  A Input is a widget that contains one line of editable text.
CLASS  Checkbox @public  A Checkbox is a widget that has two states: Checked or not.
CLASS  Dropdown @public  A Dropdown is a widget that allows selecting one item in a list.
CLASS  Textarea @public  A Textarea is a widget that contains editable text.
CLASS  Color @public  Specifies a color to be used for a Style.
ENUM  ColorName @public  Values to be used when creating a Color object.
ENUM  Unit @public  Values to be used when setting a size.
ENUM  BorderStyle @public  Values to be used in setBorder() and setBorderStyle().
ENUM  HorAlign @public  Horizontal alignment.
ENUM  VerAlign @public  Vertical alignment.
CLASS  Style @public  A style to be attached to a Widget or Table cell. Specifies various properties for the item.
INTERFACE  I_Controller @public 
CLASS  ListController<Titem> @public  Display a list of items in a Panel.
INTERFACE  I_WidgetBuilder<Titem> @public  Interface for a builder that can create a Widget from a Titem.
 
root() ZWT.AbsolutePanel @public  Get the toplevel Panel. Widgets added to this will appear in the page.
alert(message) @public  Open a popup window to display message.
error(message) @public  Abort execution with an error, displayed in the JS console.
setCloseHandler(handler) @public  Install handler to be called when the page is about to be abandoned.
close() @public  Abort execution of the UI.
createPage(server, path, title, moduleType) @public  Create the HTML page that selects the Javascript file to load. Makes all necessary items available through server.
 

members (alphabetically)

     

PROC alert(string message) @public

     

Open a popup window to display message.

PROC close() @public

     

Abort execution of the UI.

PROC createPage(HTTP.Server server, string path, string title, type moduleType) @public

     

Create the HTML page that selects the Javascript file to load. Makes all necessary items available through server.

path is the path under which the page will be available, e.g. "index.html".

title is the page title.

moduleType is the type of the module of the page to be displayed. This is only used by the server, not by the Javascript files.

Example for http://localhost/index.html displaying the page created by MyZwtModule:

 HTTP.Server server = NEW(80)
 ZWT.createPage(server, "index.html", "My ZWT page", MyZwtModule.Type()

PROC error(string message) @public

     

Abort execution with an error, displayed in the JS console.

FUNC root() ZWT.AbsolutePanel @public

     

Get the toplevel Panel. Widgets added to this will appear in the page.

PROC setCloseHandler(func< => string> handler) @public

     

Install handler to be called when the page is about to be abandoned.

When the user closes the window, tab or leaves the page in another way, the handler will be called. If it returns NIL or an empty string the close will continue. If it returns a non-empty string a dialog will popup to ask the user if he really wants to close the window.

Example:

 ZWT.setCloseHandler({ => isChanged()
                       ? "There are unsaved changes."
                       : NIL })

credits

      The Class hierarchy, generated Javascript and a few other things are based on the Google Web Toolkit. http://code.google.com/webtoolkit/overview.html

license

      Copyright 2009 Bram Moolenaar All Rights Reserved.

      Licensed under the Apache License, Version 2.0. See the LICENSE file or obtain a copy at: http://www.apache.org/licenses/LICENSE-2.0