Zebra API Doc

zebra.ui.BaseLayer Class

Extends zebra.ui.Panel

Base layer UI component. Layer is special type of UI components that is used to decouple different logical UI components types from each other. Zebra Canvas consists from number of layers where only one can be active at the given point in time. Layers are stretched to fill full canvas size. Every time an input event happens system detects an active layer by asking all layers from top to bottom. First layer that wants to catch input gets control. The typical layers examples are window layer, popup menus layer and so on.

Constructor

zebra.ui.BaseLayer

(
  • id
)

Parameters:

  • id String

    an unique id to identify the layer

Item Index

Attributes

Methods

isLayerActiveAt

(
  • x
  • y
)
Boolean

Ask if the layer is active at the given location. If the method is not defined that means the layer is active at any location.

Parameters:

  • x Integer

    a x location

  • y Integer

    a y location


Return: Boolean

return true if the layer is active at this location

layerKeyPressed

(
  • code
  • m
)
Boolean

Define the method to catch key pressed event and answer if the layer wants to have a control. If the method is not defined it is considered as the key event doesn't activate the layer

Parameters:

  • code Integer

    a key code

  • m Integer

    key modifier mask


Return: Boolean

return true if the layer wants to catch control

layerMousePressed

(
  • x
  • y
  • m
)
Boolean

Define the method to catch mouse pressed event and answer if the layer wants to have a control. If the method is not defined it is considered as the layer is not activated by the mouse event

Parameters:

  • x Integer

    a x mouse cursor location

  • y Integer

    a y mouse cursor location

  • m Integer

    mouse pressed button mask


Return: Boolean

return true if the layer wants to catch control

Attributes

id

String readonly

Id of the layer