pyWinAuto: pywinauto.controls.menuwrapper.MenuItem -- Wrap a menu item

MenuItem

Wrap a menu item


Methods

f __init__(self, ctrl, menu, index, on_main_menu=False) ...

Initalize the menu item

  • ctrl The dialog or control that owns this menu
  • menu The menu that this item is on
  • index The Index of this menuitem on the menu
  • on_main_menu True if the item is on the main menu

f Rectangle(self) ...

Get the rectangle of the menu item

f Index(self) ...

Return the index of this menu item

f State(self) ...

Return the state of this menu item

f ID(self) ...

Return the ID of this menu item

f Type(self) ...

Return the Type of this menu item

Main types are MF_STRING, MF_BITMAP, MF_SEPARATOR.

See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/resources/menus/menureference/menustructures/menuiteminfo.asp for further information.

f Text(self) ...

Return the state of this menu item

f SubMenu(self) ...

Return the SubMenu or None if no submenu

f IsEnabled(self) ...

Return True if the item is enabled.

f IsChecked(self) ...

Return True if the item is checked.

f Click(self) ...

Click on the menu item

If the menu is open this it will click with the mouse on the item. If the menu is not open each of it's parent's will be opened until the item is visible.

f Select(self) ...

Select the menu item

This will send a message to the parent window that the item was picked

f GetProperties(self) ...

Return the properties for the item as a dict

If this item opens a sub menu then call Menu.GetProperties() to return the list of items in the sub menu. This is avialable under teh 'MenuItems' key

See the source for more information.