Package com.ms.ui Previous
Previous
Contents
Contents
Index
Index
Next
Next

Class UIMenuList

Constructors , Methods

public class UIMenuList extends UIList
{
  // Constructors
  public UIMenuList();
  public UIMenuList(int layoutStyle);

  // Methods
  public boolean mouseUp(Event e, int x, int y);
  public boolean mouseEnter(Event e, int x, int y);
  
}

A class that implements a menu list control. A UIMenuList object is typically used for the content of a pop-up menu, and is contained within a UIPopup window. Every UIMenuLauncher object is associated with a UIMenuList control.

By default, a LIST_SELECT event is generated each time the mouse enters a menu list item. When an item is clicked, an action event is generated.

For an example of using UIMenuList objects, see the UIMenuLauncher overview.


Constructors


UIMenuList

public UIMenuList();

Creates an empty menu list control.

Remarks:

Call the add method (inherited through UIList) to add items to the list. By default, the control's selection mode is SINGLESELECT, and the layout style is FILL.


UIMenuList

public UIMenuList(int layoutStyle);

Creates an empty menu list control with the specified layout style.

ParameterDescription
layoutStyle The layout style of the control. Specify UIVerticalFlowLayout.MULTICOLUMN, UIVeritcalFlowLayout.FILL, or a bitwise combination of the two. (FILL extends the width of an item to the width of the list control; this allows the item to be selected even when the area outside of its text label is clicked.) Specify 0 for a single-column list with no fill.

Remarks:

Call the add method (inherited through UIList) to add items to the list. By default, the control's selection mode is SINGLESELECT. If an undefined layout style is specified, an IllegalArgumentException is thrown.


Methods


mouseEnter

public boolean mouseEnter(Event e, int x, int y);

Reacts to the mouse entering the menu list control.

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
e The event posted to the menu list control.
x The x coordinate of the event.
y The y coordinate of the event.

Remarks:

If the component at the mouse's location has an associated pop-up menu, this menu is launched.


mouseUp

public boolean mouseUp(Event e, int x, int y);

Reacts to the mouse button being released over the menu list control.

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
e The event posted to the menu list control.
x The x coordinate of the event.
y The y coordinate of the event.



Top© 1997 Microsoft Corporation. All rights reserved. Legal Notices.