(→See also) |
m (Use complete words.) |
||
(10 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | The '''$did''' identifier allows you to get the settings and values of controls in a dialog and use them to assist in performing the functions of buttons, radio boxes, etc. | + | {{mirc title|$did Identifier}}The '''$did''' identifier allows you to get the settings and values of controls in a dialog and use them to assist in performing the functions of buttons, radio boxes, etc. |
== Synopsis == | == Synopsis == | ||
$did(<name>,<id>,[N])[.property] | $did(<name>,<id>,[N])[.property] | ||
+ | |||
+ | '''Note:''' Inside the on dialog event, you can omit the whole dialog <name> parameter: | ||
+ | |||
+ | $did(<id>,[N])[.property] | ||
+ | |||
== Properties == | == Properties == | ||
Line 20: | Line 25: | ||
* '''enabled''' - returns $true if control is enabled, otherwise $false | * '''enabled''' - returns $true if control is enabled, otherwise $false | ||
* '''isid''' - returns $true if id exists in the dialog, otherwise $false | * '''isid''' - returns $true if id exists in the dialog, otherwise $false | ||
− | * '''csel''' - returns line number of Nth checked box in a | + | * '''csel''' - returns line number of Nth checked box in a list checkbox control, if N = 0, returns number of checkmarked lines |
− | * '''cstate''' - returns 0 = off, 1 = on for item in a | + | * '''cstate''' - returns 0 = off, 1 = on for item in a list checkbox control |
== Parameters == | == Parameters == | ||
Line 63: | Line 68: | ||
== Compatibility == | == Compatibility == | ||
− | + | {{mIRC compatibility|5.5}} | |
− | |||
− | |||
− | |||
− | |||
== See also == | == See also == | ||
− | * | + | * {{mIRC|$dname}} |
− | * | + | * {{mIRC|$devent}} |
− | * | + | * {{mIRC|$didwm}} |
− | * | + | * {{mIRC|$didreg}} |
− | * | + | * {{mIRC|$didtok}} |
− | * | + | * {{mIRC|/dialog}} |
− | * | + | * {{mIRC|/did}} |
− | * | + | * {{mIRC|/didtok}} |
* [[On dialog - mIRC|ON DIALOG]] | * [[On dialog - mIRC|ON DIALOG]] | ||
+ | {{mIRC identifier list}} | ||
− | [[Category:mIRC identifiers]] | + | [[Category:mIRC identifiers|did]] |
Latest revision as of 17:03, 21 February 2024
The $did identifier allows you to get the settings and values of controls in a dialog and use them to assist in performing the functions of buttons, radio boxes, etc.
Synopsis[edit]
$did(<name>,<id>,[N])[.property]
Note: Inside the on dialog event, you can omit the whole dialog <name> parameter:
$did(<id>,[N])[.property]
Properties[edit]
- text - returns line or Nth line
- len - returns length of line or length of Nth line
- lines - returns number of lines
- sel - returns line number of Nth selected line
- seltext - returns selected text in an editbox, or first selected item in a listbox
- selstart - returns selected start character in the editbox
- selend - returns selected end character in editbox line
- edited - returns $true if text in editbox was changed, and is not empty.
- state - returns state of checkboxes, radio buttons, 0 = off, 1 = on, 2 = indeterminate (for 3stage checkbox)
- next - returns id of next control in order of tab keypress.
- prev - returns id of previous control in order of tab keypress.
- visible - returns $true if control is visible, otherwise $false
- enabled - returns $true if control is enabled, otherwise $false
- isid - returns $true if id exists in the dialog, otherwise $false
- csel - returns line number of Nth checked box in a list checkbox control, if N = 0, returns number of checkmarked lines
- cstate - returns 0 = off, 1 = on for item in a list checkbox control
Parameters[edit]
- <name> - name of the dialog
- <id> - id of the controls
- [N] - usually a line number, it can also be an id number with menus, use 0 if you want to access the editbox of a combo control.
- [.property] - used to check features of the dialog id, such as button state, selected line in a combo control, or number of lines in an editbox.
Example[edit]
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[edit]
Added: mIRC v5.5
Added on: 08 Jan 1999
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.