Project

General

Profile

Actions

$dialog » History » Revision 4

« Previous | Revision 4/12 (diff) | Next »
Per Amundsen, 08/14/2015 01:56 PM


Added in 1.9.0

$dialog(name,table,[parent])

Creates a modal dialog.

Parameters

name - Name of the dialog to create.
table - Name of the dialog table to use.
[parent] - Name of the parent window to associate the dialog with. (optional)

Example

: Create a dialog table.
Dialog Example1 {
  title "This is Example 1" 
  size -1 -1 172 129
  option dbu
  tab "Tab A", 14, 2 0 165 123
  tab "Tab B", 15
  tab "Tab C", 16
  edit "", 17, 8 16 154 104, tab 16 multi return autohs vsbar
  menu "&File", 1
  item "&New", 6, 1
  item "&Open", 7, 1
  item break, 8, 1
  item "&Save", 9, 1
  item "Save &as", 10, 1
  menu "&Edit", 2
  item "&Copy", 11, 2
  item "P&aste", 12, 2
  menu "&view", 3
  item "&All", 13, 3
  menu "&Help", 4
  item "&About", 5, 4
}

; Create and open the dialog using the 'Example' table.
//noop $dialog(Example, Example)

See also /dialog.


$dialog(name|N)

Returns information about a dialog.

Parameters

name|N - Name of the dialog or if N = 0, number of dialogs, otherwise the Nth dialog.

Properties

.result - Returns ID of the 'result' button if specified.
.x - Returns the X position of the dialog.
.y - Returns the Y position of the dialog.
.w - Returns the width of the dialog.
.h - Returns the height of the dialog.
.cw - Returns the width of the dialog client area.
.ch - Returns the height of the dialog client area.
.title - Returns the dialog title.
.modal - Returns $true if the dialog is modal, otherwise $false.
.table - Returns the name of the dialog table.
.ok - Returns ID of the 'ok' button if specified.
.cancel - Returns ID of the 'cancel' button if specified.
.focus - Returns ID of the control that currently has focus.
.active - Returns $true if the dialog is active, otherwise $false.
.tab - Returns id of tab that is currently displayed.
.hwnd - Returns the window handle.

Example

; Print number of dialogs.
//echo -ag $dialog(0)

; Print name of the first dialog.
//echo -ag $dialog(1)

Updated by Per Amundsen over 9 years ago · 4 revisions

Also available in: PDF HTML TXT