MenuItem Class

Definition

Line 1371 of System.Windows/Menu.cm

Inheritance

Constructors & Destructor

public MenuItem(const String<char>& text_)

Member Functions

public inline nothrow wchar AccessKey() const
public void AddMenuItem(MenuItemBase* menuItem)
public void CalculateChildRect(Graphics& graphics, const Font& font, const StringFormat& format, const Point& location)
public virtual nothrow int ChildIndicatorIndent() const
public virtual nothrow int ChildIndicatorWidth() const
public nothrow const Container& Children() const
public nothrow Event<ClickEventHandler, EmptyEventArgs>& ClickEvent()
private void Close(MenuControl* menuControl)
internal nothrow void CollectShortcuts(HashMap<Keys, MenuItem*, Hasher<Keys>, EqualTo<Keys>>& shortcuts)
public nothrow bool Contains(const Point& p)
public override nothrow Padding DefaultPadding() const
public nothrow void Disable()
internal void DispatchMouseMove(MouseEventArgs& args, bool& handled, MenuControl* menuControl)
internal void DoClick()
private void DoMouseDown(MouseEventArgs& args, MenuControl* menuControl)
internal void DoMouseDown(MouseEventArgs& args, bool& handled, MenuControl* menuControl)
internal void DoMouseEnter(bool parentIsOpen, MenuControl* menuControl)
internal void DoMouseLeave(MenuControl* menuControl)
internal void DoMouseMove(MouseEventArgs& args)
private void DoMouseUp(MouseEventArgs& args, MenuControl* menuControl)
internal void DoMouseUp(MouseEventArgs& args, bool& handled, MenuControl* menuControl)
public override void Draw(Graphics& graphics, const Padding& parentPadding, const Brush& textBrush, const Brush& disabledTextBrush, const Brush& backgroundBrush, const Brush& mouseOverBrush, const Brush& menuOpenBrush, const Brush& shadowBrush, const Brush& blackBrush, const Pen& blackPen, const Pen& darkPen, const Font& font, const StringFormat& format, const Color& menuOpenColor, MenuControl* menuControl, bool drawSubItems, const Point& origin)
private void DrawChildIndicator(Graphics& graphics, const Brush& blackBrush, const Point& origin)
private void DrawClosed(Graphics& graphics, const Padding& parentPadding, const Brush& textBrush, const Brush& disabledTextBrush, const Brush& mouseOverBrush, const Brush& backgroundBrush, const Brush& menuOpenBrush, const Brush& blackBrush, const Pen& blackPen, const Font& font, const StringFormat& format, const Color& menuOpenColor, MenuControl* menuControl, bool drawSubItems, const Point& origin)
private void DrawOpen(Graphics& graphics, const Padding& parentPadding, const Brush& textBrush, const Brush& disabledTextBrush, const Brush& backgroundBrush, const Brush& mouseOverBrush, const Brush& menuOpenBrush, const Brush& shadowBrush, const Brush& blackBrush, const Pen& blackPen, const Pen& darkPen, const Font& font, const StringFormat& format, const Color& menuOpenColor, MenuControl* menuControl, bool drawSubItems, const Point& origin)
private void DrawShortcut(Graphics& graphics, const Brush& textBrush, const Font& font, const StringFormat& format, const Point& origin)
public nothrow void Enable()
private void Execute(MenuItem* parentMenuItem, bool& wantsKeys, MenuControl* menuControl)
private nothrow MenuItem* GetChildItemByAccessKey(wchar accessKey)
public nothrow MenuItem* GetFirstMenuItem() const
public nothrow MenuItem* GetLastMenuItem() const
private nothrow MenuControl* GetMenuControl() const
public nothrow MenuItem* GetNextMenuItem() const
public nothrow void GetOpenRect(Rect& parentRect)
public nothrow MenuItem* GetParentMenuItem() const
public nothrow MenuItem* GetPrevMenuItem() const
public inline nothrow State GetState() const
internal bool HandleKey(Keys key, bool& wantsKeys, MenuItem* parentMenuItem, MenuControl* menuControl)
public inline nothrow bool IsDisabled() const
public inline nothrow bool IsEnabled() const
internal nothrow bool IsSameOrParentOf(MenuItem* menuItem) const
private inline nothrow bool LButtonPressed() const
internal void LeaveChildren(MenuControl* menuControl)
public override Size MeasureItem(Graphics& graphics, const Font& font, const StringFormat& format, int& shortcutFieldWidth, int& childIndicatorFieldWidth)
public nothrow Event<MouseEventHandler, MouseEventArgs>& MouseDownEvent()
public nothrow Event<MouseEnterEventHandler, EmptyEventArgs>& MouseEnterEvent()
internal inline nothrow bool MouseInClient() const
public nothrow Event<MouseLeaveEventHandler, EmptyEventArgs>& MouseLeaveEvent()
public nothrow Event<MouseEventHandler, MouseEventArgs>& MouseMoveEvent()
public nothrow Event<MouseEventHandler, MouseEventArgs>& MouseUpEvent()
protected virtual void OnClick()
protected virtual void OnMouseDown(MouseEventArgs& args)
protected virtual void OnMouseEnter()
protected virtual void OnMouseLeave()
protected virtual void OnMouseMove(MouseEventArgs& args)
protected virtual void OnMouseUp(MouseEventArgs& args)
private nothrow void ResetLButtonPressed()
internal void ResetMouseInClient()
internal nothrow void ResetSelected(MenuControl* menuControl)
internal inline nothrow bool Selected() const
private nothrow void SetAccessKey()
private nothrow void SetLButtonPressed()
internal void SetMouseInClient()
internal nothrow void SetSelected(MenuControl* menuControl)
public nothrow void SetShortcut(Keys shortcut_)
internal void SetState(State state_, MenuControl* menuControl)
public nothrow void SetText(const String<char>& text_, MenuControl* menuControl)
public virtual nothrow int ShadowWidth() const
public nothrow Padding ShortcutPadding() const
public nothrow const String<char>& Text() const
public inline nothrow const Rect& UnionRect() const
public nothrow bool UnionRectContains(const Point& p)

