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

Package | flexlib.mdi.containers
Class | public class MDIWindow
Inheritance | MDIWindow mx.containers.Panel

Central window class used in flexlib.mdi. Includes min/max/close buttons by default.

Public Properties

| Property | Defined By
--- | --- | ---
|  | closeBtn : Button [read-only] Close window button. | MDIWindow
|  | cornerHandleSize : Number = 10 Size of corner handles. | MDIWindow
|  | draggable : Boolean = true Flag determining whether or not this window is draggable. | MDIWindow
|  | edgeHandleSize : Number = 4 Size of edge handles. | MDIWindow
|  | hasFocus : Boolean Property is set by MDIManager when a window's focus changes. | MDIWindow
|  | maximized : Boolean [read-only] | MDIWindow
|  | maximizeRestoreBtn : Button [read-only] Maximize/restore window button. | MDIWindow
|  | minimizeBtn : Button [read-only] Minimize window button. | MDIWindow
|  | minimized : Boolean [read-only] | MDIWindow
|  | minimizeHeight : Number [read-only] | MDIWindow
|  | resizable : Boolean = true Flag determining whether or not this window is resizable. | MDIWindow
|  | savedWindowRect : Rectangle Rectangle to represent window's size and position when resize begins or window's size/position is saved. | MDIWindow
|  | showCloseButton : Boolean | MDIWindow
|  | showControls : Boolean | MDIWindow
|  | titleBarOverlay : Canvas Invisible shape laid over titlebar to prevent funkiness from clicking in title textfield. | MDIWindow
|  | winContextMenu : ContextMenu = null Window's context menu. | MDIWindow
|  | windowControls : MDIWindowControlsContainer Reference to class used to create windowControls property. | MDIWindow
|  | windowManager : MDIManager Reference to MDIManager instance this window is managed by, if any. | MDIWindow
|  | windowStyleName : Object | MDIWindow

Public Methods

| Method | Defined By
--- | --- | ---
|  | MDIWindow() Constructor | MDIWindow
|  | close(event:MouseEvent = null):void Close the window. | MDIWindow
|  | getTitleIconObject():DisplayObject Returns reference to titleIconObject which is mx_internal by default. | MDIWindow
|  | getTitleTextField():UITextField Returns reference to titleTextField which is protected by default. | MDIWindow
|  | maximize():void Maximize the window. | MDIWindow
|  | maximizeRestore(event:MouseEvent = null):void Called from maximize/restore button | MDIWindow
|  | minimize(event:MouseEvent = null):void Minimize the window. | MDIWindow
|  | restore():void Restores the window to its last floating position. | MDIWindow
|  | restoreStyle():void Restores style settings for restore and maximize | MDIWindow
|  | saveStyle():void Save style settings for minimizing. | MDIWindow
|  | styleChanged(styleProp:String):void [override] Detects change to styleName that is executed by MDIManager indicating a change in focus. | MDIWindow
|  | unMinimize(event:MouseEvent = null):void Restore window to state it was in prior to being minimized. | MDIWindow
|  | updateContextMenu():void | MDIWindow

Protected Methods

| Method | Defined By
--- | --- | ---
|  | createChildren():void [override] Create resize handles and window controls. | MDIWindow
|  | getSelectorList():Array | MDIWindow
|  | updateDisplayList(w:Number, h:Number):void [override] Position and size resize handles and window controls. | MDIWindow

Events

