Special

Special Print Offer

Get the RBD Archive 7 printed book for FREE when you buy an Ultimate Combo printed back issue package! This perfect-bound book is over 300 pages and contains the full year 7 of RBD. Normally this book sells for $50, but with this special offer you not only save 25% off the normal package price, you get the book included for free!

RBD Magazines

Supplies are limited, so take advantage of this offer before it goes away.

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.


 


|

 


Weblog Commenting and Trackback by HaloScan.com