Enumerated Types

private enum Flags
public enum State

Member Variables

private wchar accessKey
private int childIndicatorFieldWidth
private Rect childRect
private Container children
private Event<ClickEventHandler, EmptyEventArgs> clickEvent
private Flags flags
private Event<MouseEventHandler, MouseEventArgs> mouseDownEvent
private Event<MouseEnterEventHandler, EmptyEventArgs> mouseEnterEvent
private Event<MouseLeaveEventHandler, EmptyEventArgs> mouseLeaveEvent
private Event<MouseEventHandler, MouseEventArgs> mouseMoveEvent
private Event<MouseEventHandler, MouseEventArgs> mouseUpEvent
private Keys shortcut
private int shortcutFieldWidth
private State state
private String<char> text
private Rect unionRect

Constructor& Destructor Details

MenuItem Constructor

public MenuItem(const String<char>& text_)

Definition
Line 1381 of System.Windows/Menu.cm


Member Function Details

AccessKey Member Function

public inline nothrow wchar AccessKey()

Definition
Line 2363 of System.Windows/Menu.cm


AddMenuItem Member Function

public void AddMenuItem(MenuItemBase* menuItem)

Definition
Line 1386 of System.Windows/Menu.cm


CalculateChildRect Member Function

public void CalculateChildRect(Graphics& graphics, const Font& font, const StringFormat& format, const Point& location)

Definition
Line 2279 of System.Windows/Menu.cm


ChildIndicatorIndent Member Function

public virtual nothrow int ChildIndicatorIndent()

Definition
Line 2453 of System.Windows/Menu.cm


ChildIndicatorWidth Member Function

