DLG: Interactive screen input/output (H+)

⇒Help ⇒Contents ⇒Input-Output (⇒Optional Keywords Syntax)

Bookmarks:
  ⇒alternate dlg() syntax   ⇒an example   ⇒bitmap button   ⇒breakpoint   ⇒button-details   ⇒calling a subroutine from dlg   ⇒checkbox-details   ⇒combobox-details   ⇒dialog management   ⇒draw attention   ⇒dynamically generate dialogs   ⇒edit-details   ⇒font-size and font   ⇒force button return   ⇒full screen edit   ⇒hotkey   ⇒icon buttons   ⇒label jump   ⇒linewrap   ⇒listbox-details   ⇒local file browser button   ⇒mail client   ⇒modal dialog   ⇒modeless dialog   ⇒no caption bar   ⇒numerical modifiers   ⇒open browser   ⇒position individual control   ⇒positional modifiers   ⇒prefixed dialog item   ⇒print dialog   ⇒radio-button-details   ⇒run mode button   ⇒sorting a dialog list   ⇒step mode   ⇒stop program execution   ⇒undo in edit controls   ⇒visual dlg support

Optional keywords:
Align BaCkcolor BiTteXt BLAck BORder Button CALLback CenterAlign CHeckbox CHIld ColS ComBobox DEFault DefHeight DefWidth DNum Edit EnAble FixedFont FocuS FONt ForeColor FRAMe GRAY Group GroupEnd Height HelpFile Jumpto KiLl LeftAlign Line ListBox MAx MIn NameEdit NoClose Owner PassWord PoinT ProgressBar RADio ReadOnly REct ReturnCode RightAlign ScrollBar SelIdx SelTxt SEParators SetMemory SHOW SOrt SPace Text TItle TrackBar UPDAte UpDown Vertical WHIte Width WINdowhandle WRap X X0 XMemoryadd Y Y0 YMemoryadd
control effect ( √ is MatrixExplorer supported) most useful modifiers
√ rectangle with text, causes action when clicked CALLback, ReturnCode
  • DLG(Text=num)
  • √ for a num argument its symbolic name is prefixed ( ⇒ example)
  • positions are as for the other controls (unlike Align)

CenterAlign

,

LeftAlign

,

RightAlign

positions a text of arbitrary length to the right of previous control (Text=txt is shown with DefWidth) Line
  • DLG(Edit=num)
√ text or number for display and change DNum, Height, ReadOnly, Width, WRap
  • DLG(NameEdit=num)
prefixes an Edit control with its symbolic name (1 DefWidth) Line
select from a list of texts SelIdx, SelTxt, Height
combines Edit and ListBox: enter new text or select and edit SelIdx, SelTxt, Height
√ square with text, toggled 0/1 when clicked BiTteXt
circle with text, other circles unselected when clicked BiTteXt
√ partially paints a rectangle MAx, MIn, Vertical, Width
√ arrow in a bar to be moved with mouse or arrow keys. Shows tooltip window with num value scaled to 0...100 when mouse is clicked on the thumb MAx, MIn, Vertical, Width
√ updown with thumb MAx, MIn, Vertical, Width
√ stand-alone very short scroll bar without thumb
group the following controls with a frame title of txt. Either the last control or an explicit

GroupEnd

terminate the group
filled rectangle, default is BLAck

BLAck

,

GRAY

,

WHIte

unfilled rectangle, default is BLAck BLAck, GRAY, WHIte

button-details

