Zebra API Doc

zebra.ui.Window Class

Extends zebra.ui.Panel

Window UI component class. Implements window like UI component. The window component has a header, status bar and content areas. The header component
is usually placed at the top of window, the status bar component is placed at the bottom and the content component at places the central part of the window. Also the window defines corner UI component that is supposed to be used to resize the window. The window implementation provides the following possibilities:

  • Move window by dragging the window on its header
  • Resize window by dragging the window corner element
  • Place buttons in the header to maximize, minimize, close, etc the window
  • Indicates state of window (active or inactive) by changing the widow header style
  • Define a window icon component
  • Define a window status bar component

Constructor

zebra.ui.Window

(
  • [content]
  • [content]
)

Parameters:

  • [content] String optional

    a window title

  • [content] zebra.ui.Panel optional

    a window content

Methods

catchInput

(
  • c
)
Boolean

Inherited from zebra.ui.Composite:

The method is called to ask if the given children UI component has to be input events transparent

Parameters:


Return: Boolean

true if the given children component has to be input events transparent

close

()

Close the window

insideCorner

(
  • px
  • py
)
type protected

Test if the mouse cursor is inside the window corner component

Parameters:

  • px Integer

    a x coordinate of the mouse cursor

  • py Integer

    a y coordinate of the mouse cursor


Return: type

true if the mouse cursor is inside window corner component

isActive

() Boolean

Test if the window is shown as a window and activated


Return: Boolean

true is the window is shown as internal window and is active.

isMaximized

() Boolean

Test if the window has been maximized to occupy the whole window layer space.


Return: Boolean

true if the window has been maximized

maximize

()

Maximize the window

restore

()

Restore the window size

setButtons

(
  • buttons
)

Set the window buttons set.

Parameters:

  • buttons Object

    dictionary of buttons icons for window buttons. The dictionary key defines a method of the window component to be called when the given button has been pressed. So the method has to be defined in the window component.

setSizeable

(
  • b
)

Make the window sizable or not sizeable

Parameters:

  • b Boolean

    a sizeable state of the window

Attributes

buttons

zebra.ui.Panel readonly

Window buttons panel. The panel can contain number of window buttons

caption

zebra.ui.Panel readonly

Window caption panel. The panel contains window icons, button and title label

icons

zebra.ui.Panel readonly

Icons panel. The panel can contain number of icons.

isSizeable

Boolean readonly

Indicate if the window can be resized by dragging its by corner

Default: true

minSize

Integer

Minimal possible size of the window

Default: 40

root

zebra.ui.Panel readonly

Root window panel. The root panel has to be used to add any UI components

status

zebra.ui.Panel readonly

Window status panel.

title

zebra.ui.Panel readonly

Window title component