os::ImageButton Class Reference
[The Syllable Graphical User Interface API]

Imagebutton gui element. More...

Inheritance diagram for os::ImageButton:

os::Button os::Control os::View os::Invoker os::Handler List of all members.

Public Types

enum  ImageButton_Position {
  IB_TEXT_RIGHT = 0x0001,
  IB_TEXT_LEFT = 0x0002,
  IB_TEXT_TOP = 0x0003,
  IB_TEXT_BOTTOM = 0x0004
}
 Positions. More...

Public Member Functions

 ImageButton (Rect cFrame, const String &cName, const String &cLabel, Message *pcMessage, Image *pcBitmap, uint32 nTextPosition=ImageButton::IB_TEXT_BOTTOM, bool bShowFrames=false, bool bShowText=false, bool bMouse=false, uint32 nResizeMask=CF_FOLLOW_LEFT|CF_FOLLOW_TOP, uint32 nFlags=WID_WILL_DRAW|WID_FULL_UPDATE_ON_RESIZE)
 Initialize the imagebutton.
virtual ~ImageButton ()
uint32 GetTextPosition (void) const
 Gets the text postion.
void SetTextPosition (uint32 nTextPosition)
 Resests the text postion.
void SetImage (StreamableIO *pcStream)
 Load an image from a stream.
void SetImage (Image *pcImage)
 Sets the Image from another image.
ImageGetImage (void) const
 Gets the Image.
void ClearImage ()
 Clears the image.
virtual void Activated (bool)
 Hook called when the view gain or loose focus.
virtual void MouseDown (const Point &cPosition, uint32 nButton)
 Hook called by the system when a mouse button is pressed.
virtual void MouseMove (const Point &cNewPos, int nCode, uint32 nButtons, Message *pcData)
 Hook called by the system when the mouse is moved.
virtual void MouseUp (const Point &cPosition, uint32 nButton, Message *pcData)
 Hook called by the system when a mouse button is release.
virtual void Paint (const Rect &cUpdateRect)
 Called by the system update "damaged" areas of the view.
virtual Point GetPreferredSize (bool bLargest) const
ImageButtonoperator= (const ImageButton &)
 Copy an ImageButton.
virtual void _reserved1 ()
virtual void _reserved2 ()
virtual void _reserved3 ()
virtual void _reserved4 ()
virtual void _reserved5 ()
virtual void _reserved6 ()
virtual void _reserved7 ()
virtual void _reserved8 ()
virtual void _reserved9 ()
virtual void _reserved10 ()

Public Attributes

enum os::ImageButton::ImageButton_Position Positon
 Positions.

Classes

class  Private

Detailed Description

..

Description:
Simple image pushbutton class...
Author:
Rick Caudill ( [email protected])


Member Enumeration Documentation

enum os::ImageButton::ImageButton_Position

Description:
These values are used to specify the positon of the image and label on the imagebutton.
Enumerator:
IB_TEXT_RIGHT  Sets the text to the right of the imagebutton.
IB_TEXT_LEFT  Sets the text to the left of the imagebutton.
IB_TEXT_TOP  Sets the text to the top of the imagebutton.
IB_TEXT_BOTTOM  Sets the text to the bottom of the imagebutton.


Constructor & Destructor Documentation

ImageButton::ImageButton ( Rect  cFrame,
const String cName,
const String cLabel,
Message pcMessage,
Image pcBitmap,
uint32  nTextPosition = ImageButton::IB_TEXT_BOTTOM,
bool  bShowFrames = false,
bool  bShowText = false,
bool  bMouse = false,
uint32  nResizeMask = CF_FOLLOW_LEFT|CF_FOLLOW_TOP,
uint32  nFlags = WID_WILL_DRAW | WID_FULL_UPDATE_ON_RESIZE 
)

Description:
The imagebutton contructor initialize the local object.
Parameters:
cFrame - The size and position of the imagebutton.
pzName - The name of the imagebutton.
pzLabel - The label of the imagebutton.
pcMessage - The message passed to the imagebutton.
pcImage - The bitmapimage for the imagebutton.
nTextPosition - The Position of the label and the image for the imagebutton.
bShowFrames - Determines whether the imagebutton will have frames or not.
bShowText - Determines whether the imagebutton will show the label or not.
bMouse - Determines whether the imagebutton will have mouseover abilities(this is not working yet).
nResizeMask - Determines what way the imagebutton will follow the rest of the window. Default is CF_FOLLOW_LEFT|CF_FOLLOW_TOP.
nFlags - Deteremines what flags will be sent to the imagebutton.
Author:
Rick Caudill ([email protected]) based on Andrew Keenan's ImageButton class

ImageButton::~ImageButton (  )  [virtual]


Member Function Documentation

uint32 ImageButton::GetTextPosition ( void   )  const

..

Description:
Gets the text positon of the ImageButton.
Author:
Rick Caudill ([email protected])

void ImageButton::SetTextPosition ( uint32  nTextPosition  ) 

..

Description:
Resests the text postion and then flushes the imagebutton.
Parameters:
nTextPosition - int that holds the text position. Should be: ID_TEXT_BOTTOM, ID_TEXT_RIGHT, ID_TEXT_TOP, or ID_TEXT_LEFT.
Author:
Rick Caudill ([email protected])

void ImageButton::SetImage ( StreamableIO pcStream  ) 

Description:
Reads the BitmapImage for the ImageButton from a data stream.
Parameters:
pcStream - A StreamableIO data source for the Bitmap data.
Author:
Kristian Van Der Vliet ([email protected])

void ImageButton::SetImage ( Image pcImage  ) 

