Pyro higlevel API
|
Classes | |
class | Private |
Public Member Functions | |
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... | |
Menu * | GetSubMenu () const |
Gets the Sub Menu(Menu that is inside the MenuItem)... More... | |
Menu * | GetSuperMenu () 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 String & | GetLabel () const |
Gets the label of the MenuItem... More... | |
void | SetLabel (const os::String &cTitle) |
Sets the label of the MenuItem... More... | |
virtual void | Draw () |
Draws the os::MenuItem. More... | |
Point | GetContentLocation () const |
Returns the current location of this item... More... | |
virtual bool | Invoked (Message *pcMessage) |
Intercept outgoing messages. 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... | |
virtual void | SetHighlighted (bool bHighlighted) |
Tells the system to highlight or unhighlight this element... More... | |
bool | IsHighlighted () const |
Tells the programmer whether this element is highlighted or not highlighted... More... | |
Image * | GetImage () 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 String & | GetShortcut () const |
Gets the shortcut for the menu item... More... | |
virtual bool | IsSelectable () const |
Tells the system whether or not this item can be selected. 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... | |
Message * | GetMessage () 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... | |
Handler * | GetTarget (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... | |
Handler * | GetHandlerForReply () 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... | |
Friends | |
class | Menu |
MenuItem::MenuItem | ( | const String & | cLabel, |
Message * | pcMsg, | ||
const String & | cShortcut = "" , |
||
Image * | pcImage = NULL |
||
) |
cLabel | - The label that will be displayed. |
pcMsg | - The message that will be passed when invoked. |
cShortcut | - Keyboard shortcut. |
pcImage | - The image that will be attached to the MenuItem. |
References os::MenuItem::Private::m_cLabel, os::MenuItem::Private::m_cShortcut, os::MenuItem::Private::m_pcMessage, and SetImage().
MenuItem::MenuItem | ( | Menu * | pcMenu, |
Message * | pcMsg, | ||
const String & | cShortcut = "" , |
||
Image * | pcImage = NULL |
||
) |
pcMenu | - The menu that will be a sub menu. |
pcMsg | - The message that will be passed when invoked. |
cShortcut | - Keyboard shortcut. |
pcImage | - The image that will be attached to this menu item. |
References os::Menu::GetLabel(), os::MenuItem::Private::m_cLabel, os::MenuItem::Private::m_cShortcut, os::MenuItem::Private::m_pcMessage, os::MenuItem::Private::m_pcSubMenu, and SetImage().
MenuItem::~MenuItem | ( | ) |
|
virtual |
Reimplemented in os::MenuSeparator, os::CheckMenu, and os::RadioMenuItem.
References os::Rect::bottom, os::COL_MENU_BACKGROUND, os::COL_MENU_TEXT, os::COL_SEL_MENU_BACKGROUND, os::COL_SEL_MENU_TEXT, DM_BLEND, DM_COPY, DM_OVER, os::Image::Draw(), os::View::DrawText(), DTF_ALIGN_LEFT, DTF_ALIGN_MIDDLE, DTF_UNDERLINES, os::View::FillRect(), os::get_default_color(), os::Image::GetBounds(), os::View::GetBounds(), os::View::GetFontHeight(), GetFrame(), GetImage(), os::MenuItem::Private::GetImage(), GetLabel(), os::Menu::GetLayout(), os::Image::GetSize(), GetSubMenu(), GetSuperMenu(), H_ROW_SPACE, os::Rect::Height(), ICON_TO_TEXT_SPACE, IMG_STATE_GRAY, IMG_STATE_HIGHLIGHT, IMG_STATE_NORMAL, IsEnabled(), os::ITEMS_IN_COLUMN, os::Rect::left, os::MenuItem::Private::m_bIsHighlighted, os::MenuItem::Private::m_cFrame, os::MenuItem::Private::m_cShortcut, os::MenuItem::Private::m_pcSuperMenu, os::Rect::MoveTo(), os::Rect::right, os::View::SetBgColor(), os::View::SetDrawingMode(), os::View::SetFgColor(), SUB_MENU_ARROW_W, os::Rect::top, and os::Point::x.
Referenced by os::Menu::Paint(), SetEnable(), SetHighlighted(), and SetImage().
|
virtual |
References os::MenuItem::Private::GetImage(), GetLabel(), os::Image::GetSize(), GetSuperMenu(), os::View::GetTextExtent(), ICON_TO_TEXT_SPACE, os::MenuItem::Private::m_cShortcut, MIN_ICON_MARGIN, TITLE_TO_SHORTCUT_SPACE, width, os::Point::x, and os::Point::y.
Referenced by os::Menu::InvalidateLayout().
Point MenuItem::GetContentLocation | ( | ) | const |
References os::Rect::left, os::MenuItem::Private::m_cFrame, and os::Rect::top.
|
virtual |
Reimplemented in os::MenuSeparator.
References os::MenuItem::Private::GetImage(), GetLabel(), os::Menu::GetLayout(), os::Image::GetSize(), GetSubMenu(), GetSuperMenu(), os::View::GetTextExtent(), H_ROW_SPACE, ICON_TO_TEXT_SPACE, os::ITEMS_IN_ROW, os::MenuItem::Private::m_cShortcut, os::MenuItem::Private::m_pcSuperMenu, os::Point::x, and os::Point::y.
Referenced by os::Menu::InvalidateLayout().
Rect MenuItem::GetFrame | ( | ) | const |
References os::MenuItem::Private::m_cFrame.
Referenced by os::RadioMenuItem::Draw(), os::CheckMenu::Draw(), Draw(), os::MenuSeparator::Draw(), os::Menu::GetItemAt(), and os::Menu::InvalidateLayout().
Image * MenuItem::GetImage | ( | void | ) | const |
References os::MenuItem::Private::GetImage().
Referenced by Draw().
const String & MenuItem::GetLabel | ( | void | ) | const |
References os::MenuItem::Private::m_cLabel.
Referenced by os::RadioMenuItem::Draw(), os::CheckMenu::Draw(), Draw(), os::Menu::FindItem(), GetColumnWidth(), os::RadioMenuItem::GetContentSize(), os::CheckMenu::GetContentSize(), and GetContentSize().
|
virtual |
Referenced by os::Menu::InvalidateLayout().
const String & MenuItem::GetShortcut | ( | ) | const |
References os::MenuItem::Private::m_cShortcut.
Menu * MenuItem::GetSubMenu | ( | ) | const |
References os::MenuItem::Private::m_pcSubMenu.
Referenced by os::Menu::AddItem(), Draw(), os::Menu::FindItem(), GetContentSize(), os::Menu::GetIndexOf(), os::Menu::GetSubMenuAt(), os::Menu::KeyDown(), os::Menu::MouseUp(), os::Menu::RemoveItem(), os::Menu::SetEnable(), and os::Menu::SetTargetForItems().
Menu * MenuItem::GetSuperMenu | ( | ) | const |
References os::MenuItem::Private::m_pcSuperMenu.
Referenced by os::RadioMenuItem::Draw(), os::CheckMenu::Draw(), Draw(), os::MenuSeparator::Draw(), GetColumnWidth(), os::RadioMenuItem::GetContentSize(), os::CheckMenu::GetContentSize(), GetContentSize(), os::MenuSeparator::GetContentSize(), and os::Menu::GetSuperMenu().
|
virtual |
pcMessage | Pointer to the message that is about to be sendt. You can do any modification you like to this message (but never delete it). |
Reimplemented from os::Invoker.
Reimplemented in os::CheckMenu.
bool MenuItem::IsEnabled | ( | void | ) | const |
References os::MenuItem::Private::m_bIsEnabled.
Referenced by Draw(), and os::Menu::MouseUp().
bool MenuItem::IsHighlighted | ( | ) | const |
References os::MenuItem::Private::m_bIsHighlighted.
Referenced by os::Menu::FindMarked().
|
virtual |
Reimplemented in os::MenuSeparator, and os::CheckMenu.
References os::MenuItem::Private::m_bIsSelectable.
void MenuItem::SetEnable | ( | bool | bEnabled | ) |
bEnabled | - To enable this element set this to true(default) and to disable set this to false. |
References Draw(), os::MenuItem::Private::m_bIsEnabled, and os::MenuItem::Private::m_bIsSelectable.
Referenced by os::IconDirectoryView::OpenContextMenu(), and os::Menu::SetEnable().
|
virtual |
bHighlighted | - To highlight this element set this to true(default) and to unhighlight set this to false. |
Reimplemented in os::MenuSeparator, os::CheckMenu, and os::RadioMenuItem.
References Draw(), and os::MenuItem::Private::m_bIsHighlighted.
Referenced by os::RadioMenuItem::SetHighlighted(), and os::CheckMenu::SetHighlighted().
void MenuItem::SetImage | ( | Image * | pcImage, |
bool | bRefresh = false |
||
) |
pcImage | - the image to be placed on the MenuItem. |
bRefresh | - tell the system whether to or not to redraw the MenuItem |
References Draw(), os::MenuItem::Private::FreeImages(), and os::MenuItem::Private::m_pcImage.
Referenced by MenuItem().
void MenuItem::SetLabel | ( | const os::String & | cLabel | ) |
References os::MenuItem::Private::m_cLabel.
void MenuItem::SetShortcut | ( | const String & | cShortcut | ) |
cShortcut | - The shortcut key that will invoke with this menuitem. |
References os::MenuItem::Private::m_cShortcut.
|
friend |