up: ZWT     index Zimbu documentation

CLASS ZWT.Panel EXTENDS ZWT.Widget @abstract @public

summary

     

A Widget that contains one or more other widgets. How they are ordered is defined by subclasses.

list<ZWT.Widget>  $items @public  The widgets inside this panel.
int  $highlighted @protected 
 
NEW() @public  Create an empty Panel.
$detach() @public  Detach the contents from Panel. Allows for faster updates, if the Panel supports it.
$attach() @public  Re-attach the contents to Panel. Only to be called after $detach().
$add(widget) @public  Add widget to end of the Panel.
$add(widget, style) @public  Add widget to end of the panel and set the style.
$addItem(widget) @public  Add widget to the list of widgets without adding it to the Panel.
$insert(widget) @public  Insert widget at the start of the panel.
$insert(widget, index) @public  Insert widget before position index. When using zero it will appear before the widgets already present.
$insertItem(widget, index) @public  Insert widget to the list of widgets without adding it to the Panel.
$set(widget, index) @public  Set widget at index in the panel.
$remove(widget) @public  Remove widget from this Panel.
$remove(index) ZWT.Widget @public  Remove the widget at index from this Panel.
$clear() @public  Remove all widgets from this Panel.
$setStyle(widget, style) @public  Set the Style for Widget w, which must be in this Panel.
$setController(controller) @public  Set the controller for this Panel. Use NIL to detach the controller.
$getController() ZWT.I_Controller @public  Get the controller for this Panel, as previously set with setController. Can be NIL.
$getHighlighted() ZWT.Widget @public  Return the first highlighted item. NIL if there is none.
$getHighlightIndex() int @public  Return the index of the first highlighted item. -1 if there is none.
$getHightlightSet() set<int> @public  Return a set with indexes of all highlighted items. Empty set if there is none.
$setHighlightStyle(style) @public  Set the Style to be used for the highlighted item.
$setHighlighted(item) @public  Set the highlight to item. Remove highlight when item is NIL.
$setHighlighted(index) @public  Set the highlight to the item with index index.
$addHighlighted(index) @public  Highlight an item without removing any existing highlight.
$removeHighlight() @public  Remove highlighting from items, if there is any.
 
Inherited from ZWT.Widget:
$getParent() UIObject @public  Return the parent of this Widget.
$ToString() string @public  Returns "Widget". Should be replaced by subclasses.
$getText() string @public  Return the text of the Widget. NIL if there is none.
$setHoverText(text) ZWT.Widget @public  Set the text to be displayed on hover-over.
$getHoverText() string @public  Get the text to be displayed on hover-over.
$addToParent(parent) @public  Add this widget to parent.
$removeFromParent() @public  Remove this Widget from its parent.
$setHandler(eventType, handler) @public  Set handler as the only method to be invoked for eventType.
$addHandler(eventType, handler) @public  Add handler as a method to be invoked for eventType.
$setClickHandler(handler) @public  Set handler as the method to be invoked for a click event on this widget.
$setMouseOverHandler(handler) @public  Set handler as the method to be invoked when the mouse enters the area of this widget.
$setMouseOutHandler(handler) @public  Set handler as the method to be invoked when the mouse leaves the area of this widget.
$setKeyHandler(handler) @public  Set handler to be invoked when a key is typed in this widget.
$setKeyDownHandler(handler) @public  Set handler to be invoked when a key is pressed in this widget.
$setKeyUpHandler(handler) @public  Set handler to be invoked when a key is released in this widget.
$setActive(active) @public  Set whether the Widget handles click events.
$isActive() bool @public  Return whether the Widget was set to be active.
$setInactiveStyle(style) @public  Set the style to be used when the Widget is inactive.
 
Inherited from ZWT.UIObject:
ZWT.Element  $elem @public  The HTML element for this Item.
 
