The cControl_Webbutton class implements a button similar to a simple HTML button commonly found on webpages.
The WebButton control is designed to function individually or in tandem with other WebButton controls. Multiple WebButtons may function as an option group, where only one of several buttons may be selected at a time, or as a toggle group, where several may
be selected simultaneously.
The WebButton Control manages the highlighting and selecting of buttons using the
object. Referring to the diagram, we may construct two groups of WebButtons (one a toggle button group, the other an option button group). Each WebButton object has a local instance of the
class, which serves as a delegator for control event handlers which act to "unhighlight" the web button when the mouse moves over them (i.e., forms, section controls, other controls adjacent to the WebButton, etc).
The option group Webbuttons each share a reference to one Select_Button reference (a cControlChild_ActiveButton object). This makes it possible to have a reference to the currently-selected WebButton in the group. Selecting another WebButton, then, is a simple
matter of "Unselecting" the WebButton referenced by the
property, and assigining the newly-selected WebButton to the same property.
Note that the toggle group WebButtons each carry a local reference to a Select_Button. This is necessary since a toggle button may be enabled or disabled without regard to the state of any other WebButton.
The remaining object, the
object, is shared across all WebButton controls in both groups. The Highlight_Button object maintains the highlighted state of a WebButton control just as the Select_Button object maintains the selected state of the WebButton controls.
Thus, by sharing one cControlChild_ActiveButton Highlight_Button among all WebButtons, we can guarantee no two WebButtons can be highlighted simultaneously. The cControl_Deselector object maintains a registry of other control event handlers which act to turn
off highlighting for the buttons on an individual basis. This allows unique control references which may be adjacent to one WebButton control (but not another) to act on only the appropriate WebButton.
cControl_WebButton Object Members
cCompositeControls Methods for cControl_WebButton