Window - AppDaddy-Software-Solutions-Inc/framework-markup-language GitHub Wiki

<WINDOW/> : <BOX/>

The <WINDOW/> (formerly <MODAL/>) widget creates a new popup window that can be moved, resized, and/or closed.

Attributes

Name Type Default Description Req

Header

titlebar boolean true If false, the default header is hidden
title string The title to display in the header

Resize

resizeable bool true If the window can be manually resized using the mouse or minimized/maximized using the minimize/maximize button in the header toolbar.

Can be specified as a comma separated list (width, height) for setting resizeablewidth and resizeableheight.
resizeablewidth bool true If the window can be manually resized horizontally
resizeableheight bool true If the window can be manually resized vertically

Drag

draggable bool true If the window can be manually moved by dragging the window using the mouse.

Can be specified as a comma separated list (width, height) for setting draggablewidth and draggableheight.
draggablewidth bool true If the window can be dragged horizontally
draggableheight bool true If the window can be dragged vertically

Modality

modal bool false If the window is opened as modal. This defeats all interaction outside the window until closed.
dismissible bool true If false and modal, the window is not automatically dismissed by clicking outside of the window display.
closable bool true If the window can be manually closed by clicking on the close button in the header toolbar.

Methods

Name Description
open ( [ $${\color{blue}bool}$$ modal = false ] ) Opens the window.

If modal is true, the window is displayed with a modal background curtain.

  See it in Action
close ( ) Closes the window.

  See it in Action

Examples

Template
<COL center="true" radius="8" bordercolor="lightblue" borderwidth="2"  pad="10" expand="false" height="200">

	<ROW expand="false" margin="10"> 
		<BUTTON id="policybtn" visible="true"  onclick="m1.open()">
			<TEXT label="Click to view and accept our policy" color="lightblue"/>
		</BUTTON>

		<BUTTON id="licensebtn" visible="true"  onclick="m2.open()">
			<TEXT label="Click to view our license" color="lightblue"/>
		</BUTTON>
	</ROW>

	<BUTTON id="submitbtn" type="outlined" enabled="false" label="Submit" onclick="toast('submitted');policybtn.visible.set(true);submitbtn.enabled.set(false);"/>
	
</COL>

<!-- Policy  Window -->
<!-- Both window can be opened at the same time! -->
<WINDOW id="m1" title="Policy" radius="25" width="300" height="200" color="red,orange" draggable="true" resizeable="true" closeable="true" modal="true" valign="around" halign="center">
	<TEXT id="policy">Some Policy</TEXT>
	<TEXT id="policy" size="12" color="black">try dragging, resizing or minimizing me!</TEXT>
	<ROW halign="around">
		<BUTTON label="Cancel" onclick="m1.close()"/>
		<BUTTON label="Agree" onclick="m1.close();policybtn.visible.set(false, visible);submitbtn.enabled.set(true);"/>
	</ROW>
</WINDOW>

<!-- License  Window -->
<!-- Both windows can be opened at the same time! -->
<WINDOW id="m2" titlebar="false" width="300" height="200" color="blue" draggable="true" resizeable="true" closeable="true" modal="false" valign="around" halign="center">
	<TEXT id="policy">Our License</TEXT>
	<TEXT id="policy" size="12" color="black">try dragging, resizing or minimizing me!</TEXT>
	<BTN label="close" type="elevated" onclick="m2.close()"/>
</WINDOW>

Modal

logo See it in Action

⚠️ **GitHub.com Fallback** ⚠️