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

Popupmenu gui element. More...

Inheritance diagram for os::PopupMenu:

os::View os::Handler List of all members.

Public Member Functions

 PopupMenu (const Rect &, const String &, const String &, Menu *pcMenu=NULL, Image *pcImage=NULL, uint32 nResizeMask=CF_FOLLOW_LEFT|CF_FOLLOW_TOP, uint32 nFlags=WID_FULL_UPDATE_ON_RESIZE|WID_WILL_DRAW)
 Initialize the popupmenu.
 ~PopupMenu ()
void SetIcon (Image *)
 Sets the icon that will be attached to the PopupMenu.
ImageGetIcon ()
 Gets the icon that is attached to the PopupMenu.
String GetLabel ()
 Gets the label of the PopupMenu.
void SetLabel (const String &)
 Sets the label of the PopupMenu.
bool IsEnabled ()
 Tells the programmer whether this element is enabled or disabled.
void SetEnabled (bool, bool bValidate=false)
 Tells the system to disable or enable this element.
void SetDrawArrow (bool bArrow)
 Tells the element whether you want the arrow icon attached to the PopupMenu.
virtual void Paint (const Rect &)
 Called by the system update "damaged" areas of the view.
virtual void MouseDown (const Point &, uint32)
 Hook called by the system when a mouse button is pressed.
virtual void MouseUp (const Point &cPosition, uint32 nButtons, Message *pcData)
 Hook called by the system when a mouse button is release.
virtual void MouseMove (const Point &cPosition, int nCode, uint32 nButtons, Message *pcData)
 Hook called by the system when the mouse is moved.
Point GetPreferredSize (bool bLargest) const

Classes

class  Private

Detailed Description

..

Description:
PopupMenu class...
Author:
Rick Caudill ([email protected])


Constructor & Destructor Documentation

PopupMenu::PopupMenu ( const Rect cFrame,
const String cName,
const String cLabel,
Menu pcMenu = NULL,
Image pcIcon = NULL,
uint32  nResizeMask = CF_FOLLOW_LEFT|CF_FOLLOW_TOP,
uint32  nFlags = WID_FULL_UPDATE_ON_RESIZE | WID_WILL_DRAW 
)

Description:
The popupmenu constructor initializes the local object.
Parameters:
cFrame - The size and position of the popupmenu.
cName - The name of the popupmenu.
cLabel - The label written on the popupmenu.
pcMenu - The menu that will be displayed when you click the popupmenu. Caveat: You must set the menu to a handler or a meessenger(Menu::SetTargetForItems())
pcIcon - The image displyed on popupmenu.
nResizeMask - Determines what way the popupmenu will follow the rest of the window. Default is CF_FOLLOW_LEFT|CF_FOLLOW_TOP.
nFlags - Deteremines what flags will be sent to the popupmenu. Default is WID_WILL_DRAW | WID_CLEAR_BACKGROUND | WID_FULL_UPDATE_ON_RESIZE
Author:
Rick Caudill ([email protected])

PopupMenu::~PopupMenu (  ) 


Member Function Documentation

void PopupMenu::SetIcon ( Image pcIcon  ) 

..

Description:
Sets the icon that will be attached to the PopupMenu.
Parameters:
pcIcon - The image that will become the icon that is attached to the PopupMenu.
See also:
GetIcon()
Author:
Rick Caudill ([email protected])

Image * PopupMenu::GetIcon (  ) 

..

Description:
Gets the icon that is attached to the PopupMenu.
See also:
SetIcon()
Author:
Rick Caudill ([email protected])

String PopupMenu::GetLabel (  ) 

..

Description:
Gets the label of the PopupMenu. Returns it as an os::String
Author:
Rick Caudill ([email protected])

void PopupMenu::SetLabel ( const String cString  ) 

..

Description:
Sets the label of the PopupMenu.
Parameters:
cString - The string that you want to set it to.
Author:
Rick Caudill ([email protected])

bool PopupMenu::IsEnabled ( void   ) 

..

Description:
This method will tell programmer whether or not this element is enabled.
See also:
SetEnabled()
Author:
Rick Caudill ([email protected])

void PopupMenu::SetEnabled ( bool  bEnabled,
bool  bValidate = false 
)

..

Description:
This method will tell the system to disable or enable this element.
Parameters:
bEnabled - To enable this element set this to true(default) and to disable set this to false.
See also:
IsEnabled()
Author:
Rick Caudill ([email protected])

void PopupMenu::SetDrawArrow ( bool  bArrow  ) 

..

Description:
Tells the element whether you want the arrow icon attached to the PopupMenu...
Parameters:
bArrow - To enable the arrow icon set this to true(default) and to disable set this to false.
Author:
Rick Caudill ([email protected])

void PopupMenu::Paint ( const Rect cRect  )  [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::View.

void PopupMenu::MouseDown ( const Point cPos,
uint32  nButtons 
) [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::View.

void PopupMenu::MouseUp ( const Point cPosition,
uint32  nButtons,
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::View.

void PopupMenu::MouseMove ( const Point cPosition,
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::View.

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

Reimplemented from os::View.


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