Article Preview
Buy Now
| Print: | |
| PDF: |
The Topographic Apprentice
Control Panel Library
Switch Class
Issue: 4.1 (September/October 2005)
Author: Joe Nastasi
Article Description: No description available.
Article Length (in bytes): 7,375
Starting Page Number: 36
RBD Number: 4117
Resource File(s): None
Related Link(s): None
Known Limitations: None
Excerpt of article text...
In this installment of Topographic Apprentice, we'll take a look at the SwitchClass. But the big news is that the demo program is now on the REALbasic Developer web site, so download it and start trying out the library!
SwitchClass
The SwitchClass is very similar to the IndicatorClass in that it uses 2D pictures, stored as shapes, to represent each switch position. These change by changing the Shape property to reflect the current switch state. The key is how it knows that the state has changed. More on that later.
Earlier in the series, I mentioned using RBScript for switches. As it turns out, testing for the switch status in the simulation or game loop is simpler and all that is required for most applications.
Properties
Height as Integer - A local property that contains the height of the indicator.
Width as Integer - A local property that contains the width of the indicator.
InitialState as Integer - A local property that indicates what state or position the switch will be in when first drawn.
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.
|








