Class: OperaWatir::QuickMenu
- Inherits:
-
QuickWidget
- Object
- QuickWidget
- OperaWatir::QuickMenu
- Defined in:
- lib/operawatir/quickwidgets/quick_menu.rb
Overview
??
Constant Summary
Constants inherited from QuickWidget
OperaWatir::QuickWidget::ConditionTimeout
Instance Method Summary collapse
-
#exist? ⇒ Boolean
(also: #exists?)
Checks whether a widget exists or not.
-
#height ⇒ Object
Height of widget.
-
#name ⇒ Object
The name of the menu (as found in standard_menu.ini).
-
#parentmenu? ⇒ Boolean
True if this menu has one or more submenus.
-
#quick_menuitems ⇒ Object
@example: menu.menuitems.select { |item| item.menu != menu.name }.should be_empty menu.menuitems.each { | item | puts item.name }.
-
#to_s ⇒ Object
String representation of menu.
-
#width ⇒ Object
Width of widget.
-
#window_id ⇒ Object
Note: This only makes sense for the menubars (and not on mac where there is only one menubar) Note: This makes it possible to distinguish between menubars in different main windows.
Methods inherited from QuickWidget
#click_with_condition, #double_click_with_condition, #enabled?, #focus_with_click, #focus_with_hover, #has_ui_string?, #middle_click_with_condition, #open_menu_with_rightclick, #open_window_with_hover, #parent_name, #position, #quick_tabs, #quick_widgets, #right_click_with_condition, #text, #type, #value, #verify_includes_text, #verify_text, #visible?, #widget_info_string
Methods included from DesktopContainer
#quick_addressfield, #quick_button, #quick_checkbox, #quick_dialogtab, #quick_dropdown, #quick_dropdownitem, #quick_editfield, #quick_find, #quick_griditem, #quick_gridlayout, #quick_label, #quick_menu, #quick_menuitem, #quick_radiobutton, #quick_searchfield, #quick_tab, #quick_thumbnail, #quick_toolbar, #quick_treeitem, #quick_treeview, #quick_window
Instance Method Details
#exist? ⇒ Boolean Also known as: exists?
Checks whether a widget exists or not
125 126 127 128 129 |
# File 'lib/operawatir/quickwidgets/quick_menu.rb', line 125 def exist? !!element rescue Exceptions::UnknownObjectException false end |
#height ⇒ Object
Returns height of widget.
76 77 78 |
# File 'lib/operawatir/quickwidgets/quick_menu.rb', line 76 def height element.getRect().height end |
#name ⇒ Object
Returns the name of the menu (as found in standard_menu.ini).
32 33 34 |
# File 'lib/operawatir/quickwidgets/quick_menu.rb', line 32 def name element.getName end |
#parentmenu? ⇒ Boolean
Returns true if this menu has one or more submenus.
97 98 99 100 101 102 103 104 |
# File 'lib/operawatir/quickwidgets/quick_menu.rb', line 97 def element.getItemList().each do |item| if item.hasSubMenu() return true end end false end |
#quick_menuitems ⇒ Object
@example:
..select { |item| item. != .name }.should be_empty
..each { | item | puts item.name }
114 115 116 117 118 |
# File 'lib/operawatir/quickwidgets/quick_menu.rb', line 114 def element.getItemList().map do |java_item| QuickMenuItem.new(self,java_item) end end |
#to_s ⇒ Object
Returns string representation of menu.
59 60 61 62 |
# File 'lib/operawatir/quickwidgets/quick_menu.rb', line 59 def to_s window = window_id > 0 ? "window_id #{window_id}" : "" "QUICKMENU #{name} #{window}" # TODO: Add rect end |
#width ⇒ Object
Returns width of widget.
68 69 70 |
# File 'lib/operawatir/quickwidgets/quick_menu.rb', line 68 def width element.getRect().width end |
#window_id ⇒ Object
Note: This only makes sense for the menubars (and not on mac where there is
only one )
Note: This makes it possible to distinguish between menubars in different
main windows
@example:
browser.(:name, "Main Menu").window_id
browser.quick_window(:id, <id>).(:name, "Browser File Menu")...
51 52 53 |
# File 'lib/operawatir/quickwidgets/quick_menu.rb', line 51 def window_id element.getParentWindowId() end |