# Menuing Support Tasks

|  |  |  |  | Task Summary | Owner
|  |  |  |  | BMenu | Justin Gasper
|  |  |  |  | BMenuBar | Justin Gasper
|  |  |  |  | BMenuItem | Justin Gasper
|  |  |  |  | BSeparatorItem |
|  |  |  |  | BMenuField |
|  |  |  |  | BPopUpMenu |
|  |  |  |  | Menu Config |

|  |  |  |  | Task Details
BMenu Class
|  |  |  |  | BMenu(const char* title, menu_layout layout = B_ITEMS_IN_COLUMN);
|  |  |  |  | BMenu(const char* title, float width, float height);
|  |  |  |  | BMenu(BMessage* data);
|  |  |  |  | virtual ~BMenu();
|  |  |  |  | static BArchivable* Instantiate(BMessage* data);
|  |  |  |  | virtual status_t Archive(BMessage* data, bool deep = true) const;
|  |  |  |  | virtual void AttachedToWindow();
|  |  |  |  | virtual void DetachedFromWindow();
|  |  |  |  | bool AddItem(BMenuItem* item);
|  |  |  |  | bool AddItem(BMenuItem* item, int32 index);
|  |  |  |  | bool AddItem(BMenuItem* item, BRect frame);
|  |  |  |  | bool AddItem(BMenu* menu);
|  |  |  |  | bool AddItem(BMenu* menu, int32 index);
|  |  |  |  | bool AddItem(BMenu* menu, BRect frame);
|  |  |  |  | bool AddList(BList* list, int32 index);
|  |  |  |  | bool AddSeparatorItem();
|  |  |  |  | bool RemoveItem(BMenuItem* item);
|  |  |  |  | BMenuItem* RemoveItem(int32 index);
|  |  |  |  | bool RemoveItems(int32 index, int32 count, bool del = false);
|  |  |  |  | bool RemoveItem(BMenu* menu);
|  |  |  |  | BMenuItem* ItemAt(int32 index) const;
|  |  |  |  | BMenu* SubmenuAt(int32 index) const;
|  |  |  |  | int32 CountItems() const;
|  |  |  |  | int32 IndexOf(BMenuItem* item) const;
|  |  |  |  | int32 IndexOf(BMenu* menu) const;
|  |  |  |  | BMenuItem* FindItem(uint32 command) const;
|  |  |  |  | BMenuItem* FindItem(const char* name) const;
|  |  |  |  | virtual status_t SetTargetForItems(BHandler* target);
|  |  |  |  | virtual status_t SetTargetForItems(BMessenger messenger);
|  |  |  |  | virtual void SetEnabled(bool state);
|  |  |  |  | virtual void SetRadioMode(bool state);
|  |  |  |  | virtual void SetTriggersEnabled(bool state);
|  |  |  |  | virtual void SetMaxContentWidth(float max);
|  |  |  |  | void SetLabelFromMarked(bool on);
|  |  |  |  | bool IsLabelFromMarked();
|  |  |  |  | bool IsEnabled() const;
|  |  |  |  | bool IsRadioMode() const;
|  |  |  |  | bool AreTriggersEnabled() const;
|  |  |  |  | bool IsRedrawAfterSticky() const;
|  |  |  |  | float MaxContentWidth() const;
|  |  |  |  | BMenuItem* FindMarked();
|  |  |  |  | BMenu* Supermenu() const;
|  |  |  |  | BMenuItem* Superitem() const;
|  |  |  |  | virtual void MessageReceived(BMessage* msg);
|  |  |  |  | virtual void KeyDown(const char* bytes, int32 numBytes);
|  |  |  |  | virtual void Draw(BRect updateRect);
|  |  |  |  | virtual void GetPreferredSize(float* width, float* height);
|  |  |  |  | virtual void ResizeToPreferred();
|  |  |  |  | virtual void FrameMoved(BPoint new_position);
|  |  |  |  | virtual void FrameResized(float new_width, float new_height);
|  |  |  |  | void InvalidateLayout();
|  |  |  |  | virtual BHandler* ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier, int32 form, const char* property);
|  |  |  |  | virtual status_t GetSupportedSuites(BMessage* data);
|  |  |  |  | virtual status_t Perform(perform_code d, void* arg);
|  |  |  |  | virtual void MakeFocus(bool state = true);
|  |  |  |  | virtual void AllAttached();
|  |  |  |  | virtual void AllDetached();
|  |  |  |  | BMenu(BRect frame, const char* viewName, uint32 resizeMask, uint32 flags, menu_layout layout, bool resizeToFit);
|  |  |  |  | virtual BPoint ScreenLocation();
|  |  |  |  | void SetItemMargins(float left, float top, float right, float bottom);
|  |  |  |  | void GetItemMargins(float* left, float* top, float* right,float* bottom) const;
|  |  |  |  | menu_layout Layout() const;
|  |  |  |  | virtual void Show();
|  |  |  |  | void Show(bool selectFirstItem);
|  |  |  |  | void Hide();
|  |  |  |  | BMenuItem* Track(bool start_opened = false, BRect* special_rect = NULL);
|  |  |  |  | virtual bool AddDynamicItem(add_state s);
|  |  |  |  | virtual void DrawBackground(BRect update);
|  |  |  |  | void SetTrackingHook(menu_tracking_hook func, void* state);
BMenuBar Class
|  |  |  |  | BMenuBar(BRect frame, const char* title, uint32 resizeMask = B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP, menu_layout layout = B_ITEMS_IN_ROW, bool resizeToFit = true);
|  |  |  |  | BMenuBar(BMessage* data);
|  |  |  |  | virtual ~BMenuBar();
|  |  |  |  | static BArchivable* Instantiate(BMessage* data);
|  |  |  |  | virtual status_t Archive(BMessage* data, bool deep = true) const;
|  |  |  |  | virtual void SetBorder(menu_bar_border border);
|  |  |  |  | menu_bar_border Border() const;
|  |  |  |  | virtual void Draw(BRect updateRect);
|  |  |  |  | virtual void AttachedToWindow();
|  |  |  |  | virtual void DetachedFromWindow();
|  |  |  |  | virtual void MessageReceived(BMessage* msg);
|  |  |  |  | virtual void MouseDown(BPoint where);
|  |  |  |  | virtual void WindowActivated(bool state);
|  |  |  |  | virtual void MouseUp(BPoint where);
|  |  |  |  | virtual void FrameMoved(BPoint new_position);
|  |  |  |  | virtual void FrameResized(float new_width, float new_height);
|  |  |  |  | virtual void Show();
|  |  |  |  | virtual void Hide();
|  |  |  |  | virtual BHandler* ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier, int32 form, const char* property);
|  |  |  |  | virtual status_t GetSupportedSuites(BMessage* data);
|  |  |  |  | virtual void ResizeToPreferred();
|  |  |  |  | virtual void GetPreferredSize(float* width, float* height);
|  |  |  |  | virtual void MakeFocus(bool state = true);
|  |  |  |  | virtual void AllAttached();
|  |  |  |  | virtual void AllDetached();
|  |  |  |  | virtual status_t Perform(perform_code d, void* arg);
BMenuItem Class
|  |  |  |  | BMenuItem(const char* label, BMessage* message, char shortcut = 0, uint32 modifiers = 0);
|  |  |  |  | BMenuItem(BMenu* menu, BMessage* message = NULL);
|  |  |  |  | BMenuItem(BMessage* data);
|  |  |  |  | virtual ~BMenuItem();
|  |  |  |  | static BArchivable* Instantiate(BMessage* data);
|  |  |  |  | virtual status_t Archive(BMessage* data, bool deep = true) const;
|  |  |  |  | virtual void SetLabel(const char* name);
|  |  |  |  | virtual void SetEnabled(bool state);
|  |  |  |  | virtual void SetMarked(bool state);
|  |  |  |  | virtual void SetTrigger(char ch);
|  |  |  |  | virtual void SetShortcut(char ch, uint32 modifiers);
|  |  |  |  | const char* Label() const;
|  |  |  |  | bool IsEnabled() const;
|  |  |  |  | bool IsMarked() const;
|  |  |  |  | char Trigger() const;
|  |  |  |  | char Shortcut(uint32* modifiers = NULL) const;
|  |  |  |  | BMenu* Submenu() const;
|  |  |  |  | BMenu* Menu() const;
|  |  |  |  | BRect Frame() const;
|  |  |  |  | virtual void GetContentSize(float* width, float* height);
|  |  |  |  | virtual void TruncateLabel(float max, char* new_label);
|  |  |  |  | virtual void DrawContent();
|  |  |  |  | virtual void Draw();
|  |  |  |  | virtual void Highlight(bool on);
|  |  |  |  | bool IsSelected() const;
|  |  |  |  | BPoint ContentLocation() const;
|  |  |  |  | virtual status_t Invoke(BMessage* msg = NULL);
BSeparatorItem Class
|  |  |  |  | BSeparatorItem();
|  |  |  |  | BSeparatorItem(BMessage* data);
|  |  |  |  | virtual ~BSeparatorItem();
|  |  |  |  | virtual status_t Archive(BMessage* data, bool deep = true) const;
|  |  |  |  | static BArchivable* Instantiate(BMessage* data);
|  |  |  |  | virtual void SetEnabled(bool state);
|  |  |  |  | virtual void GetContentSize(float* width, float* height);
|  |  |  |  | virtual void Draw();
BMenuField Class
|  |  |  |  | BMenuField(BRect frame, const char* name, const char* label, BMenu* menu, uint32 resize = B_FOLLOW_LEFT|B_FOLLOW_TOP, uint32 flags = B_WILL_DRAW | B_NAVIGABLE);
|  |  |  |  | BMenuField(BRect frame, const char* name, const char* label, BMenu* menu, bool fixed_size, uint32 resize = B_FOLLOW_LEFT|B_FOLLOW_TOP, uint32 flags = B_WILL_DRAW | B_NAVIGABLE);
|  |  |  |  | BMenuField(BMessage* data);
|  |  |  |  | virtual ~BMenuField();
|  |  |  |  | static BArchivable* Instantiate(BMessage* data);
|  |  |  |  | virtual status_t Archive(BMessage* data, bool deep = true) const;
|  |  |  |  | virtual void Draw(BRect update);
|  |  |  |  | virtual void AttachedToWindow();
|  |  |  |  | virtual void AllAttached();
|  |  |  |  | virtual void MouseDown(BPoint where);
|  |  |  |  | virtual void KeyDown(const char* bytes, int32 numBytes);
|  |  |  |  | virtual void MakeFocus(bool state);
|  |  |  |  | virtual void MessageReceived(BMessage* msg);
|  |  |  |  | virtual void WindowActivated(bool state);
|  |  |  |  | virtual void MouseUp(BPoint pt);
|  |  |  |  | virtual void MouseMoved(BPoint pt, uint32 code, const BMessage* msg);
|  |  |  |  | virtual void DetachedFromWindow();
|  |  |  |  | virtual void AllDetached();
|  |  |  |  | virtual void FrameMoved(BPoint new_position);
|  |  |  |  | virtual void FrameResized(float new_width, float new_height);
|  |  |  |  | BMenu* Menu() const;
|  |  |  |  | BMenuBar* MenuBar() const;
|  |  |  |  | BMenuItem* MenuItem() const;
|  |  |  |  | virtual void SetLabel(const char* label);
|  |  |  |  | const char* Label() const;
|  |  |  |  | virtual void SetEnabled(bool on);
|  |  |  |  | bool IsEnabled() const;
|  |  |  |  | virtual void SetAlignment(alignment label);
|  |  |  |  | alignment Alignment() const;
|  |  |  |  | virtual void SetDivider(float dividing_line);
|  |  |  |  | float Divider() const;
|  |  |  |  | void ShowPopUpMarker();
|  |  |  |  | void HidePopUpMarker();
|  |  |  |  | virtual BHandler* ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier, int32 form, const char* property);
|  |  |  |  | virtual status_t GetSupportedSuites(BMessage* data);
|  |  |  |  | virtual void ResizeToPreferred();
|  |  |  |  | virtual void GetPreferredSize(float* width, float* height);
|  |  |  |  | virtual status_t Perform(perform_code d, void* arg);
BPopUpMenu Class
|  |  |  |  | BPopUpMenu(const char* title, bool radioMode = true, bool autoRename = true, menu_layout layout = B_ITEMS_IN_COLUMN);
|  |  |  |  | BPopUpMenu(BMessage* data);
|  |  |  |  | virtual ~BPopUpMenu();
|  |  |  |  | virtual status_t Archive(BMessage* data, bool deep = true) const;
|  |  |  |  | static BArchivable* Instantiate(BMessage* data);
|  |  |  |  | BMenuItem* Go(BPoint where, bool delivers_message = false, bool open_anyway = false, bool async = false);
|  |  |  |  | BMenuItem* Go(BPoint where, bool delivers_message, bool open_anyway, BRect click_to_open, bool async = false);
|  |  |  |  | virtual void MessageReceived(BMessage* msg);
|  |  |  |  | virtual void MouseDown(BPoint pt);
|  |  |  |  | virtual void MouseUp(BPoint pt);
|  |  |  |  | virtual void MouseMoved(BPoint pt, uint32 code, const BMessage* msg);
|  |  |  |  | virtual void AttachedToWindow();
|  |  |  |  | virtual void DetachedFromWindow();
|  |  |  |  | virtual void FrameMoved(BPoint new_position);
|  |  |  |  | virtual void FrameResized(float new_width, float new_height);
|  |  |  |  | virtual BHandler* ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier, int32 form, const char* property);
|  |  |  |  | virtual status_t GetSupportedSuites(BMessage* data);
|  |  |  |  | virtual status_t Perform(perform_code d, void* arg);
|  |  |  |  | virtual void ResizeToPreferred();
|  |  |  |  | virtual void GetPreferredSize(float* width, float* height);
|  |  |  |  | virtual void MakeFocus(bool state = true);
|  |  |  |  | virtual void AllAttached();
|  |  |  |  | virtual void AllDetached();
|  |  |  |  | void SetAsyncAutoDestruct(bool state);
|  |  |  |  | bool AsyncAutoDestruct() const;
|  |  |  |  | virtual BPoint ScreenLocation();
Menu Config Functions
|  |  |  |  | status_t set_menu_info(menu_info* info);
|  |  |  |  | status_t get_menu_info(menu_info* info);

Legend
| Functional Spec
| Use Cases
| Unit Tests
| Technical Spec
| Implementation
| Completed

The OpenBeOS project is hosted by:

Copyright © 2001-2002 OpenBeOS Project