[r8981]: docs / trunk / oodialog / en-US / listbox.xml  Maximize  Restore  History

Download this file

1435 lines (1286 with data), 53.7 kB

   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
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "oodialog.ent">
%BOOK_ENTITIES;
]>
<!--#########################################################################
#
# Description: Open Object Rexx: ooDialog Reference XML file.
#
# Copyright (c) 2005-2013 Rexx Language Association. All rights reserved.
# Portions Copyright (c) 2004, IBM Corporation. All rights reserved.
#
# This program and the accompanying materials are made available under
# the terms of the Common Public License v1.0 which accompanies this
# distribution. A copy is also available at the following address:
# http://www.oorexx.org/license.html
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the distribution.
#
# Neither the name of Rexx Language Association nor the names
# of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#########################################################################
-->
<chapter id="clsListBox" xreflabel="ListBox"><title>List Box Controls</title>
<indexterm><primary>ListBox class</primary></indexterm>
<para>The <computeroutput>ListBox</computeroutput> class provides methods to query and
modify list box controls.
</para>
<para>
In addition to the methods of the class itself, the following methods from other classes in the ooDialog framework are
needed, or are useful, when working with list box controls:
<variablelist>
<varlistentry><term><emphasis role="bold">Instantiation:</emphasis></term>
<listitem>
<para>
Use the <xref linkend="mthNewListBox"/>() method of the
<xref linkend="chpDialogObject"/> object to retrieve a list box object.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Dynamic Definition:</emphasis></term>
<listitem>
<para>
To dynamically create a list box in the dialog template of a <xref linkend="clsUserDialog"/> use
the <xref linkend="mthCreateListBox"/> method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Event Notification</emphasis></term>
<listitem>
<para>
To connect the <xref linkend="ovvEvents"/> notifications sent by the underlying list box control to a
method in the Rexx dialog object use the <xref linkend="mthConnectListBoxEvent"/>)
method.
</para>
</listitem></varlistentry>
</variablelist>
</para>
<section id="sctMethodsListBox"><title>Method Table</title>
<para>
The following table provides links to the documentation for the primary methods and attributes used in working
with ListBox objects, including the pertinent methods from other classes:
</para>
<table id="tblListBoxMethods" frame="all">
<title>ListBox Methods and Attributes</title>
<tgroup cols="2">
<colspec colwidth="1*" />
<colspec colwidth="3*" />
<thead>
<row>
<entry>Method</entry>
<entry>Documentation</entry>
</row>
</thead>
<tbody>
<row>
<entry align="center"><emphasis role="bold">Useful External Methods</emphasis></entry>
<entry align="center"><emphasis role="bold"></emphasis></entry>
</row>
<row>
<entry><xref linkend="tmthNewListBox"/></entry>
<entry>Obtains a ListBox object that represents a list box control in a dialog.</entry>
</row>
<row>
<entry><xref linkend="tmthCreateListBox"/></entry>
<entry>Creates a list box control in an <xref linkend="clsUserDialog"/>.</entry>
</row>
<row>
<entry><xref linkend="tmthConnectListBoxEvent"/></entry>
<entry>Connects ListBox event notifications to a Rexx dialog method.</entry>
</row>
<row>
<entry align="center"><emphasis role="bold">Instance Methods</emphasis></entry>
<entry align="center"><emphasis role="bold"></emphasis></entry>
</row>
<row>
<entry><xref linkend="mthAddClsListBox"/></entry>
<entry>Adds a new item to the list.</entry>
</row>
<row>
<entry><xref linkend="mthAddDirectoryClsListBox"/></entry>
<entry>Adds all or selected file names of a given directory to the list box.</entry>
</row>
<row>
<entry><xref linkend="mthColumnWidthEquals"/></entry>
<entry>Sets the width, in dialog units, of the list box columns in a multicolumn list box control. <emphasis role="bold">(Inaccurate.)</emphasis></entry>
</row>
<row>
<entry><xref linkend="mthColumnWidthPxEquals"/></entry>
<entry>Sets the width, in pixels, of the list box columns in a multicolumn list box control.</entry>
</row>
<row>
<entry><xref linkend="mthDeleteClsListBox"/></entry>
<entry>Removes a list item from the associated list box.</entry>
</row>
<row>
<entry><xref linkend="mthDeleteAllClsListBox"/></entry>
<entry>Removes all list items from the associated list box.</entry>
</row>
<row>
<entry><xref linkend="mthDeSelectIndex"/></entry>
<entry>Deselects the list entry at the specified position for multiple selection listboxes.</entry>
</row>
<row>
<entry><xref linkend="mthDeSelectRange"/></entry>
<entry>Removes the selection for one or more consecutive items of the associated multiselection list box.</entry>
</row>
<row>
<entry><xref linkend="mthFindClsListBox"/></entry>
<entry>Searches the list box for a list entry containing a specified text.</entry>
</row>
<row>
<entry><xref linkend="mthGetFirstVisible"/></entry>
<entry>Retrieves the index of the first visible list item in the list box.</entry>
</row>
<row>
<entry><xref linkend="mthGetTextClsListBox"/></entry>
<entry>Gets the text of the list item at the specified position in the list box.</entry>
</row>
<row>
<entry><xref linkend="mthHitTestInfoClsListBox"/></entry>
<entry>Determines the one-based index of the item nearest the specified point in this list box.</entry>
</row>
<row>
<entry><xref linkend="mthInsertClsListBox"/></entry>
<entry>Inserts a new item into the list after the specified item.</entry>
</row>
<row>
<entry><xref linkend="mthItemHeight"/></entry>
<entry>Retrieves the height, in dialog units, of the items in the list box. <emphasis role="bold">(Inaccurate.)</emphasis></entry>
</row>
<row>
<entry><xref linkend="mthItemHeightPx"/></entry>
<entry>Retrieves the height, in pixels, of the items in the list box.</entry>
</row>
<row>
<entry><xref linkend="mthItemHeightEquals"/></entry>
<entry>Sets the height, in dialog units, of the items in the list box. <emphasis role="bold">(Inaccurate.)</emphasis></entry>
</row>
<row>
<entry><xref linkend="mthItemHeightPxEquals"/></entry>
<entry>Sets the height, in pixels, of the items in the list box.</entry>
</row>
<row>
<entry><xref linkend="mthItemsClsListBox"/></entry>
<entry>Retrieves the number of items in the list box.</entry>
</row>
<row>
<entry><xref linkend="mthMakeFirstVisibleClsListBox"/></entry>
<entry>Scrolls the list box so the specified item is at the top of the visible range.</entry>
</row>
<row>
<entry><xref linkend="mthModifyClsListBox"/></entry>
<entry>Changes the text of the list item at the specified position.</entry>
</row>
<row>
<entry><xref linkend="mthSelectClsListBox"/></entry>
<entry>Selects the list entry that matches the specified text.</entry>
</row>
<row>
<entry><xref linkend="mthSelectedClsListBox"/></entry>
<entry>Retrieves the text of the currently selected list entry.</entry>
</row>
<row>
<entry><xref linkend="mthIsSingleSelection"/></entry>
<entry>Determine if a list box is a single-selection list box.</entry>
</row>
<row>
<entry><xref linkend="mthSelectedIndexClsListBox"/></entry>
<entry>Retrieves the index of the currently selected list entry.</entry>
</row>
<row>
<entry><xref linkend="mthSelectedIndexes"/></entry>
<entry>Retrieves the indexes of all items that are currently selected in the
associated multiselection list box.</entry>
</row>
<row>
<entry><xref linkend="mthSelectedItemsClsListBox"/></entry>
<entry>Retrieves the number of items that are currently selected in the
associated multiselection list box.</entry>
</row>
<row>
<entry><xref linkend="mthSelectIndexClsListBox"/></entry>
<entry>Selects the list entry at the specified position.</entry>
</row>
<row>
<entry><xref linkend="mthSelectRange"/></entry>
<entry>Selects one or more consecutive items of the associated multiselection list box.</entry>
</row>
<row>
<entry><xref linkend="mthSetTabulators"/></entry>
<entry>Sets the tabulators for the associated list box control.</entry>
</row>
<row>
<entry><xref linkend="mthSetWidth"/></entry>
<entry>Sets the internal width, in dialog units, of the list box. <emphasis role="bold">(Inaccurate.)</emphasis></entry>
</row>
<row>
<entry><xref linkend="mthSetWidthPx"/></entry>
<entry>Sets the internal width, in pixel, of the list box.</entry>
</row>
<row>
<entry><xref linkend="mthWidth"/></entry>
<entry>Retrieves the internal width, in dialog units, of the associated list box. <emphasis role="bold">(Inaccurate.)</emphasis></entry>
</row>
<row>
<entry><xref linkend="mthWidthPx"/></entry>
<entry>Retrieves the internal width, in pixels, of the associated list box.</entry>
</row>
</tbody></tgroup>
</table>
</section>
<section id="tmthNewListBox" xreflabel="newListBox"><title>newListBox (dialog object method)</title>
<para>
<computeroutput>ListBox</computeroutput> objects can not be instantiated by the programmer from Rexx code using a <emphasis
role="italic">new</emphasis>() method. Rather, a list box object is obtained by using the
<xref linkend="mthNewListBox"/>() method of the <xref linkend="chpDialogObject"/>
object. The syntax is:
<programlisting>
<![CDATA[
>>--newListBox(--id--)---------------------------><
]]>
</programlisting>
</para>
</section> <!-- End Dialog::newListBox() (dialog object method) -->
<section id="tmthCreateListBox" xreflabel="createListBox"><title>createListBox (UserDialog method)</title>
<para>
A list box control can be created in the dialog template of a <xref linkend="clsUserDialog"/>
through the <xref linkend="mthCreateListBox"/> method. The basic syntax is:
<programlisting>
<![CDATA[
>>--createListBox(-id-,--x-,--y-,--cx-,--cy-+----------+-+-------------+--)----><
+-,--style-+ +-,--attrName-+
]]>
</programlisting>
</para>
</section> <!-- End UserDialog::createListBox() (UserDialog method) -->
<section id="tmthConnectListBoxEvent" xreflabel="connectListBoxEvent">
<title>connectListBoxEvent (dialog object method)</title>
<para>
To connect event notifications from a list box control use the
<xref linkend="mthConnectListBoxEvent"/> method of the
<xref linkend="chpDialogObject"/> object. The basic syntax is:
<programlisting> <![CDATA[
>>--connectListBoxEvent(--id--,--event--+----------------+--)------------------><
+--,-methodName--+
]]>
</programlisting>
</para>
</section> <!-- End EventNotification::connectListBoxEvent() (dialog object method) -->
<section id="mthAddClsListBox" xreflabel="add"><title>add</title>
<indexterm><primary>add</primary><secondary>ListBox class</secondary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>add</secondary></indexterm>
<programlisting>
<![CDATA[
>>--add(--listEntry--)---------------------------><
]]>
</programlisting>
<para>The add method adds a new item to the list. If
the list is not sorted, the new item is added to the end of the list.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>listEntry</term>
<listitem><para>A text string added to the list.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>A one-based index that specifies the position at which the entry has
been added, or 0 or a value less than 0 to indicate an error.
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::add() -->
<section id="mthAddDirectoryClsListBox" xreflabel="addDirectory"><title>addDirectory</title>
<indexterm><primary>addDirectory</primary><secondary>ListBox class</secondary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>addDirectory</secondary></indexterm>
<programlisting>
<![CDATA[
>>--addDirectory(--drvPath--+-------------------+--)---------------------------><
+-,-fileAttributes--+
]]>
</programlisting>
<para>
The addDirectory method adds all or selected file names of a given directory to the list box.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>drvPath [required]</term>
<listitem>
<para>
The drive, path, and name pattern.
</para>
</listitem></varlistentry>
<varlistentry><term>fileAttributes [optional]</term>
<listitem>
<para>
A list of 0 or more of the following keywords separated by spaces, case is not significant:
</para>
<para>
<simplelist type='vert' columns='3'>
<member>READWRITE</member>
<member>READONLY </member>
<member>HIDDEN </member>
<member>SYSTEM </member>
<member>DIRECTORY</member>
<member>ARCHIVE </member>
</simplelist>
<variablelist>
<varlistentry><term>READWRITE</term>
<listitem>
<para>
Normal read/write files. This is the default if this argument is omitted.
</para>
</listitem></varlistentry>
<varlistentry><term>READONLY</term>
<listitem>
<para>
Files that have the read-only bit.
</para>
</listitem></varlistentry>
<varlistentry><term>HIDDEN</term>
<listitem>
<para>
Files that have the hidden bit.
</para>
</listitem></varlistentry>
<varlistentry><term>SYSTEM</term>
<listitem>
<para>
Files that have the system bit.
</para>
</listitem></varlistentry>
<varlistentry><term>DIRECTORY</term>
<listitem>
<para>
Files that have the directory bit.
</para>
</listitem></varlistentry>
<varlistentry><term>ARCHIVE</term>
<listitem>
<para>
Files that have the archive bit.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The one-based index of the file added last to the list, or 0 if an error occurred.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
The following example puts the names of all read/write files with extension .REX in the given directory of the list
box:
<programlisting>
<![CDATA[
self~addDirectory(203, drive":\"path"\*.rex", "READWRITE")
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::addDirectory() -->
<section id="mthColumnWidthEquals" xreflabel="columnWidth="><title>columnWidth=</title>
<indexterm><primary>columnWidth=</primary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>columnWidth=</secondary></indexterm>
<programlisting>
<![CDATA[
>>--columnWidth = width--------------------------><
]]>
</programlisting>
<para>The columnWidth= method sets the width of the list
box columns in a multicolumn list box control, in dialog units.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>width</term>
<listitem><para>The width of all list box columns, in dialog units.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::columnWidth=() -->
<section id="mthColumnWidthPxEquals" xreflabel="columnWidthPx="><title>columnWidthPx=</title>
<indexterm><primary>columnWidthPx=</primary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>columnWidthPx=</secondary></indexterm>
<programlisting>
<![CDATA[
>>--columnWidthPx = width------------------------><
]]>
</programlisting>
<para>The columnWidthPx= method sets the width of the list
box columns in a multicolumn list box control, in pixels.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>width</term>
<listitem><para>The width of all list box columns, in pixels.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::columnWidthPx=() -->
<section id="mthDeleteClsListBox" xreflabel="delete"><title>delete</title>
<indexterm><primary>delete</primary><secondary>ListBox class</secondary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>delete</secondary></indexterm>
<programlisting>
<![CDATA[
>>--delete(--+-------+--)------------------------><
+-index-+
]]>
</programlisting>
<para>The delete method removes a list item from the
associated list box.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>index</term>
<listitem><para>The index (starting with 1) of the list item to be removed from the
list. If this argument is omitted, the currently selected item is deleted.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The number of remaining list items, or 0 to indicate an error.
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::delete() -->
<section id="mthDeleteAllClsListBox" xreflabel="deleteAll"><title>deleteAll</title>
<indexterm><primary>deleteAll</primary><secondary>ListBox class</secondary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>deleteAll</secondary></indexterm>
<programlisting>
<![CDATA[
>>--deleteAll------------------------------------><
]]>
</programlisting>
<para>The deleteAll method removes all list items from
the associated list box.</para>
</section> <!-- End ListBox::deleteAll() -->
<section id="mthDeSelectIndex" xreflabel="deSelectIndex"><title>deSelectIndex</title>
<indexterm><primary>deSelectIndex</primary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>deSelectIndex</secondary></indexterm>
<programlisting>
<![CDATA[
>>--deSelectIndex(--+-------+--)-----------------><
+-index-+
]]>
</programlisting>
<para>The deSelectIndex method deselects the list entry
at the specified position for multiple selection listboxes. The currently
selected list item is highlighted and surrounded by a dotted border.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>index</term>
<listitem><para>The index (starting with 1) of the list item to be deselected. If you
specify no index or 0 for this argument, all items are deselected.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>-1 if an error occurred.
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::deSelectIndex() -->
<section id="mthDeSelectRange" xreflabel="deSelectRange"><title>deSelectRange</title>
<indexterm><primary>deSelectRange</primary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>deSelectRange</secondary></indexterm>
<programlisting>
<![CDATA[
>>--deSelectRange(--+-------------+--+-------------+--)------------------------><
+-startIndex--+ +-,--endIndex-+
]]>
</programlisting>
<para>The deSelectRange method removes the selection
for one or more consecutive items of the associated multiselection list box.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The arguments are:</para>
<variablelist>
<varlistentry><term>startIndex</term>
<listitem><para>The position of the first list item to be deselected. If this argument
is omitted, the deselection range starts with the first item in the list.
</para></listitem></varlistentry>
<varlistentry><term>endIndex</term>
<listitem><para>The position of the last list item to be deselected. If this argument
is omitted, the deselection range ends with the last item in the list.
</para></listitem></varlistentry>
</variablelist>
<para>If <emphasis role="italic">startIndex</emphasis> is equal to <emphasis role="italic">endIndex</emphasis>, a single item
of the list is deselected.</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>-1 if an error occurred. This can happen, for example, if the
list box is no multiselection list box.
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem><para>The following example deselects the items 1 through 5:</para>
<programlisting>
<![CDATA[
lb = self~newListBox("Offers")
if lb == .Nil then return
lb~deSelectRange(,6)
]]>
</programlisting>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::deSelectRange() -->
<section id="mthFindClsListBox" xreflabel="find"><title>find</title>
<indexterm><primary>find</primary><secondary>ListBox class</secondary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>find</secondary></indexterm>
<programlisting>
<![CDATA[
>>--find(--TextorPrefix--+---------------------------------+--)----------------><
+-,--+------------+--+----------+-+
+-startIndex-+ +-,--exact-+
]]>
</programlisting>
<para>The find method searches the list box for a list
entry containing the specified text or prefix. The search is caseless.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The arguments are:
<variablelist>
<varlistentry><term>TextorPrefix</term>
<listitem><para>The text or prefix for which the list is searched.
</para></listitem></varlistentry>
<varlistentry><term>startIndex</term>
<listitem><para>The first list item at which the search is to be started. When the search
reaches the bottom of the list, it is continued backward. If you omit this
argument or specify 0, the entire list is searched.
</para></listitem></varlistentry>
<varlistentry><term>exact</term>
<listitem><para>If you specify 1 or E, the text of the list item must exactly match
the text specified for <emphasis role="italic">TextorPrefix</emphasis>. If you omit this argument or
specify 0, the list entries are searched for a prefix that matches <emphasis role="italic">TextorPrefix</emphasis>.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The one-based index of the list entry that matches the search text,
or 0 if not found.
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::find() -->
<section id="mthGetFirstVisible" xreflabel="getFirstVisible"><title>getFirstVisible</title>
<indexterm><primary>getFirstVisible</primary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>getFirstVisible</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getFirstVisible------------------------------><
]]>
</programlisting>
<para>The getFirstVisible method retrieves the index
of the first list item visible in the list box.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The one-based index of the list box item visible first.
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::getFirstVisible() -->
<section id="mthGetTextClsListBox" xreflabel="getText"><title>getText</title>
<indexterm><primary>getText</primary><secondary>ListBox class</secondary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>getText</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getText(--index--)---------------------------><
]]>
</programlisting>
<para>The getText method gets the text of the list item
at the specified position in the list box.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>index</term>
<listitem><para>The one-based index of the list box item containing the text you are
interested in.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The text of the list box item at the given position, or an empty string
if the <emphasis role="italic">index</emphasis> does not refer to an item or an error occurred.
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::getText() -->
<section id="mthHitTestInfoClsListBox" xreflabel="hitTestInfo"><title>hitTestInfo</title>
<indexterm><primary>hitTestInfo</primary><secondary>ListBox class</secondary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>hitTestInfo</secondary></indexterm>
<programlisting>
<![CDATA[
Form 1:
>>--hitTestInfo(--pos--+---------+--)------------><
+-,-info--+
Form 2:
>>--hitTestInfo(--x--,--y--+---------+--)--------><
+-,-info--+
Generic Form:
>>--hitTestInfo(--hitPoint--+---------+--)-------><
+-,-info--+
]]>
</programlisting>
<para>
Determines the one-based index of the item nearest the specified point in this list box.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
</para>
<variablelist>
<varlistentry><term>hitPoint [required]</term>
<listitem>
<para>
The point, in client <xref linkend="defScreenCoordinates"/>, to test.
</para>
</listitem></varlistentry>
<varlistentry><term>info [optional in / out]</term>
<listitem>
<para>
A <computeroutput>.Directory</computeroutput> object in which additional information concerning the hit test
will be returned. This argument can be omitted if the additional information is not needed. When the argument is
used, on return <emphasis role="italic">info</emphasis> will contain the following indexes:
</para>
<variablelist>
<varlistentry><term>INCLIENTAREA</term>
<listitem>
<para>
The value of this index will be true or false. It will be true when the hit point is within the client area of the
list box and false if the point is not within the client area.
</para>
</listitem></varlistentry>
<varlistentry><term>ITEMINDEX</term>
<listitem>
<para>
The index of the item closest to the point specified. This value will be the same as the return value from the
method.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The one-base index of the list box item that is closet to the point specified.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
It is important to realize that no matter where the point specified is, there will <emphasis
role="italic">always</emphasis> be an item that is closest to it. The return value of this method will always be the
index of an item in the list box. Because of this, the <emphasis role="italic">info</emphasis> argument is usually
needed. The <emphasis role="italic">INCLIENTAREA</emphasis> index is really the only way to know if a list box item is
under the specified point.
</para>
<para>
Another point that may not be evident at first glance. The item index returned will always be the index of an item
showing. That is, say the list box contains 12 items and the items are scrolled so that the items 1 through 3 are
scrolled to the top of the list box out of view. If the specified point has a y coordinate of -5, it might be expected
that the index returned will be 3, the item that would actually be under that point. The return will not be 3, it will be
4, the index of the item at the top of the viewable area in the list box.
</para>
<para>
The operating system accepts any point, even one that seems silly like (-7000, -6000).
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect usage is detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example returns the text of the list box item under the specified point, or .nil if the point is not over the list
box:
<programlisting>
<![CDATA[
::method textAtPoint
use strict arg point
lb = self~newListBox(IDC_LB_FNAME)
d = .Directory~new
index = lb~hitTestInfo(point, d)
if d~inClientArea then do
text = lb~getText(index)
return text
end
return .nil
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::hitTestInfo() -->
<section id="mthInsertClsListBox" xreflabel="insert"><title>insert</title>
<indexterm><primary>insert</primary><secondary>ListBox class</secondary></indexterm>
<indexterm><primary>insert</primary><secondary>ListBox class</secondary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>insert</secondary></indexterm>
<programlisting>
<![CDATA[
>>--insert(--+-------+--,--listEntry--)----------><
+-index-+
]]>
</programlisting>
<para>The insert method inserts a new item into the list
after the specified item.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The arguments are:
<variablelist>
<varlistentry><term>index</term>
<listitem><para>The index (starting with 1) of the list item after which the new item
is to be added. If this argument is omitted, the list entry is added after
the currently selected item.
</para></listitem></varlistentry>
<varlistentry><term>listEntry</term>
<listitem><para>A text string added to the list.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>A one-based index that specifies the position at which the entry has
been added, or 0 or a value less than 0 to indicate an error.
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::() -->
<section id="mthIsSingleSelection" xreflabel="isSingleSelection"><title>isSingleSelection</title>
<indexterm><primary>isSingleSelection</primary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>isSingleSelection</secondary></indexterm>
<programlisting>
<![CDATA[
>>--isSingleSelection----------------------------><
]]>
</programlisting>
<para>
Determine if a list box is a single-selection list box. In a single-selection list box,
the user can select only one item at a time.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
This method has no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns <computeroutput>.true</computeroutput> if the list box is a single-selection list box, otherwise
<computeroutput>.false</computeroutput>.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::isSingleSelection() -->
<section id="mthItemHeight" xreflabel="itemHeight"><title>itemHeight</title>
<indexterm><primary>itemHeight</primary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>itemHeight</secondary></indexterm>
<programlisting>
<![CDATA[
>>--itemHeight-----------------------------------><
]]>
</programlisting>
<para>The itemHeight method retrieves the height of the
items in the list box, in dialog units.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The height of the list box items, in dialog units.
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::itemHeight() -->
<section id="mthItemHeightEquals" xreflabel="itemHeight="><title>itemHeight=</title>
<indexterm><primary>itemHeight=</primary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>itemHeight=</secondary></indexterm>
<programlisting>
<![CDATA[
>>--itemHeight = height--------------------------><
]]>
</programlisting>
<para>The itemHeight= method sets the height of the items
in the list box, in dialog units.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>height</term>
<listitem><para>The height of all list box items, in dialog units.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::itemHeight=() -->
<section id="mthItemHeightPx" xreflabel="itemHeightPx"><title>itemHeightPx</title>
<indexterm><primary>itemHeightPx</primary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>itemHeightPx</secondary></indexterm>
<programlisting>
<![CDATA[
>>--itemHeightPx---------------------------------><
]]>
</programlisting>
<para>The itemHeightPx method retrieves the height of the
items in the list box, in pixels.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The height of the list box items, in pixels.
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::itemHeightPx() -->
<section id="mthItemHeightPxEquals" xreflabel="itemHeightPx="><title>itemHeightPx=</title>
<indexterm><primary>itemHeightPx=</primary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>itemHeightPx=</secondary></indexterm>
<programlisting>
<![CDATA[
>>--itemHeightPx = height------------------------><
]]>
</programlisting>
<para>The itemHeightPx= method sets the height of the items
in the list box, in pixels.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>height</term>
<listitem><para>The height of all list box items, in pixels.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::itemHeightPx=() -->
<section id="mthItemsClsListBox" xreflabel="items"><title>items</title>
<indexterm><primary>items</primary><secondary>ListBox class</secondary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>items</secondary></indexterm>
<programlisting>
<![CDATA[
>>--items----------------------------------------><
]]>
</programlisting>
<para>The items method retrieves the number of items
in the list box.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The number of items in the list box.
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::items() -->
<section id="mthMakeFirstVisibleClsListBox" xreflabel="makeFirstVisible"><title>makeFirstVisible</title>
<indexterm><primary>makeFirstVisible</primary><secondary>ListBox class</secondary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>makeFirstVisible</secondary></indexterm>
<programlisting>
<![CDATA[
>>--makeFirstVisible(--index--)------------------><
]]>
</programlisting>
<para>The makeFirstVisible method makes the list entry
at the specified position the first visible list item when you scroll up or
down.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>index</term>
<listitem><para>The one-based index of the list box item to be made first visible.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>-1 if an error occurred.
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::makeFirstVisible() -->
<section id="mthModifyClsListBox" xreflabel="modify"><title>modify</title>
<indexterm><primary>modify</primary><secondary>ListBox class</secondary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>modify</secondary></indexterm>
<programlisting>
<![CDATA[
>>--modify(--+-------+--,--newText--)------------><
+-index-+
]]>
</programlisting>
<para>The modify method changes the text of the list
item at the specified position in the list box.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The arguments are:
<variablelist>
<varlistentry><term>index</term>
<listitem><para>The one-based index of the list box item of which the text is to be
changed. If you omit this argument, the currently selected item is modified.
</para></listitem></varlistentry>
<varlistentry><term>newText</term>
<listitem><para>The new text string to be displayed at the given position.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The one-based index of the modified list box item at the given position.
The return value is 0 if an error occurred, or -1 if the <emphasis role="italic">index</emphasis>
does not refer to an item.
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::modify() -->
<section id="mthSelectClsListBox" xreflabel="select"><title>select</title>
<indexterm><primary>select</primary><secondary>ListBox class</secondary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>select</secondary></indexterm>
<programlisting>
<![CDATA[
>>--select(--itemText--)-------------------------><
]]>
</programlisting>
<para>The select method selects the list entry that matches
the specified text.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>itemText</term>
<listitem><para>The text that the list box is searched for.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>0 if an error occurred or a matching list entry was not found.
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::select() -->
<section id="mthSelectedClsListBox" xreflabel="selected"><title>selected</title>
<indexterm><primary>selected</primary><secondary>ListBox class</secondary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>selected</secondary></indexterm>
<programlisting>
<![CDATA[
>>--selected-------------------------------------><
]]>
</programlisting>
<para>The selected method retrieves the text of the currently
selected list entry.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The text of the currently selected list entry, or an empty string if
none is selected.
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::selected() -->
<section id="mthSelectedIndexClsListBox" xreflabel="selectedIndex"><title>selectedIndex</title>
<indexterm><primary>selectedIndex</primary><secondary>ListBox class</secondary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>selectedIndex</secondary></indexterm>
<programlisting>
<![CDATA[
>>--selectedIndex--------------------------------><
]]>
</programlisting>
<para>The selectedIndex method retrieves the
index of the currently selected list entry. This entry is highlighted and
surrounded by a dotted border. To get the selected items for a multiple selection
listbox, use getListBoxData; see <xref linkend="mthGetListBoxData"/>.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The one-based index of the currently selected list entry, or 0 if none
is selected.
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::selectedIndex() -->
<section id="mthSelectedIndexes" xreflabel="selectedIndexes"><title>selectedIndexes</title>
<indexterm><primary>selectedIndexes</primary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>selectedIndexes</secondary></indexterm>
<programlisting>
<![CDATA[
>>--selectedIndexes------------------------------><
]]>
</programlisting>
<para>The selectedIndexes method retrieves the indexes
of all items that are currently selected in the associated multiselection
list box.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>A text string containing the indexes of the selected items in the list,
separated by blanks.
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem><para>The following example lists all items selected in the associated multiselection
list box:
<programlisting>
<![CDATA[
lb = self~newListBox("Offers")
if lb == .Nil then return
sit = lb~selectedItems
if sit > 0 then do
say "You ordered:"
sndx = lb~selectedIndexes
do i = 1 to sit
parse var sndx order sndx
say "1 x" lb~getText(order)
end
end
]]>
</programlisting>
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::selectedIndexes() -->
<section id="mthSelectedItemsClsListBox" xreflabel="selectedItems"><title>selectedItems</title>
<indexterm><primary>selectedItems</primary><secondary>ListBox class</secondary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>selectedItems</secondary></indexterm>
<programlisting>
<![CDATA[
>>--selectedItems--------------------------------><
]]>
</programlisting>
<para>The selectedItems method retrieves the number of
items that are currently selected in the associated multiselection list box.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The number of selected items, or -1 if this method fails, for
example if the list box is no multiselection list box.
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem><para>For an example, refer to <xref linkend="mthSelectedIndexes"/>.
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::selectedItems() -->
<section id="mthSelectIndexClsListBox" xreflabel="selectIndex"><title>selectIndex</title>
<indexterm><primary>selectIndex</primary><secondary>ListBox class</secondary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>selectIndex</secondary></indexterm>
<programlisting>
<![CDATA[
>>--selectIndex(--index--)-----------------------><
]]>
</programlisting>
<para>The selectIndex method selects the list
entry at the specified position. The currently selected list item is highlighted
and surrounded by a dotted border. To select multiple items of a multiple
selection listbox, use the <xref linkend="mthSetListBoxData"/>() method.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>index</term>
<listitem><para>The index (starting with 1) of the list item to be selected. If you
specify 0 for this argument, the list box must not contain any selection.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>0 if an error occurred or you specified 0 for <emphasis role="italic">index</emphasis> to remove
the selection.
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::selectIndex() -->
<section id="mthSelectRange" xreflabel="selectRange"><title>selectRange</title>
<indexterm><primary>selectRange</primary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>selectRange</secondary></indexterm>
<programlisting>
<![CDATA[
>>--selectRange(--+-------------+--+-------------+--)--------------------------><
+-startIndex--+ +-,--endIndex-+
]]>
</programlisting>
<para>The selectRange method selects one or more consecutive
items of the associated multiselection list box.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The arguments are:</para>
<variablelist>
<varlistentry><term>startIndex</term>
<listitem><para>The position of the first list item to be selected. If this argument
is omitted, the selection range starts with the first item in the list.
</para></listitem></varlistentry>
<varlistentry><term>endIndex</term>
<listitem><para>The position of the last list item to be selected. If this argument
is omitted, the selection range ends with the last item in the list.
</para></listitem></varlistentry>
</variablelist>
<para>If <emphasis role="italic">startIndex</emphasis> is equal to <emphasis role="italic">endIndex</emphasis>, a single item
of the list is selected.</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>-1 if an error occurred. This can happen, for example, if the
list box is not a multiselection list box.
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem><para>The following example selects the items 5 through 9:</para>
<programlisting>
<![CDATA[
lb = self~newListBox("Offers")
if lb == .Nil then return
lb~selectRange(5,9)
]]>
</programlisting>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::selectRange() -->
<section id="mthSetTabulators" xreflabel="setTabulators"><title>setTabulators</title>
<indexterm><primary>setTabulators</primary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>setTabulators</secondary></indexterm>
<programlisting>
<![CDATA[
+-,------+
V |
>>--setTabulators(----tabPos-+--)----------------><
]]>
</programlisting>
<para>The setTabulators method sets the tabulators for
the associated list box control. This enables you to use items containing
tab characters ("09"x), which is useful if you want to format the
list in more than one column when using proportional fonts.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>tabPos</term>
<listitem><para>The position or positions of the tabs relative to the left edge of the
list box, in dialog units.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>1 if an error occurred.
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem><para>The following example creates a list that can handle up to three tabulators
in a list entry. The tabulator positions are 10, 20, and 30.
<programlisting>
<![CDATA[
lb = MyDialog~newListBox(102)
if lb == .Nil then return
lb~setTabulators(10, 20, 30)
lb~add(textcol1 || "09"x || textcol2 || "09"x || textcol3 || "09"x ||,
textcol4)
]]>
</programlisting>
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::setTabulators() -->
<section id="mthSetWidth" xreflabel="setWidth"><title>setWidth</title>
<indexterm><primary>setWidth</primary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>setWidth</secondary></indexterm>
<programlisting>
<![CDATA[
>>--setWidth(--width--)--------------------------><
]]>
</programlisting>
<para>The setWidth method sets the internal width of
the list box, in dialog units. If the internal width exceeds the width of
the list box control and the list box has the HSCROLL style, the list box
provides a horizontal scroll bar.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>width</term>
<listitem><para>The width of the list box, in dialog units.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem><para>The following example sets the internal width twice the width of the
list box control:
<programlisting>
<![CDATA[
lb = MyDialog~newListBox(102)
if lb == .Nil then return
lb~setWidth(lb~SizeX*2)
]]>
</programlisting>
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::setWidth() -->
<section id="mthSetWidthPx" xreflabel="setWidthPx"><title>setWidthPx</title>
<indexterm><primary>setWidthPx</primary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>setWidthPx</secondary></indexterm>
<programlisting>
<![CDATA[
>>--setWidthPx(--width--)------------------------><
]]>
</programlisting>
<para>The setWidthPx method sets the internal width of
the list box, in pixels. If the internal width exceeds the width of
the list box control and the list box has the HSCROLL style, the list box
provides a horizontal scroll bar.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>width</term>
<listitem><para>The width of the list box, in pixels.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::setWidthPx() -->
<section id="mthWidth" xreflabel="width"><title>width</title>
<indexterm><primary>width</primary><secondary>ListBox class</secondary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>width</secondary></indexterm>
<programlisting>
<![CDATA[
>>--width----------------------------------------><
]]>
</programlisting>
<para>The width method retrieves the internal width of
the associated list box, in dialog units.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The internal width of the list box, in dialog units, or 0 if an error
occurred.
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::width() -->
<section id="mthWidthPx" xreflabel="widthPx"><title>widthPx</title>
<indexterm><primary>widthPx</primary></indexterm>
<indexterm><primary>ListBox class</primary><secondary>width</secondary></indexterm>
<programlisting>
<![CDATA[
>>--widthPx--------------------------------------><
]]>
</programlisting>
<para>The widthPx method retrieves the internal width of
the associated list box, in pixels.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The internal width of the list box, in pixels, or 0 if an error
occurred.
</para></listitem></varlistentry>
</variablelist>
</section> <!-- End ListBox::widthPx() -->
</chapter>

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks