- Home
- General Usage
- DCX Controls
- DCX Features
- About DCX
|
Edit |
Normal edit control. Root control: Edit
|
Control Styles |
These control styles are available when creating a Edit control. Remember that the general styles disabled, group, hidden, notheme, tabstop and transparent apply to all DCX controls except the embedded Dialog and Window controls. |
alpha |
Control is alpha blended. |
autohs |
Text scrolling is automatically scrolled horizontally without need of a horizontal scrollbar. |
autovs |
Text scrolling is automatically scrolled vertically without need of a vertical scrollbar. |
center |
Text is centered. |
eolcr |
Allow carriage returns to end lines. (win10+) |
eollf |
Allow line feeds to end lines. (win10+) |
hsbar |
Displays a horizontal scrollbar. |
lowercase |
Converts all characters to lowercase as they are typed into the edit control. |
multi |
Enables a multiline edit. |
number |
Allows only digits to be entered into the edit control. |
password |
Displays an asterisk (*) for each character typed into the edit control. |
readonly |
Prevents the user from typing or editing text in the edit control. |
return |
Specifies that a carriage return be inserted when the user presses the ENTER key while entering text into a multiline edit control in a dialog box. |
right |
Text is right justified. |
showlinenumbers |
Show line numbers in a multi line control |
showsel |
When the control loses focus, the selection is still displayed. |
tooltips |
The edit will have a tooltip. |
unlockgutter |
Allow resizing the gutter area. |
uppercase |
Converts all characters to uppercase as they are typed into the edit control. |
vsbar |
Displays a vertical scrollbar. |
zoomable |
Control is zoomable. (win10+) |
| Note.- Even with number style, it is still possible to paste non-digits into the edit control.
- password does not work with multi style.
- By default the edit control defines the end of line as crlf
|
/xdid flags |
Control commands are input to the control with the /xdid command. |
/xdid -a |
This command lets you add text to the end of the edit. |
Syntax: |
/xdid -a [DNAME] [ID] [TEXT] |
Example: |
/xdid -a dcx 4 New Text |
/xdid -c |
This command will copy the text in the edit to the clipboard. |
Syntax: |
/xdid -c [DNAME] [ID] |
Example: |
/xdid -c dcx 4 |
/xdid -d |
This command lets you delete the Nth line of text in the edit. |
Syntax: |
/xdid -d [DNAME] [ID] [N,N2,N3-N4] |
Example: |
/xdid -d dcx 4 2,40-55 |
| Note. Only works with multi. |
/xdid -g |
This command lets you set the colours to use for line numbers |
Syntax: |
/xdid -g [DNAME] [ID] [Selected line Background Colour|-] (Background Colour|-) (Selected Line Text Colour|-) (Text Colour|-) (Border Colour|-) (Unlock Gutter 0|1|-) (Gutter Size|-) (Gutter Border Size|-) |
Example: |
/xdid -g dcx 4 $rgb(255,0,0) $rgb(16,24,5) - $rgb(12,34,0) |
| Note.- A value of - will cause an option to be ignored.
- atm the Gutter Border Size option isnt implemented.
|
/xdid -i |
This command lets you insert a line at the Nth position in the edit. |
Syntax: |
/xdid -i [DNAME] [ID] [N] (TEXT) |
Example: |
/xdid -i dcx 4 5 New Text |
| Note. If the multi style is not used, will overwrite the whole text. |
/xdid -j |
This command lets you trigger the password style of the edit control on the fly. |
Syntax: |
/xdid -j [DNAME] [ID] [1|0] (CHAR) |
Example: |
/xdid -j dcx 4 1 * |
| Note. Sets the password obscuring char to (CHAR) if supplied, or the default for your system. |
/xdid -l |
This command lets you change the readonly style. |
Syntax: |
/xdid -l [DNAME] [ID] [1|0] |
Example: |
/xdid -l dcx 4 1 |
/xdid -o |
This command lets you overwrite the Nth line in the edit. |
Syntax: |
/xdid -o [DNAME] [ID] [N] [TEXT] |
Example: |
/xdid -o dcx 4 5 New multi line Text /xdid -o dcx 4 0 New single line Text
|
| Note.- If the multi style is not used, will overwrite the whole text.
- [N] must be supplied even if the control is single line
- For a multi line control [N] must be > zero
|
/xdid -q |
This command lets you set a char length limit on the edit. |
Syntax: |
/xdid -q [DNAME] [ID] [LIMIT] |
Example: |
/xdid -q dcx 4 8 |
/xdid -r |
This command lets you clear the contents of the edit. |
Syntax: |
/xdid -r [DNAME] [ID] |
Example: |
/xdid -r dcx 4 |
/xdid -t |
This command lets you load the contents of a file directly in the edit. |
Syntax: |
/xdid -t [DNAME] [ID] [FILENAME] |
Example: |
/xdid -t dcx 4 C:/mIRC/blah.txt |
/xdid -u |
This command lets you save the contents of the edit directly to a file. |
Syntax: |
/xdid -u [DNAME] [ID] [FILENAME] |
Example: |
/xdid -u dcx 4 C:/mIRC/blah.txt |
/xdid -y |
This command lets you ignore callbacks for repeated keydown events when the user holds a button. This command also allows you to enable/disable line numbers |
Syntax: |
/xdid -y [DNAME] [ID] [1|0|-] (0|1) |
Example: |
/xdid -y dcx 4 1 |
| Note.- Repeated keys are ignored by default.
- A value of 1 will prevent callbacks from being generated for repeated keydown events.
|
/xdid -E |
This command lets you set the cue text. It behaves like a ghostly value when the edit control is empty. |
Syntax: |
/xdid -E [DNAME] [ID] [TEXT] or [+FLAGS] [TEXT] |
Example: |
/xdid -E dcx 4 Username /xdid -E dcx 4 +f Username
|
Parameters: |
+FLAGS |
Cue flags. |
f |
Cue text stays visible when control has focus. |
TEXT |
Cue text to use. |
/xdid -I |
This command lets you insert a line at the Nth position in the edit. |
Syntax: |
/xdid -I [DNAME] [ID] [N] [TEXT] |
Example: |
/xdid -I dcx 4 5 Inserted Text |
| Note. The text is inserted at the Nth character no matter what mode the control is in. If the control has less that N characters the text is added to the end. |
/xdid -P |
This command lets you paste the contents of the clipboard into the edit control. |
Syntax: |
/xdid -P [DNAME] [ID] |
Example: |
/xdid -P dcx 4 |
| Note. The text will be pasted directly into the current caret position. See /xdid -S. |
/xdid -S |
This command lets you set the selection range (and/or caret position) in the edit control. |
Syntax: |
/xdid -S [DNAME] [ID] [START] (END) |
Example: |
/xdid -S dcx 4 1 3 /xdid -S dcx 4 5
|
| Note. When the END parameter is not specified, then this command will set the caret position to START. |
/xdid -V |
This command lets you scroll the contents to make the caret visible. |
Syntax: |
/xdid -V [DNAME] [ID] |
Example: |
/xdid -V dcx 4 |
$xdid() Properties |
The $xdid identifier is a given mIRC alias that communicates with the DCX DLL to extract information in DCX controls. |
$xdid().caretpos |
This property lets you retreive the position of the cursor. |
Syntax: |
$xdid(dialog, ID).caretpos |
Example: |
$xdid(dcx, 4).caretpos |
Return | LINE COLUMN CHAR |
$xdid().cue |
This returns the cue banner text in the control. |
Syntax: |
$xdid(dialog, ID).cue |
Example: |
$xdid(dcx, 4).cue |
$xdid().endofline |
This property returns the character used to mark the end of lines. (win10+) |
Syntax: |
$xdid(dialog, ID).endofline |
Example: |
$xdid(dcx, 4).endofline |
Return | 0 - No end of line character 1 - EC_ENDOFLINE_CRLF - end of line is a CRLF pair. 2 - EC_ENDOFLINE_CR - end of line is a CR 3 - EC_ENDOFLINE_LF - end of line is a LF |
$xdid().find |
This property lets you retreive the character offset of the Nth found match to the input search patern. |
Syntax: |
$xdid(dialog, ID, [TAB]Matchtext[TAB], T, N, LINE, SUBCHAR).find |
Example: |
$xdid(dcx, 4, $chr(9) *Item* $chr(9), W, 3, 1, 30).find |
Parameters: |
MATCHTEXT |
String composed of wildcards or regex paterns used for the search. |
T |
Value indicating if the search is using a regex patern, a wildcard string, or an exact match. |
W |
Matchtext is a wildcard string. |
R |
Matchtext is a regex patern. |
E |
Matchtext is an exact match |
N |
Parameter indicating to return the Nth match. |
LINE |
The line to start the search at. |
SUBCHAR |
The character within the line to start the search at. |
Return | OFFSET - The character offset within the text that matched the search. | | Note.- If N is 0, returns the total number of matching items.
- The [TAB] characters surrounding the matchtext are mandatory or else it wont work.
|
$xdid().ismodified |
Have the contents have been modified? |
Syntax: |
$xdid(dialog, ID).ismodified |
Example: |
$xdid(dcx, 4).ismodified |
Return | 0 - Contents have not been modified. 1 - Contents have been modified. |
$xdid().ispass |
Is the edit control using the password style? |
Syntax: |
$xdid(dialog, ID).ispass |
Example: |
$xdid(dcx, 4).ispass |
Return | 0 - Password mode disabled. 1 - Password mode enabled. |
$xdid().isreadonly |
Is the edit control using the readonly style? |
Syntax: |
$xdid(dialog, ID).isreadonly |
Example: |
$xdid(dcx, 4).isreadonly |
Return | 0 - Control is NOT readonly. 1 - Control IS readonly. |
$xdid().len |
This property returns the length of the controls contents or a specific line. |
Syntax: |
$xdid(dialog, ID, (N)).len |
Example: |
$xdid(dcx, 4).len $xdid(dcx, 4, 2).len
|
Parameters: |
N |
The line index to get the length of. |
| Note. If the multi style is not used, then N is ignored and the length of all the text is returned. |
$xdid().linenumbers |
This returns if line numbers are enabled. |
Syntax: |
$xdid(dialog, ID).linenumbers |
Example: |
$xdid(dcx, 4).linenumbers |
Return | 0 - disabled. 1 - enabled. |
$xdid().num |
This property lets you retreive the number of lines in the edit. |
Syntax: |
$xdid(dialog, ID).num |
Example: |
$xdid(dcx, 4).num |
$xdid().passchar |
This property returns the character used to cover passwords. |
Syntax: |
$xdid(dialog, ID).passchar |
Example: |
$xdid(dcx, 4).passchar |
| Note. If the password style is not used then this will return zero. |
$xdid().sel |
This returns the index of the first and last selected character position in the control. |
Syntax: |
$xdid(dialog, ID).sel |
Example: |
$xdid(dcx, 4).sel |
$xdid().selend |
This returns the index of the last selected character position in the control. |
Syntax: |
$xdid(dialog, ID).selend |
Example: |
$xdid(dcx, 4).selend |
$xdid().selstart |
This returns the index of the first selected character position in the control. |
Syntax: |
$xdid(dialog, ID).selstart |
Example: |
$xdid(dcx, 4).selstart |
$xdid().seltext |
This returns the selected text in the control. |
Syntax: |
$xdid(dialog, ID).seltext |
Example: |
$xdid(dcx, 4).seltext |
$xdid().text |
This property lets you retreive the Nth line in the edit or the whole edit text. |
Syntax: |
$xdid(dialog, ID, [N]).text |
Example: |
$xdid(dcx, 4, 2).text |
Parameters: |
N |
The line index to get. |
| Note. If the multi style is not used, you can ignore N when retrieving the edit text. |
$xdid().zoom |
This property returns the zoom level. (win10+) |
Syntax: |
$xdid(dialog, ID).zoom |
Example: |
$xdid(dcx, 4).zoom |
Return | ZOOM - Level of zoom | | Note.- Only works on controls that have the zoomable style.
- The zoom ratio is always between 1/64 and 64 NOT inclusive, 1.0 = no zoom
|
Edit Events |
These events are fired when activity occurs in the Edit control. |
copy |
When the user copies text from the edit control. |
Syntax: |
/cb_alias DNAME copy ID |
Example: |
/cb_alias dcx copy 4 |
Return | nocopy - To block the copy operation. |
cut |
When the user cuts text from the edit control. |
Syntax: |
/cb_alias DNAME cut ID |
Example: |
/cb_alias dcx cut 4 |
Return | nocut - To block the cut operation. |
dragbegin |
Triggers when one or more files are dropped onto the control. |
Syntax: |
/cb_alias DNAME dragbegin ID COUNT |
Example: |
/cb_alias dcx dragbegin 4 3 |
Parameters: |
COUNT |
Total number of files dragged into the control. |
Return | cancel - To stop the drag drop events from occuring. |
dragfile |
The filename of the file which was dropped onto the edit control. |
Syntax: |
/cb_alias DNAME dragfile ID FILENAME |
Example: |
/cb_alias dcx dragfile 4 C:/mIRC/blah.txt |
dragfinish |
Event triggered when processing of drag drop is complete. |
Syntax: |
/cb_alias DNAME dragfinish ID |
Example: |
/cb_alias dcx dragfinish 4 |
edit |
When the text is edited in the edit control. |
Syntax: |
/cb_alias DNAME edit ID |
Example: |
/cb_alias dcx edit 4 |
help |
Launched when you click on a control using the ? contexthelp button. |
Syntax: |
/cb_alias DNAME help ID |
Example: |
/cb_alias dcx help 4 |
keydown |
When a key is pressed in the edit control. |
Syntax: |
/cb_alias DNAME keydown ID KEYCODE |
Example: |
/cb_alias dcx keydown 4 65 |
keyup |
When a key is unpressed in the edit control. |
Syntax: |
/cb_alias DNAME keyup ID KEYCODE |
Example: |
/cb_alias dcx keyup 4 65 |
paste |
When the user pastes text into the edit control. |
Syntax: |
/cb_alias DNAME paste ID |
Example: |
/cb_alias dcx paste 4 |
Return | nopaste - To block the paste operation. |
return |
When the enter key is pressed in the edit control. |
Syntax: |
/cb_alias DNAME return ID |
Example: |
/cb_alias dcx return 4 |
|