Packageorg.openzet.containers
Classpublic class MDI
InheritanceMDI Inheritance mx.containers.Canvas
ImplementsIMDI

MDI, short for Multiple Document Interface, provides features defined by a normal MDI class, which are naturally supported by Flex framework. Class groups for providing MDI features include MDI and MDIWindow classes and you can register children for these containers only the instances of classes implementing IMDIWindow interface. MDI provides features of aligning horizontally, vertically and cascadingly. MDIWindow provides features of maximizing, minimizing, restoring windows.

MXML Syntaxexpanded Hide MXML Syntax

<zet:MDI> tag inherits all properties of its superclass and adds following properties.

  <zet:MDI
   Properties
   maxChildren="10"
   sequenceAnimate="false|true"
   sequenceInterval="1"
   Styles
   windowGap="0"
   paddingTop="0"
   paddingRight="0"
   paddingBottom="0"
   paddingLeft="0"
   Events
   childrenFull="No default"
   minimizeAll="No default"
   resizeAll="No default"
   >
      ...
      child tags
      ...
  </zet:MDI>
  

See also

org.openzet.containers.IMDI
org.openzet.containers.MDIWindow


Public Properties
 PropertyDefined by
  allowResizeOverflow : Boolean
Flag that specifies whehter the other side increases its size when the opposite side reaches its limit If true, the other side's size will increase when the opposite side cannot increase its size when it reached its bounds.
MDI
  boundsEnabled : Boolean
Flag that specifies whether to set border when MDI instance's child is moving.
MDI
  includeMinimizedWindowForAlign : Boolean
Flag that specifies whether to include minimzed windows when aligning windows.
MDI
  maxChildren : int
maximum number of children windows.
MDI
  minimizedWindowAutoAlign : Boolean
Flag that specifies whether to auto-layout minimized windows.
MDI
  sequenceAnimate : Boolean
Flag that specifies whether to squentially animate windows, when aligning them.
MDI
  sequenceInterval : Number
Effect interval when animating windows sequentially.
MDI
  windowDefaultHeight : Number
Window's default height.
MDI
  windowDefaultWidth : Number
Window's default width.
MDI
  windowMinHeight : Number
window minimum height
MDI
  windowMinWidth : Number
window minimum width
MDI
Public Methods
 MethodDefined by
  
MDI()
Constructor.
MDI
  
bringToFront(window:IMDIWindow, restore:Boolean = false):void
Activated windows should always have grater level than other objects stored in childList.
MDI
  
cascade():void
Cascades all windows.
MDI
  
createWindow(className:Class, duplicate:Boolean = true, initObject:Object = null):IMDIWindow
Populates a new window in MDI

Example

var window:IMDIWindow = mdi.createPopUp(Window);
        window.title = "My Title";
MDI
  
Aligns all windows horizontally.
MDI
  
minimizeAll():void
Minimizes all windows.
MDI
  
random():void
Randomizes all windows' position and size.
MDI
  
restoreAll():void
Restores all windows to their previous size.
MDI
  
Aligns all windows vertically.
MDI
Protected Methods
 MethodDefined by
  
initWindow(window:IMDIWindow):void
Initializes MDIWindow instance This method is invoked before addChild() method is called.
MDI
Events
 EventSummaryDefined by
   Dispatched when children's count surpasses maxChildren value.MDI
Styles
 StyleDescriptionDefined by
  
paddingBottom
Type: Number   Format: Length   CSS Inheritance: no
MDI
  
paddingLeft
Type: Number   Format: Length   CSS Inheritance: no
Number of pixels between the component's left border and the left edge of its content area. The default value is 0.
MDI
  
paddingRight
Type: Number   Format: Length   CSS Inheritance: no
Number of pixels between the component's right border and the right edge of its content area. The default value is 0.
MDI
  
paddingTop
Type: Number   Format: Length   CSS Inheritance: no
Number of pixels between the container's top border and the top of its content area. The default value is 0.
MDI
  
windowGap
Type: Number   Format: Length   CSS Inheritance: no
Specifies the gap between windows when populating a new window. The default value is 20.
MDI
Property detail
allowResizeOverflowproperty
allowResizeOverflow:Boolean  [read-write]

Flag that specifies whehter the other side increases its size when the opposite side reaches its limit If true, the other side's size will increase when the opposite side cannot increase its size when it reached its bounds.

The default value is true.

Implementation
    public function get allowResizeOverflow():Boolean
    public function set allowResizeOverflow(value:Boolean):void
boundsEnabledproperty 
boundsEnabled:Boolean  [read-write]

Flag that specifies whether to set border when MDI instance's child is moving. If set to true, a border is set, which defines the restricting bounds area.

The default value is true.

Implementation
    public function get boundsEnabled():Boolean
    public function set boundsEnabled(value:Boolean):void
