From WikiChip
Editing mirc/dialogs

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
Line 1: Line 1:
 
{{mirc title|Dialogs}}
 
{{mirc title|Dialogs}}
  
'''Dialogs''' make it possible to create custom dialog windows inside of mIRC. The {{mIRC|/dialog}} command opens new dialogs, and the {{mIRC|dialog components}} are the objects within the dialog, such as buttons, labels, etc.
+
'''Dialogs''' make it possible to create custom dialog windows inside of mIRC. The [[/dialog command - mIRC|/dialog command]] is the key way to opening new dialogs, and the [[Dialog components - mIRC|Dialog components]] are the objects within the dialog, such as buttons, labels, etc.
  
 
=== What dialogs are ===
 
=== What dialogs are ===
Line 7: Line 7:
  
 
=== mIRC Dialogs ===
 
=== mIRC Dialogs ===
mIRC dialogs are created by users through custom scripts. Through these dialog interactions, the dialogs adhere to an event listener, the {{mIRC|on dialog}} event. Through this event, all aspects of the custom dialogs, as well as their controls, can be monitored, tracked, and modified.
+
mIRC dialogs are created by users through custom scripts. Through these dialog interactions, the dialogs adhere to an event listener, the [[On dialog - mIRC|ON DIALOG]] event. Through this event, all aspects of the custom dialogs, as well as their controls, can be monitored, tracked, and modified.
  
 
=== Scope ===
 
=== Scope ===
The scope of this article is to generally familiarize users with the term '''dialogs''', and what exactly it is they are used for within mIRC. Since these components are geared towards more advanced scripters, beginners should make sure they have already gone through the preceding tutorials from the {{mIRC|Introduction}} page, all the way leading up to '''Dialogs'''
+
The scope of this article is to generally familiarize users with the term '''dialogs''', and what exactly it is they are used for within mIRC. Since these components are geared towards more advanced scripters, beginners should make sure they have already gone through the preceding tutorials from the [[Introduction - mIRC|mIRC Introduction]] page, all the way leading up to '''Dialogs'''
  
 
=== Two types of dialog ===
 
=== Two types of dialog ===
  
They are two type of dialogs - modal dialogs which block access to other parts of the mIRC interface until they are closed, and modeless dialogs which can be left open whilst continuing to allow access to the rest of mIRC (i.e. effectively a separate mIRC-based window).
+
They are two type of dialogs - modeless dialog and modal dialog.
  
 
Modals dialog are dialog which block the current script execution, you cannot access others windows, usually used to get a quick user input.
 
Modals dialog are dialog which block the current script execution, you cannot access others windows, usually used to get a quick user input.
mIRC has built-in modals dialog, {{mIRC|$?}}'s families and {{mIRC|$input}} are modals dialogs.
+
mIRC has built-in modals dialog, {{mIRC|$?}}'s famillies and {{mIRC|$input}} are modals dialogs.
  
 
Modeless dialog can be opened indefinitely and does not halt the script execution.
 
Modeless dialog can be opened indefinitely and does not halt the script execution.
 +
mIRC also has modeless dialog, such as the mIRC Options dialog (alt + o).
  
 
==== Modeless dialog ====
 
==== Modeless dialog ====
Line 57: Line 58:
  
 
<source lang="mIRC">dialog -l <name> {
 
<source lang="mIRC">dialog -l <name> {
 +
 
     title        "text"
 
     title        "text"
 +
 
     icon        filename, index
 
     icon        filename, index
 +
 
     size        x y w h
 
     size        x y w h
 +
 
     option      type                                  (pixels, dbu, map, notheme, disable)
 
     option      type                                  (pixels, dbu, map, notheme, disable)
 +
 
     text        "text", id, x y w h, style            (right, center, nowrap)
 
     text        "text", id, x y w h, style            (right, center, nowrap)
 +
 
     edit        "text", id, x y w h, style            (right, center, multi, pass, read, return, hsbar, vsbar, autohs, autovs, limit N, rich)
 
     edit        "text", id, x y w h, style            (right, center, multi, pass, read, return, hsbar, vsbar, autohs, autovs, limit N, rich)
 +
 
     button      "text", id, x y w h, style            (default, ok, cancel, flat, multi)
 
     button      "text", id, x y w h, style            (default, ok, cancel, flat, multi)
 +
 
     check        "text", id, x y w h, style            (left, push, 3state)
 
     check        "text", id, x y w h, style            (left, push, 3state)
 +
 
     radio        "text", id, x y w h, style            (left, push)
 
     radio        "text", id, x y w h, style            (left, push)
 +
 
     box          "text", id, x y w h, style
 
     box          "text", id, x y w h, style
 +
 
     scroll      "text", id, x y w h, style            (top left bottom right horizontal range N N)
 
     scroll      "text", id, x y w h, style            (top left bottom right horizontal range N N)
 +
 
     list        id, x y w h, style                    (sort, extsel, multsel, size, vsbar, hsbar, check, radio)
 
     list        id, x y w h, style                    (sort, extsel, multsel, size, vsbar, hsbar, check, radio)
 +
 
     combo        id, x y w h, style                    (sort, edit, drop, size, vsbar, hsbar)
 
     combo        id, x y w h, style                    (sort, edit, drop, size, vsbar, hsbar)
 +
 
     icon        id, x y w h, filename, index, style    (noborder top left bottom right small large actual)
 
     icon        id, x y w h, filename, index, style    (noborder top left bottom right small large actual)
 +
 
     link        "text", id, x y w h
 
     link        "text", id, x y w h
 +
 
     tab          "text", id, x y w h
 
     tab          "text", id, x y w h
 +
 
     tab          "text", id  
 
     tab          "text", id  
 +
 
     menu        "text", menuid [, menuid]
 
     menu        "text", menuid [, menuid]
 +
 
     item        "text", id [, menuid]
 
     item        "text", id [, menuid]
 +
 
     item        break, id [, menuid]
 
     item        break, id [, menuid]
 +
 
}</source>
 
}</source>
  
