A simple push button control to initiate an action.
![]() | ButtonType Type of button for construction |
![]() | PPushButton ( PInteractor * parent, ButtonType deflt = OrdinaryButton ) Create a push button control with the specified name. |
![]() | PPushButton ( PInteractorLayout * parent, PRESOURCE_ID ctlID, const PNotifier & notify, void * valuePtr ) Create control from interactor layout with the specified control ID. |
![]() | ~PPushButton () Destroy the push button control. |
![]() | DrawButtonSurround ( PCanvas & canvas, BOOL isSelected ) Draw the 3D look of a pushbutton surround. |
![]() | OnDrawFace ( PCanvas & canvas, const PRect & rect, BOOL hasFocus, BOOL isSelected ) Draw the contents (face) of the push button. |
![]() | New functions for class |
![]() | System callback functions. |
![]() | defaultButton Flag for button is a default button with extra highlighting |
PNotifier codes
Overrides from class PInteractor
Overrides from class PInteractor
Member variables
Overrides from class PObject
A simple push button control to initiate an action.This is an abstract class for user defined types of push buttons, as well as the standard text and image buttons. When making a customised push button the application should not override the PInteractor::OnRedraw() function.
The exact appearence of a push button is defined by the descendent class. However, they all have the same semantics of calling the notification function when they are selected, be that via mouse click or some other mechanism as is possible on the specific platform.
DefaultButton
The default implementation draws a "lighted" rectangle that is raised
when the button is a default button. This function should be overridden when the button surround needs to be
something other than the default. Do not override the
PInteractor::OnRedraw() function, override
DrawButtonSurround() and/or the OnDrawFace() functions for
drawing custom buttons. This is required by the various platforms
implementations.
This is a pure function and must be overridden by descendent classes to
give the button its visual appearance. It is called immediately after
the DrawButtonSurround() function whenever the button needs to
be redrawn. Note that due to the implementation just overriding the
PInteractor::OnRedraw() function is insufficient to correctly
implement a new look for a button. Always override the
DrawButtonSurround() and OnDrawFace() functions.
PPushButton( PInteractorLayout * parent, PRESOURCE_ID ctlID, const PNotifier & notify, void * valuePtr )
ctlID - Identifier for the control in the layout.
notify - Function to call when changes state.
valuePtr - Variable to change to the button state.virtual ~PPushButton()
New functions for class
virtual PRect DrawButtonSurround( PCanvas & canvas, BOOL isSelected )
isSelected - Flag for whether button is currently down. System callback functions.
virtual void OnDrawFace( PCanvas & canvas, const PRect & rect, BOOL hasFocus, BOOL isSelected )
rect - Bounds in which to draw the button face.
hasFocus - Flag indicating that the button has the focus.
isSelected - Flag indicating the button is currently down.BOOL defaultButton
Alphabetic index HTML hierarchy of classes or Java