Packages
 In this topic

*Constructors

*Methods

*Fields

 

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

 


Class UISpinnerEdit

public class UISpinnerEdit extends UISpinner
{
  // Fields
  public static final int BORDER;
  public static final int CENTER;
  public static final int LEFT;
  public static final int RIGHT;

  // Constructors
  public UISpinnerEdit();
  public UISpinnerEdit(int style, int editStyle);
  public UISpinnerEdit(int style, int editStyle, int min, int max,
        int page, int line, int pos);

  // Methods
  public int getEditStyle();
  public void setEditStyle(int editStyle);
}

This class implements a spin box control with its associated buttons and edit box. The edit control takes any number in a range of numerical values. To attach a listener to the edit control inside UISpinnerEdit, call getLayoutComponent. The following code demonstrates this usage.


UISpinnerEdit spin = new UISpinnerEdit (UISpinnerEdit.RAISED |
                                          UISpinnerEdit.CIRCULAR,
                                          UISpinnerEdit.BORDER | 
                                          UISpinnerEdit.CENTER,
                                          0,128,6,1,12));

IUIComponent comp = spin.getLayoutComponent (UISpinner.BUDDY);
if (comp instanceof UIEdit)
 { 
   UIEdit e = (UIEdit)comp;
   e.addTextListener (this);
 }
UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIScroll
          |
          +--UISpinner
            |
            +--UISpinnerEdit

Constructors

UISpinnerEdit

public UISpinnerEdit();

Creates a spinner edit box control with a range of 0-100. By default, the button style is RAISED.

UISpinnerEdit

public UISpinnerEdit(int style, int editStyle);

Creates a Spinner edit box control with a range of 0-100 and with the specified button style. By default, the edit box associated with the spinner has a border.

ParameterDescription
style The style of spinner. This can be one or a combination of RAISED, VERTICAL, or CIRCULAR.
editStyle The edit box style for the spinner control. This style can be a combination of BORDER and one of the following: LEFT, CENTER, or RIGHT.

If some other style is needed (for example, vertical centering or read-only), you can use the getLayoutComponent method to retrieve the IUISpinnerBuddy helper class.

UISpinnerEdit

public UISpinnerEdit(int style, int editStyle, int min, int max, int page,
        int line, int pos);

Creates a Spin Box control with the given metrics and with the specified style.

ParameterDescription
style The style of spinner. This can be one or a combination of RAISED, VERTICAL, or CIRCULAR.
editStyle The edit box style for the spinner control. This style can be a combination of BORDER and one of the following: LEFT, CENTER, or RIGHT.

If some other style is needed (for example, vertical centering or read-only), you can use the getLayoutComponent method to retrieve the IUISpinnerBuddy helper class.

Note The page parameter is used internally when the scrollPageUp or scrollPageDown are called.

min The minimum value of the spinner's range.
max The maximum value of the spinner's range.
page The number of scroll positions associated with a full page.
line The number to add or subtract when a lineUp or lineDown operation is processed.
pos The starting position inside the spinner's range.

Methods

getEditStyle

public int getEditStyle();

Retrieves the spinner control's edit box style.

Return Value:

Returns the current style of the spinner's edit box. By default, the edit style is BORDER.

See Also: setEditStyle

setEditStyle

public void setEditStyle(int editStyle);

Sets the style of the spinner control's edit box.

Return Value:

No return value.

ParameterDescription
editStyle The edit box style for the spinner control. This style can be a combination of BORDER and one of the following: LEFT, CENTER, or RIGHT.

See Also: getEditStyle

Fields

BORDER
The edit control associated with the spinner has a border.
CENTER
The text in the edit box associated with the Spin Box control is center-aligned.
LEFT
The text in the edit box associated with the Spin Box control is left-aligned.
RIGHT
The text in the edit box associated with the Spin Box control is right-aligned.

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