Packages
 In this topic

*Constructors

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.ui   Previous This
Package
Next

 


Class AwtUICheckButton

public class AwtUICheckButton extends AwtUIButton implements 
            IAwtUIItemSelectable
{
  // Constructors
  public AwtUICheckButton();
  public AwtUICheckButton(String name);
  public AwtUICheckButton(String name, int style);
  public AwtUICheckButton(IUIComponent comp);
  public AwtUICheckButton(IUIComponent comp, int style);

  // Methods
  public void addItemListener(ItemListener l);
  public IUIComponent getBase();
  protected void processHostEvent(AWTEvent e);
  protected void processItemEvent(ItemEvent e);
  public void removeItemListener(ItemListener l);
}

This class implements the functionality of a UICheckButton object in an AWT-based control. An AwtUICheckButton control is an AwtUIHost component whose associated root container holds a UICheckButton object. By hosting this object, an AwtUICheckButton control integrates AFC with AWT. Although an AwtUICheckButton control is fully compatible with AWT, a UICheckButton control is optimized for performance and size.

Note The hot-track color is the same color as the button text color. As a result, hot-tracking does not appear to be functional.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIButton
        |
        +--AwtUICheckButton

Constructors

AwtUICheckButton

public AwtUICheckButton();

Creates an AWT-based check box button with no content.

Remarks:

By default, the button's style is set to TOGGLE.

AwtUICheckButton

public AwtUICheckButton(String name);

Creates an AWT-based check box button with the specified text.

ParameterDescription
name The text to be displayed with the check box image.

Remarks:

By default, the button is hot-tracked and its style is set to TOGGLE. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

AwtUICheckButton

public AwtUICheckButton(String name, int style);

Creates an AWT-based check box button with the specified text and style.

ParameterDescription
name The text to be displayed with the check box image.
style The style of the button. Possible values include UIButton.TOGGLE or UIButton.TRITOGGLE.

Remarks:

By default, the button is hot-tracked. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

AwtUICheckButton

public AwtUICheckButton(IUIComponent comp);

Creates an AWT-based check box button with the specified component.

ParameterDescription
comp The component to be displayed with the check box image.

Remarks:

Typically, you'll pass a UIText, a UIGraphic, or a UIItem object for the component. By default, the button's style is set to TOGGLE.

AwtUICheckButton

public AwtUICheckButton(IUIComponent comp, int style);

Creates an AWT-based check box button with the specified component and style.

ParameterDescription
comp The component to be displayed with the check box image.
style The style of the button. Possible values include UIButton.TOGGLE or UIButton.TRITOGGLE.

Remarks:

Typically, you'll pass a UIText, a UIGraphic, or a UIItem object for the component.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Methods

addItemListener

public void addItemListener(ItemListener l);

Adds the specified item listener. The listener receives all item events generated for the control.

Return Value:

No return value.

ParameterDescription
l The item listener to be added.

See Also: removeItemListener

getBase

public IUIComponent getBase();

Retrieves the UI component that the button is based on.

Return Value:

Returns the UICheckButton object associated with the button control.

Remarks:

When the AWT-based button is first created, it is associated with a UICheckButton object.

processHostEvent

protected void processHostEvent(AWTEvent e);

Processes the specified event.

Return Value:

No return value.

ParameterDescription
e The event.

Remarks:

This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processHostEvent calls one of the following methods.

Event type Method called
item event processItemEvent
component event processComponentEvent (inherited through AwtUIHost)
container event processContainerEvent (inherited through AwtUIHost)
focus event processFocusEvent (inherited through AwtUIHost)
key event processKeyEvent (inherited through AwtUIHost)
mouse event processMouseEvent (inherited through AwtUIHost)
mouse motion event processMouseMotionEvent (inherited through AwtUIHost)

When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.

processItemEvent

protected void processItemEvent(ItemEvent e);

Processes item events.

Return Value:

No return value.

ParameterDescription
e The item event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered item listener. When overriding this method, call processItemEvent to ensure the default event processing continues normally.

See Also: addItemListener

removeItemListener

public void removeItemListener(ItemListener l);

Removes the specified item listener. The listener no longer receives the control's item events.

Return Value:

No return value.

ParameterDescription
l The item listener to be removed.

See Also: addItemListener

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.