File: 298.htm

package info (click to toggle)
eagle 4.16-5
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k
  • size: 36,508 kB
  • sloc: sh: 82; makefile: 32
file content (94 lines) | stat: -rw-r--r-- 3,935 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<html>
<head>
<title>EAGLE Help: dlgListView</title>
</head>
<body bgcolor=white>
<font face=Helvetica,Arial>
<hr>
<i>EAGLE Help</i>
<h1><center>dlgListView</center></h1>
<hr>
<dl>
<dt>
<b>Function</b>
<dd>
Defines a multi column list view selection field.
<p>
<dt>
<b>Syntax</b>
<dd>
<tt>dlgListView(string Headers, string array[], int &amp;Selected[, int &amp;Sort]) [ <i>statement</i> ]</tt>
<p>
<dt>
<b>Description</b>
<dd>
The <tt>dlgListView</tt> statement defines a multi column list view selection field with the contents
of the given <tt>array</tt>.
<p>
<tt>Headers</tt> is the tab separated list of column headers.
<p>
<tt>Selected</tt> reflects the index of the selected list view entry in the <tt>array</tt>
(the sequence in which the entries are actually displayed may be different, because the contents
of a <tt>dlgListView</tt> can be sorted by the various columns).
The first entry has index <tt>0</tt>.<br>
If no particular entry shall be initially selected, <tt>Selected</tt> should be
initialized to <tt>-1</tt>.
<p>
<tt>Sort</tt> defines which column should be used to sort the list view. The leftmost
column is numbered <tt>1</tt>. The sign of this parameter defines the direction in which
to sort (positive values sort in ascending order). If <tt>Sort</tt> is <tt>0</tt> or
outside the valid number of columns, no sorting will be done. The returned value of
<tt>Sort</tt> reflects the column and sort mode selected by the user by clicking
on the list column headers. By default <tt>dlgListView</tt> sorts by the first
column, in ascending order.
<p>
Each element of <tt>array</tt> defines the contents of one line in the list view,
and must contain tab separated values. If there are fewer values in an element of <tt>array</tt>
than there are entries in the <tt>Headers</tt> string the remaining fields will be empty.
If there are more values in an element of <tt>array</tt> than there are entries in the
<tt>Headers</tt> string the superfluous elements will be silently dropped.
None of the strings in <tt>array</tt> may be empty (if there is an empty string,
all strings after and including that one will be dropped).
<p>
The optional <tt>statement</tt> is executed whenever the user double clicks on an entry
of the <tt>dlgListView</tt>.<br>
Before the <tt>statement</tt> is executed, all variables that have been used with dialog objects
are updated to their current values, and any changes made to these variables inside the
<tt>statement</tt> will be reflected in the dialog when the statement returns.
<p>
If the initial value of <tt>Selected</tt> is outside the range of the <tt>array</tt>
indexes, no entry will be selected.
<p>
If <tt>Headers</tt> is an empty string, the first element of the <tt>array</tt> is used
as the header string. Consequently the index of the first entry is then <tt>1</tt>.
<p>
The contents of a <tt>dlgListView</tt> can be sorted by any column by clicking on
that column's header. Columns can also be swapped by "click&amp;dragging" a column
header. Note that none of these changes will have any effect on the contents of the
<tt>array</tt>.
If the contents shall be sorted alphanumerically a <tt>numeric string[]</tt> array
can be used.
<p>
</dl>
<b>See also</b> <a href=297.htm>dlgListBox</a>,
<a href=296.htm>dlgLabel</a>,
<a href=311.htm>Layout Information</a>,
<a href=318.htm>A Complete Example</a>
<p>
<b>Example</b>
<pre>
string Colors[] = { "red\tThe color RED", "green\tThe color GREEN", "blue\tThe color BLUE" };
int Selected = 0; // initially selects "red"
dlgListView("Name\tDescription", Colors, Selected) dlgMessageBox("You have selected " + Colors[Selected]);
</pre>

<hr>
<table width=100% cellspacing=0 border=0><tr><td align=left><font face=Helvetica,Arial>
<a href=index.htm>Index</a>
</font></td><td align=right><font face=Helvetica,Arial size=-1>
<i>Copyright &copy; 2005 CadSoft Computer GmbH</i>
</font></td></tr></table>
<hr>
</font>
</body>
</html>