Documentazione mIRC

on dialog

on dialog

Indice

The ON DIALOG event listens for events which take place inside of custom dialog windows.

Contents - 1 Synopsis - 2 Parameters - 3 Events - 4 Examples - 5 Compatibility - 6 See Also

Synopsis

ON <level>:DIALOG:<name>:<event>:<id>:{}

Parameters

****The level for the event to trigger.

****The dialog name that this event triggers for; wildcards”) accepted.

****The dialog event that this event triggers for; wildcards”) accepted.

****The id name of the dialog item to listen for; wildcards”) accepted. Multiple IDs can be specified in the form: 1,2,3,4-8,9

Events

EventDescription
activeTriggers when the dialog is made active.
closeTriggered when a dialog has been closed.
dclickOccurs when a double left-click has occurred in a list box or combo box, as well as on the dialog itself.
dropTriggers when an item has been dragged and dropped with the mouse.
editWhen text in an editbox or a combo box has changed.
initThis event ID is 0, and triggers before a dialog is displayed. This allows initialization time for the dialog and its items.
menuWhenever a menu-item is selected.
mouseWhen the mouse is moved.
rclickWorks when the mouse right-clicks.
sclickOccurs during a single-click in a list box/combo box, during check/uncheck of radio/check buttons, or during the click of a button.
scrollA scroller control position has changed.
uclickLeft mouse button has been released/gone up.

Examples

Here we will create an alias that launches a dialog. This dialog has a mouse event listener that will track mouse movements in the dialog, and write them to specific dialog components:

; To use this example, simply type: /mouseListener
alias mouseListener dialog - $+ $iif($dialog(mouseListener),v,m) mouseListener mouseListener
dialog -l mouseListener {
  title "Mouse Listener"
  size -1 -1 184 120
  option dbu
  text "Move Your Mouse In Here!", 1, 56 32 73 8
  text "X", 2, 56 48 5 8
  text "0", 3, 64 48 25 8
  text "Y", 4, 95 48 5 8
  text "0", 5, 103 48 25 8
  button "&Close", 6, 139 99 37 16, ok
}
ON *:DIALOG:mouseListener:mouse:*: {
  did -ra $dname 3 $mouse.x
  did -ra $dname 5 $mouse.y
}

In the example above, we have created an alias, mouseListener, to handle a local dialog, which cannot be seen outside of the scope of whatever script file it is saved to. This will help make sure no other dialogs collide with this dialog and its events.

This example can be triggered by typing the following command:

/mouseListener

Once the demo has begun, the mouse event will now listen. When the mouse begins moving around inside of the dialog, the X and Y positions of the mouse are represented inside of the text components of ID 3, and 5, respectively.

Clicking the Close button will close the dialog and halt event listening.

Below is another, more thorough example. This example will monitor what events are triggering, what event ID is triggering the event, and any current captions or titles of the event ID which triggered an event. Created a custom alias called /whatEvents which will open up the local dialog whatEvents:

alias whatEvents dialog - $+ $iif($dialog(whatEvents),v,m) whatEvents whatEvents
dialog -l whatEvents {
  title "Events? What Events?"
  size -1 -1 136 112
  option dbu
  text "Event Type", 1, 8 8 73 8
  text "", 2, 82 8 49 8
  text "Event Item ID", 3, 8 18 73 8
  text "", 4, 82 18 49 8
  text "Event Item Caption/Value", 5, 8 28 73 8
  text "", 6, 82 28 49 7
  button "Click me", 7, 8 40 37 12
  edit "Type in me", 8, 48 40 66 13
  check "Check/Uncheck Me", 9, 8 64 58 10
  text "0", 10, 8 73 58 10
  text "Scroll Me", 11, 72 64 57 8, center
  scroll "", 12, 72 72 58 8, range 0 100 horizontal bottom
  button "&Close", 13, 93 90 37 16, ok
}
ON *:DIALOG:whatEvents:*:*: {
  did -ra $dname 2 $devent
  did -ra $dname 4 $did
  did -ra $dname 6 $iif($did == 0,NA,$iif($did($did),$v1,$iif($did($did).sel,$v1,$iif($did($did) == 0,0,NA))
  did -ra $dname 10 $did(9).state
}

Once saved into a script file inside of the mIRC remotes, the above example can be executed by typing the following command:

/whatEvents

Almost all events are accounted for. The dialog properly tracks mouse movements, the ID of the elements being altered/used, and any other sorts of attainable event information.

Compatibility

Added: mIRC v5.5
Added on: 01/08/1999
Note: Individual switches were not taken into consideration.

See Also

mIRC on event list

A on Action, on Active, on Agent”), on Appactive B on Ban C on Chat, on Chatclose”), on Chatopen”), on Close, on Connect, on Connectfail, on Ctcpreply D on Dccserver, on Dehelp, on Deop, on Deowner, on Devoice, on Dialog, on Disconnect, on Dns E on Error, on Exit F on Filercvd, on Filesent G on GetfailH on Help, on Hotlink I on Input, on Invite J on Join K on Keydown, on Keyup, on Kick L on Load, on Logon M on Me”), on Midiend, on Mode, on Mp3end N on Nick, on Nosound, on Notice, on Notify O on Op, on Open, on Owner P on Part, on Ping, on Playend, on PongQ on Queryclose”), on Queryopen”), on Quit R on Rawmode S on Sendfail, on Serv, on Servclose”), on Servermode, on Serverop, on Servopen”), on Signal”), on Snotice, on Sockclose”), on Socklisten, on Sockopen, on Sockread, on Sockwrite, on Start T on Text, on Topic U on Udpread, on Udpwrite, on Unban, on Unload, on Unotify, on UsermodeV on Vcmd, on Voice W on Wallops, on Waveend