BiWindow

This class is used for internal windows inside the application window.

This class extends BiComponent and therefore all methods and fields available for BiComponent are also available for BiWindow .

Constructor

new BiWindow ( [ sCaption ] )

Parameters

NameTypeOptionalDefaultDescripton
sCaptionStringchecked"" The title text of the window.

Properties

NameTypegetsetDescripton
acceptButtonBiEventTargetcheckedcheckedThe button that acts as the default accept button. If this is set then the action event is dispatched from the accept button when the enter key is pressed. This does not have to be a BiButton, any BiEventTarget will work.
activeBooleancheckedcheckedWhether the window should be the active window.
cancelButtonBiEventTargetcheckedcheckedThe button that acts as the default cancel button. If this is set then the action event is dispatched from the cancel button when the Esc key is pressed. This does not have to be a BiButton, any BiEventTarget will work.
canCloseBooleancheckedcheckedWhether the window can be closed by the user. If the window cannot be closed and the close button is shown the button is disabled.
canMinimizeBooleancheckedcheckedWhether the window can be minimized by the user. If the window cannot be minimized and the minimize button is shown the button is disabled.
captionStringcheckedcheckedThe title text of the window.
contentPaneBiComponentcheckedcheckedThis returns the component representing the client area of the window. All components should be added to this component.
continuousLayoutBooleancheckedcheckedWhether resizing/moving of the window should be continuously updated.
disposeOnCloseBooleancheckedcheckedWhether the window should be disposed upon closing. Defaults to true. If set to false, the window is just hidden when closed.
hideChromeBooleancheckedcheckedWhether to hide the caption bar of the window.
iconBiImagecheckedcheckedThe icon image to show on the window caption. Note that changing the image object does not update the window icon. You'll have to set the icon property to update the icon. The size of the icon is ignored and will always be 16 x 16 pixels.
menuBarBiMenuBarcheckedcheckedThe menu bar of this window.
movableBooleancheckedcheckedWhether the window can be moved by the user.
opaqueBooleancheckedcheckedWhether to make the window opaque. An opaque window will not let plugins and other windowed controls show through. However, there is a price to this. This is achieved using an internal iframe and this makes the window heavier and slower.
resizableBooleancheckedcheckedWhether the window can be resized by the user. If the window cannot be resized and the maximize button is shown the button is disabled.
showCloseBooleancheckedcheckedWhether to show the close button on the caption.
showIconBooleancheckedcheckedWhether to show the icon on the caption.
showMaximizeBooleancheckedcheckedWhether to show the maximize button on the caption
showMinimizeBooleancheckedcheckedWhether to show the minimize button on the caption.
stateStringcheckedcheckedThe state of the window. Valid values are:

normal
maximized
minimized
stringBundleBiStringBundlecheckedcheckedThe string bundle to use for this window. If this is set to null then the string bundle for application is used.
windowMenuBiMenucheckedThis returns the menu used when the user clicks on the icon or right clicks on the caption. It gives access to restore, minimize, maximize and close.
wireFrameBiComponentcheckedThe component that should be visually updated if continuousLayout is set to false.

Methods

NameDescription
addCommandAdding a command to the window allows the window to execute the command when the user presses the needed keys.
addMenuBarAdds a menu bar to this window
bringToFrontMakes so that the window is displayed on top of all other shown windows.
closeCloses the window. Once closed the object cannot be used any more. To hide the window so that it can be used later set the visible property to false.

Before the window is closed the beforeclose event is fired. If the default action is prevented using preventDefault the window will not be closed. If the default action is not prevented then the close event is fired and the window is closed.
removeCommandRemoves a command from the window.
sendToBackMakes so that the current window is displayed behind all other windows.

Events

NameTypeBubblesDescripton
activatedBiEventFires when the window becomes active.
beforecloseBiEventFires before the window is closed. If the default action is prevented the window is not closed.
captionchangedBiEventFires when the caption changes.
closeBiEventFires when the window is closed.
deactivatedBiEventFires when the window becomes inactive
iconchangedBiEventFires when the icon changes.
statechangedBiEventFires when the window state changes.

Static Methods

None.

Static Fields

None.

Remarks

Content should not be added directly to the window but should be added to the contentPane. The labels for the window menu items are provided by a BiStringBundle and the following keys are used: WindowRestore - Restore label text WindowRestoreMnemonic - Restore label mnemonic WindowMinimize - Minimize label text WindowMinimizeMnemonic - Minimize label mnemonic WindowMaximize - Maximimize label text WindowMaximizeMnemonic - Maximize label mnemonic WindowClose - Close label text WindowCloseMnemonic - Close label mnemonic

Method Details

addCommand

Adding a command to the window allows the window to execute the command when the user presses the needed keys.

Syntax

object.addCommand ( c )

Parameters

NameTypeOptionalDefaultDescripton
cBiCommandThe command to add

Return Type

void

addMenuBar

Adds a menu bar to this window

Syntax

object.addMenuBar ( oMenuBar )

Parameters

NameTypeOptionalDefaultDescripton
oMenuBarBiMenuBarThe menu bar to add

Return Type

void

bringToFront

Makes so that the window is displayed on top of all other shown windows.

Syntax

object.bringToFront ( )

Parameters

No arguments.

Return Type

void

close

Closes the window. Once closed the object cannot be used any more. To hide the window so that it can be used later set the visible property to false.

Before the window is closed the beforeclose event is fired. If the default action is prevented using preventDefault the window will not be closed. If the default action is not prevented then the close event is fired and the window is closed.

Syntax

object.close ( )

Parameters

No arguments.

Return Type

void

removeCommand

Removes a command from the window.

Syntax

object.removeCommand ( c )

Parameters

NameTypeOptionalDefaultDescripton
cBiCommandThe command to remove

Return Type

void

sendToBack

Makes so that the current window is displayed behind all other windows.

Syntax

object.sendToBack ( )

Parameters

No arguments.

Return Type

void