[r8770]: ooDialog / branches / 4.2.1 / doc / oodialog / en-US / trackbar.xml  Maximize  Restore  History

Download this file

1055 lines (972 with data), 38.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
<?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="clsTrackBar" xreflabel="TrackBar"><title>Trackbar Controls</title>
<indexterm><primary>Trackbar class</primary></indexterm>
<para>
A trackbar is a window that contains a slider and optional tick marks. Prior to the effort to
<link linkend="termMethodNameUnification">unify</link> the ooDialog class and method names, a trackbar was called a slider
control. This was misnomer, the slider is a part of the the track bar. Trackbars are now called by their correct name in
this documentation.
</para>
<para>
Trackbars are useful if you want the user to select a specific value or a set of consecutive values within a specific
range. For example, you might use a trackbar to allow the user to set the repeat rate of the keyboard by moving the
slider in the trackbar to a given tick mark.
</para>
<para>
When the user moves the slider in the trackbar, using either the mouse or the direction keys, the trackbar sends
notification messages to its parent dialog to indicate the change.
</para>
<para>
The slider in a trackbar moves in increments that you specify when you create it. For example, if you specify that
the trackbar should have a range from 0 to 10, the slider can occupy only eleven positions: a position at the left
side of the slider and one position for each increment in the range. Typically, each of these positions is identified
by a tick mark.
</para>
<para>
After you have created a trackbar, you can use its methods to set and retrieve its properties. Refer to the
<computeroutput>propdemo.rex</computeroutput> example program included in the ooRexx distribution under the
<computeroutput>samples</computeroutput> subdirectory for some help in getting started using a track bar.
</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 trackbar controls:
<variablelist>
<varlistentry><term><emphasis role="bold">Instantiation:</emphasis></term>
<listitem>
<para>
Use the <xref linkend="tmthNewTrackBar"/> method of the <xref linkend="chpDialogObject"/> object to retrieve a new
TrackBar object.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Dynamic Definition:</emphasis></term>
<listitem>
<para>
To dynamically define a trackbar in the dialog template of a <xref linkend="clsUserDialog"/> class, use the <xref
linkend="tmthCreateTrackBar"/> 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 trackbar control to a
method in the Rexx dialog object use the <xref linkend="tmthConnectTrackBarEvent"/> method.
</para>
</listitem></varlistentry>
</variablelist> </para>
<section id="sctMethodsTrackBar"><title>Method Table</title>
<para>
The following table provides links to the documentation for the primary methods and attributes used in working
with <computeroutput>TrackBar</computeroutput> objects, including the pertinent methods from other classes:
</para>
<table id="tblTrackBarMethods" frame="all">
<title>Trackbar Instance 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="tmthNewTrackBar"/></entry>
<entry>Returns a <computeroutput>Trackbar</computeroutput> object for the control with the specified ID.</entry>
</row>
<row>
<entry><xref linkend="tmthCreateTrackBar"/></entry>
<entry>Creates a trackbar control in the dialog template of a <xref linkend="clsUserDialog"/></entry>
</row>
<row>
<entry><xref linkend="tmthConnectTrackBarEvent"/></entry>
<entry>Connects trackbar event notifications to a method in the Rexx dialog object</entry>
</row>
<row>
<entry><xref linkend="mthClearSelRange"/></entry>
<entry>Clears the current selection range in a trackbar.</entry>
</row>
<row>
<entry><xref linkend="mthClearTicks"/></entry>
<entry>Removes the current tick marks from a trackbar.</entry>
</row>
<row>
<entry><xref linkend="mthCountTicks"/></entry>
<entry>Retrieves the number of tick marks in a trackbar,</entry>
</row>
<row>
<entry><xref linkend="mthGetLineStep"/></entry>
<entry>Retrieves the number of logical positions that the slider in a trackbar moves in response to keyboard input from the arrow keys.</entry>
</row>
<row>
<entry><xref linkend="mthGetPageStep"/></entry>
<entry>Retrieves the number of logical positions that the slider in a trackbar moves in response to page up or down keys, or mouse clicks.</entry>
</row>
<row>
<entry><xref linkend="mthGetTick"/></entry>
<entry>Retrieves the logical position of a tick mark in a trackbar.</entry>
</row>
<row>
<entry><xref linkend="mthInitRange"/></entry>
<entry>Sets the minimum and maximum positions of the trackbar and redraws the trackbar, if requested.</entry>
</row>
<row>
<entry><xref linkend="mthInitSelRange"/></entry>
<entry>Sets the starting and ending logical positions for the current selection range in a trackbar.</entry>
</row>
<row>
<entry><xref linkend="mthPos"/></entry>
<entry>Retrieves the current logical position of the slider in a trackbar.</entry>
</row>
<row>
<entry><xref linkend="mthPosEquals"/></entry>
<entry>Sets the logical position of the slider in a trackbar, however the trackbar is not redrawn.</entry>
</row>
<row>
<entry><xref linkend="mthRangeClsTrackBar"/></entry>
<entry>Retrieves the minimum and maximum positions of the trackbar.</entry>
</row>
<row>
<entry><xref linkend="mthSelRange"/></entry>
<entry>Retrieves the starting position of the current selection range in a trackbar.</entry>
</row>
<row>
<entry><xref linkend="mthSetLineStep"/></entry>
<entry>Sets the number of logical positions that the slider in a trackbar moves in response to keyboard input from the arrow keys.</entry>
</row>
<row>
<entry><xref linkend="mthSetMax"/></entry>
<entry>Sets the maximum logical position for a trackbar and redraws the trackbar, if requested.</entry>
</row>
<row>
<entry><xref linkend="mthSetMin"/></entry>
<entry>Sets the minimum logical position for a trackbar and redraws the trackbar, if requested.</entry>
</row>
<row>
<entry><xref linkend="mthSetPageStep"/></entry>
<entry>Sets the number of logical positions that the slider in a trackbar moves in response to page up or down keys, or mouse clicks.</entry>
</row>
<row>
<entry><xref linkend="mthSetPosClsTrackBar"/></entry>
<entry>Sets the new logical position of the slider in a trackbar and redraws the trackbar, if requested.</entry>
</row>
<row>
<entry><xref linkend="mthSetSelEnd"/></entry>
<entry>Sets the logical ending position for the current selection range in a trackbar.</entry>
</row>
<row>
<entry><xref linkend="mthSetSelStart"/></entry>
<entry>Sets the starting logical position for the current selection range in a trackbar.</entry>
</row>
<row>
<entry><xref linkend="mthSetTickAt"/></entry>
<entry>Sets a tick mark at the specified logical position in the trackbar.</entry>
</row>
<row>
<entry><xref linkend="mthSetTickFrequency"/></entry>
<entry>Sets the interval frequency for tick marks in a trackbar</entry>
</row>
</tbody></tgroup>
</table>
</section>
<section id="tmthNewTrackBar" xreflabel="newTrackBar"><title>newTrackBar (dialog object method)</title>
<para>
Track bar objects can not be instantiated by the programmer from Rexx code. Rather a trackbar object is obtained by
using the <xref linkend="mthNewTrackBar"/> method of the <xref linkend="chpDialogObject"/> object. The syntax is:
<programlisting>
<![CDATA[
>>-newTrackBar(--id--)---------------------------><
]]>
</programlisting>
</para>
</section> <!-- End newTrackBar() [PlainBaseDialog method] -->
<section id="tmthCreateTrackBar" xreflabel="createTrackBar"><title>createTrackBar (UserDialog method)</title>
<para>
A trackbar control can be added to the dialog template for a <xref linkend="clsUserDialog"/> dialog
through the <xref linkend="mthCreateTrackBar"/>() method. The basic syntax is:
<programlisting>
<![CDATA[
>>--createTrackBar(-id-,--x-,--y-,--cx-,--cy-+---------+--+------------+--)----><
+-,-style-+ +-,-attrName-+
]]>
</programlisting>
</para>
</section> <!-- End UserDialog::createTrackBar() [UserDialog method] -->
<section id="tmthConnectTrackBarEvent" xreflabel="connectTrackBarEvent">
<title>connectTrackBarEvent (dialog object method)</title>
<para>
To connect event notifications from an trackbar control use the
<xref linkend="mthConnectTrackBarEvent"/>() method of the
<xref linkend="chpDialogObject"/> object. The basic syntax is:
<programlisting>
<![CDATA[
>>--connectTrackBarEvent(--id--,--event--+---------------+--)---><
+-,--methodName-+
]]>
</programlisting>
</para>
</section> <!-- End connectTrackBarEvent() [EventNotification method] -->
<section id="mthClearSelRange" xreflabel="clearSelRange"><title>clearSelRange</title>
<indexterm><primary>clearSelRange</primary></indexterm>
<programlisting>
<![CDATA[
>>--clearSelRange(--+----------+--)--------------><
+--redraw--+
]]>
</programlisting>
<para>The clearSelRange method clears the current selection
range in a slider.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>redraw [optional]</term>
<listitem>
<para>
The redraw flag. If <computeroutput>.true</computeroutput>, the trackbar is redrawn after the selection is cleared. If
<computeroutput>.false</computeroutput> the trackbar is not redrawn. The default is
<computeroutput>.true</computeroutput>.
</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="mthClearTicks" xreflabel="clearTicks"><title>clearTicks</title>
<indexterm><primary>clearTicks</primary></indexterm>
<programlisting>
<![CDATA[
>>--clearTicks(--+----------+--)-----------------><
+--redraw--+
]]>
</programlisting>
<para>The clearTicks method removes the current tick
marks from a slider. It does not, however, remove the first and last tick
marks because they are created automatically by the slider.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The arguments are:
<variablelist>
<varlistentry><term>redraw [optional]</term>
<listitem>
<para>
The redraw flag, if <computeroutput>.true</computeroutput> the trackbar is redrawn after the tick marks are removed.
If <computeroutput>.false</computeroutput> the trackbar is not redrawn. The default is
<computeroutput>.true</computeroutput>.
</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="mthCountTicks" xreflabel="countTicks"><title>countTicks</title>
<indexterm><primary>countTicks</primary></indexterm>
<programlisting>
<![CDATA[
>>--countTicks-----------------------------------><
]]>
</programlisting>
<para>The countTicks method retrieves the number of tick
marks in a trackbar, including the first and last tick marks, which are created
automatically by the slider.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The number of tick marks.
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthGetLineStep" xreflabel="getLineStep"><title>getLineStep</title>
<indexterm><primary>getLineStep</primary></indexterm>
<programlisting>
<![CDATA[
>>--getLineStep----------------------------------><
]]>
</programlisting>
<para>The getLineStep method retrieves the number of
logical positions that the trackbar moves in response to keyboard input from
the arrow keys, such as the Right arrow or the Down arrow keys. The logical
positions are the integer increments within the minimum and maximum positions
of the slider.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The line size for the slider.
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthGetPageStep" xreflabel="getPageStep"><title>getPageStep</title>
<indexterm><primary>getPageStep</primary></indexterm>
<programlisting>
<![CDATA[
>>--getPageStep----------------------------------><
]]>
</programlisting>
<para>The getPageStep method retrieves the number of
logical positions that the trackbar moves in response to keyboard input, such
as the PageUp or PageDown keys, or mouse input, such as clicks in the trackbar's
channel. The logical positions are the integer increments within the minimum
and maximum positions of the slider.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The page size for the slider.
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthGetTick" xreflabel="getTick"><title>getTick</title>
<indexterm><primary>getTick</primary></indexterm>
<programlisting>
<![CDATA[
>>--getTick(--tic--)-----------------------------><
]]>
</programlisting>
<para>The getTick method retrieves the logical position
of a tick mark in a slider. A valid position is an integer value within the
minimum and maximum positions of the slider.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>tic</term>
<listitem><para>A zero-based index identifying a tick mark. A valid index is in the
range of 0 to 2 ticks less than the tick count returned by the countTicks
method (see <xref linkend="mthCountTicks"/>).
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The logical position of the specified tick mark, or -1 if you
did not specify a valid index for <emphasis role="italic">tic</emphasis>.
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthInitRange" xreflabel="initRange"><title>initRange</title>
<indexterm><primary>initRange</primary></indexterm>
<programlisting>
<![CDATA[
>>--initRange(--+-----+--+-------+--+-----------+--)------------><
+-min-+ +-,-max-+ +-,-redraw--+
]]>
</programlisting>
<para>The initRange method sets the minimum and maximum
positions of the trackbar and redraws the trackbar, if required.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The arguments are:
<variablelist>
<varlistentry><term>min [optional]</term>
<listitem><para>The minimum position of the slider. The default is 0.
</para></listitem></varlistentry>
<varlistentry><term>max [optional]</term>
<listitem><para>The maximum position of the slider. The default is 100.
</para></listitem></varlistentry>
<varlistentry><term>redraw [optional]</term>
<listitem>
<para>
The redraw flag. If you specify <computeroutput>.true</computeroutput>, the trackbar is redrawn after the range is
set. If you specify <computeroutput>.false</computeroutput> the trackbar is not redrawn. The default is false.
</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 range was set.
</para></listitem></varlistentry>
<varlistentry><term>-1</term>
<listitem><para>The minimum you specified is greater than the maximum.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem><para>The following example sets the range, the line step, the page step,
and the tick frequency of the slider:
<programlisting>
<![CDATA[
::method initDialog
curSL = self~newTrackBar("IDC_1")
if curSL \= .Nil then do
curSL~initRange(0,100)
curSL~setLineStep(1)
curSL~setPageStep(10)
curSL~setTickFrequency(10)
end
]]>
</programlisting>
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthInitSelRange" xreflabel="initSelRange"><title>initSelRange</title>
<indexterm><primary>initSelRange</primary></indexterm>
<programlisting>
<![CDATA[
>>--initSelRange(--+-----+--,--+-----+--,--+--------+--)--------><
+-min-+ +-max-+ +-redraw-+
]]>
</programlisting>
<para>The initSelRange method sets the starting and ending
logical positions for the current selection range in a slider. It is ignored
if the trackbar does not have a selection range.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The arguments are:
<variablelist>
<varlistentry><term>min</term>
<listitem><para>The logical starting position of the selection range.
The default is 0.
</para></listitem></varlistentry>
<varlistentry><term>max</term>
<listitem><para>The logical ending position of the selection range. If you omit this
argument, the maximum position of the trackbar's range is assumed.
</para></listitem></varlistentry>
<varlistentry><term>redraw</term>
<listitem><para>The redraw flag. If you specify <computeroutput>.true</computeroutput>, the trackbar is redrawn after
the selection range is set. If you specify <computeroutput>.false</computeroutput> the selection range is set but the
trackbar is not redrawn. The default is <computeroutput>.false</computeroutput>.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>
<variablelist>
<varlistentry><term>-1</term>
<listitem><para>The minimum you specified is greater than the maximum.
</para></listitem></varlistentry>
<varlistentry><term>0</term>
<listitem><para>In all other cases.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthPos" xreflabel="pos"><title>pos</title>
<indexterm><primary>pos</primary></indexterm>
<programlisting>
<![CDATA[
>>--pos------------------------------------------><
]]>
</programlisting>
<para>The pos method retrieves the current logical position
of the slider.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The current logical position of the slider.
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem><para>The following example displays the current trackbar position:
<programlisting>
<![CDATA[
::method displayPos
ctrl=self~newTrackBar("IDC_1")
pos = ctrl~pos
say pos
]]>
</programlisting>
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthPosEquals" xreflabel="pos="><title>pos=</title>
<indexterm><primary>pos=</primary></indexterm>
<programlisting>
<![CDATA[
>>--pos=value------------------------------------><
]]>
</programlisting>
<para>The pos= method sets the new logical position of
the trackbar and redraws the slider.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>value</term>
<listitem><para>The new logical position. A valid position is an integer value within
the range of the minimum and maximum positions of the slider. If you specify
a value outside this range, the position is set to the maximum or minimum
position.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthRangeClsTrackBar" xreflabel="range"><title>range</title>
<indexterm><primary>range</primary>
<secondary>Trackbar class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--range----------------------------------------><
]]>
</programlisting>
<para>The range method retrieves the minimum and maximum
positions of the slider.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The minimum and maximum positions of the trackbar, separated by a blank.
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem><para>The following example displays the range of a slider:
<programlisting>
<![CDATA[
::method displayRange
ctrl=self~newTrackBar("IDC_1")
range = ctrl~range
parse var range min max
say min max
]]>
</programlisting>
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthSelRange" xreflabel="selRange"><title>selRange</title>
<indexterm><primary>selRange</primary></indexterm>
<programlisting>
<![CDATA[
>>--selRange-------------------------------------><
]]>
</programlisting>
<para>The selRange method retrieves the starting position
of the current selection range in a slider.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The starting and ending positions of the current selection
range, separated by a blank.
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthSetLineStep" xreflabel="setLineStep"><title>setLineStep</title>
<indexterm><primary>setLineStep</primary></indexterm>
<programlisting>
<![CDATA[
>>--setLineStep(--step--)------------------------><
]]>
</programlisting>
<para>The setLineStep method sets the number of logical
positions that the trackbar moves in response to keyboard input from the arrow
keys, such as the Right arrow or the Down arrow keys. The logical positions
are the integer increments within the minimum and maximum positions of the
slider.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>step</term>
<listitem><para>The new line size.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The previous line size, or -1 if you omit
<emphasis role="italic">step</emphasis>.
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem><para>The following example sets the range, the line step, the page step,
and the tick frequency of the slider:
<programlisting>
<![CDATA[
::method initDialog
curSL = self~newTrackBar("IDC_1")
if curSL \= .Nil then do
curSL~initRange(0,100)
curSL~setLineStep(1)
curSL~setPageStep(10)
curSL~setTickFrequency(10)
end
]]>
</programlisting>
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthSetMax" xreflabel="setMax"><title>setMax</title>
<indexterm><primary>setMax</primary></indexterm>
<programlisting>
<![CDATA[
>>--setMax(--max--+-----------+--)---------------><
+-,-redraw--+
]]>
</programlisting>
<para>The setMax method sets the maximum logical position
for a trackbar and redraws the trackbar, if required.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The arguments are:
<variablelist>
<varlistentry><term>min</term>
<listitem><para>The maximum position of the slider.
</para></listitem></varlistentry>
<varlistentry><term>redraw [optional]</term>
<listitem>
<para>
The redraw flag. If you specify <computeroutput>.true</computeroutput> the trackbar is redrawn after the maximum
position is set. If you specify <computeroutput>.false</computeroutput> the trackbar is not redrawn. The default is
<computeroutput>.true</computeroutput>.
</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 maximum position was set successfully.
</para></listitem></varlistentry>
<varlistentry><term>-1</term>
<listitem><para>You omitted <emphasis role="italic">min</emphasis>.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthSetMin" xreflabel="setMin"><title>setMin</title>
<indexterm><primary>setMin</primary></indexterm>
<programlisting>
<![CDATA[
>>--setMin(--min--+-----------+--)---------------><
+-,-redraw--+
]]>
</programlisting>
<para>The setMin method sets the minimum logical position
for a trackbar and redraws the trackbar, if required.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The arguments are:
<variablelist>
<varlistentry><term>min</term>
<listitem><para>The minimum position of the slider.
</para></listitem></varlistentry>
<varlistentry><term>redraw [optional]</term>
<listitem>
<para>
The redraw flag. If you specify <computeroutput>.true</computeroutput> the trackbar is redrawn after the minimum
position is set. If you specify <computeroutput>.false</computeroutput> the trackbar is not redrawn. The default is
<computeroutput>.true</computeroutput>.
</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 minimum position was set.
</para></listitem></varlistentry>
<varlistentry><term>-1</term>
<listitem><para>You omitted <emphasis role="italic">min</emphasis>.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthSetPageStep" xreflabel="setPageStep"><title>setPageStep</title>
<indexterm><primary>setPageStep</primary></indexterm>
<programlisting>
<![CDATA[
>>--setPageStep(--step--)------------------------><
]]>
</programlisting>
<para>The setPageStep method sets the number of logical
positions that the trackbar moves in response to keyboard input, such as the
PageUp or PageDown keys, or mouse input, such as clicks in the trackbar's
channel. The logical positions are the integer increments within the minimum
and maximum positions of the slider.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>step</term>
<listitem><para>The new page size.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>The previous page size.
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem><para>The following example sets the range, the line step, the page step,
and the tick frequency of the slider:
<programlisting>
<![CDATA[
::method initDialog
curSL = self~newTrackBar("IDC_1")
if curSL \= .Nil then do
curSL~initRange(0,100)
curSL~setLineStep(1)
curSL~setPageStep(10)
curSL~setTickFrequency(10)
end
]]>
</programlisting>
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthSetPosClsTrackBar" xreflabel="setPos"><title>setPos</title>
<indexterm><primary>setPos</primary>
<secondary>Trackbar class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--setPos(--pos--+-----------+--)---------------><
+-,-redraw--+
]]>
</programlisting>
<para>The setPos method sets the new logical position
of the trackbar and redraws the trackbar if required.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The arguments are:
<variablelist>
<varlistentry><term>pos</term>
<listitem><para>The new logical position. A valid position is an integer value within
the range of the minimum and maximum positions of the slider. If you specify
a value outside this range, the position is set to the maximum or minimum
position.
</para></listitem></varlistentry>
<varlistentry><term>redraw [optional]</term>
<listitem>
<para>
The redraw flag. If you specify <computeroutput>.true</computeroutput>, the control is redrawn with the trackbar at
the position given by <emphasis role="italic">pos</emphasis>. If you specify <computeroutput>.false</computeroutput>
the control is not redrawn. However, the new position is set regardless of the redraw argument. The default is
<computeroutput>.false</computeroutput>.
</para>
</listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem><para>The following example sets the trackbar to the maximum position, with
the range of the trackbar already been set to 0 to 100 using the setRange method:
<programlisting>
<![CDATA[
::method setToMax
ctrl=self~newTrackBar("IDC_1")
ctrl~setPos(100,1)
]]>
</programlisting>
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthSetSelEnd" xreflabel="setSelEnd"><title>setSelEnd</title>
<indexterm><primary>setSelEnd</primary></indexterm>
<programlisting>
<![CDATA[
>>--setSelEnd(--max--+----------+--)-------------><
+-,-redraw-+
]]>
</programlisting>
<para>The setSelEnd method sets the logical ending position
for the current selection range in a slider. It is ignored if the trackbar does
not have a selection range.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The arguments are:
<variablelist>
<varlistentry><term>min</term>
<listitem><para>The logical ending position of the selection range.
</para></listitem></varlistentry>
<varlistentry><term>redraw [optional]</term>
<listitem>
<para>
The redraw flag. If you specify <computeroutput>.true</computeroutput> the trackbar is redrawn after the ending
position has been set. If you specify <computeroutput>.false</computeroutput> the ending position is set but the
trackbar is not redrawn. The default is <computeroutput>.true</computeroutput>.
</para>
</listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>
<variablelist>
<varlistentry><term>-1</term>
<listitem><para>You omitted <emphasis role="italic">max</emphasis>.
</para></listitem></varlistentry>
<varlistentry><term>0</term>
<listitem><para>In all other cases.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthSetSelStart" xreflabel="setSelStart"><title>setSelStart</title>
<indexterm><primary>setSelStart</primary></indexterm>
<programlisting>
<![CDATA[
>>--setSelStart(--min--+----------+--)-----------><
+-,-redraw-+
]]>
</programlisting>
<para>The setSelStart method sets the starting logical
position for the current selection range in a slider. It is ignored if the
trackbar does not have a selection range.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The arguments are:
<variablelist>
<varlistentry><term>min</term>
<listitem><para>The logical starting position of the selection range.
</para></listitem></varlistentry>
<varlistentry><term>redraw [optional]</term>
<listitem>
<para>
The redraw flag. If you specify <computeroutput>.true</computeroutput> the trackbar is redrawn after the starting
position has been set. If you specify <computeroutput>.false</computeroutput> the starting position is set but the
trackbar is not redrawn. The default is <computeroutput>.true</computeroutput>.
</para>
</listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem><para>
<variablelist>
<varlistentry><term>-1</term>
<listitem><para>You omitted <emphasis role="italic">min</emphasis>.
</para></listitem></varlistentry>
<varlistentry><term>0</term>
<listitem><para>In all other cases.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthSetTickAt" xreflabel="setTickAt"><title>setTickAt</title>
<indexterm><primary>setTickAt</primary></indexterm>
<programlisting>
<![CDATA[
>>--setTickAt(--pos--)---------------------------><
]]>
</programlisting>
<para>The setTickAt method sets a tick mark at the specified
logical position in the slider.</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem><para>The only argument is:
<variablelist>
<varlistentry><term>pos</term>
<listitem><para>An integer value within the minimum and maximum positions of the slider.
</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 tick mark was set.
</para></listitem></varlistentry>
<varlistentry><term>-1</term>
<listitem><para>You omitted <emphasis role="italic">pos</emphasis>.
</para></listitem></varlistentry>
<varlistentry><term>1</term>
<listitem><para>For all other cases.
</para></listitem></varlistentry>
</variablelist>
</para></listitem></varlistentry>
</variablelist>
</section>
<section id="mthSetTickFrequency" xreflabel="setTickFrequency"><title>setTickFrequency</title>
<indexterm><primary>setTickFrequency</primary></indexterm>
<programlisting>
<![CDATA[
>>--setTickFrequency(--freq--)-------------------><
]]>
</programlisting>
<para>
The <emphasis role="italic">setTickFrequency</emphasis> method sets the interval frequency for tick marks in a
trackbar. For example, if you set the frequency to 2, a tick mark is displayed for every other increment in the
trackbar's range. By deault the frequency is 1.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>freq [required]</term>
<listitem>
<para>
The frequency of the tick marks. By default the trackbar sets its frequency to 1, that is, every increment in
the range is associated with a tick mark.
</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">Example:</emphasis></term>
<listitem>
<para>
The following example sets the range, the line step, the page step, and the tick frequency of the trackbar:
<programlisting>
<![CDATA[
::method initDialog
curSL = self~newTrackBar("IDC_1")
if curSL \= .nil then do
curSL~initRange(0,100)
curSL~setLineStep(1)
curSL~setPageStep(10)
curSL~setTickFrequency(10)
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section>
</chapter>

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

Sign up for the SourceForge newsletter:





No, thanks