flexlib :: library Documentation | All Packages | All Classes | Index | Frames No Frames |
WindowShade

Package | flexlib.containers
Class | public class WindowShade
Inheritance | WindowShade mx.core.LayoutContainer

This control displays a button, which when clicked, will cause a panel to "unroll" beneath it like a windowshade being pulled down; or if the panel is already displayed it will be "rolled up" like a windowshade being rolled up. When multiple WindowShades are stacked in a VBox, the result will be similar to an mx.containers.Accordian container, except that multiple WindowShades can be opened simultaneously whereas an Accordian acts like a tab navigator, with only one panel visible at a time.

Public Properties

| Property | Defined By
--- | --- | ---
|  | closedHeight : Number = 0 | WindowShade
|  | headerLocation : String Specifies where the header button is placed relative tot he content of this WindowShade. | WindowShade
|  | headerRenderer : IFactory To control the header used on the WindowShade component you can either set the headerClass or the headerRenderer. | WindowShade
|  | label : String [override] The text that appears on the headerButton. | WindowShade
|  | opened : Boolean Sets or gets the state of this WindowShade, either opened (true) or closed (false). | WindowShade
|  | viewMetrics : EdgeMetrics [override] [read-only] | WindowShade

Public Methods

| Method | Defined By
--- | --- | ---
|  | WindowShade() | WindowShade

Protected Methods

| Method | Defined By
--- | --- | ---
|  | applyHeaderButtonStyles(button:Button):void | WindowShade
|  | createOrReplaceHeaderButton():void | WindowShade

Events

| Event | Summary | Defined By
--- | --- | --- | ---
|  | closeBegin | Dispatched when the WindowShade is about to be closed. | WindowShade
|  | closeEnd | Dispatched when the WindowShade has finished closing. | WindowShade
|  | openBegin | Dispatched when the WindowShade is about to be opened. | WindowShade
|  | openedChanged | Dispatched when the opened property is changed, either through user action or programatically. | WindowShade
|  | openEnd | Dispatched when the WindowShade has finished opening. | WindowShade

Styles

| Style | Description | Defined By
--- | --- | --- | ---
|  | closeDuration | Type: Number Format: Time CSS Inheritance: no The duration of the WindowShade closing transition, in milliseconds. The value 0 specifies no transition. The default value is`250`. | WindowShade
|  | closeIcon | Type: Class CSS Inheritance: no This is the icon displayed on the headerButton when the WindowShade is in the closed state. | WindowShade
|  | headerClass | Type: Class CSS Inheritance: no The class from which the headerButton will be instantiated. Must be mx.controls.Button or a subclass. The default value is`mx.controls.Button`. | WindowShade
|  | headerStyleName | Type: String CSS Inheritance: no Name of CSS style declaration that specifies styles for the headerButton. | WindowShade
|  | headerTextAlign | Type: String CSS Inheritance: no Alignment of text on the headerButton. The value set for this style is used as the textAlign style on the headerButton. Valid values are "left", "center" and "right". The default value is`"right"`. | WindowShade
|  | openDuration | Type: Number Format: Time CSS Inheritance: no The duration of the WindowShade opening transition, in milliseconds. The value 0 specifies no transition. The default value is`250`. | WindowShade
|  | openIcon | Type: Class CSS Inheritance: no This is the icon displayed on the headerButton when the WindowShade is in the open state. | WindowShade
|  | toggleHeader | Type: Boolean CSS Inheritance: no If true, the value of the headerButton's `toggle` property will be set to true; otherwise the `toggle` property will be left in its default state. The default value is`false`. | WindowShade

Property Detail

closedHeight | property

`public var closedHeight:Number = 0`

headerLocation | property |

`headerLocation:String`

Specifies where the header button is placed relative tot he content of this WindowShade. Possible values are `top` and `bottom`.

This property can be used as the source for data binding.

Implementation
`public function get headerLocation():String`
`public function set headerLocation(value:String):void`

headerRenderer | property |

`headerRenderer:IFactory`

To control the header used on the WindowShade component you can either set the `headerClass` or the `headerRenderer`. The `headerRenderer` works similar to the itemRenderer of a List control. You can set this using MXML using any Button control. This would let you customize things like button skin. You could even combine this with the CanvasButton component to make complex headers.

Implementation
`public function get headerRenderer():IFactory`
`public function set headerRenderer(value:IFactory):void`

label | property |

`label:String`[override]

The text that appears on the headerButton.

Implementation
`public function get label():String`
`public function set label(value:String):void`

opened | property |

`opened:Boolean`

Sets or gets the state of this WindowShade, either opened (true) or closed (false).

