Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[r8598]: docs / trunk / oodialog / en-US / tab.xml Maximize Restore History

Download this file

tab.xml    1634 lines (1487 with data), 58.2 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
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
<?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-2012, 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="clsTab" xreflabel="Tab"><title>Tab Controls</title>
<indexterm><primary>Tab class</primary></indexterm>
<para>
A tab in a tab control is similar to a label in a file cabinet or divider in a notebook. Using a tab control the
programmer can define several pages for the same area in a dialog. When the user selects one of the tabs in the tab
control, the page for that tab is displayed. Individual pages can contain their own set of dialog controls or
information.
</para>
<para>
A tab control consists of the tabs and a display area. The tabs occupy a row (or rows) along the edge of the display
area. Each tab consists of a label and an icon. Tabs can be added and removed. Tabs are identified by their index. In
ooDialog, the indexes are zero-based rather than one-based as is normal in Rexx. Because of backwards compatibility,
this can not be changed.
</para>
<para>
There is a special type of tab control with tabs that look like buttons. Clicking a button immediately performs a
command instead of displaying a page.
</para>
<para>
As usual in Windows controls, there are a number of different styles for the tab control. For instance, by default a
tab control will only display one row of tabs. However, there is the MULTILINE style. A tab control with this style
will use multiple rows to display the tabs, so that all tabs are visible at once.
</para>
<para>
The <computeroutput>Tab</computeroutput> class provides methods to work with and manipulate the underlying
Windows tab dialog control which it represents. It is a concrete subclass of the dialog <xref linkend="chpDialogControlObject"/>
object and therefore has all methods of the dialog control object.
</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 tab controls:
<variablelist>
<varlistentry><term><emphasis role="bold">Instantiation:</emphasis></term>
<listitem>
<para>
Use the <xref linkend="tmthNewTab"/> method of the
<xref linkend="chpDialogObject"/> object to retrieve a new Tab object.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Dynamic Definition:</emphasis></term>
<listitem>
<para>
To dynamically define a tab in a <xref linkend="clsUserDialog"/> class, use the
<xref linkend="tmthCreateTab"/> 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 tab control to
a method in the Rexx dialog object use the <xref linkend="tmthConnectTabEvent"/> method.
</para> </listitem></varlistentry>
</variablelist> </para>
<section id="sctMethodsTab"><title>Method Table</title>
<para>
The following table provides links to the documentation for the primary methods and attributes used in working
with Tab objects, including the pertinent methods from other classes:
</para>
<table id="tblTabMethods" frame="all">
<title>Important Tab Methods</title>
<tgroup cols="2">
<colspec colwidth="1*" />
<colspec colwidth="4*" />
<thead>
<row>
<entry>Method</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry align="center"><emphasis role="bold">Useful</emphasis></entry>
<entry align="center"><emphasis role="bold"> External Methods</emphasis></entry>
</row>
<row>
<entry><xref linkend="tmthNewTab"/></entry>
<entry>Returns a <computeroutput>Tab</computeroutput> object for the control with the specified ID.</entry>
</row>
<row>
<entry><xref linkend="tmthCreateTab"/></entry>
<entry>Creates a tab control in the dialog template of a <xref linkend="clsUserDialog"/></entry>
</row>
<row>
<entry><xref linkend="tmthConnectTabEvent"/></entry>
<entry>Connects tab event notifications to a method in the Rexx dialog object</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="mthAddFullSeq"/></entry>
<entry>Inserts a sequence of 1 through N tabs into a tab control. The index for an icon in the imagelist for the tab can be included.</entry>
</row>
<row>
<entry><xref linkend="mthAddSequence"/></entry>
<entry>Inserts a sequence of 1 through N tabs into a tab control. The index for an icon can not be included.</entry>
</row>
<row>
<entry><xref linkend="mthAdjustToRectangle"/></entry>
<entry>Calculates the window rectangle of a tab control that corresponds to the specified display rectangle.</entry>
</row>
<row>
<entry><xref linkend="mthCalcDisplayArea"/></entry>
<entry>Takes the window rectangle of the tab control, and adjusts the rectangle to that needed for the display rectangle</entry>
</row>
<row>
<entry><xref linkend="mthCalcWindowRect"/></entry>
<entry>Takes a display rectangle and adjusts the rectangle to be that needed for tab control to contain the display rectangle.</entry>
</row>
<row>
<entry><xref linkend="mthDeleteTab"/></entry>
<entry>Removes a tab from a tab control.</entry>
</row>
<row>
<entry><xref linkend="mthDeleteAllTab"/></entry>
<entry>Removes all tabs from a tab control.</entry>
</row>
<row>
<entry><xref linkend="mthFocusTab"/></entry>
<entry>Sets the focus to the specified tab in a tab control.</entry>
</row>
<row>
<entry><xref linkend="mthFocusedTab"/></entry>
<entry>Returns the index of the tab that has the focus.</entry>
</row>
<row>
<entry><xref linkend="mthGetImageListTab"/></entry>
<entry>Retrieves the current image list from the tab control, if there is one.</entry>
</row>
<row>
<entry><xref linkend="mthGetItemRectClsTab"/></entry>
<entry>Gets the bounding rectangle for a tab in a tab control.</entry>
</row>
<row>
<entry><xref linkend="mthInsertTab"/></entry>
<entry>Inserts a new tab in a tab control.</entry>
</row>
<row>
<entry><xref linkend="mthIteminfoTab"/></entry>
<entry>Retrieves information about a tab in a tab control.</entry>
</row>
<row>
<entry><xref linkend="mthItemsTab"/></entry>
<entry>Retrieves the number of tabs in a tab control.</entry>
</row>
<row>
<entry><xref linkend="mthLastTab"/></entry>
<entry>Retrieves the index of the last tab in a tab control.</entry>
</row>
<row>
<entry><xref linkend="mthModifyTab"/></entry>
<entry>Sets some, or all, of the attributes of a tab.</entry>
</row>
<row>
<entry><xref linkend="mthPosRectangle"/></entry>
<entry>Retrieves the rectangle around a tab in a tab control.</entry>
</row>
<row>
<entry><xref linkend="mthRequiredWindowSize"/></entry>
<entry>Calculates the display rectangle of a tab control that corresponds to the specified window rectangle.</entry>
</row>
<row>
<entry><xref linkend="mthRows"/></entry>
<entry>Retrieves the current number of rows of tabs in a tab control.</entry>
</row>
<row>
<entry><xref linkend="mthSelectTab"/></entry>
<entry>Selects the tab with the specified label text.</entry>
</row>
<row>
<entry><xref linkend="mthSelectedTab"/></entry>
<entry>Retrieves the label text of the currently selected tab.</entry>
</row>
<row>
<entry><xref linkend="mthSelectedIndexTab"/></entry>
<entry>Retrieves the index of the currently selected tab.</entry>
</row>
<row>
<entry><xref linkend="mthSelectIndexTab"/></entry>
<entry>Selects a tab in the tab control.</entry>
</row>
<row>
<entry><xref linkend="mthSetImageListClsTabControl"/></entry>
<entry>Assigns, or removes, an image list for the tab control.</entry>
</row>
<row>
<entry><xref linkend="mthSetItemSize"/></entry>
<entry>Sets the width and height of the tabs in a fixed-width tab control.</entry>
</row>
<row>
<entry><xref linkend="mthSetPadding"/></entry>
<entry>Sets the amount of space (padding) around the icon and the label of a tab.</entry>
</row>
<row>
<entry><xref linkend="mthSetSize"/></entry>
<entry>Sets the width and height of the tabs in a fixed-width tab control.</entry>
</row>
</tbody></tgroup>
</table>
</section>
<section id="tmthNewTab" xreflabel="newTab"><title>newTab (dialog object method)</title>
<para>
Tab objects can not be instantiated by the programmer from Rexx code. Rather a Tab object is obtained by using the
<xref linkend="mthNewTab"/>() method of the <xref linkend="chpDialogObject"/> object. The
syntax is:
<programlisting>
<![CDATA[
>>-newTab(--id--)---------------------><
]]>
</programlisting>
</para>
</section> <!-- End newTab() [PlainBaseDialog method] -->
<section id="tmthCreateTab" xreflabel="createTab"><title>createTab (UserDialog method)</title>
<para>
A tab control can be added to the dialog template for a <xref linkend="clsUserDialog"/>
dialog through the <xref linkend="mthCreateTab"/>() method. The basic syntax is:
<programlisting> <![CDATA[
>>--createTab(-id-,--x-,--y-,--cx-,--cy-+---------+--+-----------------+--)---><
+-,-style-+ +-,-attributeName-+
]]>
</programlisting>
</para>
</section> <!-- End UserDialog::createTab() [UserDialog method] -->
<section id="tmthConnectTabEvent" xreflabel="connectTabEvent"><title>connectTabEvent (dialog object method)</title>
<para>
To connect event notifications from an tab control use the
<xref linkend="mthConnectTabEvent"/>() method of the
<xref linkend="chpDialogObject"/> object. The basic syntax is:
<programlisting> <![CDATA[
>>-connectTabEvent(--id--,--event--+----------------+--+--------------+--)-----><
+--,-methodName--+ +-,-willReply--+
]]>
</programlisting>
</para>
</section> <!-- End connectTabEvent() [EventNotification method] -->
<section id="mthAddFullSeq" xreflabel="addFullSeq"><title>addFullSeq</title>
<indexterm><primary>addFullSeq</primary></indexterm>
<indexterm><primary>Tab class</primary><secondary>addFullSeq</secondary></indexterm>
<programlisting>
<![CDATA[
>>--addFullSeq(--text1--,-+-------+-,-+-------+-+--------------------------+--)--><
+-icon1-+ +-user1-+ +-,-...-+-----------+-+----+
+--,-textN--+ +-..-+
]]>
</programlisting>
<para>
The <emphasis role="italic">addFullSeq</emphasis> method inserts a sequence of 1 through N tabs into a tab control.
For each inserted tab, an optional icon index and user object can be specified.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>text [required]</term>
<listitem>
<para>The label text for the inserted tab.
</para>
</listitem></varlistentry>
<varlistentry><term>icon1 [optional]</term>
<listitem>
<para>The index of the icon in the image list of the tab control, set with the
<xref linkend="mthSetImageListClsTabControl"/>() method.
</para>
</listitem></varlistentry>
<varlistentry><term>user1 [optional]</term>
<listitem>
<para>
Any object the programmer wants stored together with the tab. This can be used to save information to be
associated with each tab.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The index of the tab inserted last, or -1 for any error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The argument <emphasis role="italic">text</emphasis> can repeat any number of times. A single comma can used to
signal that the icond index and / or user data argument is omitted for a tab. For each text argument one tab is
inserted into the tab control. However, in the sequence 1 though N arguments, the text argument can not be omitted.
Another way of saying that is, if two commas follow the text argument, the third argument is required. This is
acceptable:
<programlisting>
<![CDATA[
tabControl~addSequence(myText, , , myText2, ,)
]]>
</programlisting>
But this is not, and will raise a syntax error:
<programlisting>
<![CDATA[
tabControl~addSequence("Label One", , , "Label Two", , , )
]]>
</programlisting>
If no arguments are used, -1 is returned.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
The following example adds a sequence of tabs and sets their label and icon index, but omits any user data for each
tab:
<programlisting>
<![CDATA[
::method initDialog
tab = self~newTab("IDC_TAB")
if tab \= .nil then do
tab~setImageList(imageList)
tab~addFullSeq("s11", 0, , "s12", 1, , "s13", 2, , "s14", 3)
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section>
<section id="mthAddSequence" xreflabel="addSequence"><title>addSequence</title>
<indexterm><primary>addSequence</primary></indexterm>
<indexterm><primary>Tab class</primary><secondary>addSequence</secondary></indexterm>
<programlisting>
<![CDATA[
>>--addSequnce(--text1--+---------------------+--)----------------------------><
+--,-...--+-----------+
+--,-textN--+
]]>
</programlisting>
<para>
The <emphasis role="italic">addSequence</emphasis> method inserts a sequence of one through N tabs in a tab control.
The sequence of tabs starts immediately after the last added tab, or at index 0 if there are no tabs in the tab
control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The only, repeating, argument is:
<variablelist>
<varlistentry><term>text</term>
<listitem>
<para>
The label text for the inserted tab(s).
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The index of the tab inserted last, or -1 for any error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The argument <emphasis role="italic">text</emphasis> can repeat any number of times. For each argument one tab is
inserted into the tab control. However, in the sequence 1 though N arguments, no argument can be omitted. If no
arguments are used, -1 is returned.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
The following example inserts three tabs in a tab control:
</para>
<programlisting>
<![CDATA[
::method initDialog
tab = self~newTab("IDC_TAB")
if tab \= .nil then do
tab~addSequence("First Tab", "Second Tab", "Third Tab")
end
]]>
</programlisting>
</listitem></varlistentry>
</variablelist>
</section>
<section id="mthAdjustToRectangle" xreflabel="adjustToRectangle"><title>adjustToRectangle</title>
<indexterm><primary>adjustToRectangle</primary></indexterm>
<indexterm><primary>Tab class</primary><secondary>adjustToRectangle</secondary></indexterm>
<programlisting>
<![CDATA[
>>--adjustToRectangle(--left--,--top--,--right--,--bottom--)-><
]]>
</programlisting>
<para>The adjustToRectangle method calculates the window
rectangle of a tab control that corresponds to the specified display rectangle.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The arguments are:
<variablelist>
<varlistentry><term>left</term>
<listitem><para>The x-coordinate of the upper left corner of the display rectangle.
</para></listitem></varlistentry>
<varlistentry><term>top</term>
<listitem><para>The y-coordinate of the upper left corner of the display rectangle.
</para></listitem></varlistentry>
<varlistentry><term>right</term>
<listitem><para>The x-coordinate of the lower right corner of the display rectangle.
</para></listitem></varlistentry>
<varlistentry><term>bottom</term>
<listitem><para>The y-coordinate of the lower right corner of the display rectangle.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>A string containing the coordinates of the window rectangle, or an empty
string. The coordinates are separated by blanks and are in the following order:
<itemizedlist>
<listitem><para>X-coordinate of the upper left corner of the rectangle</para></listitem>
<listitem><para>Y-coordinate of the upper left corner of the rectangle</para></listitem>
<listitem><para>X-coordinate of the lower right corner of the rectangle</para></listitem>
<listitem><para>Y-coordinate of the lower right corner of the rectangle</para></listitem>
</itemizedlist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
This method is outmoded and retained solely for backwards compatibility. All new code should use the
<xref linkend="mthCalcWindowRect"/> method.
</para>
</listitem></varlistentry>
</variablelist>
</section>
<section id="mthCalcDisplayArea" xreflabel="calcDisplayArea"><title>calcDisplayArea</title>
<indexterm><primary>calcDisplayArea</primary></indexterm>
<indexterm><primary>Tab class</primary><secondary>calcDisplayArea</secondary></indexterm>
<programlisting>
<![CDATA[
>>--calcDisplayArea(--rect--)--------------------><
]]>
</programlisting>
<para>
Given a <xref linkend="clsRect"/> object that specifies the window rectangle of a tab control, calculates
the display area of the the tab control. This method should be used when the size of the tab control is fixed and the
size of the contents of a page in the tab control can be adjusted.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>rect [required] [in/out]</term>
<listitem>
<para>
A <xref linkend="clsRect"/> object that specifies the window rect of the tab conrol when the method is
invoked. On return, the <computeroutput>rect</computeroutput> object will contain the coordinates of the display
area of the tab control.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns 0, always.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
Two strategies can be used for placing the content of a page of a tab control. The position and size of the content
can be adjusted to the position and size of the display area of the tab control, or the tab control's position and
size can be adjusted so the content fits into the display area. This method is used to facilitate the first
strategy. Give the size and position of the tab control, it returns the position and size for the page content.
</para>
<para>
This method is only for tab controls that have their tabs on the top. It does not apply for tab controls that have
their tabs on the sides or bottom.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Tab::calcDisplayArea() -->
<section id="mthCalcWindowRect" xreflabel="calcWindowRect"><title>calcWindowRect</title>
<indexterm><primary>calcWindowRect</primary></indexterm>
<indexterm><primary>Tab class</primary><secondary>calcWindowRect</secondary></indexterm>
<programlisting>
<![CDATA[
>>--calcWindowRect(--rect--)---------------------><
]]>
</programlisting>
<para>
Takes a display rectangle and adjusts the rectangle to be the window rect of the tab control needed for that display.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>rect [required] [in/out]</term>
<listitem>
<para>
A <xref linkend="clsRect"/> object that specifies the display area of the tab conrol when the method is
invoked. On return, the <computeroutput>rect</computeroutput> object will contain the coordinates of the window
rectangle of the tab control.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
This method always returns 0.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
Two strategies can be used for placing the content of a page of a tab control. The position and size of the content
can be adjusted to the position and size of the display area of the tab control, or the tab control's position and
size can be adjusted so the content fits into the display area. This method is used to facilitate the second
strategy. Give the position and size of the page content, it returns the position and size that the tab control
needs to be.
</para>
<para>
This method is only for tab controls that have their tabs on the top. It does not apply for tab controls that have
their tabs on the sides or bottom.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Tab::calcWindowRect() -->
<section id="mthDeleteTab" xreflabel="delete"><title>delete</title>
<indexterm><primary>delete</primary><secondary>Tab class</secondary></indexterm>
<indexterm><primary>Tab class</primary><secondary>delete</secondary></indexterm>
<programlisting>
<![CDATA[
>>--delete(--index--)----------------------------><
]]>
</programlisting>
<para>The delete method removes a tab from a tab control.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>tab</term>
<listitem><para>The number of the tab to be removed.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>
<variablelist>
<varlistentry><term>0</term>
<listitem><para>The tab was removed.
</para></listitem></varlistentry>
<varlistentry><term>-1</term>
<listitem><para>You did not specify <emphasis role="italic">tab</emphasis>
or there is no tab available.
</para></listitem></varlistentry>
<varlistentry><term>1</term>
<listitem><para>For all other cases.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthDeleteAllTab" xreflabel="deleteAll"><title>deleteAll</title>
<indexterm><primary>deleteAll</primary><secondary>Tab class</secondary></indexterm>
<indexterm><primary>Tab class</primary><secondary>deleteAll</secondary></indexterm>
<programlisting>
<![CDATA[
>>--deleteAll------------------------------------><
]]>
</programlisting>
<para>The deleteAll method removes all tabs from a tab
control.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>
<variablelist>
<varlistentry><term>0</term>
<listitem><para>The tabs were removed.
</para></listitem></varlistentry>
<varlistentry><term>1</term>
<listitem><para>For all other cases.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthFocusTab" xreflabel="focus"><title>focus</title>
<indexterm><primary>focus</primary><secondary>Tab class</secondary></indexterm>
<indexterm><primary>Tab class</primary><secondary>focus</secondary></indexterm>
<programlisting>
<![CDATA[
>>--focus(--index--)-----------------------------><
]]>
</programlisting>
<para>The focus method sets the focus to the specified
tab in a tab control.</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 of the tab to receive the focus.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>0.
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthFocusedTab" xreflabel="focused"><title>focused</title>
<indexterm><primary>focused</primary><secondary>Tab class</secondary></indexterm>
<indexterm><primary>Tab class</primary><secondary>focused</secondary></indexterm>
<programlisting>
<![CDATA[
>>--focused--------------------------------------><
]]>
</programlisting>
<para>The focused method returns the number of the tab
that has the focus. The tab with the focus can differ from the selected tab.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The number of the tab having the focus.
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthGetImageListTab" xreflabel="getImageList"><title>getImageList</title>
<indexterm><primary>getImageList</primary><secondary>Tab class</secondary></indexterm>
<indexterm><primary>Tab class</primary><secondary>getImageList</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getImageList---------------------------------><
]]>
</programlisting>
<para>
Retrieves the current image list from the tab control, if there is one.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
There are no arguments to this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
This method returns the current image <xref linkend="clsImageList"/>, if there is one.
<computeroutput>.nil</computeroutput> is returned if there is no current image list.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example gets the current image list from the tab control when the dialog is closed and releases it as it is no
longer userd.
<programlisting>
<![CDATA[
::method ok
self~releaseImageLists
return self~ok:super
::method cancel
self~releaseImageLists
return self~cancel:super
::method releaseImageLists
expose tabControl
imageList = tabControl~getImageList
if imageList \== .nil then imageList~release
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End TabControl::getImageList() -->
<section id="mthGetItemRectClsTab" xreflabel="getItemRect"><title>getItemRect</title>
<indexterm><primary>getItemRect</primary<secondary>Tab class</secondary></indexterm>
<indexterm><primary>Tab class</primary><secondary>getItemRect</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getItemRect(--index--,--rect--)--------------><
]]>
</programlisting>
<para>
Gets the bounding rectangle for a tab in a tab control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>index [required]</term>
<listitem>
<para>
The index of the tab to get the bounding rectangle for.
</para>
</listitem></varlistentry>
<varlistentry><term>rect [required] [in/out]</term>
<listitem>
<para>
A <xref linkend="clsRect"/> object in which the coordinates of tab are returned.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns true on success, otherwise false.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Tab::getItemRect() -->
<section id="mthInsertTab" xreflabel="insert"><title>insert</title>
<indexterm><primary>insert</primary><secondary>Tab class</secondary></indexterm>
<indexterm><primary>Tab class</primary><secondary>insert</secondary></indexterm>
<programlisting>
<![CDATA[
>>--insert(--+-----+--+--------+--+--------+--+------------+--)---------------><
+-tab-+ +-,-text-+ +-,-icon-+ +-,-userData-+
]]>
</programlisting>
<para>
Inserts a new tab in a tab control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>tab [opitonal]</term>
<listitem>
<para>
The index of the tab to insert. If you omit this argument, the index of the last tab added to the control, plus
one, is used for the index. If the argument is omitted, and no tab has yet been added to the tab control, the
index of zero is ued.
</para>
</listitem></varlistentry>
<varlistentry><term>text [optiona]</term>
<listitem>
<para>
The label text for the inserted tab. If omitted, the empty string is used.
</para>
</listitem></varlistentry>
<varlistentry><term>icon [optional]</term>
<listitem>
<para>
The index of the icon in the image list of the tab control to use with the tab. The image list for the control
is set with the <xref linkend="mthSetImageListClsTabControl"/>() method. If this argument is
omitted, no icon is used for the tab.
</para>
</listitem></varlistentry>
<varlistentry><term>userData [optiona]</term>
<listitem>
<para>
Any object the programmer wants to store with the tab.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The index of the insert tab, or -1 for any error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
The following example inserts three tabs in a tab control with the specified label and index in the image list for
an icon for the tab:
<programlisting>
<![CDATA[
::method initDialog
tab = self~newTab("IDC_TAB")
if tab \= .Nil then do
tab~setImageList(imageList)
tab~insert(, "First Tab", 0)
tab~insert(, "Second Tab", 1)
tab~insert(, "Third Tab", 2)
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section>
<section id="mthIteminfoTab" xreflabel="itemInfo"><title>itemInfo</title>
<indexterm><primary>itemInfo</primary><secondary>Tab class</secondary></indexterm>
<indexterm><primary>Tab class</primary><secondary>itemInfo</secondary></indexterm>
<programlisting>
<![CDATA[
>>--itemInfo(--index--)--------------------------><
]]>
</programlisting>
<para>The itemInfo method retrieves information about
a tab in a tab control.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>text</term>
<listitem><para>The number of the tab.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>A compound variable that stores the attributes of the tab, or -1
in all other cases. The compound variable can be:
<variablelist>
<varlistentry><term>RetStem.!TEXT</term>
<listitem><para>The label text for the tab.
</para></listitem></varlistentry>
<varlistentry><term>RetStem.!IMAGE</term>
<listitem><para>The index of the tab in the image list of the tab control, or -1
if the tab does not have an image.
</para></listitem></varlistentry>
<varlistentry><term>RetStem.!PARAM</term>
<listitem><para>An integer value stored together with the tab to save information:
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem><para>The following example displays the text of all tabs:
<programlisting>
<![CDATA[
::method DisplayText
curTab = self~newTab("ID_TAB")
if curTab \= .Nil then do
do i = 0 to curTab~items - 1
ItemInfo. = curTab~itemInfo(i)
say ItemInfo.!Text
end
end
]]>
</programlisting>
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthItemsTab" xreflabel="items"><title>items</title>
<indexterm><primary>items</primary><secondary>Tab class</secondary></indexterm>
<indexterm><primary>Tab class</primary><secondary>items</secondary></indexterm>
<programlisting>
<![CDATA[
>>--items----------------------------------------><
]]>
</programlisting>
<para>The items method retrieves the number of tabs in
a tab control.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The number of the tabs, or 0 for all other cases.
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem><para>The following example displays the number of tabs:
<programlisting>
<![CDATA[
::method DisplayTabNum
curTab = self~newTab("ID_TAB")
if curTab \= .Nil then do
say curTab~items
end
]]>
</programlisting>
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthLastTab" xreflabel="last"><title>last</title>
<indexterm><primary>last</primary><secondary>Tab class</secondary></indexterm>
<indexterm><primary>Tab class</primary><secondary>last</secondary></indexterm>
<programlisting>
<![CDATA[
>>--last-----------------------------------------><
]]>
</programlisting>
<para>
Retrieves the index of the last tab in a tab control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The index of the last tab. -1 is returned if there are no tabs or for any error.
</para>
</listitem></varlistentry>
</variablelist>
</section>
<section id="mthModifyTab" xreflabel="modify"><title>modify</title>
<indexterm><primary>modify</primary></indexterm>
<indexterm><primary>Tab class</primary><secondary>modify</secondary></indexterm>
<programlisting>
<![CDATA[
>>--modify(--index--+--------+--+--------+--+------------+--)-----------------><
+-,-text-+ +-,-icon-+ +-,-userData-+
]]>
</programlisting>
<para>
The <emphasis role="italic">modify</emphasis> method sets some, or all, of the attributes of a tab. It can be used to
change the value of any attribute that has already been set.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>index [required]</term>
<listitem>
<para>
The index of the tab to modify.
</para>
</listitem></varlistentry>
<varlistentry><term>text [optiona]</term>
<listitem>
<para>
The new label text for the inserted tab.
</para>
</listitem></varlistentry>
<varlistentry><term>icon [optional]</term>
<listitem>
<para>
The new index of the icon in the image list of the tab control to use with the tab. The image list for the
control is set with the <xref linkend="mthSetImageListClsTabControl"/>() method.
</para>
</listitem></varlistentry>
<varlistentry><term>userData [optiona]</term>
<listitem>
<para>
The new object the programmer wants to store with the tab. There is no restriction on this argument, it can be
any object.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
0 for success and 1 for any error, or if all the optional arguments are omitted.
</para>
</listitem></varlistentry>
</variablelist>
</section>
<section id="mthPosRectangle" xreflabel="posRectangle"><title>posRectangle</title>
<indexterm><primary>posRectangle</primary></indexterm>
<indexterm><primary>Tab class</primary><secondary>posRectangle</secondary></indexterm>
<programlisting>
<![CDATA[
>>--posRectangle(--index--)----------------------><
]]>
</programlisting>
<para>The posRectangle method retrieves the rectangle
around a tab in a tab control.</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 of the tab.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>A string containing the coordinates of the rectangle, or an empty string.
The coordinates are separated by blanks and are in the following order:
<itemizedlist>
<listitem><para>X-coordinate of the upper left corner of the rectangle</para></listitem>
<listitem><para>Y-coordinate of the upper left corner of the rectangle</para></listitem>
<listitem><para>X-coordinate of the lower right corner of the rectangle</para></listitem>
<listitem><para>Y-coordinate of the lower right corner of the rectangle</para></listitem>
</itemizedlist>
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthRequiredWindowSize" xreflabel="requiredWindowSize"><title>requiredWindowSize</title>
<indexterm><primary>requiredWindowSize</primary></indexterm>
<indexterm><primary>Tab class</primary><secondary>requiredWindowSize</secondary></indexterm>
<programlisting>
<![CDATA[
>>--requiredWindowSize(--left--,--top--,--right--,--bottom--)-><
]]>
</programlisting>
<para>The requiredWindowSize method calculates the display
rectangle of a tab control that corresponds to the specified window rectangle.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The arguments are:
<variablelist>
<varlistentry><term>left</term>
<listitem><para>The x-coordinate of the upper left corner of the window rectangle.
</para></listitem></varlistentry>
<varlistentry><term>top</term>
<listitem><para>The y-coordinate of the upper left corner of the window rectangle.
</para></listitem></varlistentry>
<varlistentry><term>right</term>
<listitem><para>The x-coordinate of the lower right corner of the window rectangle.
</para></listitem></varlistentry>
<varlistentry><term>bottom</term>
<listitem><para>The y-coordinate of the lower right corner of the window rectangle.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>A string containing the coordinates of the display rectangle, or an
empty string. The coordinates are separated by blanks and are in the following
order:
<itemizedlist>
<listitem><para>X-coordinate of the upper left corner of the rectangle</para></listitem>
<listitem><para>Y-coordinate of the upper left corner of the rectangle</para></listitem>
<listitem><para>X-coordinate of the lower right corner of the rectangle</para></listitem>
<listitem><para>Y-coordinate of the lower right corner of the rectangle</para></listitem>
</itemizedlist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
This method is outmoded and retained solely for backwards compatibility. All new code should use the
<xref linkend="mthCalcDisplayArea"/> method.
</para>
</listitem></varlistentry>
</variablelist>
</section>
<section id="mthRows" xreflabel="rows"><title>rows</title>
<indexterm><primary>rows</primary></indexterm>
<indexterm><primary>Tab class</primary><secondary>rows</secondary></indexterm>
<programlisting>
<![CDATA[
>>--rows-----------------------------------------><
]]>
</programlisting>
<para>The rows method retrieves the current number of
rows of tabs in a tab control. Only tab controls with multiline style can
have several rows of tabs.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The number of the tab rows.
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthSelectTab" xreflabel="select"><title>select</title>
<indexterm><primary>select</primary><secondary>Tab class</secondary></indexterm>
<indexterm><primary>Tab class</primary><secondary>select</secondary></indexterm>
<programlisting>
<![CDATA[
>>--select(--text--)-----------------------------><
]]>
</programlisting>
<para>The select method selects the tab with the specified
label text.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>text</term>
<listitem><para>The label text of the tab to be selected.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The number of the selected tab, or 0 in all other cases.
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthSelectedTab" xreflabel="selected"><title>selected</title>
<indexterm><primary>selected</primary><secondary>Tab class</secondary></indexterm>
<indexterm><primary>Tab class</primary><secondary>selected</secondary></indexterm>
<programlisting>
<![CDATA[
>>--selected-------------------------------------><
]]>
</programlisting>
<para>The selected method retrieves the label text of
the currently selected tab.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The label text of the currently selected tab, or 0 in all other cases.
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthSelectedIndexTab" xreflabel="selectedIndex"><title>selectedIndex</title>
<indexterm><primary>selectedIndex</primary><secondary>Tab class</secondary></indexterm>
<indexterm><primary>Tab class</primary><secondary>selectedIndex</secondary></indexterm>
<programlisting>
<![CDATA[
>>--selectedIndex--------------------------------><
]]>
</programlisting>
<para>The selectedIndex method retrieves the number of
the currently selected tab.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The number of the currently selected tab, or 0 in all other cases.
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthSelectIndexTab" xreflabel="selectIndex"><title>selectIndex</title>
<indexterm><primary>selectIndex</primary><secondary>Tab class</secondary></indexterm>
<indexterm><primary>Tab class</primary><secondary>selectIndex</secondary></indexterm>
<programlisting>
<![CDATA[
>>--selectIndex(--index--)-----------------------><
]]>
</programlisting>
<para>
Selects a tab in the tab control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The only argument is:
<variablelist>
<varlistentry><term>index [required]</term>
<listitem>
<para>
The index of the tab to be selected.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The index of the previously selected tab on success, or -1 for any error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The tab control does not send a SELCHANGING or SELCHANGE <xref linkend="ovvEvents"/> notification when a tab is
selected using this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example allows the user to push a button to go to the next or previous tabs. Note that the <emphasis
role="italic">onNewTab</emphasis> method is connected to the SELCHANGE event. Since the tab control does not
generate the SELCHAGE event when the <emphasis role="italic">selectIndex</emphasis> method is invoked, the program
just calls the <emphasis role="italic">onNewTab</emphasis> method directly.
<programlisting>
<![CDATA[
::method defineDialog
self~createTab(IDC_TAB, 10, 5, 305, 265)
self~createPushButton(IDC_PB_PREVIOUS, 10, 278, 60, 14, , "Previous Control", onPrevious)
self~createPushButton(IDC_PB_NEXT, 80, 278, 60, 14, , "Next Control", onNext)
self~connectTabEvent(IDC_TAB, SELCHANGE, onNewTab)
...
::method onNext
expose tabControl
tabControl~selectIndex(tabControl~selectedIndex + 1)
self~onNewTab
::method onPrevious
expose tabControl
tabControl~selectIndex(tabControl~selectedIndex - 1)
self~onNewTab
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Tab::selectIndex() -->
<section id="mthSetImageListClsTabControl" xreflabel="setImageList"><title>setImageList</title>
<indexterm><primary>setImageList</primary><secondary>Tab class</secondary></indexterm>
<indexterm><primary>Tab class</primary><secondary>setImageList</secondary></indexterm>
<programlisting>
<![CDATA[
>>--setImageList(--newImageList--)---------------><
]]>
</programlisting>
<para>
Assigns, or removes, an image list for the tab control. Using <computeroutput>.nil</computeroutput> for the first
argument removes the current image list. Each tab can have an icon associated with it, which is specified by an index
in the image list for the tab control.
</para>
<para>
Destroying a tab control does not destroy an image list that is associated with it. The programmer must destroy the
image list separately, if desired. This is useful if the programmer wants to assign the same image list to multiple
tab controls. In essence, the ownership of the image list remains with the programmer. The
<xref linkend="clsImageList"/> and <xref linkend="clsImage"/> classes are used to manage image
lists and images in ooDialog. The documentation on both classes discusses when and why the programmer may want to
release image lists. The Image class documentation has the most detail on this subject.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>The single argument is
<variablelist>
<varlistentry><term>newImageList [required]</term>
<listitem>
<para>
The image <xref linkend="clsImageList"/> to assign to the tab control. If this argument is
<computeroutput>.nil</computeroutput> the existing image list, if any, is removed.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The existing image list is returned, if there is one. Otherwise, <computeroutput>.nil</computeroutput> is returned.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example creates an image list from a bitmap file that is a series of 16x16 bitmaps, each one a
colored letter. The image list is then assigned to the tab control.
<programlisting>
<![CDATA[
-- Add all the tabs, including the index into the image list for an icon for
-- each tab.
tc~addFullSeq("Red", 0, ,"Green", 1, , "Moss", 2, , "Blue", 3, , "Purple", 4, , -
"Cyan", 5, , "Gray", 6)
-- Create a COLORREF (pure white) and load our bitmap. The bitmap is a
-- series of 16x16 images, each one a colored letter.
cRef = .Image~colorRef(255, 255, 255)
image = .Image~getImage("bmp\psdemoTab.bmp")
-- Create our image list, as a masked image list.
flags = .DlgUtil~or(.Image~toID(ILC_COLOR24), .Image~toID(ILC_MASK))
imageList = .ImageList~create(.Size~new(16, 16), flags, 10, 0)
if \image~isNull, \imageList~isNull then do
imageList~addMasked(image, cRef)
tc~setImageList(imageList)
-- The image list makes a copy of each image added to it. So, we can now
-- release the original image to free up some small amount of system
-- resoureces.
image~release
end
else do
-- do some type of error handling
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End TabControl::setImageList() -->
<section id="mthSetItemSize" xreflabel="setItemSize"><title>setItemSize</title>
<indexterm><primary>setItemSize</primary></indexterm>
<indexterm><primary>Tab class</primary><secondary>setItemSize</secondary></indexterm>
<programlisting>
<![CDATA[
Form 1:
>>--setItemSize(--sizeObj--)---------------------><
Form 2:
>>--setItemSize(--cx--,--cy--)-------------------><
Generic form:
>>--setItemSize(--newSize--)---------------------><
]]>
</programlisting>
<para>
Sets the width and height of the tabs in a fixed-width tab control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>newSize [required]</term>
<listitem>
<para>
The new size (height and width) in pixels. The <emphasis role="italic">newSize</emphasis> argument(s) can be
specified either as a single <xref linkend="clsSize"/> object, or as two separate arguments, width first
and height second.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return is a <computeroutput>Size</computeroutput> object specifying the old width and height of the tabs in the
control.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The <xref linkend="mthSetSize"/> and <emphasis role="italic">setItemSize</emphasis> methods are
identical except that the <emphasis role="italic">setSize</emphasis> method returns the old size a string and the
<emphasis role="italic">setItemSize</emphasis> method returns the old size as a <xref linkend="clsSize"/>
object.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Tab::setItemSize() -->
<section id="mthSetPadding" xreflabel="setPadding"><title>setPadding</title>
<indexterm><primary>setPadding</primary></indexterm>
<indexterm><primary>Tab class</primary><secondary>setPadding</secondary></indexterm>
<programlisting>
<![CDATA[
Form 1:
>>--setPadding(--sizeObj--)----------------------><
Form 2:
>>--setPadding(--cx--,--cy--)--------------------><
Generic form:
>>--setPadding(--padding--)----------------------><
]]>
</programlisting>
<para>
The <emphasis role="italic">setPadding</emphasis> method sets the amount of space (padding) around the icon and the
label of a tab in the tab control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>padding [required]</term>
<listitem>
<para>
The new padding (horizontal and vertical padding) in pixels. The <emphasis role="italic">padding</emphasis>
argument(s) can be specified either as a single <xref linkend="clsSize"/> object, or as two separate
arguments, horizontal padding first and vertical padding second.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns 0, always.
</para>
</listitem></varlistentry>
</variablelist>
</section>
<section id="mthSetSize" xreflabel="setSize"><title>setSize</title>
<indexterm><primary>setSize</primary><secondary>Tab class</secondary></indexterm>
<indexterm><primary>Tab class</primary><secondary>setSize</secondary></indexterm>
<programlisting>
<![CDATA[
Form 1:
>>--setSize(--sizeObj--)-------------------------><
Form 2:
>>--setSize(--cx--,--cy--)-----------------------><
Generic form:
>>--setSize(--newSize--)-------------------------><
]]>
</programlisting>
<para>
The <emphasis role="italic">setSize</emphasis> method sets the width and height of tabs in a fixed-width tab control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>newSize [required]</term>
<listitem>
<para>
The new size (height and width) in pixels. The <emphasis role="italic">newSize</emphasis> argument(s) can be
specified either as a single <xref linkend="clsSize"/> object, or as two separate arguments, width first
and height second.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The old width and height, in pixels, as a string of two blank-delimited words. The width is the first word and the
height is the second word.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The <xref linkend="mthSetItemSize"/> and <emphasis role="italic">setSize</emphasis> methods are
identical except that the <emphasis role="italic">setSize</emphasis> method returns the old size as a string and the
<emphasis role="italic">setItemSize</emphasis> method returns the old size as a <xref linkend="clsSize"/>
object.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
</variablelist>
</section>
</chapter> <!-- End Tab class -->