includeMinimizedWindowForAlignproperty 
includeMinimizedWindowForAlign:Boolean  [read-write]

Flag that specifies whether to include minimzed windows when aligning windows. If set to true, when horizontalAlign(), verticalAlign(), cascade() methods are called, minimized windows will also be aligned. Otherwise, minimized windows will not be aligned.

The default value is false.

Implementation
    public function get includeMinimizedWindowForAlign():Boolean
    public function set includeMinimizedWindowForAlign(value:Boolean):void
maxChildrenproperty 
maxChildren:int  [read-write]

maximum number of children windows. If zero, unlimited number of children could be added.

The default value is 10.

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

Implementation
    public function get maxChildren():int
    public function set maxChildren(value:int):void
minimizedWindowAutoAlignproperty 
minimizedWindowAutoAlign:Boolean  [read-write]

Flag that specifies whether to auto-layout minimized windows.

The default value is false.

Implementation
    public function get minimizedWindowAutoAlign():Boolean
    public function set minimizedWindowAutoAlign(value:Boolean):void
sequenceAnimateproperty 
sequenceAnimate:Boolean  [read-write]

Flag that specifies whether to squentially animate windows, when aligning them.

Implementation
    public function get sequenceAnimate():Boolean
    public function set sequenceAnimate(value:Boolean):void
sequenceIntervalproperty 
sequenceInterval:Number  [read-write]

Effect interval when animating windows sequentially.

Implementation
    public function get sequenceInterval():Number
    public function set sequenceInterval(value:Number):void
windowDefaultHeightproperty 
windowDefaultHeight:Number  [read-write]

Window's default height. When a new window is instantiated, its height will be set using this value. Also when windows are cascaded, all windows' height will be set usting this value.

The default value is 200.

Implementation
    public function get windowDefaultHeight():Number
    public function set windowDefaultHeight(value:Number):void
windowDefaultWidthproperty 
windowDefaultWidth:Number  [read-write]

Window's default width. When a new window is instantiated, its width will be set based on this value. Also when windows are cascaded, all windows' width will be set using this value.

The default value is 300.

Implementation
    public function get windowDefaultWidth():Number
    public function set windowDefaultWidth(value:Number):void
windowMinHeightproperty 
windowMinHeight:Number  [read-write]

window minimum height

The default value is 28.

Implementation
    public function get windowMinHeight():Number
    public function set windowMinHeight(value:Number):void
windowMinWidthproperty 
windowMinWidth:Number  [read-write]

window minimum width

The default value is 140.

Implementation
    public function get windowMinWidth():Number
    public function set windowMinWidth(value:Number):void
Constructor detail
MDI()constructor
public function MDI()

Constructor.

Method detail
bringToFront()method
public function bringToFront(window:IMDIWindow, restore:Boolean = false):void

Activated windows should always have grater level than other objects stored in childList. This method sets a window at the top level. If you click on any window, this method will be invoked automatically. Yet in other cases, you should manually call this method to dynamically adjust a window level.

Parameters
window:IMDIWindow — MDIWindow to set at the top level
 
restore:Boolean (default = false) — Flag to specify whehter to restore a window's size to its previous state
cascade()method 
public function cascade():void

Cascades all windows. Uses windows' childIndexes in an ascending order.

createWindow()method 
public function createWindow(className:Class, duplicate:Boolean = true, initObject:Object = null):IMDIWindow

Populates a new window in MDI

Example

var window:IMDIWindow = mdi.createPopUp(Window);
        window.title = "My Title";
Parameters
className:Class — Class name of a window to populate
 
duplicate:Boolean (default = true) — State to set on a newly created window. Applicable states are maximized, minimized and normal states.
 
initObject:Object (default = null) — Flag to specify whether to allow duplication of newly created windows. If false, when attempting to create a duplicate window, new instance will by replaced by a previously instanced one. Otherwise, every time a new instance will be created.

Returns
IMDIWindow
horizontalAlign()method 
public function horizontalAlign():void

Aligns all windows horizontally. Uses windows' child indexes in a descending order.

initWindow()method 
protected function initWindow(window:IMDIWindow):void

Initializes MDIWindow instance This method is invoked before addChild() method is called.

Parameters
window:IMDIWindow — IMDIWindow instance to add as a child
minimizeAll()method 
public function minimizeAll():void

Minimizes all windows. Uses windows' created order.

random()method 
public function random():void

Randomizes all windows' position and size. Uses windows' child indexes in an ascending order.

restoreAll()method 
public function restoreAll():void

Restores all windows to their previous size. Uses windows' created order.

verticalAlign()method 
public function verticalAlign():void

Aligns all windows vertically. Uses windows' child indexes in a descending order.

Event detail
childrenFullevent 
Event object type: org.openzet.events.MDIEvent

Dispatched when children's count surpasses maxChildren value. This event is usually triggered by the invccation of addChild() method.