| Event | Summary | Defined By
--- | --- | --- | ---
|  | close | Dispatched when the close button is clicked. | MDIWindow
|  | drag | Dispatched while the window is being dragged. | MDIWindow
|  | dragEnd | Dispatched when the window stops being dragged. | MDIWindow
|  | dragStart | Dispatched when the window starts being dragged. | MDIWindow
|  | focusEnd | Dispatched when the window loses focus and no longer has topmost z-index of MDIManager's children. | MDIWindow
|  | focusStart | Dispatched when the window gains focus and is given topmost z-index of MDIManager's children. | MDIWindow
|  | maximize | Dispatched when the maximize button is clicked or when the window is in a normal state (not minimized or maximized) and the titleBar is double clicked. | MDIWindow
|  | minimize | Dispatched when the minimize button is clicked. | MDIWindow
|  | resize | Dispatched while the mouse is down on a resize handle. | MDIWindow
|  | resizeEnd | Dispatched when the mouse is released from a resize handle. | MDIWindow
|  | resizeStart | Dispatched when a resize handle is pressed. | MDIWindow
|  | restore | If the window is minimized, this event is dispatched when the titleBar is clicked. | MDIWindow

Styles

| Style | Description | Defined By
--- | --- | --- | ---
|  | closeBtnStyleName | Type: String CSS Inheritance: no Style declaration name for the window's close button. If `closeBtnStyleNameNoFocus` is not provided this style will be used regardless of the window's focus. If `closeBtnStyleNameNoFocus` is provided this style will be applied only when the window has focus. The default value is`"mdiWindowCloseBtn"`. | MDIWindow
|  | closeBtnStyleNameNoFocus | Type: String CSS Inheritance: no Style declaration name for the window's close button when window does not have focus. See `closeBtnStyleName` documentation for details. | MDIWindow
|  | maximizeBtnStyleName | Type: String CSS Inheritance: no Style declaration name for the window's maximize button. If `maximizeBtnStyleNameNoFocus` is not provided this style will be used regardless of the window's focus. If `maximizeBtnStyleNameNoFocus` is provided this style will be applied only when the window has focus. The default value is`"mdiWindowMaximizeBtn"`. | MDIWindow
|  | maximizeBtnStyleNameNoFocus | Type: String CSS Inheritance: no Style declaration name for the window's maximize button when window does not have focus. See `maximizeBtnStyleName` documentation for details. | MDIWindow
|  | minimizeBtnStyleName | Type: String CSS Inheritance: no Style declaration name for the window's minimize button. If `minimizeBtnStyleNameNoFocus` is not provided this style will be used regardless of the window's focus. If `minimizeBtnStyleNameNoFocus` is provided this style will be applied only when the window has focus. The default value is`"mdiWindowMinimizeBtn"`. | MDIWindow
|  | minimizeBtnStyleNameNoFocus | Type: String CSS Inheritance: no Style declaration name for the window's minimize button when window does not have focus. See `minimizeBtnStyleName` documentation for details. | MDIWindow
|  | resizeCursorHorizontalSkin | Type: Class CSS Inheritance: no Name of the class used as cursor when resizing the window horizontally. | MDIWindow
|  | resizeCursorHorizontalXOffset | Type: Number CSS Inheritance: no Distance to horizontally offset resizeCursorHorizontalSkin. | MDIWindow
|  | resizeCursorHorizontalYOffset | Type: Number CSS Inheritance: no Distance to vertically offset resizeCursorHorizontalSkin. | MDIWindow
|  | resizeCursorTopLeftBottomRightSkin | Type: Class CSS Inheritance: no Name of the class used as cursor when resizing from top left or bottom right corner. | MDIWindow
|  | resizeCursorTopLeftBottomRightXOffset | Type: Number CSS Inheritance: no Distance to horizontally offset resizeCursorTopLeftBottomRightSkin. | MDIWindow
|  | resizeCursorTopLeftBottomRightYOffset | Type: Number CSS Inheritance: no Distance to vertically offset resizeCursorTopLeftBottomRightSkin. | MDIWindow
|  | resizeCursorTopRightBottomLeftSkin | Type: Class CSS Inheritance: no Name of the class used as cursor when resizing from top right or bottom left corner. | MDIWindow
|  | resizeCursorTopRightBottomLeftXOffset | Type: Number CSS Inheritance: no Distance to horizontally offset resizeCursorTopRightBottomLeftSkin. | MDIWindow
|  | resizeCursorTopRightBottomLeftYOffset | Type: Number CSS Inheritance: no Distance to vertically offset resizeCursorTopRightBottomLeftSkin. | MDIWindow
|  | resizeCursorVerticalSkin | Type: Class CSS Inheritance: no Name of the class used as cursor when resizing the window vertically. | MDIWindow
|  | resizeCursorVerticalXOffset | Type: Number CSS Inheritance: no Distance to horizontally offset resizeCursorVerticalSkin. | MDIWindow
|  | resizeCursorVerticalYOffset | Type: Number CSS Inheritance: no Distance to vertically offset resizeCursorVerticalSkin. | MDIWindow
|  | restoreBtnStyleName | Type: String CSS Inheritance: no Style declaration name for the window's restore button. If `restoreBtnStyleNameNoFocus` is not provided this style will be used regardless of the window's focus. If `restoreBtnStyleNameNoFocus` is provided this style will be applied only when the window has focus. The default value is`"mdiWindowRestoreBtn"`. | MDIWindow
|  | restoreBtnStyleNameNoFocus | Type: String CSS Inheritance: no Style declaration name for the window's restore button when window does not have focus. See `restoreBtnStyleName` documentation for details. | MDIWindow
|  | styleNameFocus | Type: String CSS Inheritance: no Style declaration name for the window when it has focus. The default value is`"mdiWindowFocus"`. | MDIWindow
|  | styleNameNoFocus | Type: String CSS Inheritance: no Style declaration name for the window when it does not have focus. The default value is`"mdiWindowNoFocus"`. | MDIWindow
|  | titleStyleNameFocus | Type: String CSS Inheritance: no Style declaration name for the text in the title bar when the window is in focus. If `titleStyleName` (inherited from Panel) is set, titleStyleNameFocus will be overridden by it. The default value is`"mdiWindowTitleStyle"`. | MDIWindow
|  | titleStyleNameNoFocus | Type: String CSS Inheritance: no Style declaration name for the text in the title bar when the window is not in focus. If `titleStyleName` (inherited from Panel) is set, `titleStyleNameNoFocus` will be overridden by it. If `titleStyleNameNoFocus` is not set but `titleStyleNameFocus` is, `titleStyleNameFocus` will be used, regardless of the window's focus state. | MDIWindow
|  | windowControlsClass | Type: Class CSS Inheritance: no Reference to class that will contain window control buttons like minimize, close, etc. Changes to this style will be detected and will initiate the instantiation and addition of a new class instance. The default value is`flexlib.mdi.containers.MDIWindowControlsContainer`. | MDIWindow

