-
This class captures the abstraction of a pushable control in the
user interface. Each button has a name that defines the text
appearing on the face of the button. The name suggests the action
associated with the button being pushed. When the button is pushed,
the OnPush function of the simple programming environment is called
with the name of the button as a parameter. By testing this name,
the identity of the pushed button can be determined.
A button appears at a
specified Location within a Panel and occupies a region defined by
a Shape. A button is added to a Panel using a method defined in
the Panel class.
[
Index |
Source |
Summary | Member Functions ]
Class Summary
class Button
{
public:
- Button(char* name, Location location, Shape shape);
- int IsNamed(char* name);
- ~Button();
}; // Button
Back to the top of Button
Button(char* name, Location location, Shape shape);
Construct a button object with the specified name, Location, and
Shape. The Shape must be sufficiently large to contain the characters
of the name.
- name : the name that appears on the face of the button
in the user interface; also passed to the OnPush function when
the button is pushed by the user.
- location : the position in a Panel of the upper
left-hand corner of the button.
- shape : the rectangular area occupied by the button
in a Panel.
Button(char* name, Location location, Shape shape);
Back to the top of Button
int IsNamed(char* name);
Determine if the name of the button matches a given text string.
Return 1 if the given text string matches the button's name,
otherwise return 0.
int IsNamed(char* name);
Back to the top of Button
~Button();
Release all resources owned by the Button's implementation.
~Button();
Back to the top of Button
Member Functions
- public:
- int IsNamed(char* name);
Back to the top of Button
Generated from source by the Cocoon utilities on Thu Apr 02 12:40:03 1998
.
Report problems to jkotula@unimax.com