class PImageButton: public PPushButton

A simple push button control with an image icon in it, which is used to initiate an action

Inheritance:


Public Methods

[more]void DefaultDimensions ()
Set the default (minimum) dimensions for the control
[more]virtual void OnDrawFace ( PCanvas & canvas, const PRect & rect, BOOL hasFocus, BOOL isSelected )
Draw the contents (face) of the pushbutton.
[more] PImageButton ( PInteractor * parent, ButtonType deflt = OrdinaryButton )
Create an icon button control with the specified attributes.
[more] PImageButton ( PInteractorLayout * parent, PRESOURCE_ID ctlID, const PNotifier & notify, void * valuePtr )
Create control from interactor layout with the specified control ID.
[more]virtual ~PImageButton ()
Destroy the icon push button control and image.
[more]void DefaultDimensions ()
Set the default (minimum) dimensions for the control.
[more]void SetImage ( const PImgIcon & img )
Set the current image used in the button.
[more]PImgIcon GetEnabledImage () const
Get the current image being drawn in the face of the button when it is enabled.
[more]PImgIcon GetDisabledImage () const
Get the current image being drawn in the face of the button when it is disabled.
[more]virtual void OnDrawFace ( PCanvas & canvas, const PRect & rect, BOOL hasFocus, BOOL isSelected )
Draw the contents (face) of the pushbutton.

Public

[more] New functions for class
[more] System callback functions.

Protected Fields

[more]PImgIcon enabledImage
The small pixel image to be used in the button when enabled.
[more]PImgIcon disabledImage
The small pixel image to be used in the button when disabled.


Inherited from PPushButton:

Public Classes

oenum ButtonType

Public Methods

ovirtual PRect DrawButtonSurround( PCanvas & canvas, BOOL isSelected )

Protected Fields

oBOOL defaultButton


Inherited from PNamedControl:

Public Methods

oPString GetName() const
ovoid SetName( const PString & name )


Inherited from PControl:

Public Fields

oPRESOURCE_ID controlID

Public Methods

ovirtual PBalloon* OnBalloonHelp()
ovirtual BOOL IsTabStop() const
oPRESOURCE_ID GetControlID() const
ovoid SetControlID( PRESOURCE_ID theID )
oconst PNotifier& GetNotifier() const
oBOOL WillNotifyOnStateUpdate() const
ovoid SetNotifier( const PNotifier & func, BOOL notifyForStateUpdate = FALSE )
ovoid* GetValuePointer() const
ovoid SetValuePointer( void * ptr )
ovirtual void TransferValue( int option )
oconst PString& GetBalloonHelp() const
ovoid SetBalloonHelp( const PString & text )
ovirtual void UpdateMyCommandSources()

Public

PNotifier codes

o Codes passed to the notification function on changes of state.

Overrides from class PInteractor

Protected Fields

oPNotifier callback
ovoid* valuePointer
oBOOL notifyForStateUpdate
oPString balloonHelpText

Protected

Overrides from class PInteractor

Member variables


Inherited from PInteractor:

Public Classes

oenum PositionOrigin
oenum CoordinateSystem
oenum AutoAdjustType

Public Fields

oPCursor cursor

Public Methods