Public Constants

| Constant | Defined By
--- | --- | ---
|  | CONTEXT_MENU_LABEL_CLOSE : String = Close [static] | MDIWindow
|  | CONTEXT_MENU_LABEL_MAXIMIZE : String = Maximize [static] | MDIWindow
|  | CONTEXT_MENU_LABEL_MINIMIZE : String = Minimize [static] | MDIWindow
|  | CONTEXT_MENU_LABEL_RESTORE : String = Restore [static] | MDIWindow

Property Detail

closeBtn | property

`closeBtn:Button` [read-only]

Close window button.

Implementation
`public function get closeBtn():Button`

cornerHandleSize | property |

`public var cornerHandleSize:Number = 10`

Size of corner handles. Can be adjusted to affect "sensitivity" of resize area.

draggable | property |

`public var draggable:Boolean = true`

Flag determining whether or not this window is draggable.

edgeHandleSize | property |

`public var edgeHandleSize:Number = 4`

Size of edge handles. Can be adjusted to affect "sensitivity" of resize area.

hasFocus | property |

`hasFocus:Boolean`

Property is set by MDIManager when a window's focus changes. Triggers an update to the window's styleName.

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

maximized | property |

`maximized:Boolean` [read-only]

Implementation
`public function get maximized():Boolean`

maximizeRestoreBtn | property |

`maximizeRestoreBtn:Button` [read-only]

