Pyro higlevel API
Public Member Functions | List of all members
os::CheckMenu Class Reference
Inheritance diagram for os::CheckMenu:
os::MenuItem os::Invoker

Public Member Functions

 CheckMenu (const String &cLabel, Message *pcMsg, bool bChecked=false)
 
 CheckMenu (Menu *pcMenu, Message *pcMsg, bool bChecked=false)
 
 ~CheckMenu ()
 
virtual void Draw ()
 Draws the os::MenuItem. More...
 
virtual void SetHighlighted (bool bHighlighted)
 Tells the system to highlight or unhighlight this element... More...
 
virtual Point GetContentSize () const
 
bool IsChecked () const
 Find out if the menu is currently selected. More...
 
void SetChecked (bool bChecked)
 Check or uncheck a menu. More...
 
virtual bool Invoked (Message *pcMessage)
 Intercept outgoing messages. More...
 
virtual bool IsSelectable () const
 Tells the system whether or not this item can be selected. More...
 
- Public Member Functions inherited from os::MenuItem
 MenuItem (const String &cLabel, Message *pcMsg, const String &cShortcut="", Image *pcImage=NULL)
 Constructor. More...
 
 MenuItem (Menu *pcMenu, Message *pcMsg, const String &cShortcut="", Image *pcImage=NULL)
 Constructor. More...
 
 ~MenuItem ()
 internal More...
 
MenuGetSubMenu () const
 Gets the Sub Menu(Menu that is inside the MenuItem)... More...
 
MenuGetSuperMenu () const
 Gets the Super Menu(Menu that holds the MenuItem)... More...
 
Rect GetFrame () const
 Gets the frame of the MenuItem... More...
 
virtual Point GetContentSize ()
 Gets the size of the MenuItem... More...
 
virtual float GetColumnWidth (int nColumn) const
 Gets the size of a column. More...
 
virtual int GetNumColumns () const
 Get number of columns. More...
 
const StringGetLabel () const
 Gets the label of the MenuItem... More...
 
void SetLabel (const os::String &cTitle)
 Sets the label of the MenuItem... More...
 
Point GetContentLocation () const
 Returns the current location of this item... More...
 
void SetEnable (bool bEnabled)
 Tells the system to disable or enable this element... More...
 
bool IsEnabled () const
 Tells the programmer whether this element is enabled or disabled... More...
 
bool IsHighlighted () const
 Tells the programmer whether this element is highlighted or not highlighted... More...
 
ImageGetImage () const
 Gets the image that is attached to the MenuItem... More...
 
void SetImage (Image *pcImage, bool bRefresh=false)
 Sets the image that you want to attach to the MenuItem... More...
 
void SetShortcut (const String &cShortcut)
 Sets the shortcut for the MenuItem. More...
 
const StringGetShortcut () const
 Gets the shortcut for the menu item... More...
 
- Public Member Functions inherited from os::Invoker
 Invoker ()
 Default constructor. More...
 
 Invoker (Message *pcMessage)
 Constructor. More...
 
 Invoker (Message *pcMessage, const Handler *pcHandler, const Looper *pcLooper=NULL)
 Constructor. More...
 
 Invoker (Message *pcMessage, const Messenger &cTarget)
 Constructor. More...
 
virtual ~Invoker ()
 Destructor. More...
 
virtual status_t SetMessage (Message *pcMessage)
 Assign a new message to the invoker. More...
 
MessageGetMessage () const
 Get the message currently assigned to the invoker. More...
 
uint32 GetCode () const
 Get the code field from the currently assigned message. More...
 
virtual void TargetChanged (const Messenger &cOldTarget)
 Virtual hook called by the system after the target has been changed. More...
 
virtual void MessageChanged (const Message &cOldMsg)
 Virtual hook called by the system after the message has been changed. More...
 
virtual status_t SetTarget (const Handler *pcHandler, const Looper *pcLooper=NULL)
 Set a new message target. More...
 