..

Description:
Sets the Image for the ImageButton from another Image.
Parameters:
pcImage - The image.
Author:
Rick Caudill ([email protected])

Image * ImageButton::GetImage ( void   )  const

..

Description:
Gets the Image that is passed to the ImageButton.
Author:
Rick Caudill ([email protected])

void ImageButton::ClearImage ( void   ) 

..

Description:
Clears the BitmapImage that is passed to the ImageButton.
Author:
Rick Caudill ([email protected])

void ImageButton::Activated ( bool  bIsActive  )  [virtual]

Description:
This is a callback member that can be overloaded by derived classes to learn when the view is activated and when it is deactivated. The bIsActive parameter tell whether the focus was lost or gained.
The view has focus when it is the active view in the active window.
Note:
This is a hook function that is called by the system to notify about an event. You should never call this member yourself.
The window is locked when this member is called.
Parameters:
bIsActive - true if the view gain and false if it loose focus.
See also:
MakeFocus(), WindowActivated()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::Button.

void ImageButton::MouseDown ( const Point cPosition,
uint32  nButton 
) [virtual]

Description:
This member is called from the window thread whenever a mouse button is clicked above the view. You can overload this member if your view need to know about mouse-down events.
A view will not automatically take focus when clicked so if you want that behaviour you must call MakeFocus() from an overloaded version of this member.
The default implementation of this member will call MouseDown() on it's parent view if one exists.
Parameters:
cPosition Mouse position in the views coordinate system at the time the mouse was pressed.
nButtons Index of the pressed button. Buttons start at 1 for the left button, 2 for the right button, 3 for the middle button. Additional buttons might be supported by the mouse driver and will then be assigned numbers from 4 and up.
See also:
MouseUp(), MouseMove(), WheelMoved()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::Button.

void ImageButton::MouseMove ( const Point cNewPos,
int  nCode,
uint32  nButtons,
Message pcData 
) [virtual]

Description:
This member is called from the window thread whenever the mouse is moved above the view or if the view has focus.
Oveload this member if your view need to handle mouse-move events.
The default implementation of this member will call MouseMove() on it's parent view if one exists.
Parameters:
cNewPos New mouse position given in the views coordinate system.
nCode Enter/exit code. This is MOUSE_ENTERED when the mouse first enter the view, MOUSE_EXITED when the mouse leaves the view, MOUSE_INSIDE whenever the mouse move withing the boundary of the view and MOUSE_OUTSIDE when the mouse move outside the view (will only happen if the view has focus).
nButtons Bitmask telling which buttons that are currently pressed. Bit 0 is button 1 (left), bit 1 is button 2 (right), and bit 2 is button 3 (middle), and so on.
pcData Pointer to a Message object containing the dragged data if the user is in the middle of a drag and drop operation. Otherwise this pointer is NULL. Look at BeginDrag() for a more detailed description of the drag and drop system.
See also:
MouseDown(), MouseUp(), WheelMoved(), BeginDrag()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::Button.

void ImageButton::MouseUp ( const Point cPosition,
uint32  nButton,
Message pcData 
) [virtual]

Description:
This member is called from the window thread whenever a mouse button is released above the view. You can overload this member if your view need to know about mouse-up events or if your view support drag and drop.
If mouse-up was the result of ending a drag and drop operation the pcData member will point to a Message containing the dragged data. Look at BeginDrag() for a more detailed description of the drag and drop system.
The default implementation of this member will call MouseDown() on it's parent view if one exists.
Parameters:
cPosition Mouse position in the views coordinate system at the time the mouse was pressed.
nButtons Index of the pressed button. Buttons start at 1 for the left button, 2 for the right button, 3 for the middle button. Additional buttons might be supported by the mouse driver and will then be assigned numbers from 4 and up.
pcData Pointer to a Message object containing the dragged data if this mouse-up was the end of a drag and drop operation. If no data was dragged it will be NULL.
See also:
MouseDown(), MouseMove(), WheelMoved()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::Button.

void ImageButton::Paint ( const Rect cUpdateRect  )  [virtual]

Description:
Note:
Warning:
Parameters:
cUpdateRect A rectangle enclosing all damaged areas. This is just a rough "worst-case", further fine-grained clipping will be performed by the Application Server to avoid updating non-damaged pixels and make the update as fast and flicker-free as possible.
See also:
Invalidate(), Flush()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::Button.

Point ImageButton::GetPreferredSize ( bool  bLargest  )  const [virtual]

Reimplemented from os::Button.

ImageButton & ImageButton::operator= ( const ImageButton cImageButton  ) 

Description:
Copy the Image from one ImageButton to another
Parameters:
cImageButton - The ImageButton to copy from.
Author:
Kristian Van Der Vliet ([email protected])

void ImageButton::_reserved1 (  )  [virtual]

void ImageButton::_reserved2 (  )  [virtual]

void ImageButton::_reserved3 (  )  [virtual]

void ImageButton::_reserved4 (  )  [virtual]

void ImageButton::_reserved5 (  )  [virtual]

void ImageButton::_reserved6 (  )  [virtual]

void ImageButton::_reserved7 (  )  [virtual]

void ImageButton::_reserved8 (  )  [virtual]

void ImageButton::_reserved9 (  )  [virtual]

void ImageButton::_reserved10 (  )  [virtual]


Member Data Documentation

enum os::ImageButton::ImageButton_Position os::ImageButton::Positon

Description:
These values are used to specify the positon of the image and label on the imagebutton.


Generated on Sat May 9 22:51:32 2009 for Syllable higlevel API by  doxygen 1.5.1