ovirtual Comparison Compare( const PObject & obj ) const
oPInteractor* GetParent() const
oBOOL IsChild( PInteractor * parent ) const
oPINDEX GetNumChildren()
oPInteractor& operator[]( PINDEX index )
ovirtual void UpdateCommandSources()
ovirtual void SetFont( const PFont & newFont, BOOL toChildren = TRUE )
oconst PRealFont& GetFont()
oPDIMENSION ToPixelsDX( PDIMENSION x ) const
oPDIMENSION ToPixelsDY( PDIMENSION y ) const
oPORDINATE ToPixelsX( PORDINATE x ) const
oPORDINATE ToPixelsY( PORDINATE y ) const
oPDim ToPixels( const PDim & dim ) const
oPPoint ToPixels( const PPoint & pt ) const
oPRect ToPixels( const PRect & r ) const
oPDIMENSION FromPixelsDX( PDIMENSION x ) const
oPDIMENSION FromPixelsDY( PDIMENSION y ) const
oPORDINATE FromPixelsX( PORDINATE x ) const
oPORDINATE FromPixelsY( PORDINATE y ) const
oPDim FromPixels( const PDim & dim ) const
oPPoint FromPixels( const PPoint & pt ) const
oPRect FromPixels( const PRect & r ) const
ovoid SetPosition( PORDINATE x, PORDINATE y, PositionOrigin xOrigin = TopLeftParent, PositionOrigin yOrigin = TopLeftParent )
oPPoint GetPosition( CoordinateSystem coords ) const
oPPoint ToScreen( PORDINATE x, PORDINATE y, CoordinateSystem coords ) const
oPPoint FromScreen( PORDINATE x, PORDINATE y, CoordinateSystem coords ) const
ovoid SetDimensions( PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
oPDim GetDimensions( CoordinateSystem coords ) const
oPRect GetStructureBounds( CoordinateSystem coords ) const
ovirtual PRect GetDrawingBounds( CoordinateSystem coords ) const
ovoid AutoAdjustBounds( PRect & bounds, AutoAdjustType type = AdjustBounds )
oBOOL ContainsPoint( const PPoint & pt, CoordinateSystem coords ) const
oPInteractor* FindInteractor( const PPoint & pt, CoordinateSystem coords ) const
ovirtual void Enable( BOOL enabled = TRUE )
ovoid Disable()
oBOOL IsEnabled() const
ovirtual void ShowAll()
ovirtual void Show( BOOL visible = TRUE )
ovoid Hide()
oBOOL IsVisible() const
ovirtual void BringToTop()
ovirtual BOOL IsOnTop() const
ovoid Invalidate( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
ovoid Validate( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
ovoid Update()
ovoid GrabMouse()
ovoid ReleaseMouse()
oBOOL HasMouse() const
ovoid GrabFocus()
oBOOL HasFocus() const
ovirtual void SetCursor( const PCursor & newCursor )
oPCursor GetCursor() const
ovoid SetCursorToParent( BOOL useParent = TRUE )
ovoid SetAllCursors( const PCursor & newCursor )
ovoid RestoreAllCursors()
ovoid SetWaitCursor()
ovoid SetCursorPos( PORDINATE x, PORDINATE y, CoordinateSystem coords )
oPPoint GetCursorPos( CoordinateSystem coords ) const
ovirtual void ShowCursor( BOOL show = TRUE )
ovoid HideCursor()
ovoid SetCaret( const PCaret & newCaret )
oPCaret GetCaret() const
ovoid SetCaretPos( PORDINATE x, PORDINATE y, CoordinateSystem coords )
oPPoint GetCaretPos( CoordinateSystem coords ) const
ovirtual void ShowCaret(BOOL show = TRUE)
ovoid HideCaret()
ovirtual void SetForegroundColour( const PColour & newColour )
oconst PColour& GetForegroundColour() const
ovirtual void SetBackgroundColour( const PColour & newColour )
oconst PColour& GetBackgroundColour() const
oPDim GetBorderSize() const
oconst PColour& GetBorderColour() const
oPCanvas* StartMouseTrack( BOOL wantsCanvas = FALSE )
ovirtual void OnMouseMove( PKeyCode button, const PPoint & where )
ovirtual void OnMouseDown( PKeyCode button, const PPoint & where, BOOL doubleClick )
ovirtual void OnMouseUp( PKeyCode button, const PPoint & where )
ovirtual BOOL OnKeyDown( PKeyCode key, unsigned repeat )
ovirtual void OnKeyUp( PKeyCode key )
ovirtual void OnKeyInput( const PString & str )
ovirtual void OnGainFocus()
ovirtual void OnLostFocus()
ovirtual void OnStartInput()
ovirtual BOOL OnEndInput()
ovirtual void OnRedraw( PCanvas & canvas )
ovirtual void OnControlNotify( PControl & control, int option )
ovirtual void OnSelectHelp()
ovirtual void OnMouseTrack( PCanvas * canvas, const PPoint & where, BOOL lastTrack )
ovirtual void _SetPosition( PORDINATE x, PORDINATE y, PositionOrigin xOrigin, PositionOrigin yOrigin )

Public

Overrides from class PObject

Protected Fields

oPApplication* owner
oPInteractor* parent
oPInteractorList children
oPRealFont font
oPCursor savedCursor
oPCaret caret
oPPoint caretPosition
oint caretVisible
oPColour foregroundColour
oPColour backgroundColour
oPInteractor* mouseTrackInteractor
oPInteractorCanvas* mouseTrackCanvas

Protected Methods

ovirtual void _SetDimensions( PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
ovirtual void _Invalidate( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
ovirtual void _Validate( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
ovirtual void _SetCursorPos( PORDINATE x, PORDINATE y, CoordinateSystem coords )
ovirtual void _SetCaretPos( PORDINATE x, PORDINATE y, CoordinateSystem coords )
ovirtual void SetFocusInteractor( PInteractor * interactor )
ovirtual PInteractor* GetFocusInteractor() const

Protected

o Flag to indicate that the parent interactor layouts cursor should be used with this interactor.


Documentation

A simple push button control with an image icon in it, which is used to initiate an action
ovoid DefaultDimensions()
Set the default (minimum) dimensions for the control

ovirtual void OnDrawFace( PCanvas & canvas, const PRect & rect, BOOL hasFocus, BOOL isSelected )
Draw the contents (face) of the pushbutton.

On some platforms this may be a dummy function which does nothing and is never called.

Parameters:
canvas - Canvas into which to draw the button face.
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.

o PImageButton( PInteractor * parent, ButtonType deflt = OrdinaryButton )
Create an icon button control with the specified attributes.
Parameters:
parent - Interactor into which the control is placed.
deflt - Flag for is the default button.

o PImageButton( PInteractorLayout * parent, PRESOURCE_ID ctlID, const PNotifier & notify, void * valuePtr )
Create control from interactor layout with the specified control ID. This is mainly used in support of resource based dialogs.
Parameters:
parent - Interactor into which the box is placed.
ctlID - Identifier for the control in the layout.
notify - Function to call when changes state.
valuePtr - Variable to change to the button state.

ovirtual ~PImageButton()
Destroy the icon push button control and image.

o New functions for class

ovoid DefaultDimensions()
Set the default (minimum) dimensions for the control. This will be just enough to contain the iamge and the buttons 3d surround.

ovoid SetImage( const PImgIcon & img )
Set the current image used in the button. This will be updated on the screen immediately (within OS contsraints).
Parameters:
img - New image to set in the button.

oPImgIcon GetEnabledImage() const
Get the current image being drawn in the face of the button when it is enabled.

Returns:
image icon that is used in the button.

oPImgIcon GetDisabledImage() const
Get the current image being drawn in the face of the button when it is disabled.

Returns:
image icon that is used in the button.

o System callback functions.

ovirtual void OnDrawFace( PCanvas & canvas, const PRect & rect, BOOL hasFocus, BOOL isSelected )
Draw the contents (face) of the pushbutton.

The default action for this function is to draw the image centred in the specified rectrangle. A slight offset is applied to this when the

This aids the visual appearance.

Parameters:
canvas - Canvas into which to draw the button face.
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.

oPImgIcon enabledImage
The small pixel image to be used in the button when enabled.

oPImgIcon disabledImage
The small pixel image to be used in the button when disabled.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.