Module: AMS::Menu

Defined in:
Documentation/ams/menu.rb

Overview

Note:

Windows only!

The Menu namespace contains functions associated with Windows menu.

Since:

  • 2.0.0

Class Method Summary collapse

Class Method Details

.endBoolean

Deactivate active context menu.

Returns:

  • (Boolean)

    success

See Also:

Since:

  • 2.0.0


17
18
# File 'Documentation/ams/menu.rb', line 17

def end
end

.get_commands(handle, cur_path = "") ⇒ Hash<String, Fixnum>

Get menu commands.

Parameters:

  • handle (Fixnum)

    A handle to a valid menu or sub-menu.

  • cur_path (String) (defaults to: "")

    Current menu path.

Returns:

  • (Hash<String, Fixnum>)

    { path => id, … }

Since:

  • 2.0.0


86
87
# File 'Documentation/ams/menu.rb', line 86

def get_commands(handle, cur_path = "")
end

.get_item_count(handle) ⇒ Fixnum

Get menu item count.

Parameters:

  • handle (Fixnum)

    A handle to a valid menu or sub-menu.

Returns:

  • (Fixnum)

    count

See Also:

Since:

  • 2.0.0


24
25
# File 'Documentation/ams/menu.rb', line 24

def get_item_count(handle)
end

.get_item_id(handle, index) ⇒ Fixnum?

Note:

A return value of zero implies the menu item is a separator.

Get menu item id by item position.

Parameters:

  • handle (Fixnum)

    A handle to a valid menu or sub-menu.

  • index (Fixnum)

Returns:

  • (Fixnum, nil)

    Menu item identifier if successful or -1 if not.

See Also:

Since:

  • 2.0.0


33
34
# File 'Documentation/ams/menu.rb', line 33

def get_item_id(handle, index)
end

.get_item_string_by_id(handle, id) ⇒ String?

Get menu item string by item identifier.

Parameters:

  • handle (Fixnum)

    A handle to a valid menu or sub-menu.

  • id (Fixnum)

Returns:

  • (String, nil)

    Menu item string if successful or nil if not.

See Also:

Since:

  • 3.0.0


59
60
# File 'Documentation/ams/menu.rb', line 59

def get_item_string_by_id(handle, id)
end

.get_item_string_by_pos(handle, index) ⇒ String?

Get menu item string by item position.

Parameters:

  • handle (Fixnum)

    A handle to a valid menu or sub-menu.

  • index (Fixnum)

Returns:

  • (String, nil)

    Menu item string if successful or nil if not.

See Also:

Since:

  • 3.0.0


50
51
# File 'Documentation/ams/menu.rb', line 50

def get_item_string_by_pos(handle, index)
end

.get_sub_menu(handle, index) ⇒ Fixnum?

Get menu sub-menu handle by sub-menu position.

Parameters:

  • handle (Fixnum)

    A handle to a valid menu or sub-menu.

  • index (Fixnum)

Returns:

  • (Fixnum, nil)

    A handle to sub-menu if successful or nil if not.

See Also:

Since:

  • 2.0.0


41
42
# File 'Documentation/ams/menu.rb', line 41

def get_sub_menu(handle, index)
end

.is_item_checked_by_id?(handle, id) ⇒ Boolean

Determine if menu item is checked.

Parameters:

  • id (Fixnum)

Returns:

  • (Boolean)

    True if checked; false if unchecked.

Since:

  • 3.6.0


100
101
# File 'Documentation/ams/menu.rb', line 100

def is_item_checked_by_id?(handle, id)
end

.is_item_checked_by_pos?(handle, index) ⇒ Boolean

Determine if menu item is checked.

Parameters:

  • index (Fixnum)

Returns:

  • (Boolean)

    True if checked; false if unchecked.

Since:

  • 3.6.0


93
94
# File 'Documentation/ams/menu.rb', line 93

def is_item_checked_by_pos?(handle, index)
end

.is_item_grayed_by_id?(handle, id) ⇒ Boolean

Determine if menu item is grayed.

Parameters:

  • id (Fixnum)

Returns:

  • (Boolean)

    True if grayed/disabled; false if enabled.

Since:

  • 3.6.0


114
115
# File 'Documentation/ams/menu.rb', line 114

def is_item_grayed_by_id?(handle, id)
end

.is_item_grayed_by_pos?(handle, index) ⇒ Boolean

Determine if menu item is grayed.

Parameters:

  • index (Fixnum)

Returns:

  • (Boolean)

    True if grayed/disabled; false if enabled.

Since:

  • 3.6.0


107
108
# File 'Documentation/ams/menu.rb', line 107

def is_item_grayed_by_pos?(handle, index)
end

.is_valid?(handle) ⇒ Boolean

Determine whether handle is a reference to a valid menu.

Parameters:

  • handle (Fixnum)

    A menu handle to be tested.

Returns:

  • (Boolean)

See Also:

Since:

  • 2.0.0


11
12
# File 'Documentation/ams/menu.rb', line 11

def is_valid?(handle)
end

.set_item_string_by_id(handle, id, string) ⇒ Boolean

Set menu item string by item identifier.

Parameters:

  • handle (Fixnum)

    A handle to a valid menu or sub-menu.

  • id (Fixnum)
  • string (String)

Returns:

  • (Boolean)

    success

See Also:

Since:

  • 3.0.0


79
80
# File 'Documentation/ams/menu.rb', line 79

def set_item_string_by_id(handle, id, string)
end

.set_item_string_by_pos(handle, index, string) ⇒ Boolean

Set menu item string by item position.

Parameters:

  • handle (Fixnum)

    A handle to a valid menu or sub-menu.

  • index (Fixnum)
  • string (String)

Returns:

  • (Boolean)

    success

See Also:

Since:

  • 3.0.0


69
70
# File 'Documentation/ams/menu.rb', line 69

def set_item_string_by_pos(handle, index, string)
end