:
  • the following buttons close a

    modal dialog

    (the program waits until the dialog is closed
  • rc = DLG(Button="OK")
  • rc is set to itemnr+1000 (here == 1001)
  • breakpoint

    : script waits until button (or ESCape) is hit
  • rc = DLG(B="5:action 1", B="23:action 2")

prefixed dialog item

: rc is set to 5 or 23 for the buttons "action 1" or "action 2" resp.
  • rc = DLG(B="1:!", B="2:i", B="3:X", B="4:?")

icon buttons

can be used instead of texts
  • DLG(B="&OK")
  • "&OK" is the default button
  • & defines a

    hotkey

    , here the key "O" will close the dialog
  • DLG(B="0:Cancel")
a "0:" prefix to

stop program execution

(same as ESCape)
  • DLG(B="test.bmp")

bitmap button

: the button displays a bitmap file in its full size
increase button height, line wrap button text
  • DLG(B=">123:name") ! or:
  • DLG(B="jump",

    Jumpto

    =123)

label jump

: jump to label 123 of current procedure. If not found continue with next statement.
  • DLG(B="chapter5:show &5", B="chapter6:show &6")
  • DLG(B="STEP:&Step")

step mode

to continue execution in single steps
  • DLG(B="RUN:&Run")

run mode button

to continue execution
  • DLG(B="$Print:print this dialog")
open

print dialog

  • DLG(B="http://www.anyname.xyz")

open browser

to URL = www.anyname.xyz
  • DLG(B="shell:c:\HicEst\Web\faq.htm")

local file browser button

  • DLG(B="mailto:info@xyz.com ?subject=hello &&BODY=something important")
open (no send)

mail client

with
  • mail address ("info@xyz.com")
  • subject (hello)
  • text body (something important)
  • DLG(HelpFile="HicEst.hlp", B="DLG.Button:&show")
A "show" button. When hit, Appendix item of current HelpFile opens (here DLG.button)
A

modeless dialog

includes the

WINdowhandle

=handle option:
  • DLG(B="5:KEEP",

    ReturnCode

    =rtn, WINdowhandle=handle)
  • a modeless dialog stays on the screen while the script continues running. It is closed when button is hit, or a DLG(KiLl=handle) is executed

  • edit-details

    , the DLG(Edit=argument) can be numerical or textual:
Without a Button the explicit return value (e.g. "rc") of the DLG function is itemnr+1000 (here == 1001), else it is the default-button ID
  • rc = DLG(Edit=x)

undo in Edit controls

is via ESCape or Cntl+Z
  • rc = DLG(Edit=num_array)
MatrixExplorer is called when the argument to Edit is a numerical array
  • DLG(Edit=num, DNum=delta)
⇒ see example
numeric edit with a spinner (2 small arrows):
  • delta <= 0 or absent: num changes by +- 1
  • > 0: num changes +- 1 in its n-th significant digit
  • DLG(E="text is too long but may be scrolled")
text that is too long for the default width can be horizontally scrolled
  • DLG(E=num_or_txt, RightAlign)
as for the Text-option CenterAlign and LeftAlign are also possible
↵ on edit control will not close DLG. Useful to

force Button return

input appears as ***
input is rejected, sometimes preferable to Text option

checkbox-details

  • on output

    radio-button-details

    are equivalent to checkbox-details
  • on input only the most recently activated radio button is set
  • DLG(CHeckbox=num)
with a scalar variable num this acts as a simple 0/1 switch
  • CHARACTER names="alfa beta gamma delta "
  • DLG(

    BiTteXt

    =names, CHeckbox=num)
  • DLG(BiTteXt=names, RADio=num)
  • BiTteXt as

    prefix

    to CHeckbox or RADio generates a series of up to 32 check boxes or radio buttons named as the words in its argument.
  • num is the sum of 2^(namenr-1), e.g. for num == 5 the boxes alfa and gamma are checked, beta and delta are unchecked
  • the optional keyword

    ColS

    =n breaks the series of checkboxes after n columns and starts a new row
  • DLG(CHeckbox=array)
  • DLG(RADio=array)
MatrixExplorer is called when the argument to CHeckbox or RADio is a numerical array

combobox-details

and

listbox-details

  • DLG(ComBobox=names,

    SelIdx

    =si,

    SelTxt

    =string)
  • DLG(ListBox=names, SelIdx=si, SelTxt=string)
⇒ see example
  • si selects the initial index
  • si receives the selected index. si == 0 when some new text is entered
  • string gets the selected or the newly entered text
  • without the Height option:
    • combobox shows edit area only without dropdown list
    • listbox shows maximum height possible
  • DLG(ComBobox=names, Width=0)
  • DLG(ListBox=names, Width=0)
Width=0 adjusts the width to the maximum length of a line
  • DLG(ComBobox=names, Height=3, B="&OK", Line)
  • with the Height option a combobox shows a dropdown list only when another control follows below it
  • DLG(listb=names,

    SOrt

    =log)

sorting a dialog list

: SOrt with log /= 0. SelIdx=si will have the sorted index
  • DLG(lbox="Tutorial.hic")
if "Tutorial.hic" is a valid file name, the file will be listed.
if the listbox or combobox argument is not a valid file name:
  • DLG(ListBox="xyz")
  • DLG(

    HelpFile

    ="Tutorial.hic", ListBox="SUBROUTINE DLGchild()", Width=6)
  • lists start with the 1st occurrence of the listbox or combobox argument in column 1 of the
    • HelpFile argument
    • current script file without HelpFile option
  • the list is terminated with the next line that has a non-blank in column 1
if above fails:
  • DLG(combo="duck,dog,donkey,")
"duck,dog,donkey," is a string with non-alfanumeric characters as separators
  • DLG(HeLP="topic")
to open a HicEst help window for "topic" from the script

visual DLG support

  • DLG(Edit=num,MIn=min,MAx=max,DNum=dn, ProgressBar=num,MIn=min,MAx=max,DNum=dn, TrackBar=num,MIn=min,MAx=max,DNum=dn, ScrollBar=num,MIn=min,MAx=max,DNum=dn, UpDown=num,MIn=min,MAx=max,DNum=dn, TItle="Edit, Progress, Track, Scroll, UpDown", UPDAte)
  • Vertical

    is possible after ScrollBar, ProgressBar, TrackBar

option type

numerical modifiers

(missing [num] evaluates to o
default setting

MIn

num set lower bound of a numerical control -1E300

MAx

num MAx=max sets the upper bound of a numerical control 1E300

DNum

[num] DNum = dn sets the step size of a numerical control
  • TrackBar, ScrollBar, UpDown: page up/down keys
  • TrackBar: scale tic difference
  • Edit ⇒ DNum details
0

UPDAte

--- to repaint the dialog when a control modified its argument value ---

positional modifiers

:

modify all subsequent controls of this DLG statement

W, H= dialog font width, height

BORder

[num] spacing between box edges and controls 1.75 * W

DefHeight

num default height DH of controls 1.5 * H

DefWidth

num default width DW of controls 10 * W

SPace

[num] spacing between controls W

position individual control

by modifying default position of

preceding control

  • num ≥ 1: multiples of DW or DH
  • num < 0: multiples of W or H
  • 0.01...0.999: screen portions
  • if missing: same as num=0
default values:
  • DH = current DefHeight
  • DW = current DefWidth
  • H = character height
  • W = character width

Height

num height of control 1 * DH

Width

num width of control 1 * DW

X

[num] x-position of control
left border: X=0 or simply X
1 * SPace right of preceding control

Y

[num] y-position of control
top border: Y=0 or simply Y
if for preceding control
  • default H: Y unchanged
  • H set: 1 SPace below preceding control

Line

[num] add to current Y and reset X to 0 1 * DH

SetMemory

remember X and Y of

next

control
---

XMemoryadd

[num] add to X of preceding SetMemory, use instead X 0

YMemoryadd

[num] add to Y of preceding SetMemory, use instead Y 0

X0

num horizontal position of dialog (> 1:

script

font character widths)
script window right aligned

Y0

num vertical position of dialog (> 1:

script

font character heights)
script window center aligned

calling a subroutine from DLG

CALLback

SUB
  • call SUB after ↵ on Button, numeric Edit, TrackBar, ScrollBar
  • CALLback is inherited by all subsequent items
  • use ReturnCode to tell which item caused SUB to be invoked
  • controls can be postfixed by different CALLback options to call different SUBs
  • CALLback=" " will cancel callbacks following the preceding control
no default

draw attention

to a particular control

FocuS

--- preceding control gets initial focus 1st control

DEFault

--- preceding Button becomes default ↵ regardless of actual focus "&OK" is always DEFault

EnAble

log 0 to disable (gray-out) and 1 to enable preceding control 1 (enabled)

SHOW

log 0 to hide and 1 to show preceding control 1 (show)

ForeColor

num foreground ⇒ color of preceding control 0 (black)

BaCkcolor

num background ⇒ color of
  • preceding control
  • of DLG window if prefixed to 1st control
11 (bright cyan)

font-size and font

FONt

n/c HicEst Menu → Options → Fonts →3

PoinT

num font size for this DLG

FixedFont

--- use fixed font for this DLG

dialog management

TItle

txt title caption ⇒ example. To have a DLG with

no caption bar

set txt=" "
"..."

KiLl

NUM
  • DLG(KiLl=otherhandle, ...)
close a DLG or WINDOW with handle == otherhandle
---

Owner

NUM
  • DLG(..., WINdowhandle=win2, Owner=win1)
  • create modeless dialog with handle win2
  • with Owner=win1 the new window win2 will always be in front of the owner window win1.
  • If not specified, or if specified as constant 0, then the new window can be overlapped by any window in your program.
  • Owned dialogs or windows are closed when the owner is closed
Main window

CHIld

---
  • DLG(..., WINdowhandle=win2, CHIld, Owner=win1)
Creates a child dialog box. When used with a modeless dialog box, the dialog box will maintain its position relative to the owner window.
not a child

SEParators

txt to replace the default separators ( ⇒ alternate syntax DLG only) enter txt as a 8-byte replacement string for (1) Space " ", (2) Colon ":", (3) Equals "=", (4) Asterisk "*", (5) Semicolon ";", (6) Goto ">", (-) Minus "-", (8) newline "|"
" :=*;>-|"



©2000-2008 Georg Petrich, HicEst Instant Prototype Computing. All rights reserved.
Impressum