public virtual nothrow int ChildIndicatorWidth()

Definition
Line 2457 of System.Windows/Menu.cm


Children Member Function

public nothrow const Container& Children()

Definition
Line 2423 of System.Windows/Menu.cm


ClickEvent Member Function

public nothrow Event<ClickEventHandler, EmptyEventArgs>& ClickEvent()

Definition
Line 2881 of System.Windows/Menu.cm


Close Member Function

private void Close(MenuControl* menuControl)

Definition
Line 1865 of System.Windows/Menu.cm


CollectShortcuts Member Function

internal nothrow void CollectShortcuts(HashMap<Keys, MenuItem*, Hasher<Keys>, EqualTo<Keys>>& shortcuts)

Definition
Line 2406 of System.Windows/Menu.cm


Contains Member Function

public nothrow bool Contains(const Point& p)

Definition
Line 2461 of System.Windows/Menu.cm


DefaultPadding Member Function

public override nothrow Padding DefaultPadding()

Definition
Line 2427 of System.Windows/Menu.cm


Disable Member Function

public nothrow void Disable()

Definition
Line 2824 of System.Windows/Menu.cm


DispatchMouseMove Member Function

internal void DispatchMouseMove(MouseEventArgs& args, bool& handled, MenuControl* menuControl)

Definition
Line 2195 of System.Windows/Menu.cm


DoClick Member Function

internal void DoClick()

Definition
Line 2266 of System.Windows/Menu.cm


DoMouseDown Member Function

private void DoMouseDown(MouseEventArgs& args, MenuControl* menuControl)

Definition
Line 2058 of System.Windows/Menu.cm


DoMouseDown Member Function

internal void DoMouseDown(MouseEventArgs& args, bool& handled, MenuControl* menuControl)

Definition
Line 1904 of System.Windows/Menu.cm


DoMouseEnter Member Function

internal void DoMouseEnter(bool parentIsOpen, MenuControl* menuControl)

Definition
Line 2105 of System.Windows/Menu.cm


DoMouseLeave Member Function

internal void DoMouseLeave(MenuControl* menuControl)

Definition
Line 2177 of System.Windows/Menu.cm


DoMouseMove Member Function

internal void DoMouseMove(MouseEventArgs& args)

Definition
Line 2153 of System.Windows/Menu.cm


DoMouseUp Member Function

private void DoMouseUp(MouseEventArgs& args, MenuControl* menuControl)

Definition
Line 2068 of System.Windows/Menu.cm


DoMouseUp Member Function

internal void DoMouseUp(MouseEventArgs& args, bool& handled, MenuControl* menuControl)

Definition
Line 1997 of System.Windows/Menu.cm


Draw Member Function

public override void Draw(Graphics& graphics, const Padding& parentPadding, const Brush& textBrush, const Brush& disabledTextBrush, const Brush& backgroundBrush, const Brush& mouseOverBrush, const Brush& menuOpenBrush, const Brush& shadowBrush, const Brush& blackBrush, const Pen& blackPen, const Pen& darkPen, const Font& font, const StringFormat& format, const Color& menuOpenColor, MenuControl* menuControl, bool drawSubItems, const Point& origin)

Definition
Line 2333 of System.Windows/Menu.cm


DrawChildIndicator Member Function

private void DrawChildIndicator(Graphics& graphics, const Brush& blackBrush, const Point& origin)

Definition
Line 2754 of System.Windows/Menu.cm


DrawClosed Member Function

private void DrawClosed(Graphics& graphics, const Padding& parentPadding, const Brush& textBrush, const Brush& disabledTextBrush, const Brush& mouseOverBrush, const Brush& backgroundBrush, const Brush& menuOpenBrush, const Brush& blackBrush, const Pen& blackPen, const Font& font, const StringFormat& format, const Color& menuOpenColor, MenuControl* menuControl, bool drawSubItems, const Point& origin)

Definition
Line 2541 of System.Windows/Menu.cm


