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

Name Type Optional Default Descripton
sCaption String checked "" The title text of the window.

Properties

Name Type get set Descripton
acceptButton BiEventTarget checked checked The 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.
active Boolean checked checked Whether the window should be the active window.
cancelButton BiEventTarget checked checked The 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.
canMinimize Boolean checked checked Whether the window can be minimized by the user. If the window cannot be minimized and the minimize button is shown the button is disabled.
caption String checked checked The title text of the window.
contentPane BiComponent checked checked This returns the component representing the client area of the window. All components should be added to this component.
continuousLayout Boolean checked checked Whether resizing/moving of the window should be continuously updated.
hideChrome Boolean checked checked Whether to hide the caption bar of the window.
icon BiImage checked checked The 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.
movable Boolean checked checked Whether the window can be moved by the user.
opaque Boolean checked checked Whether 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.
resizable Boolean checked checked Whether the window can be resized by the user. If the window cannot be resized and the maximize button is shown the button is disabled.
showClose Boolean checked checked Whether to show the close button on the caption.
showIcon Boolean checked checked Whether to show the icon on the caption.
showMaximize BiWindow checked checked Whether to show the maximize button on the caption
showMinimize Boolean checked checked Whether to show the minimize button on the caption.
state String checked checked The state of the window. Valid values are:

normal
maximized
minimized
stringBundle BiStringBundle checked checked The string bundle to use for this window. If this is set to null then the string bundle for application is used.
windowMenu BiMenu checked This 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.
wireFrame BiComponent checked The component that should be visually updated if continuousLayout is set to false.

Methods

Name Description
addCommand Adding a command to the window allows the window to execute the command when the user presses the needed keys.
bringToFront Makes so that the window is displayed on top of all other shown windows.
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.
removeCommand Removes a command from the window.
sendToBack Makes so that the current window is displayed behind all other windows.

Events

Name Type Bubbles Descripton
activated BiEvent Fires when the window becomes active.
beforeclose BiEvent Fires before the window is closed. If the default action is prevented the window is not closed.
captionchanged BiEvent Fires when the caption changes.
close BiEvent Fires when the window is closed.
deactivated BiEvent Fires when the window becomes inactive
iconchanged BiEvent Fires when the icon changes.
statechanged BiEvent Fires 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

Name Type Optional Default Descripton
c BiCommand The command 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

Name Type Optional Default Descripton
c BiCommand The 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