Line 90: Line 112:
 
** notheme - This option prevents mIRC from applying your current windows theme to the dialog - if you like your dialogs to have a retro Windows XP feel to them which is different to how the style used by the rest of mIRC, then this is the option for you.
 
** notheme - This option prevents mIRC from applying your current windows theme to the dialog - if you like your dialogs to have a retro Windows XP feel to them which is different to how the style used by the rest of mIRC, then this is the option for you.
 
** disable - This option can use used to wait a bit before the controls in the dialog can be used, preventing accidents
 
** disable - This option can use used to wait a bit before the controls in the dialog can be used, preventing accidents
* Others elements are used to create controls, see the {{mIRC|dialog components}}
+
* Others elements are used to create controls, see the [[Dialog Components - mIRC|dialog Components page]]
  
Remember that once the dialog is created, mIRC does not allow you to resize the controls in the dialog. You can use variable and identifiers inside the dialog table to create dialog control with dynamic size
+
You can use a variable name as a style for any control, the variable is set (global variable) with the value of that control when the dialog is closed:
You can also use a variable name as a style for any control, the variable is set (global variable) with the value of that control when the dialog is closed:
 
  
<source lang="mIRC">
+
<source lang="mIRC">edit "", 2, 10 10 100 20, autohs %myedit</source>
;use a variable to define the width and an identifier to define the height of the dialog, when the dialog is closed, %myedit will contain the content of the editbox.
 
edit "", 2, 10 10 %dialog_width $dialog_height, autohs %myedit</source>
 
  
 
=== Mnemonic ===
 
=== Mnemonic ===
  
The "text" parameter of controls showing text can include the '&' character to create a mnemonic. If you want to get the '&' rendered literaly, use &&.
+
The "text" parameter of controls showing text can include the '&' character to create a mnemonic if you want to get the '&' rendered literaly, use &&.
  
 
'''Note''': even if a control renders the mnemonic correctly, the shortcut may not work, it's not working to switch tab for example.
 
'''Note''': even if a control renders the mnemonic correctly, the shortcut may not work, it's not working to switch tab for example.
Line 107: Line 126:
 
For example, the following menu definition reproduces the File menu of the mIRC Editor dialog:
 
For example, the following menu definition reproduces the File menu of the mIRC Editor dialog:
  
<source lang="mIRC">dialog test {
+
<source>dialog test {
    title "mIRC"
+
title "mIRC"
    size -1 -1 110 100
+
size -1 -1 110 100
    option dbu
+
option dbu
    menu "&File", 60
+
menu "&File", 60
    item "&New", 70
+
item "&New", 70
    menu "&Load", 80, 60
+
menu "&Load", 80, 60
    item "&Script", 90
+
item "&Script", 90
    item break, 100
+
item break, 100
    item "&Users", 110
+
item "&Users", 110
    item "&Variables", 120
+
item "&Variables", 120
    item "&Unload", 130, 60
+
item "&Unload", 130, 60
    item break, 140
+
item break, 140
    item "&Save", 150
+
item "&Save", 150
    item "&Save As...", 160
+
item "&Save As...", 160
    item "Save &All", 170
+
item "Save &All", 170
    item break, 180
+
item break, 180
    item "Save && &exit", 190, ok
+
item "Save && &exit", 190, ok
    item "&Cancel", 200, cancel
+
item "&Cancel", 200, cancel
 
}
 
}
 
</source>
 
</source>
Line 133: Line 152:
 
The {{mIRC|/did}} command can be used to change the various state of the control while {{mIRC|$did}} can be used to retrieve values and states of controls.
 
The {{mIRC|/did}} command can be used to change the various state of the control while {{mIRC|$did}} can be used to retrieve values and states of controls.
  
Check the {{mIRC|dialog components}}, which describe the usage of the two per control.
+
Check the [[Dialog Components - mIRC|dialog Components page]], which describe the usage of the two per control.
  
 
=== Others tools ===
 
=== Others tools ===
Line 143: Line 162:
 
{{mIRC|$didtok}}(name,id,C) returns a tokenized list of item from a combo/edit/list control.
 
{{mIRC|$didtok}}(name,id,C) returns a tokenized list of item from a combo/edit/list control.
  
{{mIRC|$didwm}}(name,id,wildcard,N) and {{mIRC|$didreg}}(name,id,regex,N) returns the number of the line that match the {{mirc|wildcard}} expression, starting at the optional line N, in the the control.
+
{{mIRC|$didwm}}(name,id,wildcard,N) and {{mIRC|$didreg}}(name,id,regex,N) returns the number of the line that match the expresion, starting at the optional line N, in the the control.
  
 
==== /loadbuf, /savebuf and /filter ====
 
==== /loadbuf, /savebuf and /filter ====

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)