DrawOpen Member Function

private void DrawOpen(Graphics& graphics, const Padding& parentPadding, const Brush& textBrush, const Brush& disabledTextBrush, const Brush& backgroundBrush, const Brush& mouseOverBrush, const Brush& menuOpenBrush, const Brush& shadowBrush, const Brush& blackBrush, const Pen& blackPen, const Pen& darkPen, const Font& font, const StringFormat& format, const Color& menuOpenColor, MenuControl* menuControl, bool drawSubItems, const Point& origin)

Definition
Line 2598 of System.Windows/Menu.cm


DrawShortcut Member Function

private void DrawShortcut(Graphics& graphics, const Brush& textBrush, const Font& font, const StringFormat& format, const Point& origin)

Definition
Line 2730 of System.Windows/Menu.cm


Enable Member Function

public nothrow void Enable()

Definition
Line 2811 of System.Windows/Menu.cm


Execute Member Function

private void Execute(MenuItem* parentMenuItem, bool& wantsKeys, MenuControl* menuControl)

Definition
Line 1878 of System.Windows/Menu.cm


GetChildItemByAccessKey Member Function

private nothrow MenuItem* GetChildItemByAccessKey(wchar accessKey)

Definition
Line 2389 of System.Windows/Menu.cm


GetFirstMenuItem Member Function

public nothrow MenuItem* GetFirstMenuItem()

Definition
Line 1390 of System.Windows/Menu.cm


GetLastMenuItem Member Function

public nothrow MenuItem* GetLastMenuItem()

Definition
Line 1404 of System.Windows/Menu.cm


GetMenuControl Member Function

private nothrow MenuControl* GetMenuControl()

Definition
Line 1463 of System.Windows/Menu.cm


GetNextMenuItem Member Function

public nothrow MenuItem* GetNextMenuItem()

Definition
Line 1418 of System.Windows/Menu.cm


GetOpenRect Member Function

public nothrow void GetOpenRect(Rect& parentRect)

Definition
Line 2478 of System.Windows/Menu.cm


GetParentMenuItem Member Function

public nothrow MenuItem* GetParentMenuItem()

Definition
Line 1446 of System.Windows/Menu.cm


GetPrevMenuItem Member Function

public nothrow MenuItem* GetPrevMenuItem()

Definition
Line 1432 of System.Windows/Menu.cm


GetState Member Function

public inline nothrow State GetState()

Definition
Line 2505 of System.Windows/Menu.cm


HandleKey Member Function

internal bool HandleKey(Keys key, bool& wantsKeys, MenuItem* parentMenuItem, MenuControl* menuControl)

Definition
Line 1485 of System.Windows/Menu.cm


IsDisabled Member Function

public inline nothrow bool IsDisabled()

Definition
Line 2807 of System.Windows/Menu.cm


IsEnabled Member Function

public inline nothrow bool IsEnabled()

Definition
Line 2803 of System.Windows/Menu.cm


IsSameOrParentOf Member Function

internal nothrow bool IsSameOrParentOf(MenuItem* menuItem)

Definition
Line 2773 of System.Windows/Menu.cm


LButtonPressed Member Function

private inline nothrow bool LButtonPressed()

Definition
Line 2849 of System.Windows/Menu.cm


LeaveChildren Member Function

internal void LeaveChildren(MenuControl* menuControl)

Definition
Line 2161 of System.Windows/Menu.cm


MeasureItem Member Function

public override Size MeasureItem(Graphics& graphics, const Font& font, const StringFormat& format, int& shortcutFieldWidth, int& childIndicatorFieldWidth)

Definition
Line 2517 of System.Windows/Menu.cm


MouseDownEvent Member Function

public nothrow Event<MouseEventHandler, MouseEventArgs>& MouseDownEvent()

Definition
Line 2861 of System.Windows/Menu.cm


MouseEnterEvent Member Function