virtual status_t SetTarget (const Messenger &cMessenger)
 Set a new message target. More...
 
bool IsTargetLocal () const
 Check if the target lives in our process. More...
 
HandlerGetTarget (Looper **ppcLooper=NULL) const
 Get the current target. More...
 
Messenger GetMessenger () const
 Get the messenger used to target messages sendt by the invoker. More...
 
virtual status_t SetHandlerForReply (Handler *pcHandler)
 Set a reply target for messages sendt by this messenger. More...
 
HandlerGetHandlerForReply () const
 Get the current reply target for replies on messages sendt by the invoker. More...
 
virtual status_t Invoke (Message *pcMessage=NULL)
 Send the current message to the current target. More...
 

Detailed Description

Description:
A menuitem which can either be "On" or "Off"
Since
0.4.0
See Also
os::MenuItem, os::Menu
Author
Kristian Van Der Vliet (vande.nosp@m.rs@b.nosp@m.lueyo.nosp@m.nder.nosp@m..co.u.nosp@m.k)

Constructor & Destructor Documentation

CheckMenu::CheckMenu ( const String cLabel,
Message pcMsg,
bool  bChecked = false 
)
CheckMenu::CheckMenu ( Menu pcMenu,
Message pcMsg,
bool  bChecked = false 
)
CheckMenu::~CheckMenu ( )

Member Function Documentation

void CheckMenu::Draw ( )
virtual
Point CheckMenu::GetContentSize ( ) const
virtual
bool CheckMenu::Invoked ( Message pcMessage)
virtual
Description:
This member is called from Invoke() just before a message is sendt to the target.
This allow classes that inherits from os::Invoker to add data to or otherwhice modify the message before it is sendt. The message can also be canceled entirely by returning false from this member.
The message passed to Invoked() is a copy of the internal message or the message passed to Invoke() (if any) so any changes made here will not affect the internal message or the message passed to Invoke(). When this method returns the message will imidiatly be sendt to the target and then discarded (unless false is returned in which case the message is simply discarded).
The default implementation of this member does nothing and return true.
Parameters
pcMessagePointer to the message that is about to be sendt. You can do any modification you like to this message (but never delete it).
Returns
Normally you should return true to indicate that the message should be sendt. You can however return false if you for some reason want to cancel the invokation.
See Also
Invoke(), SetMessage(), SetTarget()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::MenuItem.

References os::Message::AddBool().

bool CheckMenu::IsChecked ( ) const
Description:
Find out if a menu is checked
Returns
true if the menu is checked, false if the menu is unchecked
See Also
void SetChecked(bool bChecked)
Author
Kristian Van Der Vliet (vande.nosp@m.rs@b.nosp@m.lueyo.nosp@m.nder.nosp@m..co.u.nosp@m.k)
bool CheckMenu::IsSelectable ( ) const
virtual
Description:
Tells the system whether or not this item can be selected.
Author
Rick Caudill(sylla.nosp@m.ble@.nosp@m.sylla.nosp@m.ble-.nosp@m.desk..nosp@m.tk)

Reimplemented from os::MenuItem.

void CheckMenu::SetChecked ( bool  bChecked)
Description:
Set a menu as checked, or uncheck a checked menu
Parameters
bChecked- True to check the menu, or false to uncheck
See Also
bool IsChecked( )
Author
Kristian Van Der Vliet (vande.nosp@m.rs@b.nosp@m.lueyo.nosp@m.nder.nosp@m..co.u.nosp@m.k)
void CheckMenu::SetHighlighted ( bool  bHighlighted)
virtual
Description:
This method will tell the system to highlight or unhighlight this element.
Parameters
bHighlighted- To highlight this element set this to true(default) and to unhighlight set this to false.
See Also
IsHighlighted()
Author
Rick Caudill (sylla.nosp@m.ble_.nosp@m.deskt.nosp@m.op@h.nosp@m.otpop.nosp@m..com)

Reimplemented from os::MenuItem.

References os::MenuItem::SetHighlighted().