Package com.bit101.components
Class public class Window
Inheritance Window InheritanceComponent Inheritance flash.display.Sprite



Public Properties
  Property Defined By
    color : int
Gets / sets the background color of this panel.
Window
    content : DisplayObjectContainer
[read-only] Container for content added to this panel.
Window
    draggable : Boolean
Sets / gets whether or not the window will be draggable by the title bar.
Window
  Inherited enabled : Boolean
Sets/gets whether this component is enabled or not.
Component
    grips : Shape
[read-only] Returns a reference to the shape showing the grips on the title bar.
Window
    hasCloseButton : Boolean
Sets / gets whether or not the window will display a close button.
Window
    hasMinimizeButton : Boolean
Gets / sets whether or not the window will show a minimize button that will toggle the window open and closed.
Window
    height : Number
[override] Gets the height of the component.
Window
    minimized : Boolean
Gets / sets whether the window is closed.
Window
    shadow : Boolean
Gets / sets whether or not this Window will have a drop shadow.
Window
  Inherited tag : int
Sets/gets in integer that can identify the component.
Component
    title : String
Gets / sets the title shown in the title bar.
Window
    titleBar : Panel
Returns a reference to the title bar for customization.
Window
  Inherited width : Number
[override] Sets/gets the width of the component.
Component
  Inherited x : Number
[override] [write-only] Overrides the setter for x to always place the component on a whole pixel.
Component
  Inherited y : Number
[override] [write-only] Overrides the setter for y to always place the component on a whole pixel.
Component
Protected Properties
  Property Defined By
    _closeButton : PushButton
Window
    _color : int = -1
Window
    _draggable : Boolean = true
Window
  Inherited _enabled : Boolean = true
Component
    _grips : Shape
Window
    _hasCloseButton : Boolean
Window
    _hasMinimizeButton : Boolean = false
Window
  Inherited _height : Number = 0
Component
    _minimizeButton : Sprite
Window
    _minimized : Boolean = false
Window
    _panel : Panel
Window
  Inherited Ronda : Class
Component
    _shadow : Boolean = true
Window
  Inherited _tag : int = -1
Component
    _title : String
Window
    _titleBar : Panel
Window
    _titleLabel : Label
Window
  Inherited _width : Number = 0
Component
Public Methods
  Method Defined By
   
Window(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, title:String = Window)
Constructor
Window
   
draw():void
[override] Draws the visual ui of the component.
Window
  Inherited
initStage(stage:Stage):void
[static] Utility method to set up usual stage align and scaling.
Component
  Inherited
move(xpos:Number, ypos:Number):void
Moves the component to the specified position.
Component
  Inherited
setSize(w:Number, h:Number):void
Sets the size of the component.
Component
Protected Methods
  Method Defined By
   
addChildren():void
[override] Creates and adds the child display objects of this component.
Window
  Inherited
getShadow(dist:Number, knockout:Boolean = false):DropShadowFilter
DropShadowFilter factory method, used in many of the components.
Component
   
init():void
[override] Initializes the component.
Window
  Inherited
invalidate():void
Marks the component to be redrawn on the next frame.
Component
   
onClose(event:MouseEvent):void
Window
  Inherited
onInvalidate(event:Event):void
Called one frame after invalidate is called.
Component
   
onMinimize(event:MouseEvent):void
Window
   
onMouseDown(event:MouseEvent):void
Internal mouseDown handler.
Window
   
onMouseUp(event:MouseEvent):void
Internal mouseUp handler.
Window
Public Constants
  Constant Defined By
  Inherited DRAW : String = draw
[static]
Component
Property Detail
_closeButton property
protected var _closeButton:PushButton

_color property  
protected var _color:int = -1

_draggable property  
protected var _draggable:Boolean = true

_grips property  
protected var _grips:Shape

_hasCloseButton property  
protected var _hasCloseButton:Boolean

_hasMinimizeButton property  
protected var _hasMinimizeButton:Boolean = false

_minimizeButton property  
protected var _minimizeButton:Sprite

_minimized property  
protected var _minimized:Boolean = false

_panel property  
protected var _panel:Panel

_shadow property  
protected var _shadow:Boolean = true

_title property  
protected var _title:String

_titleBar property  
protected var _titleBar:Panel

_titleLabel property  
protected var _titleLabel:Label

color property  
color:int

Gets / sets the background color of this panel.


Implementation
    public function get color():int
    public function set color(value:int):void
content property  
content:DisplayObjectContainer  [read-only]

Container for content added to this panel. This is just a reference to the content of the internal Panel, which is masked, so best to add children to content, rather than directly to the window.


Implementation
    public function get content():DisplayObjectContainer
draggable property  
draggable:Boolean

Sets / gets whether or not the window will be draggable by the title bar.


Implementation
    public function get draggable():Boolean
    public function set draggable(value:Boolean):void
grips property  
grips:Shape  [read-only]

Returns a reference to the shape showing the grips on the title bar. Can be used to do custom drawing or turn them invisible.


Implementation
    public function get grips():Shape
hasCloseButton property  
hasCloseButton:Boolean

Sets / gets whether or not the window will display a close button. Close button merely dispatches a CLOSE event when clicked. It is up to the developer to handle this event.


Implementation
    public function get hasCloseButton():Boolean
    public function set hasCloseButton(value:Boolean):void
hasMinimizeButton property  
hasMinimizeButton:Boolean

Gets / sets whether or not the window will show a minimize button that will toggle the window open and closed. A closed window will only show the title bar.


Implementation
    public function get hasMinimizeButton():Boolean
    public function set hasMinimizeButton(value:Boolean):void
height property  
height:Number[override]

Gets the height of the component. A minimized window's height will only be that of its title bar.


Implementation
    public function get height():Number
    public function set height(value:Number):void
minimized property  
minimized:Boolean

Gets / sets whether the window is closed. A closed window will only show its title bar.


Implementation
    public function get minimized():Boolean
    public function set minimized(value:Boolean):void
shadow property  
shadow:Boolean

Gets / sets whether or not this Window will have a drop shadow.


Implementation
    public function get shadow():Boolean
    public function set shadow(value:Boolean):void
title property  
title:String

Gets / sets the title shown in the title bar.


Implementation
    public function get title():String
    public function set title(value:String):void
titleBar property  
titleBar:Panel

Returns a reference to the title bar for customization.


Implementation
    public function get titleBar():Panel
    public function set titleBar(value:Panel):void
Constructor Detail
Window () Constructor
public function Window(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, title:String = Window)

Constructor

Parameters
parent:DisplayObjectContainer (default = null) — The parent DisplayObjectContainer on which to add this Panel.
 
xpos:Number (default = 0) — The x position to place this component.
 
ypos:Number (default = 0) — The y position to place this component.
 
title:String (default = Window) — The string to display in the title bar.
Method Detail
addChildren () method
override protected function addChildren():void

Creates and adds the child display objects of this component.

draw () method  
override public function draw():void

Draws the visual ui of the component.

init () method  
override protected function init():void

Initializes the component.

onClose () method  
protected function onClose(event:MouseEvent):void

Parameters

event:MouseEvent
onMinimize () method  
protected function onMinimize(event:MouseEvent):void

Parameters

event:MouseEvent
onMouseDown () method  
protected function onMouseDown(event:MouseEvent):void

Internal mouseDown handler. Starts a drag.

Parameters

event:MouseEvent — The MouseEvent passed by the system.
onMouseUp () method  
protected function onMouseUp(event:MouseEvent):void

Internal mouseUp handler. Stops the drag.

Parameters

event:MouseEvent — The MouseEvent passed by the system.