Maximize/restore window button.

Implementation
`public function get maximizeRestoreBtn():Button`

minimizeBtn | property |

`minimizeBtn:Button` [read-only]

Minimize window button.

Implementation
`public function get minimizeBtn():Button`

minimized | property |

`minimized:Boolean` [read-only]

Implementation
`public function get minimized():Boolean`

minimizeHeight | property |

`minimizeHeight:Number` [read-only]

Implementation
`public function get minimizeHeight():Number`

resizable | property |

`public var resizable:Boolean = true`

Flag determining whether or not this window is resizable.

savedWindowRect | property |

`public var savedWindowRect:Rectangle`

Rectangle to represent window's size and position when resize begins or window's size/position is saved.

showCloseButton | property |

`showCloseButton:Boolean`

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

showControls | property |

`showControls:Boolean`

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

titleBarOverlay | property |

`public var titleBarOverlay:Canvas`

Invisible shape laid over titlebar to prevent funkiness from clicking in title textfield. Making it public gives child components like controls container access to size of titleBar.

winContextMenu | property |

`public var winContextMenu:ContextMenu = null`

Window's context menu.

windowControls | property |

`windowControls:MDIWindowControlsContainer`

Reference to class used to create windowControls property.

Implementation
`public function get windowControls():MDIWindowControlsContainer`
`public function set windowControls(value:MDIWindowControlsContainer):void`

windowManager | property |

`public var windowManager:MDIManager`

Reference to MDIManager instance this window is managed by, if any.

windowStyleName | property |

`windowStyleName:Object`

Implementation
`public function get windowStyleName():Object`
`public function set windowStyleName(value:Object):void`
Constructor Detail

MDIWindow | () | Constructor

`public function MDIWindow()`

Constructor

Method Detail

close | () | method

`public function close(event:MouseEvent = null):void`

Close the window.

Parameters

| `event:MouseEvent` (default = `null`)``

createChildren | () | method |

`override protected function createChildren():void`

Create resize handles and window controls.

getSelectorList | () | method |

`protected function getSelectorList():Array`

Returns

| `Array`

getTitleIconObject | () | method |

`public function getTitleIconObject():DisplayObject`

Returns reference to titleIconObject which is mx_internal by default. Provided to allow MDIWindowControlsContainer subclasses as much freedom as possible.

Returns

| `DisplayObject`

getTitleTextField | () | method |

`public function getTitleTextField():UITextField`

Returns reference to titleTextField which is protected by default. Provided to allow MDIWindowControlsContainer subclasses as much freedom as possible.

Returns

| `UITextField`

maximize | () | method |

`public function maximize():void`

Maximize the window.

maximizeRestore | () | method |

`public function maximizeRestore(event:MouseEvent = null):void`

Called from maximize/restore button

Parameters

| `event:MouseEvent` (default = `null`)``

Events

| `MouseEvent`

minimize | () | method |

`public function minimize(event:MouseEvent = null):void`

Minimize the window.

Parameters

| `event:MouseEvent` (default = `null`)``

restore | () | method |

`public function restore():void`

Restores the window to its last floating position.

restoreStyle | () | method |

`public function restoreStyle():void`

Restores style settings for restore and maximize

saveStyle | () | method |

`public function saveStyle():void`

Save style settings for minimizing.

styleChanged | () | method |

`override public function styleChanged(styleProp:String):void`

Detects change to styleName that is executed by MDIManager indicating a change in focus. Iterates over window controls and adjusts their styles if they're focus-aware.

Parameters

| `styleProp:String`

unMinimize | () | method |

`public function unMinimize(event:MouseEvent = null):void`

Restore window to state it was in prior to being minimized.

Parameters

| `event:MouseEvent` (default = `null`)``

updateContextMenu | () | method |

`public function updateContextMenu():void`

updateDisplayList | () | method |

`override protected function updateDisplayList(w:Number, h:Number):void`

Position and size resize handles and window controls.

Parameters

