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 | ![]() | "" | The title text of the window. |
Properties
| Name | Type | get | set | Descripton |
acceptButton | | ![]() | ![]() | 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 | ![]() | ![]() | Whether the window should be the active window. |
cancelButton | | ![]() | ![]() | 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. |
canClose | Boolean | ![]() | ![]() | Whether the window can be closed by the user. If the window cannot be closed and the close button is shown the button is disabled. |
canMinimize | Boolean | ![]() | ![]() | 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 | ![]() | ![]() | The title text of the window. |
contentPane | | ![]() | ![]() | This returns the component representing the client area of the window. All components should be added to this component. |
continuousLayout | Boolean | ![]() | ![]() | Whether resizing/moving of the window should be continuously updated. |
disposeOnClose | Boolean | ![]() | ![]() | Whether the window should be disposed upon closing. Defaults to true. If set to false, the window is just hidden when closed. |
hideChrome | Boolean | ![]() | ![]() | Whether to hide the caption bar of the window. |
icon | | ![]() | ![]() | 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. |
menuBar | | ![]() | ![]() | The menu bar of this window. |
movable | Boolean | ![]() | ![]() | Whether the window can be moved by the user. |
opaque | Boolean | ![]() | ![]() | 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 | ![]() | ![]() | 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 | ![]() | ![]() | Whether to show the close button on the caption. |
showIcon | Boolean | ![]() | ![]() | Whether to show the icon on the caption. |
showMaximize | Boolean | ![]() | ![]() | Whether to show the maximize button on the caption |
showMinimize | Boolean | ![]() | ![]() | Whether to show the minimize button on the caption. |
state | String | ![]() | ![]() | The state of the window. Valid values are:normal maximized minimized |
stringBundle | | ![]() | ![]() | The string bundle to use for this window. If this is set to null then the string bundle for application is used. |
windowMenu | | ![]() | 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 | | ![]() | 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. |
addMenuBar | Adds a menu bar to this window |
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 | | Fires when the window becomes active. | |
beforeclose | | Fires before the window is closed. If the default action is prevented the window is not closed. | |
captionchanged | | Fires when the caption changes. | |
close | | Fires when the window is closed. | |
deactivated | | Fires when the window becomes inactive | |
iconchanged | | Fires when the icon changes. | |
statechanged | | 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 | | The command to add |
Return Type
void
addMenuBar
Adds a menu bar to this window
Syntax
object.addMenuBar ( oMenuBar ) Parameters
| Name | Type | Optional | Default | Descripton |
oMenuBar | | The 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
| Name | Type | Optional | Default | Descripton |
c | | 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