$setStyle(style) @public  Set the main Style for this UIObject to style.
$setStyleList(styles) @public  Set the list of Styles for this UIObject to styles.
$addStyle(style) @public  Add style to this UIObject, keeping previously set ones.
$removeStyle(style) @public  Remove style from this UIObject.
$getStyle() ZWT.Style @public  Return the main Style for this UIObject.
$getStyleList() list<ZWT.Style> @public  Return the list of Styles for this UIObject.
$getWidth() int @public  Return the width of the Element.
$getHeight() int @public  Return the height of the Element.
$getTop() int @public  Return the vertical position of the Element in the page
$getTop(container) int @public  Return the vertical position of the Element within container
$getLeft() int @public  Return the horizontal position of the Element in the page
$getLeft(container) int @public  Return the horizontal position of the Element within container
$setHidden(hidden) @public  Set the item to be hidden or displayed.
 
Known subclasses:
     
 

members (alphabetically)

     

int $highlighted @protected

list<ZWT.Widget> $items @public

     

The widgets inside this panel.

PROC NEW() @default @replace @public

     

Create an empty Panel.

PROC $add(ZWT.Widget widget) @default @public

     

Add widget to end of the Panel.

PROC $add(ZWT.Widget widget, ZWT.Style style) @default @public

     

Add widget to end of the panel and set the style.

PROC $addHighlighted(int index) @public

     

Highlight an item without removing any existing highlight.

PROC $addItem(ZWT.Widget widget) @default @public

     

Add widget to the list of widgets without adding it to the Panel.

To be called by child classes that add the Widget to the Panel in a different way.

PROC $attach() @default @public

     

Re-attach the contents to Panel. Only to be called after $detach().

PROC $clear() @default @public

     

Remove all widgets from this Panel.

This is just like calling remove() on each Widget.

PROC $detach() @default @public

     

Detach the contents from Panel. Allows for faster updates, if the Panel supports it.

Call $attach() after the contents has been changed.

FUNC $getController() ZWT.I_Controller @public

     

Get the controller for this Panel, as previously set with setController. Can be NIL.

FUNC $getHighlightIndex() int @public

     

Return the index of the first highlighted item. -1 if there is none.

FUNC $getHighlighted() ZWT.Widget @public

     

Return the first highlighted item. NIL if there is none.

FUNC $getHightlightSet() set<int> @public

     

Return a set with indexes of all highlighted items. Empty set if there is none.

PROC $insert(ZWT.Widget widget) @default @public

     

Insert widget at the start of the panel.

PROC $insert(ZWT.Widget widget, int index) @default @public

     

Insert widget before position index. When using zero it will appear before the widgets already present.

When index is equal to or larger than the number of widgets already present this works just like $add(widget).

PROC $insertItem(ZWT.Widget widget, int index) @default @public

     

Insert widget to the list of widgets without adding it to the Panel.

To be called by child classes that add the Widget to the Panel in a different way.

PROC $remove(ZWT.Widget widget) @default @public

     

Remove widget from this Panel.

If widget is not in this Panel nothing happens.

FUNC $remove(int index) ZWT.Widget @default @public

     

Remove the widget at index from this Panel.

If the index is out of range nothing happens.

PROC $removeHighlight() @public

     

Remove highlighting from items, if there is any.

PROC $set(ZWT.Widget widget, int index) @default @public

     

Set widget at index in the panel.

When index is out of range nothing happens.

PROC $setController(ZWT.I_Controller controller) @public

     

Set the controller for this Panel. Use NIL to detach the controller.

PROC $setHighlightStyle(ZWT.Style style) @public

     

Set the Style to be used for the highlighted item.

When not set a default grey background is used.

PROC $setHighlighted(ZWT.Widget item) @public

     

Set the highlight to item. Remove highlight when item is NIL.

PROC $setHighlighted(int index) @public

     

Set the highlight to the item with index index.

Remove highlight from other items.

Remove all highlighting when index is < 0.

PROC $setStyle(ZWT.Widget widget, ZWT.Style style) @public

     

Set the Style for Widget w, which must be in this Panel.

Useful for alignment.

When style is NIL this clears the style.

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