On dialog

From Scriptwiki
Revision as of 13:58, 24 August 2006 by Cail (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The On Dialog event

If a user changes the state of controls in the dialog, eg. clicks on a button, types text in an edit box, etc., this triggers the on dialog script event which allows you to monitor input from the user:

on 1:dialog:name:event:id: {
  echo $dname $devent $did
}

Where name identifies the dialog, id is the id number of the control triggering the event, and event can be:

init	just before a dialog is displayed, controls can be initialized in this event. id is zero.
close	when a dialog is closed.
edit	text in editbox or combo box changed.
sclick	single click in list/combo box, or check/uncheck of radio/check buttons, or click of a button.
dclick	double click in list/combo box.
menu	a menu item was selected.
scroll	scroll control position has changed.

You can specify multiple ids by using commas and dashes, eg. 1-3,5,7,9,15-20.

You can also detect mouse events that aren't associated with a specific control:

mouse	mouse moved
sclick	left button down
uclick	left button up
dclick	double click
rclick	right button click
drop	drop click

You can use $mouse to retrieve the current mouse position.