Chapter 12.  Buttons and Static Texts

For purposes of this chapter, the notion of a button is fairly loose—loose enough to embrace seven built-in control classes. (A button here is like smut; I may not be able to tell you what it is, but I know it when I see it. If pressed for a definition, I might say: a button is something you click with the mouse to toggle its state or to initiate some process.) The seven classes I’m calling buttons are PushButton, BevelButton, Placard, LittleArrows, CheckBox, RadioButton, and DisclosureTriangle. An eighth class, GroupBox, is used to tell REALbasic which RadioButtons are to be grouped together, so it is treated along with them. Finally, this chapter also deals with StaticText, because it is similar to the caption of a CheckBox or RadioButton.

Figure 12-1 shows a window illustrating several of the classes discussed in this chapter. It has two GroupBoxes, each containing two RadioButtons; a CheckBox; a StaticText—next to an EditField, treated in Chapter 13—and two PushButtons.

Various buttons

Figure 12-1. Various buttons

These are all RectControls, and therefore they receive all the events and have all the methods and properties listed in Chapter 10: Open and Close events; Visible, Enabled, and AutoDeactivate properties; Top, Left, Height, and Width properties; LockLeft, LockRight, LockTop, and LockBottom properties; MouseEnter, MouseMove, and MouseExit ...

Get REALBasic: TDG, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.