Apple Newton Utilities User's Guide Page 273

  • Download
  • Add to my manuals
  • Print
  • Page
    / 942
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 272
CHAPTER 7
Controls and Other Protos
Gauge and Slider Protos 7-13
The clGaugeView class is used to display objects that look like analog bar
gauges. Although the
clGaugeView class is available, you should use the
protoGauge to display bar gauges. purpose as is the protoGauge proto. For
more information about the slots and methods for the
protoGauge proto, see
“protoGauge” (page 6-35) in Newton Programmers Reference.
Figure 7-20 A clGaugeView view
Implementing a Simple Slider 7
The clGaugeView class and the slider protos all have several slots to dene the
appearance and range of the slider:
The viewBounds slot species the size and location of the slider.
The viewValue slot species the current value of the slider.
The minValue slot species the minimum value of the slider, with a default
value of
0.
The maxValue slot species the maximum value of the slider, with a default
value of
100.
You can specify the initial value of a slider in the
viewValue slot. However, you
often need to look up the initial value; when this is the case, set the initial value of
the slider in the ViewSetupFormScript method.
To implement a slider, dene your template with the proto that you want to use,
specify the appearance and range slots, and (optionally) assign an initial value in
the
ViewSetupFormScript method of the proto. For some protos, you need to
dene additional methods that respond to the user modifying the slider.
The following example is a template that uses
protoSlider to allow adjustment
of the current system volume:
SoundSetter := {...
_proto: protoSlider,
viewBounds: RelBounds( 12, -21, 65, 9),
viewJustify: vjParentBottomV,
maxValue: 4,
ViewSetupFormScript: func()
self.viewValue := GetUserConfig('soundVolume);
Knob
Page view 272
1 2 ... 268 269 270 271 272 273 274 275 276 277 278 ... 941 942

Comments to this Manuals

No comments