Pyro higlevel API
|
The menuing system for Syllable. More...
Classes | |
class | Private |
Public Member Functions | |
Menu (Rect cFrame, const String &cName, MenuLayout_e eLayout, uint32 nResizeMask=CF_FOLLOW_LEFT|CF_FOLLOW_RIGHT|CF_FOLLOW_TOP, uint32 nFlags=WID_WILL_DRAW|WID_CLEAR_BACKGROUND|WID_FULL_UPDATE_ON_RESIZE) | |
Constructor. More... | |
~Menu () | |
internal More... | |
int | Lock (void) const |
Locks the Menu... More... | |
void | Unlock (void) const |
Unlocks the Menu... More... | |
virtual void | TimerTick (int nID) |
Timer dispatch member. More... | |
void | AttachedToWindow (void) |
void | DetachedFromWindow (void) |
void | WindowActivated (bool bIsActive) |
Hook called when the window hosting this view gain or loose focus. More... | |
Point | GetPreferredSize (bool bLargest) const |
Returns the exact size of the Menu. More... | |
virtual void | MouseDown (const Point &cPosition, uint32 nButtons) |
Hook called by the system when a mouse button is pressed. More... | |
virtual void | MouseUp (const Point &cPosition, uint32 nButtons, Message *pcData) |
Hook called by the system when a mouse button is release. More... | |
virtual void | MouseMove (const Point &cNewPos, int nCode, uint32 nButtons, Message *pcData) |
Hook called by the system when the mouse is moved. More... | |
virtual void | KeyDown (const char *pzString, const char *pzRawString, uint32 nQualifiers) |
Hook called by the system when a key is pressed while the view has focus. More... | |
virtual void | FrameSized (const Point &cDelta) |
Virtual hook called by the system when the view is resized. More... | |
virtual void | Paint (const Rect &cUpdateRect) |
Called by the system update "damaged" areas of the view. More... | |
String | GetLabel () const |
Gets the label of the Menu... More... | |
void | SetLabel (const os::String &cLabel) |
Sets the label of the Menu... More... | |
MenuLayout_e | GetLayout () const |
Gets the layout of the Menu... More... | |
bool | AddItem (const String &cLabel, Message *pcMessage, const String &cShortcut="", Image *pcImage=NULL) |
Adds a MenuItem. More... | |
bool | AddItem (MenuItem *pcItem) |
Adds a MenuItem. More... | |
bool | AddItem (MenuItem *pcItem, int nIndex) |
Adds a MenuItem. More... | |
bool | AddItem (Menu *pcItem) |
Adds a MenuItem. More... | |
bool | AddItem (Menu *pcItem, int nIndex) |
Adds a MenuItem. More... | |
MenuItem * | RemoveItem (int nIndex) |
Removes an MenuItem. More... | |
bool | RemoveItem (MenuItem *pcItem) |
Removes an MenuItem. More... | |
bool | RemoveItem (Menu *pcMenu) |
Removes an MenuItem. More... | |
MenuItem * | GetItemAt (int nIndex) const |
Gets the MenuItem at a certain index number. More... | |
MenuItem * | GetItemAt (Point cPos) const |
Gets the MenuItem at a certain point. More... | |
Menu * | GetSubMenuAt (int nIndex) const |
Gets the SubMenu determined by the passing index number. More... | |
int | GetItemCount (void) const |
Returns the number of items in the Menu. More... | |
int | GetIndexOf (MenuItem *pcItem) const |
Returns the number of the MenuItem's position. More... | |
int | GetIndexOf (Menu *pcMenu) const |
Returns the number of the Menu's position. More... | |
MenuItem * | FindItem (int nCode) const |
Method that finds an item by a certain Message code. More... | |
MenuItem * | FindItem (const String &cName) const |
Method that finds an item by a certain name. More... | |
MenuItem * | FindMarked () const |
Gets the MenuItem that is Hightlighted. More... | |
virtual status_t | SetTargetForItems (Handler *pcTarget) |
Sets the object that the MenuItems will send messages to. More... | |
virtual status_t | SetTargetForItems (Messenger cMessenger) |
Sets the object that the MenuItems will send messages to. More... | |
Menu * | GetSuperMenu () const |
Gets the Menu that the Menu is attached to. More... | |
MenuItem * | GetSuperItem () |
Gets the MenuItem that the Menu is attached to. More... | |
void | InvalidateLayout () |
Refreshes the layout of the Menu... More... | |
void | SetCloseMessage (const Message &cMsg) |
Sets the message. More... | |
void | SetCloseMsgTarget (const Messenger &cTarget) |
Sets Target for Menu. More... | |
MenuItem * | Track (const Point &cScreenPos) |
Go to a certain MenuItem by screen position... More... | |
void | Open (Point cScrPos) |
Opens the Menu at a specific position. More... | |
void | SetEnable (bool) |
Tells the system to disable or enable this element... More... | |
bool | IsEnabled () |
Tells the programmer whether this element is enabled or disabled... More... | |
Public Member Functions inherited from os::View | |
View (const Rect &cFrame, const String &cTitle, uint32 nResizeMask=CF_FOLLOW_LEFT|CF_FOLLOW_TOP, uint32 nFlags=WID_WILL_DRAW|WID_CLEAR_BACKGROUND) | |
View constructor. More... | |
virtual | ~View () |
View destructor. More... | |
virtual void | AllAttached () |
virtual void | AllDetached () |
virtual void | Activated (bool bIsActive) |
Hook called when the view gain or loose focus. More... | |
virtual void | KeyUp (const char *pzString, const char *pzRawString, uint32 nQualifiers) |
Hook called by the system when a key is released while the view has focus. More... | |
virtual void | FrameMoved (const Point &cDelta) |
Virtual hook called by the system when the view is moved within it's parent. More... | |
virtual void | ViewScrolled (const Point &cDelta) |
Virtual hook called by the system when the view content is scrolled. More... | |
virtual void | FontChanged (Font *pcNewFont) |
Called to notify the view that the font has changed. More... | |
virtual Point | GetContentSize () const |
virtual void | WheelMoved (const Point &cDelta) |
Hook called by the system when the scroll-wheel is rotated. More... | |
virtual void | AddChild (View *pcView, bool bAssignTabOrder=false) |
void | RemoveChild (View *pcChild) |
void | RemoveThis () |
View * | GetChildAt (const Point &cPos) const |
View * | GetChildAt (int nIndex) const |
View * | GetParent () const |
ScrollBar * | GetVScrollBar () const |
ScrollBar * | GetHScrollBar () const |
Window * | GetWindow () const |
String | GetTitle () const |
virtual int | GetTabOrder () const |
Get the keybord manouvering order. More... | |
virtual void | SetTabOrder (int nOrder=NEXT_TAB_ORDER) |
Set the keyboard manouvering sorting order. More... | |
virtual const ShortcutKey & | GetShortcut () const |
virtual void | SetShortcut (const ShortcutKey &cShortcut) |
Set keyboard shortcut. More... | |
virtual void | SetShortcutFromLabel (const String &cLabel) |
Set keyboard shortcut from Label. More... | |
void | SetContextMenu (Menu *pcMenu) |
Set popup menu for a View. More... | |
Menu * | GetContextMenu () const |
Get popup menu. More... | |
uint32 | GetQualifiers () const |
void | GetMouse (Point *pcPosition, uint32 *pnButtons) const |
void | SetMousePos (const Point &cPosition) |
void | BeginDrag (Message *pcData, const Point &cOffset, const Bitmap *pcBitmap, Handler *pcReplyTarget=NULL) |
Start a drag and drop operation. More... | |
void | BeginDrag (Message *pcData, const Point &cOffset, const Rect &cBounds, Handler *pcReplyTarget=NULL) |
Start a drag and drop operation. More... | |
void | SetFlags (uint32 nFlags) |
uint32 | GetFlags (uint32 nMask=~0L) const |
void | SetResizeMask (uint32 nFlags) |
uint32 | GetResizeMask () const |
void | Show (bool bVisible=true) |
Show/hide a view and all it's children. More... | |
void | Hide () |
bool | IsVisible () const |
virtual void | MakeFocus (bool bFocus=true) |
virtual bool | HasFocus () const |
Rect | GetFrame () const |
Rect | GetBounds () const |
Rect | GetNormalizedBounds () const |
float | Width () const |
float | Height () const |
Point | GetLeftTop () const |
virtual void | SetFrame (const Rect &cRect, bool bNotifyServer=true) |
Set the size and position relative to the parent view. More... | |
virtual void | MoveBy (const Point &cDelta) |
Move the view within the parent coordinate system. More... | |
virtual void | MoveBy (float vDeltaX, float vDeltaY) |
virtual void | MoveTo (const Point &cPos) |
Set the views position within the parent coordinate system. More... | |
virtual void | MoveTo (float x, float y) |
virtual void | ResizeBy (const Point &cDelta) |
virtual void | ResizeBy (float vDeltaW, float vDeltaH) |
virtual void | ResizeTo (const Point &cSize) |
Set a new absolute size for the view. More... | |
virtual void | ResizeTo (float W, float H) |
Set a new absolute size for the view. More... | |
void | SetDrawingRegion (const Region &cReg) |
Restrict rendering using a clipping region. More... | |
void | ClearDrawingRegion () |
Remove any previously assigned drawing region. More... | |
void | SetShapeRegion (const Region &cReg) |
Define a non-square shape for the view. More... | |
void | ClearShapeRegion () |
Remove any previously assigned shape region. More... | |
virtual int | ToggleDepth () |
Point | ConvertFromParent (const Point &cPoint) const |
void | ConvertFromParent (Point *cPoint) const |
Rect | ConvertFromParent (const Rect &cRect) const |
void | ConvertFromParent (Rect *cRect) const |
Point | ConvertToWindow (const Point &cPoint) const |
void | ConvertToWindow (Point *cPoint) const |
Rect | ConvertToWindow (const Rect &cRect) const |
void | ConvertToWindow (Rect *cRect) const |
Point | ConvertFromWindow (const Point &cPoint) const |
void | ConvertFromWindow (Point *cPoint) const |
Rect | ConvertFromWindow (const Rect &cRect) const |
void | ConvertFromWindow (Rect *cRect) const |
Point | ConvertToScreen (const Point &cPoint) const |
void | ConvertToScreen (Point *cPoint) const |
Rect | ConvertToScreen (const Rect &cRect) const |
void | ConvertToScreen (Rect *cRect) const |
Point | ConvertFromScreen (const Point &cPoint) const |
void | ConvertFromScreen (Point *cPoint) const |
Rect | ConvertFromScreen (const Rect &cRect) const |
void | ConvertFromScreen (Rect *cRect) const |
void | Invalidate (const Rect &cRect, bool bRecurse=false) |
Add a rectangle to the damage list. More... | |
void | Invalidate (bool bRecurse=false) |
Invalidate the whole view. More... | |
void | Flush () |
Flush the render queue. More... | |
void | Sync () |
Flush the render queue. More... | |
void | SetDrawingMode (drawing_mode nMode) |
drawing_mode | GetDrawingMode () const |
void | SetFont (Font *pcFont) |
Change the views text font. More... | |
Font * | GetFont () const |
void | SetFgColor (int nRed, int nGreen, int nBlue, int nAlpha=255) |
void | SetFgColor (Color32_s sColor) |
Color32_s | GetFgColor () const |
void | SetBgColor (int nRed, int nGreen, int nBlue, int nAlpha=255) |
void | SetBgColor (Color32_s sColor) |
Color32_s | GetBgColor () const |
void | SetEraseColor (int nRed, int nGreen, int nBlue, int nAlpha=255) |
void | SetEraseColor (Color32_s sColor) |
Color32_s | GetEraseColor () const |
void | MovePenTo (const Point &cPos) |
void | MovePenTo (float x, float y) |
void | MovePenBy (const Point &cPos) |
void | MovePenBy (float x, float y) |
Point | GetPenPosition () const |
Get the current pen position. More... | |
void | DrawLine (const Point &cToPoint) |
void | DrawLine (const Point &cFromPnt, const Point &cToPnt) |
virtual void | ScrollBy (const Point &cDelta) |
virtual void | ScrollBy (float vDeltaX, float vDeltaY) |
virtual void | ScrollTo (Point cTopLeft) |
virtual void | ScrollTo (float x, float y) |
Point | GetScrollOffset () const |
void | ScrollRect (const Rect &cSrcRect, const Rect &cDstRect) |
Copy a rectangle from one location to another within the view. More... | |
void | FillRect (const Rect &cRect) |
void | FillRect (const Rect &cRect, Color32_s sColor) |
void | DrawBitmap (const Bitmap *pcBitmap, const Rect &cSrcRect, const Rect &cDstRect) |
Render a bitmap into the view. More... | |
void | EraseRect (const Rect &cRect) |
void | DrawFrame (const Rect &cRect, uint32 nFlags) |
void | DrawRoundedFrame (const os::Rect &cReizeFrame=os::Rect(1, 4,-1,-4), const os::Color32_s &cColor=get_default_color(COL_SHADOW)) |
void | DrawRoundedFrame (const os::Rect &cFrame, const os::Rect &cReizeFrame=os::Rect(1, 4,-1,-4), const os::Color32_s &cColor=get_default_color(COL_SHADOW)) |
void | DrawString (const Point &cPos, const String &cString) |
void | DrawString (const String &cString) |
Render a text-string at the current pen position. More... | |
void | DrawString (const char *pzStr, int Len=-1) |
void | DrawText (const Rect &cPos, const String &cString, uint32 nFlags=0) |
Render a text-string in a specified rectangle. More... | |
void | DrawSelectedText (const Rect &cPos, const String &cString, const IPoint &cSel1, const IPoint &cSel2, uint32 nMode=SEL_CHAR, uint32 nFlags=0) |
void | GetSelection (const String &cClipboard="__system_clipboard__") |
void | GetTruncatedStrings (const char **pazStringArray, int nStringCount, uint32 nMode, float nWidth, char **pazResultArray) const |
float | GetStringWidth (const String &cString) const |
float | GetStringWidth (const char *pzString, int nLen=-1) const |
void | GetStringWidths (const char **apzStringArray, const int *anLengthArray, int nStringCount, float *avWidthArray) const |
Point | GetTextExtent (const String &cString, uint32 nFlags=0, int nTargetWidth=-1) const |
int | GetStringLength (const String &cString, float vWidth, bool bIncludeLast=false) const |
int | GetStringLength (const char *pzString, int nLen, float vWidth, bool bIncludeLast=false) const |
void | GetStringLengths (const char **apzStringArray, const int *anLengthArray, int nStringCount, float vWidth, int *anMaxLengthArray, bool bIncludeLast=false) const |
void | GetFontHeight (font_height *psHeight) const |
void | Ping (int nSize=0) const |
void | SetToolTip (const os::String &t) |
os::String | GetToolTip () const |
Point | ConvertToParent (const Point &cPoint) const |
Translate a os::Point into our parents coordinate system. More... | |
void | ConvertToParent (Point *cPoint) const |
Translate a os::Point into our parents coordinate system. More... | |
Rect | ConvertToParent (const Rect &cRect) const |
void | ConvertToParent (Rect *cRect) const |
Public Member Functions inherited from os::Handler | |
Handler (const String &cName) | |
Construct a handler. More... | |
virtual | ~Handler () |
Destructor. More... | |
virtual void | HandleMessage (Message *pcMessage) |
Handle a message targeted at this handler. More... | |
String | GetName () const |
Get the handlers name. More... | |
void | SetName (const String &cName) |
Rename the handler. More... | |
Looper * | GetLooper () const |
Get a pointer to the looper this handler belongs to. More... | |
void | SetNextHandler (Handler *pcNextHandler) |
Set a handler that should handle messages this handler is not interrested in. More... | |
Handler * | GetNextHandler () const |
Get the next handler in a handler chain. More... | |
void | AddFilter (MessageFilter *pcFilter) |
void | RemoveFilter (MessageFilter *pcFilter) |
const MsgFilterList & | GetFilterList () const |
const uint32 | GetToken () |
Get the handlers token. More... | |
Friends | |
class | MenuItem |
Menu::Menu | ( | Rect | cFrame, |
const String & | cTitle, | ||
MenuLayout_e | eLayout, | ||
uint32 | nResizeMask = CF_FOLLOW_LEFT | CF_FOLLOW_RIGHT | CF_FOLLOW_TOP , |
||
uint32 | nFlags = WID_WILL_DRAW | WID_CLEAR_BACKGROUND | WID_FULL_UPDATE_ON_RESIZE |
||
) |
cFrame | - The frame that holds the size of the Menu. |
cTitle | - The label that will be displayed. |
eLayout | - The layout of the Menu. OS::ITEMS_IN_ROW for displaying items horizontally and OS::ITEMS_IN_COLUMN for displaying items vertically. |
nResizeMask | - The parameters of how you want the Menu to resize when resizing the Application it is attached to. Look at os::View for more documentatinon. |
nFlags | - The view flags that will be passed to the Menu. |
References os::Menu::Private::m_cTitle, os::Menu::Private::m_eLayout, and os::Menu::Private::m_pcRoot.
Menu::~Menu | ( | ) |
References os::Menu::Private::m_pcFirstItem.
bool Menu::AddItem | ( | const String & | cLabel, |
Message * | pcMessage, | ||
const String & | cShortcut = "" , |
||
Image * | pcImage = NULL |
||
) |
cLabel | - the label of the MenuItem. |
pcMessage | - the Message of that is passed when the MenuItem is clicked. |
cShortcut | - Keyboard shortcut. |
pcImage | - pointer to Image to use as icon. The image is deleted automatically by the Menu destructor! |
References MenuItem.
Referenced by os::RadioMenu::AddItem(), AddItem(), and os::IconDirectoryView::OpenContextMenu().
bool Menu::AddItem | ( | MenuItem * | pcItem | ) |
pcItem | - the MenuItem to add |
References AddItem(), and os::Menu::Private::m_nItemCount.
bool Menu::AddItem | ( | MenuItem * | pcItem, |
int | nIndex | ||
) |
bool Menu::AddItem | ( | Menu * | pcMenu | ) |
pcMenu | - the SubMenu that will be added to the Menu. |
References AddItem(), os::Menu::Private::m_nItemCount, and os::Menu::Private::m_pcRoot.
bool Menu::AddItem | ( | Menu * | pcMenu, |
int | nIndex | ||
) |
pcMenu | - the SubMenu that will be added to the Menu. |
nIndex | - the place where the MenuItem will be put. |
References AddItem(), os::Menu::Private::m_pcRoot, and MenuItem.
|
virtual |
Reimplemented from os::View.
References InvalidateLayout(), os::Menu::Private::m_bIsRootMenu, os::Menu::Private::m_cMutex, os::Menu::Private::m_pcFirstItem, and os::Menu::Private::m_pcRoot.
|
virtual |
Reimplemented from os::View.
References os::Menu::Private::m_bIsRootMenu, os::Menu::Private::m_cMutex, os::Menu::Private::m_pcFirstItem, and os::Menu::Private::m_pcRoot.
MenuItem * Menu::FindItem | ( | int | nCode | ) | const |
nCode | - Code of the MenuItem you wish to find. |
References FindItem(), os::Message::GetCode(), os::Invoker::GetMessage(), os::MenuItem::GetSubMenu(), and os::Menu::Private::m_pcFirstItem.
Referenced by FindItem().
cName | - Name of the MenuItem you wish to find. |
References FindItem(), os::MenuItem::GetLabel(), os::MenuItem::GetSubMenu(), and os::Menu::Private::m_pcFirstItem.
MenuItem * Menu::FindMarked | ( | ) | const |
References os::MenuItem::IsHighlighted(), and os::Menu::Private::m_pcFirstItem.
Referenced by KeyDown(), os::RadioMenu::MouseUp(), and MouseUp().
|
virtual |
cDelta
calue from the current size. cDelta | The distance the bottom/right corner was moved relative to the upper/left corner. |
Reimplemented from os::View.
References os::View::Flush(), os::View::GetBounds(), os::View::Invalidate(), os::Rect::left, os::Rect::right, and os::Point::x.
int Menu::GetIndexOf | ( | MenuItem * | pcItem | ) | const |
pcItem | - The MenuItem that you w you want to get the index of. |
References os::Menu::Private::m_pcFirstItem.
int Menu::GetIndexOf | ( | Menu * | pcMenu | ) | const |
pcMenu | - The Menu you want to get the index of. |
References os::MenuItem::GetSubMenu(), and os::Menu::Private::m_pcFirstItem.
MenuItem * Menu::GetItemAt | ( | int | nIndex | ) | const |
nIndex | - The index number you want to get the MenuItem from. |
References os::Menu::Private::m_pcFirstItem.
Referenced by GetSubMenuAt(), MouseDown(), MouseMove(), os::RadioMenu::MouseUp(), MouseUp(), os::IconDirectoryView::OpenContextMenu(), and SetEnable().
cPosition | - The position that you want get the MenuItem from |
References os::Rect::DoIntersect(), os::MenuItem::GetFrame(), and os::Menu::Private::m_pcFirstItem.
int Menu::GetItemCount | ( | void | ) | const |
References os::Menu::Private::m_nItemCount.
Referenced by os::RadioMenu::AddItem(), os::RadioMenu::MouseUp(), Open(), and SetEnable().
String Menu::GetLabel | ( | void | ) | const |
References os::Menu::Private::m_cTitle.
Referenced by os::MenuItem::MenuItem().
MenuLayout_e Menu::GetLayout | ( | ) | const |
References os::Menu::Private::m_eLayout.
Referenced by os::MenuItem::Draw(), os::MenuSeparator::Draw(), os::MenuItem::GetContentSize(), and os::MenuSeparator::GetContentSize().
|
virtual |
Reimplemented from os::View.
References os::Menu::Private::m_cSize, and os::Point::y.
Menu * Menu::GetSubMenuAt | ( | int | nIndex | ) | const |
nIndex | - The index number you want to get the SubMenu from |
References GetItemAt(), and os::MenuItem::GetSubMenu().
MenuItem * Menu::GetSuperItem | ( | ) |
Menu * Menu::GetSuperMenu | ( | ) | const |
References os::MenuItem::GetSuperMenu().
Referenced by KeyDown(), MouseDown(), and MouseMove().
void Menu::InvalidateLayout | ( | ) |
References os::Rect::bottom, os::MenuItem::GetColumnWidth(), os::MenuItem::GetContentSize(), os::MenuItem::GetFrame(), os::MenuItem::GetNumColumns(), os::ITEMS_CUSTOM_LAYOUT, os::ITEMS_IN_COLUMN, os::ITEMS_IN_ROW, os::Rect::left, os::Menu::Private::m_cItemBorders, os::Menu::Private::m_cSize, os::Menu::Private::m_eLayout, os::Menu::Private::m_pcFirstItem, os::Menu::Private::m_vColumnWidths, os::Rect::right, os::Rect::top, os::Point::x, and os::Point::y.
Referenced by AddItem(), AttachedToWindow(), Open(), and RemoveItem().
bool Menu::IsEnabled | ( | void | ) |
References os::Menu::Private::m_bEnabled.
|
virtual |
pzString | String containing a single UTF-8 encoded character. This is the character generated by the pressed key according to the current keymap accounting for any qualifiers that might be pressed. |
pzRawString | Same as pzString except that the key is converted without accounting for qualifiers. Ie. if 'A' is pressed while pressing <SHIFT> pzString will contain 'A' and pzRawString will contain 'a'. |
nQualifiers | Bitmask describing which qualifiers that was active when the key was pressed. |
Reimplemented from os::View.
References FindMarked(), os::View::Flush(), os::MenuItem::GetSubMenu(), GetSuperMenu(), os::Invoker::Invoke(), os::ITEMS_IN_COLUMN, os::ITEMS_IN_ROW, os::View::KeyDown(), os::Menu::Private::m_cMutex, os::Menu::Private::m_eLayout, os::Menu::Private::m_pcRoot, VK_DOWN_ARROW, VK_ENTER, VK_LEFT_ARROW, VK_RIGHT_ARROW, and VK_UP_ARROW.
int Menu::Lock | ( | void | ) | const |
References os::Locker::Lock(), os::Menu::Private::m_cMutex, and os::Menu::Private::m_pcRoot.
|
virtual |
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. |
Reimplemented from os::View.
References os::View::ConvertFromScreen(), os::View::ConvertToScreen(), os::View::Flush(), os::View::GetBounds(), GetItemAt(), GetSuperMenu(), os::ITEMS_IN_ROW, os::Menu::Private::m_bHasOpenChilds, os::Menu::Private::m_bIsTracking, os::Menu::Private::m_cMouseHitPos, os::Menu::Private::m_cMutex, os::Menu::Private::m_eLayout, os::Menu::Private::m_hTrackPort, os::Menu::Private::m_pcRoot, os::View::MakeFocus(), and MouseDown().
Referenced by MouseDown().
|
virtual |
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. |
Reimplemented from os::View.
References os::View::ConvertFromScreen(), os::View::ConvertToScreen(), os::View::Flush(), os::View::GetBounds(), GetItemAt(), GetSuperMenu(), os::ITEMS_IN_ROW, os::Menu::Private::m_bCloseOnMouseUp, os::Menu::Private::m_bIsTracking, os::Menu::Private::m_cMouseHitPos, os::Menu::Private::m_cMutex, os::Menu::Private::m_eLayout, os::Menu::Private::m_pcRoot, MouseMove(), STICKY_THRESHOLD, os::Point::x, and os::Point::y.
Referenced by MouseMove().
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. 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. |
Reimplemented from os::View.
Reimplemented in os::RadioMenu.
References FindMarked(), os::View::GetBounds(), GetItemAt(), os::MenuItem::GetSubMenu(), os::Invoker::Invoke(), os::MenuItem::IsEnabled(), os::Menu::Private::m_bCloseOnMouseUp, os::Menu::Private::m_cMutex, os::Menu::Private::m_hTrackPort, and os::Menu::Private::m_pcRoot.
Referenced by os::RadioMenu::MouseUp().
void Menu::Open | ( | Point | cScrPos | ) |
References os::Rect::bottom, os::View::Flush(), GetItemCount(), GetPreferredSize(), os::Desktop::GetResolution(), InvalidateLayout(), os::Rect::left, os::Locker::Lock(), os::Menu::Private::m_bIsRootMenu, os::Menu::Private::m_bIsTracking, os::Menu::Private::m_cMutex, os::Menu::Private::m_pcFirstItem, os::Menu::Private::m_pcRoot, os::Menu::Private::m_pcWindow, os::View::MakeFocus(), os::Rect::right, os::View::SetFrame(), os::Looper::SetMutex(), os::Window::Show(), os::Rect::top, os::Point::x, os::IPoint::x, os::Point::y, and os::IPoint::y.
Referenced by os::View::MouseDown(), and os::IconDirectoryView::OpenContextMenu().
|
virtual |
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. |
Reimplemented from os::View.
References os::COL_MENU_BACKGROUND, os::MenuItem::Draw(), os::View::DrawFrame(), os::View::FillRect(), os::FRAME_RAISED, os::FRAME_THIN, os::FRAME_TRANSPARENT, os::get_default_color(), os::View::GetBounds(), os::Menu::Private::m_cMutex, os::Menu::Private::m_pcFirstItem, os::Menu::Private::m_pcRoot, and os::View::SetFgColor().
MenuItem * Menu::RemoveItem | ( | int | nIndex | ) |
nIndex | - the index number of the MenuItem you wish to remove. |
References os::MenuItem::GetSubMenu(), InvalidateLayout(), os::Menu::Private::m_nItemCount, and os::Menu::Private::m_pcFirstItem.
bool Menu::RemoveItem | ( | MenuItem * | pcItem | ) |
pcItem | - the MenuItem to remove. |
References os::MenuItem::GetSubMenu(), InvalidateLayout(), os::Menu::Private::m_nItemCount, and os::Menu::Private::m_pcFirstItem.
bool Menu::RemoveItem | ( | Menu * | pcMenu | ) |
pcMenu | - the SubMenu that will be used to remove a certain item. |
References os::MenuItem::GetSubMenu(), InvalidateLayout(), os::Menu::Private::m_nItemCount, and os::Menu::Private::m_pcFirstItem.
void Menu::SetCloseMessage | ( | const Message & | cMsg | ) |
References os::Menu::Private::m_cCloseMsg.
void Menu::SetCloseMsgTarget | ( | const Messenger & | cTarget | ) |
References os::Menu::Private::m_cCloseMsgTarget.
void Menu::SetEnable | ( | bool | bEnabled | ) |
bEnabled | - To enable this element set this to true(default) and to disable set this to false. |
References os::View::Flush(), GetItemAt(), GetItemCount(), os::MenuItem::GetSubMenu(), os::Menu::Private::m_bEnabled, os::MenuItem::SetEnable(), and SetEnable().
Referenced by SetEnable().
void Menu::SetLabel | ( | const os::String & | cTitle | ) |
References os::Menu::Private::m_cTitle.
|
virtual |
References os::MenuItem::GetSubMenu(), os::Menu::Private::m_pcFirstItem, os::Invoker::SetTarget(), and SetTargetForItems().
Referenced by os::IconDirectoryView::OpenContextMenu(), and SetTargetForItems().
|
virtual |
References os::MenuItem::GetSubMenu(), os::Menu::Private::m_pcFirstItem, os::Invoker::SetTarget(), and SetTargetForItems().
|
virtual |
nID
parameter. \return |
Reimplemented from os::Handler.
References os::Menu::Private::m_cMutex, and os::Menu::Private::m_pcRoot.
cScreenPos | - The screen position. |
References GetPreferredSize(), os::Locker::Lock(), os::Menu::Private::m_bIsTracking, os::Menu::Private::m_cMutex, os::Menu::Private::m_hTrackPort, os::Menu::Private::m_pcRoot, os::Menu::Private::m_pcWindow, os::View::MakeFocus(), os::View::SetFrame(), os::Looper::SetMutex(), os::Window::Show(), os::Point::x, and os::Point::y.
void Menu::Unlock | ( | void | ) | const |
References os::Menu::Private::m_cMutex, os::Menu::Private::m_pcRoot, and os::Locker::Unlock().
|
virtual |
The window is locked when this member is called.
bIsActive | - true if the window gain and false if it loose focus. |
Reimplemented from os::View.
References os::Menu::Private::m_bHasOpenChilds, os::Menu::Private::m_cMutex, os::Menu::Private::m_hTrackPort, and os::Menu::Private::m_pcRoot.