Class type Goog.​Ui.​menuButton

class type menuButton = object..end

Inherits


method enterDocument : unit Js.meth
method exitDocument : unit Js.meth

Removes event handlers specific to menu buttons, and ensures that the attached menu also exits the document.

method disposeInternal : unit Js.meth
method handleMouseDown : 
'a. (#Goog.Events.event as 'a) Js.t -> unit Js.meth

Handles mousedown events. Invokes the superclass implementation to dispatch an ACTIVATE event and activate the button. Also toggles the visibility of the attached menu.

method handleMouseUp : 
'b. (#Goog.Events.event as 'b) Js.t -> unit Js.meth

Handles mouseup events. Invokes the superclass implementation to dispatch an ACTION event and deactivate the button.

method performActionInternal : 
'c. (#Goog.Events.event as 'c) Js.t -> bool Js.t Js.meth

Performs the appropriate action when the menu button is activated by the user.

method containsElement : 
'd. (#Dom_html.element as 'd) Js.t -> bool Js.t Js.meth

Returns true if the given element is to be considered part of the component, even if it isn't a DOM descendant of the component's root element.

method handleKeyEventInternal : 
'e. (#Goog.Events.event as 'e) Js.t -> bool Js.t Js.meth
method handleMenuAction : 
'f. (#Goog.Events.event as 'f) Js.t -> unit Js.meth

Handles ACTION events dispatched by an activated menu item.

method handleMenuBlur : 
'g. (#Goog.Events.event as 'g) Js.t -> unit Js.meth

Handles BLUR events dispatched by the popup menu by closing it. Only registered if the menu is focusable.

method handleBur : 'h. (#Goog.Events.event as 'h) Js.t -> unit Js.meth

Handles blur events dispatched by the button's key event target when it loses keyboard focus by closing the popup menu (unless it is focusable). Only registered if the button is focusable.

method getMenu : menu Js.t Js.meth

Returns the menu attached to the button. If no menu is attached, creates a new empty menu.

method setMenu : menu Js.t -> menu Js.t Js.optdef Js.meth

Replaces the menu attached to the button with the argument, and returns the previous menu (if any).

method addItem : 'i. (#control as 'i) Js.t -> unit Js.meth

Adds a new menu item at the end of the menu.

method addItemAt : 
'j 'k.
((#menuItem as 'j) Js.t, (#menuSeparator as 'k) Js.t)
Goog.Tools.Union.t -> int -> unit Js.meth

Adds a new menu item at the specific index in the menu.

method removeItem : menuItem Js.t -> unit Js.meth

Removes the item from the menu and disposes of it.

method removeItemAt : int -> unit Js.meth

Removes the menu item at a given index in the menu and disposes of it.

method getItemAt : int -> menuItem Js.t Js.meth

Returns the menu item at a given index.

method getItemCount : int Js.meth

Returns the number of items in the menu (including separators).

method setVisible : bool Js.t -> bool Js.t Js.opt -> bool Js.t Js.meth

Shows/hides the menu button based on the value of the argument. Also hides the popup menu if the button is being hidden.

method setEnabled : bool Js.t -> unit Js.meth

Enables/disables the menu button based on the value of the argument, and updates its CSS styling. Also hides the popup menu if the button is being disabled.

method isAlignMenuToStart : bool Js.t Js.meth

Returns Whether the menu is aligned to the start of the button (left if the render direction is left-to-right, right if the render direction is right-to-left).

method setAlignMenuToStart : bool Js.t -> unit Js.meth

Sets whether the menu is aligned to the start or the end of the button.

method setScrollOnOverflow : bool Js.t -> unit Js.meth

Sets whether the menu should scroll when it's too big to fix vertically on the screen. The css of the menu element should have overflow set to auto.

method isScrollOnOverflow : bool Js.t Js.meth

Returns Wether the menu will scroll when it's to big to fit vertically on the screen.

method isFocusablePopupMenu : bool Js.t Js.meth

Returns Whether the attached menu is focusable.

method setFocusablePopupMenu : bool Js.t -> unit Js.meth

Sets whether the attached popup menu is focusable. If the popup menu is focusable, it may steal keyboard focus from the menu button, so the button will not hide the menu on blur.

method showMenu : unit Js.meth

Reveals the menu and hooks up menu-specific event handling.

method hideMenu : unit Js.meth

Hides the menu and cleans up menu-specific event handling.

method setOpen : bool Js.t -> unit Js.meth

Opens or closes the attached popup menu.

method positionMenu : unit Js.meth

Positions the menu under the button. May be called directly in cases when the menu size is known to change.

method handleHighlightItem : 
'l. (#Goog.Events.event as 'l) Js.t -> unit Js.meth

Handles HIGHLIGHT events dispatched by the attached menu.

method handleUnHighlightItem : 
'm. (#Goog.Events.event as 'm) Js.t -> unit Js.meth

Handles UNHIGHLIGHT events dispatched by the associated menu.