Package com.ms.ui |
![]() Previous |
![]() Contents |
![]() Index |
![]() Next |
public class UIRepeatButton extends UIPushButton implements TimerListener { // Constructors public UIRepeatButton(); public UIRepeatButton(String text); public UIRepeatButton(String text, int style); public UIRepeatButton(Component comp); public UIRepeatButton(Component comp, int style); // Methods public void setPressed(boolean on); public void timeTriggered(TimerEvent te); }
A class that implements a repeating push button control. With a simple push button, an action event is generated when the button is pressed and released. With a repeating push button, however, action events are continually generated as long as the button remains pressed.
For more information about using buttons, see the UIButton overview.
public UIRepeatButton();Creates a repeating push button control with no content.
Remarks:
By default, the button has a flat style.
public UIRepeatButton(String text);Creates a repeating push button control using the specified text for content.
Parameter Description text The text to be displayed within the button. Remarks:
By default, the button has a flat style, and the text is centered and hot-tracked. To create a button whose text is not hot-tracked, pass a UIText object instead of a String, as shown in the following example.
UIRepeatButton r = new UIRepeatButton(new UIText("Text not hot-tracked"));For more information about hot-tracking, see the UIButton overview.
public UIRepeatButton(String text, int style);Creates a repeating push button control using the specified text for content and the specified style.
Parameter Description text The text to be displayed within button. style The style of the button. You can pass any bitwise combination of UIPushButton.RAISED, UIButton.TOGGLE, and UIButton.TRITOGGLE. (Note that combining TOGGLE and TRITOGGLE results in TRITOGGLE.) To specify a flat style, pass 0 for this parameter. Remarks:
By default, the text is centered and hot-tracked. If any undefined style bits are specified, an IllegalArgumentException is thrown.
To create a button whose text is not hot-tracked, pass a UIText object instead of a String, as shown in the following example.
UIRepeatButton r = new UIRepeatButton(new UIText("Text not hot-tracked"), 0);For more information about hot-tracking, see the UIButton overview.
public UIRepeatButton(Component comp);Creates a repeating push button control using the specified component for content.
Parameter Description comp The component to be displayed within the button. Remarks:
By default, the component is centered and the button has a flat style. Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. For examples of how to construct buttons, see the UIButton.
public UIRepeatButton(Component comp, int style);Creates a repeating push button control using the specified component for content and the specified style.
Parameter Description comp The component to be displayed within button. style The style of the button. You can pass any bitwise combination of UIPushButton.RAISED, UIButton.TOGGLE, and UIButton.TRITOGGLE. (Note that combining TOGGLE and TRITOGGLE results in TRITOGGLE.) To specify a flat style, pass 0 for this parameter. Remarks:
By default, the component is centered. If any undefined style bits are specified, an IllegalArgumentException is thrown. Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. For examples of how to construct buttons, see the UIButton overview.
public void setPressed(boolean on);Sets or clears the pressed state of the button. As long as the button remains in the pressed state, action events will continually be generated.
Return Value:
No return value.
Parameter Description on If true, the pressed state is set; otherwise, it is cleared. Remarks:
This method automatically lays out the content and repaints the button to display the new state. If the on parameter is true, a repeating timer is started to continually generate action events while the button remains pressed. If on is false, the timer is stopped.
For more information about button states, see the UIButton overview.
public void timeTriggered(TimerEvent te);Posts an action event to the button.
Return Value:
No return value.
Parameter Description te A TimerEvent object that describes the timer event. Remarks:
This method implements timeTriggered in the TimerListener interface; it is automatically invoked during setPressed to continually generate action events while the button is pressed.
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.