public nothrow Event<MouseEnterEventHandler, EmptyEventArgs>& MouseEnterEvent()

Definition
Line 2869 of System.Windows/Menu.cm


MouseInClient Member Function

internal inline nothrow bool MouseInClient()

Definition
Line 2837 of System.Windows/Menu.cm


MouseLeaveEvent Member Function

public nothrow Event<MouseLeaveEventHandler, EmptyEventArgs>& MouseLeaveEvent()

Definition
Line 2877 of System.Windows/Menu.cm


MouseMoveEvent Member Function

public nothrow Event<MouseEventHandler, MouseEventArgs>& MouseMoveEvent()

Definition
Line 2873 of System.Windows/Menu.cm


MouseUpEvent Member Function

public nothrow Event<MouseEventHandler, MouseEventArgs>& MouseUpEvent()

Definition
Line 2865 of System.Windows/Menu.cm


OnClick Member Function

protected virtual void OnClick()

Definition
Line 2275 of System.Windows/Menu.cm


OnMouseDown Member Function

protected virtual void OnMouseDown(MouseEventArgs& args)

Definition
Line 2064 of System.Windows/Menu.cm


OnMouseEnter Member Function

protected virtual void OnMouseEnter()

Definition
Line 2157 of System.Windows/Menu.cm


OnMouseLeave Member Function

protected virtual void OnMouseLeave()

Definition
Line 2191 of System.Windows/Menu.cm


OnMouseMove Member Function

protected virtual void OnMouseMove(MouseEventArgs& args)

Definition
Line 2262 of System.Windows/Menu.cm


OnMouseUp Member Function

protected virtual void OnMouseUp(MouseEventArgs& args)

Definition
Line 2101 of System.Windows/Menu.cm


ResetLButtonPressed Member Function

private nothrow void ResetLButtonPressed()

Definition
Line 2857 of System.Windows/Menu.cm


ResetMouseInClient Member Function

internal void ResetMouseInClient()

Definition
Line 2845 of System.Windows/Menu.cm


ResetSelected Member Function

internal nothrow void ResetSelected(MenuControl* menuControl)

Definition
Line 2795 of System.Windows/Menu.cm


Selected Member Function

internal inline nothrow bool Selected()

Definition
Line 2783 of System.Windows/Menu.cm


SetAccessKey Member Function

private nothrow void SetAccessKey()

Definition
Line 2367 of System.Windows/Menu.cm


SetLButtonPressed Member Function

private nothrow void SetLButtonPressed()

Definition
Line 2853 of System.Windows/Menu.cm


SetMouseInClient Member Function

internal void SetMouseInClient()

Definition
Line 2841 of System.Windows/Menu.cm


SetSelected Member Function

internal nothrow void SetSelected(MenuControl* menuControl)

Definition
Line 2787 of System.Windows/Menu.cm


SetShortcut Member Function

public nothrow void SetShortcut(Keys shortcut_)

Definition
Line 2380 of System.Windows/Menu.cm


SetState Member Function

internal void SetState(State state_, MenuControl* menuControl)

Definition
Line 2509 of System.Windows/Menu.cm


SetText Member Function

public nothrow void SetText(const String<char>& text_, MenuControl* menuControl)

Definition
Line 2357 of System.Windows/Menu.cm


ShadowWidth Member Function

public virtual nothrow int ShadowWidth()

Definition
Line 2449 of System.Windows/Menu.cm


ShortcutPadding Member Function

public nothrow Padding ShortcutPadding()

Definition
Line 2438 of System.Windows/Menu.cm


Text Member Function

public nothrow const String<char>& Text()

Definition
Line 2353 of System.Windows/Menu.cm


UnionRect Member Function

public inline nothrow const Rect& UnionRect()

Definition
Line 2474 of System.Windows/Menu.cm


UnionRectContains Member Function

public nothrow bool UnionRectContains(const Point& p)

Definition
Line 2470 of System.Windows/Menu.cm