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

Class UIEdit

Constructors , Methods , Fields

public class UIEdit extends UIDrawText
{
  // Fields
  protected final static int READONLY;

  // Constructors
  public UIEdit();
  public UIEdit(String newBuff);
  public UIEdit(char newBuff[]);

  // Methods
  public int append(char key);
  public int append(char key[])
  public int insert(char key, int iPos);
  public int insert(char key[], int iPos);

  public void remove(int iPos, int numberToRemove);
  public void clear();

  public int getMaxBufferSize();
  public void setMaxBufferSize(int newMax);
  public void setReadOnly(boolean ro);

  public boolean isReadOnly();
  public boolean keyDown(Event  evt, int  key);

}

A class that implements an edit control; extends UIDrawText and allows the user to edit the control's text.


Constructors


UIEdit

public UIEdit();

Creates an empty edit control.


UIEdit

public UIEdit(String newBuff);

Creates a new edit control based on a string.

ParameterDescription
newBuff Text of the new control.


UIEdit

public UIEdit(char newBuff[]);

Creates a new edit control based on a character buffer.

ParameterDescription
newBuff Text of the new control.


Methods


append

public int append(char key);

Appends a character to the end of the control.

Return Value:

Returns the number of characters added.

ParameterDescription
key Specifies the character that will be appended.


append

public int append(char key[]);

Appends a character to the end of the control.

Return Value:

Returns the number of characters added.

ParameterDescription
key Specifies the character that will be appended.


clear

public void clear();

Deletes all the text from the edit control.

Return Value:

No return value.


getMaxBufferSize

public int getMaxBufferSize();

Retrieves the maximum number of characters that the control can hold.

Return Value:

Returns the maximum number of characters that the control can hold.


insert

public int insert(char key, int iPos);

Inserts a character into the control at the specified position.

Return Value:

Returns the number of characters inserted.

ParameterDescription
key Specifies the character that will be inserted.
iPos Specifies the character index where the character will be inserted.


insert

public int insert(char key[], int iPos);

Inserts a character into the control at the specified position.

Return Value:

Returns the number of characters inserted.

ParameterDescription
key Specifies the character that will be inserted.
iPos Specifies the character index where the character will be inserted.


isReadOnly

public boolean isReadOnly();

Determines whether the control is read-only.

Return Value:

Returns true if the READONLY style is set; otherwise, returns false.


keyDown

public boolean keyDown(Event  evt, int  key);

Processes a key down event.

Return Value:

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

ParameterDescription
evt The event posted to the control.
key The key that was pressed.


remove

public void remove(int iPos, int numberToRemove);

Delete one or more characters from the edit control.

Return Value:

No return value.

ParameterDescription
iPos Specifies the character index where the characters will be deleted.
numberToRemove Specifies the number of characters that will be deleted.


setMaxBufferSize

public void setMaxBufferSize(int newMax);

Sets the maximum number of characters that the control can hold.

Return Value:

No return value.

ParameterDescription
newMax Specifies the new maximum number of characters that the control can hold.


setReadOnly

public void setReadOnly(boolean ro);

Changes the read-only attribute of the control.

ParameterDescription
ro If true, the READONLY style is set; otherwise, it is removed.


Fields

READONLY
Specifies that the control is read-only.


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