| `w:Number`
| `h:Number`

Event Detail

close | Event

Event Object Type: `flexlib.mdi.events.MDIWindowEvent`
MDIWindowEvent.type property = `flexlib.mdi.events.MDIWindowEvent.CLOSE`

Dispatched when the close button is clicked.

drag | Event |

Event Object Type: `flexlib.mdi.events.MDIWindowEvent`
MDIWindowEvent.type property = `flexlib.mdi.events.MDIWindowEvent.DRAG`

Dispatched while the window is being dragged.

dragEnd | Event |

Event Object Type: `flexlib.mdi.events.MDIWindowEvent`
MDIWindowEvent.type property = `flexlib.mdi.events.MDIWindowEvent.DRAG_END`

Dispatched when the window stops being dragged.

dragStart | Event |

Event Object Type: `flexlib.mdi.events.MDIWindowEvent`
MDIWindowEvent.type property = `flexlib.mdi.events.MDIWindowEvent.DRAG_START`

Dispatched when the window starts being dragged.

focusEnd | Event |

Event Object Type: `flexlib.mdi.events.MDIWindowEvent`
MDIWindowEvent.type property = `flexlib.mdi.events.MDIWindowEvent.FOCUS_END`

Dispatched when the window loses focus and no longer has topmost z-index of MDIManager's children.

focusStart | Event |

Event Object Type: `flexlib.mdi.events.MDIWindowEvent`
MDIWindowEvent.type property = `flexlib.mdi.events.MDIWindowEvent.FOCUS_START`

Dispatched when the window gains focus and is given topmost z-index of MDIManager's children.

maximize | Event |

Event Object Type: `flexlib.mdi.events.MDIWindowEvent`
MDIWindowEvent.type property = `flexlib.mdi.events.MDIWindowEvent.MAXIMIZE`

Dispatched when the maximize button is clicked or when the window is in a normal state (not minimized or maximized) and the titleBar is double clicked.

minimize | Event |

Event Object Type: `flexlib.mdi.events.MDIWindowEvent`
MDIWindowEvent.type property = `flexlib.mdi.events.MDIWindowEvent.MINIMIZE`

Dispatched when the minimize button is clicked.

resize | Event |

Event Object Type: `flexlib.mdi.events.MDIWindowEvent`
MDIWindowEvent.type property = `flexlib.mdi.events.MDIWindowEvent.RESIZE`

Dispatched while the mouse is down on a resize handle.

resizeEnd | Event |

Event Object Type: `flexlib.mdi.events.MDIWindowEvent`
MDIWindowEvent.type property = `flexlib.mdi.events.MDIWindowEvent.RESIZE_END`

Dispatched when the mouse is released from a resize handle.

resizeStart | Event |

Event Object Type: `flexlib.mdi.events.MDIWindowEvent`
MDIWindowEvent.type property = `flexlib.mdi.events.MDIWindowEvent.RESIZE_START`

Dispatched when a resize handle is pressed.

restore | Event |

Event Object Type: `flexlib.mdi.events.MDIWindowEvent`
MDIWindowEvent.type property = `flexlib.mdi.events.MDIWindowEvent.RESTORE`

If the window is minimized, this event is dispatched when the titleBar is clicked. If the window is maxmimized, this event is dispatched upon clicking the restore button or double clicking the titleBar.

Constant Detail

CONTEXT_MENU_LABEL_CLOSE | Constant

`public static const CONTEXT_MENU_LABEL_CLOSE:String = Close`

CONTEXT_MENU_LABEL_MAXIMIZE | Constant |

`public static const CONTEXT_MENU_LABEL_MAXIMIZE:String = Maximize`

CONTEXT_MENU_LABEL_MINIMIZE | Constant |

`public static const CONTEXT_MENU_LABEL_MINIMIZE:String = Minimize`

CONTEXT_MENU_LABEL_RESTORE | Constant |

`public static const CONTEXT_MENU_LABEL_RESTORE:String = Restore`

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