Implementation
`public function get opened():Boolean`
`public function set opened(value:Boolean):void`

viewMetrics | property |

`viewMetrics:EdgeMetrics` [read-only] [override]

Implementation
`public function get viewMetrics():EdgeMetrics`
Constructor Detail

WindowShade | () | Constructor

`public function WindowShade()`

Method Detail

applyHeaderButtonStyles | () | method

`protected function applyHeaderButtonStyles(button:Button):void`

Parameters

| `button:Button`

createOrReplaceHeaderButton | () | method |

`protected function createOrReplaceHeaderButton():void`

Event Detail

closeBegin | Event

Event Object Type: `flexlib.events.WindowShadeEvent`
WindowShadeEvent.type property = `flexlib.events.WindowShadeEvent.CLOSE_BEGIN`

Dispatched when the WindowShade is about to be closed. This event cannot be cancelled.

In most cases, an event of this type will be followed by an event of type WindowShadeEvent.CLOSE_END (`closeEnd`); however, if the user clicks the header button before the closing transition has run to completion, the `closeEnd` event will not be dispatched, since the WindowShade will not be left in the closed state.

The WindowShadeEvent.CLOSE_BEGIN constant defines the value of the `type` property of a WindowShadeEvent object used to indicate that a WindowShade is about to be closed. This type of WindowShadeEvent is not cancelable.

In most cases, an event of this type will be followed by an event of type WindowShadeEvent.CLOSE_END (`closeEnd`); however, if the user clicks the header button before the closing transition has run to completion, the `closeEnd` event will not be dispatched, since the WindowShade will not be left in the closed state.

closeEnd | Event |

Event Object Type: `flexlib.events.WindowShadeEvent`
WindowShadeEvent.type property = `flexlib.events.WindowShadeEvent.CLOSE_END`

Dispatched when the WindowShade has finished closing. This event cannot be cancelled.

The WindowShadeEvent.CLOSE_END constant defines the value of the `type` property of a WindowShadeEvent object used to indicate that a WindowShade has been completely opened. The WindowShade, however, is not guaranteed to have been rendered in the fully open state when this event is dispatched. (Use callLater in the event handler if this is a problem.) This type of WindowShadeEvent is not cancelable.

openBegin | Event |

Event Object Type: `flexlib.events.WindowShadeEvent`
WindowShadeEvent.type property = `flexlib.events.WindowShadeEvent.OPEN_BEGIN`

Dispatched when the WindowShade is about to be opened.

In most cases, an event of this type will be followed by an event of type WindowShadeEvent.OPEN_END (`openEnd`); however, if the user clicks the header button before the closing transition has run to completion, the `openEnd` event will not be dispatched, since the WindowShade will not be left in the opened state.

The WindowShadeEvent.OPEN_BEGIN constant defines the value of the `type` property of a WindowShadeEvent object used to indicate that a WindowShade is about to be opened. This type of WindowShadeEvent is not cancelable.

In most cases, an event of this type will be followed by an event of type WindowShadeEvent.OPEN_END (`openEnd`); however, if the user clicks the header button before the opening transition has run to completion, the `openEnd` event will not be dispatched, since the WindowShade will not be left in the open state.

openedChanged | Event |

Event Object Type: `flexlib.events.WindowShadeEvent`
WindowShadeEvent.type property = `flexlib.events.WindowShadeEvent.OPENED_CHANGED`

Dispatched when the `opened` property is changed, either through user action or programatically. This event is cancelable. When cancelled through a call to Event.preventDefault(), the `opened` property will be restored to its previous state.

The WindowShadeEvent.OPENED_CHANGED constant defines the value of the `type` property of the event object for a `openedChanged` event, which indicates that the value of the `opened` property has been toggled, either through user action or programattically.

This is the only WindowShadeEvent type that can be cancelled by a listener function. If the `preventDefault()` method is called, the previous value of the `opened` property will be restored. The restoration will trigger an additonal PropertyChangeEvent to keep properties bound to the `opened` property in sync, but it will not trigger another `openChanged` event.

openEnd | Event |

Event Object Type: `flexlib.events.WindowShadeEvent`
WindowShadeEvent.type property = `flexlib.events.WindowShadeEvent.OPEN_END`

Dispatched when the WindowShade has finished opening. This event cannot be cancelled.

The WindowShadeEvent.OPEN_END constant defines the value of the `type` property of a WindowShadeEvent object used to indicate that a WindowShade has been completely opened. The WindowShade, however, is not guaranteed to have been rendered in the fully open state when this event is dispatched. (Use callLater in the event handler if this is a problem.) This type of WindowShadeEvent is not cancelable.

Mercredi Juillet 4 2012, 09:36 PM +02:00