| Home | Translations | Download | Forum | Bug Tracker

|  | v1.3.7

Listview
This control enables you to create a listview in 4 different view styles: icon, small icon, list and report.
Control Styles
These control styles are available when creating a Listview control. Remember that the general styles disabled, group, notheme, tabstop and transparent apply to all DCX controls.
icon | Creates a listview in icon view.
list | Creates a listview in item list view.
report | Creates a listview in report view (the view with columns and grid).
smallicon | Creates a listview in smallicon view.
alignleft | Items are left-aligned in the listview control. (icon & smallicon views)
aligntop | Items are aligned with the top of the listview control. (icon & smallicon views)
autoarrange | Items are rearranged automaticly when inserted. (icon & smallicon views)
balloon | The listview and listview items tooltip will use the balloon style.
borderselect | When an item is selected a special border is drawn arround it instead of it being highlighted.
checkbox | Enables checkbox support in the list view. (report view)
editlabel | Enables the possibility to edit listview item labels.
flatsb | Enables flat scroll bars on the listview.
fullrow | Highlights the full row when an item is selected. (report view)
grid | Displays grid lines between item cells. (report view)
headerdrag | Enables the possibility to drag listview headers to another position. (report view)
hottrack | Enables hot-track selection in a listview control. Hot track selection means that an item is automatically selected when the cursor remains over the item for a certain period of time.
noheader | Does not display the header on the listview. (report view)
nolabelwrap | The text is displayed on a single line. (icon & smallicon views)
noscroll | Scrolling is disabled. All items must be within the client area. (icon & smallicon views)
showsel | When the control loses focus, the selection is still displayed.
singlesel | Allows only one item at a time to be selected. By default, multiple items can be selected.
sortasc | Items are sorted based on item text in ascending order.
sortdesc | Items are sorted based on item text in descending order.
subitemimage | Subitems have images. (report view)
tooltip | If a partially hidden label in any view lacks tooltip text, the control will unfold the label. If this style is not set, the control will unfold partly hidden labels only for the icon view.
Note. Gridlines dont work with groups. See /xdid -q. sortasc and sortdesc only work with report or list views.
/xdid flags
Control commands are input to the control with the /xdid command.
/xdid -a
This command lets you add an item to the listview.
Syntax: | /xdid -a [DNAME] [ID] [N] [INDENT] [+FLAGS] [ICON] [STATE] [OVERLAY] [GROUPID] [COLOR] [BGCOLOR] (Item Text) [TAB] [+FLAGS] [ICON] (Item Text) [TAB] ...
Example: | /xdid -a dcx 4 1 0 +cbku 1 0 0 0 -1 $rgb(170,213,255) text $chr(9) + 0 text2 $chr(9) + 0 text3
Parameters:
N | Position where the listview item is inserted. (Use 0 to insert at the end)
INDENT | Space in icon width at the beginning of a line in the listview (0 for no space)
+FLAGS | Item flags.
a | Autosize.
b | The item is bold.
c | The item has a text color defined by the COLOR parameter (use -1 for no color).
d | The item appears selected like a drop target.
f | The item has focus thus having a dotted box around it.
h | Autosize according to header text width.
i | The item is italic.
k | The item has a background color defined by the BGCOLOR parameter (use -1 for no color).
m | Autosize the column to fit header or content.
s | The item is selected.
p | The item is a DCX ProgressBar control.
t | The item icon appears as 50% opaque, looks like it has a "ghost" effect.
u | The item is underlined.
ICON | Icon index number from the normal icon list.
STATE | Icon index number from the state icon list.
0 | No check.
1 | Unchecked.
2 | Checked
OVERLAY | Icon index number from the normal icon list that was marked as an overlay icon. (Note: Not functional yet)
GROUPID | Group ID. (Use 0 for no value) (XP+)
COLOR | Item text color.
BGCOLOR | Item background color.
Item Text | The text to display in the cell. If used with +p +FLAGS, then this is the DCX ProgressBar style.
Note. Icons must be added prior to be used in the listview. The INDENT parameter only works if you are using normal icons in the listview. If you add icons to the icon lists and use 0 for no icon, there will be the an icon indent space in front of the item text. (normal and state lists) You can use 0 for the #ICON, and #OVERLAY values if you wish to use no icon. You need to use checkbox style in order to use checkboxes in the listview.
/xdid -c
This command lets you select listview items.
Syntax: | /xdid -c [DNAME] [ID] [N(,N,...)]
Example: | /xdid -c dcx 4 1,3,5
Note. In a singlesel listview, there is only one value for N.
/xdid -d
This command lets you delete the Nth listview item.
Syntax: | /xdid -d [DNAME] [ID] [N]
Example: | /xdid -d dcx 4 6
/xdid -g
This command lets you set a background image to the listview control.
Syntax: | /xdid -g [DNAME] [ID] [+FLAGS] [X] [Y] (FILENAME)
Example: | /xdid -g dcx 4 +n 50 50 $mircdir/images/blah.png
Parameters:
+FLAGS | Image flags.
n | Normal image.
r | Remove image.
t | Tiled Image.
X | Normal horizontal offset.
Y | Normal vertical offset.
FILENAME | Filename of the image including the path.
Note. For X and Y, 0 = left aligned, 50 = centred, 100 = right aligned.
/xdid -i
This command lets you change the listview control colors.
Syntax: | /xdid -i [DNAME] [ID] [+FLAGS] [COLOR]
Example: | /xdid -i dcx 4 +bk none
Parameters:
+FLAGS | Color flags.
b | Background color.
k | Text background color.
o | Outline color. (see borderselect style)
t | Text color.
COLOR | Color in $rgb() format.
Note. COLOR can be none for no colors, for both background and text background flags. If COLOR is none for text background, the text background parameter of /xdid -a wont work anymore.
/xdid -j
This command lets you change the appearance of a listview item.
Syntax: | /xdid -j [DNAME] [ID] [N] [NSUB] [+FLAGS]
Example: | /xdid -j dcx 4 2 5 +bt
Parameters:
N | The row index for the item.
NSUB | The column index for the item.
STATE | Item flags
b | The item is bold.
d | The item appears selected like a drop target.
f | The item has focus thus having a dotted box around it.
i | The item is italic.
s | The item is selected.
t | The item appears as 50% opaque, looks like it has a "ghost" effect.
u | The item is underlined.
/xdid -k
This command lets you change the check state on the Nth listview item.
Syntax: | /xdid -k [DNAME] [ID] [STATE] [N]
Example: | /xdid -k dcx 4 2 5
Parameters:
STATE | Check State
0 | No check.
1 | Unchecked.
2 | Checked
N | The state to set the item to.
Note. If you are not using the checkbox style, this function can also change the state icon of an item. Be sure to insert the state icons before you use them.
/xdid -l
This command lets you change the listview item icon.
Syntax: | /xdid -l [DNAME] [ID] [N] [NSUB] [ICON]
Example: | /xdid -l dcx 4 1 2 5
Parameters:
N | Item index.
NSUB | Column index (0 for first column)
ICON | Icon index (0 for first column)
/xdid -m
This command lets you trigger the group view in the listview, which is off by default. (XP+)
Syntax: | /xdid -m [DNAME] [ID] [ENABLED]
Example: | /xdid -m dcx 4 1
/xdid -n
This command lets you change the Nth listview column width (report view only).
Syntax: | /xdid -n [DNAME] [ID] [N] [+FLAGS] (WIDTH)
Example: | /xdid -n dcx 4 2 + 100
Parameters:
N | Column index (0 for first column)
+FLAGS | Flags for column width.
a | Autosize.
h | Autosize according to header text width.
s | Autosize the column to fit header or content. Cannot be used with +a.
WIDTH | Header width (Ignored if you use flags +a, +h or +s).
Note. If the flag +h is used for the last column, the column will be resized to the width of the control.
/xdid -q
This command lets you add a group to the listview. (XP+)
Syntax: | /xdid -q [DNAME] [ID] [N] [+FLAGS] [GROUPID] [GROUPTEXT]
Example: | /xdid -q dcx 4 1 +l 101 Group 101!
Parameters:
N | Group index order.
+FLAGS | Group flags.
c | Group text is centered.
l | Group text is left aligned.
r | Group text is right aligned.
GROUPID | ID that identifies the group when adding items in /xdid -a.
GROUPTEXT | Label for the group.
/xdid -r
This command lets you clear all the listview items.
Syntax: | /xdid -r [DNAME] [ID]
Example: | /xdid -r dcx 4
/xdid -t
This command lets you set the different column header text, width and alignment. (report style only)
Syntax: | /xdid -t [DNAME] [ID] [+FLAGS] [#ICON] [WIDTH] (TEXT) [TAB] [+FLAGS] [#ICON] [WIDTH] (TEXT) [TAB] ...
Example: | /xdid -t dcx 4 +l 2 130 column 1 $chr(9) +c 1 130 column 2 $chr(9) +rb 2 130 column 3
Parameters:
+FLAGS | Item flags.
b | Header icon appears right of text.
c | Header text is centered.
l | Header text is left justified.
r | Header text is right justified.
ICON | Icon index number from the icon list (0 for no icon).
WIDTH | Column width in pixels.
Note. The leftmost column is always left aligned. If you want a leftmost column aligned other than left, create a zero width left dummy column. If you re-issue this command while the listview is populated, all the data except the first column will disappear, so you will have to refill the list. If the flag +h is used for the last column, the column will be resized to the width of the control.
/xdid -u
This command makes the currently selected listview item unselected.
Syntax: | /xdid -u [DNAME] [ID]
Example: | /xdid -u dcx 4
/xdid -v
This command lets you change the listview item text. If the target item is a DCX ProgressBar, then this allows you to send /xdid commands to the embedded ProgressBar.
Syntax: | /xdid -v [DNAME] [ID] [N] [NSUB] (TEXT)
Example: | /xdid -v dcx 4 1 2 5
Parameters:
N | Item row.
NSUB | Column index. (0 for first column)
TEXT | Item Text, or command to send to ProgressBar.
Note. Use TEXT as -v 80 to set the value of a progress bar.
/xdid -w
This command lets you add an icon to the listview image lists.
Syntax: | /xdid -w [DNAME] [ID] [+FLAGS] [INDEX] [FILENAME]
Example: | /xdid -w dcx 4 +n 113 C:/mIRC/shell.dll
Parameters:
+FLAGS | Image list flags.
n | Normal icon list.
s | State icon list.
g | Convert to grayscale icon.
INDEX | Icon index in icon archive
FILENAME | Icon archive filename
Note. Use 0 for INDEX if the file is a single icon file.
/xdid -y
This command lets you clear the listview image lists.
Syntax: | /xdid -y [DNAME] [ID] [+FLAGS]
Example: | /xdid -y dcx 4 +ns
Parameters:
+FLAGS | Image list flags
n | Normal icon list.
s | State icon list.
/xdid -z
This command lets you sort the data in the listview control.
Syntax: | /xdid -z [DNAME] [ID] [+FLAGS] [COLUMN] (ALIAS)
Example: | /xdid -z dcx 4 +ca 2 lvsort
Parameters:
+FLAGS | Sort flags.
a | Ascendant order sorting. (Default)
c | Custom sorting provided by ALIAS.
d | Descendant order sorting.
n | Numerical sorting.
s | Case-sensitive sorting. (With Alpha-numeric)
t | Alpha-numeric sorting. (Default)
COLUMN | Column to be used for sorting.
ALIAS | Alias name to be called in the case of custom sorting.
Note. ALIAS is not needed if not using a custom sorting algorithm. When using +c, sorted values given by $1 and $2 into ALIAS. The custom alias must return the following values for the comparison of custom values. The ascendant or descendant order is managed by the DLL with the given values returned. $1 < $2 return -1 $1 > $2 return 1 $1 == $2 return 0
/xdid -B
This command lets you force label editing on a listview item.
Syntax: | /xdid -B [DNAME] [ID] [N]
Example: | /xdid -B dcx 4 3
Note. You must give the listview focus before forcing the item editing mode.
$xdid() Properties
The $xdid identifier is a given mIRC alias that communicates with the DCX DLL to extract information in DCX controls.
$xdid().columns
This property lets you retreive the number of columns for the listview.
Syntax: | $xdid(dialog, ID).columns
Example: | $xdid(dcx, 4).columns
Note. If a listview is not a report listview, this will return 0. If a listview has noheader, this will return 0.
$xdid().find
This property lets you retreive the listview item index and column index of the Nth found listview item matching the input search patern.
Syntax: | $xdid(dialog, ID, [TAB]Matchtext[TAB], T, M, N).find
Example: | $xdid(dcx, 4, $chr(9) *Item* $chr(9), W, 0, 3).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 or wildcard string.
W | Matchtext is a wildcard string.
R | Matchtext is a regex patern.
M | Parameter indicating the column to search.
N | Parameter indicating to return the Nth match.
Note. If M is 0, searchs through all columns. If N is 0, returns the total number of matching items. The [TAB] characters surrounding the matchtext are mandatory or else it wont work. The global search including all columns goes left to right, line by line, starting at the top.
$xdid().genabled
This property lets you retreive whether groups are enabled or not.
Syntax: | $xdid(dialog, ID).genabled
Example: | $xdid(dcx, 4).genabled
$xdid().hicon
This property lets you retreive the Nth listview header icon index.
Syntax: | $xdid(dialog, ID, N).hicon
Example: | $xdid(dcx, 4, 2).hicon
$xdid().htext
This property lets you retreive the Nth listview header text.
Syntax: | $xdid(dialog, ID, N).htext
Example: | $xdid(dcx, 4, 2).htext
$xdid().hwidth
This property lets you retreive the Nth listview header width.
Syntax: | $xdid(dialog, ID, N).hwidth
Example: | $xdid(dcx, 4, 2).hwidth
$xdid().icon
This property lets you retreive a Nth listview item icon number.
Syntax: | $xdid(dialog, ID, N, NSUB).icon
Example: | $xdid(dcx, 4, 1, 2).icon
Note. Use NSUB value of 0 for the first column item icon.
$xdid().mouseitem
This property lets you retreive the item index over which the mouse pointer is.
Syntax: | $xdid(dialog, ID).mouseitem
Example: | $xdid(dcx, 4).mouseitem
Note. Returns 0 if mouse is not over any item.
$xdid().num
This property lets you retreive the number of items of a listview.
Syntax: | $xdid(dialog, ID).num
Example: | $xdid(dcx, 4).num
$xdid().pbar
This property lets you retreive ProgressBar properties from a specific cell.
Syntax: | $xdid(dialog, ID, N, NSUB, PBARPROP).pbar
Example: | $xdid(dcx, 4, 3, 0, value).pbar
$xdid().sel
This property lets you retreive the indexes of selected items in the listview.
Syntax: | $xdid(dialog, ID, (N)).sel
Example: | $xdid(dcx, 4, 2).sel
Parameters:
N | Optional parameter allowing you to obtain the Nth selected index.
Note. If the listview is multiline, and N is not supplied, then this command will return a comma-separated list of the selected indexes. If N is 0, then this will return the number of lines selected. (Same as $xdid().selnum) When using this property without N, the result is limited to 900 characters. This is due to an implementation that mIRC has imposed on DLL communication, so it is advised to use the N parameter to prevent inaccurate results.
$xdid().selnum
This property lets you retreive the number of selected items in the listview.
Syntax: | $xdid(dialog, ID).selnum
Example: | $xdid(dcx, 4).selnum
$xdid().seltext
This property lets you retreive the selected listview item text.
Syntax: | $xdid(dialog, ID, NSUB).seltext
Example: | $xdid(dcx, 4).seltext
Note. Use NSUB value of 0 for the first column item text.
$xdid().state
This property lets you retreive the check item state of the Nth listview item.
Syntax: | $xdid(dialog, ID, N).state
Example: | $xdid(dcx, 4, 2).state
Note. If you are not using the checkbox style, the value returned is the state icon value. Otherwise, returns 2 (checked), 1 (unchecked), or 0 (no check).
$xdid().tbitem
This property lets you retreive top and bottom visible item indexes.
Syntax: | $xdid(dialog, ID).tbitem
Example: | $xdid(dcx, 4).tbitem
Note. Returns 0 for no items or error.
$xdid().text
This property lets you retreive a Nth listview item text.
Syntax: | $xdid(dialog, ID, N, NSUB).text
Example: | $xdid(dcx, 4, 1, 2).text
Note. Use NSUB value of 0 for the first column item text.
Listview Events
These events are fired when activity occurs in the Listview control.
dclick
When an item is double clicked
Syntax: | /cb_alias DNAME dclick ID ITEM SUBITEM
Example: | /cb_alias dcx dclick 4
Parameters:
ITEM | Item number where the event was triggered.
SUBITEM | Column index where the event was triggered.
Note. This event does not require an item to be clicked on to be triggered. If no item was double clicked, no index is returned.
hdclick
When the user double clicks on a header item in the listview.
Syntax: | /cb_alias DNAME hdclick ID N
Example: | /cb_alias dcx hdclick 4
Parameters:
N | Header item index.
help
Launched when you click on a control using the ? contexthelp button.
Syntax: | /cb_alias DNAME help ID
Example: | /cb_alias dcx help 4
hover
When the mouse is hovering over the listview.
Syntax: | /cb_alias DNAME hover ID ITEM SUBITEM
Example: | /cb_alias dcx hover 4
Parameters:
ITEM | Item number where the event was triggered.
SUBITEM | Column index where the event was triggered.
Note. This event does not require an item to be hovered over to be triggered. If the mouse is not over an item, no index is returned.
hsclick
When the user clicks on a header item in the listview.
Syntax: | /cb_alias DNAME hsclick ID N
Example: | /cb_alias dcx hsclick 4
Parameters:
N | Header item index.
labelbegin
When item text label editing begins.
Syntax: | /cb_alias DNAME labelbegin ID
Example: | /cb_alias dcx labelbegin 4
Return | noedit to block label editing.
labelcancel
When the user presses ESC while editing or clicks somewhere else without editing the text.
Syntax: | /cb_alias DNAME labelcancel ID
Example: | /cb_alias dcx labelcancel 4
labelend
When the user clicks elsewhere or presses RETURN while editing or clicks somewhere else but edited the text.
Syntax: | /cb_alias DNAME labelend ID VALUE
Example: | /cb_alias dcx labelend 4
Parameters:
VALUE | Edited text label.
Return | noedit to cancel label editing (for example if string is NULL or invalid to your application).
rclick
When the listview is right clicked.
Syntax: | /cb_alias DNAME rclick ID ITEM SUBITEM
Example: | /cb_alias dcx rclick 4
Parameters:
ITEM | Item number where the event was triggered.
SUBITEM | Column index where the event was triggered.
Note. This event does not require an item to be clicked on to be triggered. If no item was right clicked, no index is returned.
rdclick
When the listview is double right-clicked.
Syntax: | /cb_alias DNAME rdclick ID ITEM SUBITEM
Example: | /cb_alias dcx rdclick 4
Parameters:
ITEM | Item number where the event was triggered.
SUBITEM | Column index where the event was triggered.
Note. This event does not require an item to be clicked on to be triggered. If no item was double-right clicked, no index is returned.
sclick
When an item is single clicked.
Syntax: | /cb_alias DNAME sclick ID ITEM SUBITEM
Example: | /cb_alias dcx sclick 4
Parameters:
ITEM | Item number where the event was triggered.
SUBITEM | Column index where the event was triggered.
Note. This event does not require an item to be clicked on to be triggered. If no item was clicked clicked, no index is returned.
scrollend
When the user has finished scrolling the vertical scrollbar in the listview.
Syntax: | /cb_alias DNAME scrollend ID
Example: | /cb_alias dcx scrollend 4
stateclick
When a checkbox is clicked.
Syntax: | /cb_alias DNAME stateclick ID ITEM
Example: | /cb_alias dcx stateclick 4
Parameters:
ITEM | Item number where the event was triggered.
trackbegin
When a header item is being resized.
Syntax: | /cb_alias DNAME trackbegin ID
Example: | /cb_alias dcx trackbegin 4
Return | notrack to cancel label editing (for example if string is NULL or invalid to your application).
| Control Styles alignleft aligntop autoarrange balloon borderselect checkbox editlabel flatsb fullrow grid headerdrag hottrack icon list noheader nolabelwrap noscroll report showsel singlesel smallicon sortasc sortdesc subitemimage tooltip /xdid Flags -a -c -d -g -i -j -k -l -m -n -q -r -t -u -v -w -y -z -B $xdid() Properties columns find genabled hicon htext hwidth icon mouseitem num pbar sel selnum seltext state tbitem text Events dclick hdclick help hover hsclick labelbegin labelcancel labelend rclick rdclick sclick scrollend stateclick trackbegin

Contact | © 2005-2006 | Last Updated: 14th January, 07