class Window
- Extends:
- UIComponent
Description:
Window UI component that extends UIComponent class.
For more methods for this component check UIComponent class.
Constructor
constructor([text], [owner_window=null], [type=Window.Type.Normal])
Window constructor.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
|
|
string |
Text displayed in Window title bar and in task bar button. |
|
|
|
null |
Enables modal mode. This new Window will always be on top of the owner Window until it is closed. |
|
|
|
Window.Type.Normal |
Type of the Window. |
Members
- [ static enum ] CloseOperation
- [ static enum ] State
- [ static enum ] Type
- [ readonly ] childCount
- [ readonly ] children
- [ readonly ] container
- [ readonly ] id
- [ readonly ] innerOffset
- [ readonly ] owner
- [ readonly ] parent
- [ readonly ] screenPosition
- [ readonly ] screenSize
- [ readonly ] shapeCount
- [ readonly ] type
Methods
From this class:
- addShape()
- alwaysOnTop()
- chooseColor()
- chooseFile()
- chooseFont()
- close()
- closeOperation()
- confirm()
- defaultButton()
- hasBorder()
- indexOfShape()
- innerSize()
- maximize()
- menuBar()
- minimize()
- onShapeEvents()
- onStateChange()
- onWindowEvents()
- removeShape()
- resizable()
- screen()
- shape()
- shapes()
- state()
Inherited from UIComponent:
- addChild()
- addTo()
- background()
- border()
- bottom()
- center()
- child()
- childIndex()
- color()
- contextMenu()
- cursor()
- destroy()
- dropAction()
- dropDataType()
- emit()
- emitFocusKeyEvents()
- focused()
- font()
- height()
- hide()
- icon()
- maxSize()
- minSize()
- move()
- onComponentEvents()
- onContainerEvents()
- onDispose()
- onDropEvents()
- onError()
- onFocusEvents()
- onKey()
- onMouseEvents()
- onMouseMotion()
- onMouseWheel()
- onPropertyChange()
- opacity()
- position()
- remove()
- right()
- size()
- snapshot()
- text()
- tooltip()
- updateUI()
- verifyComponent()
- visible()
- width()
- x()
- y()
Examples:
To create a new custom window class (recommended way for main window):
class MyWindow extends Window
{
constructor()
{
super("My New Application");
}
}
// appWindow1 will be accessible globally.
globalThis.appWindow1 = new MyWindow();
3 ways to create a new Window:
new Window() // without title text
new Window("Window Title Text") // width title text
new Window("Window Title Text", owner_window, Window.Type.Utility) // for modal window
