Package com.ms.ui |
![]() Previous |
![]() Contents |
![]() Index |
![]() Next |
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.
public UIEdit();Creates an empty edit control.
public UIEdit(String newBuff);Creates a new edit control based on a string.
Parameter Description newBuff Text of the new control.
public UIEdit(char newBuff[]);Creates a new edit control based on a character buffer.
Parameter Description newBuff Text of the new control.
public int append(char key);Appends a character to the end of the control.
Return Value:
Returns the number of characters added.
Parameter Description key Specifies the character that will be appended.
public int append(char key[]);Appends a character to the end of the control.
Return Value:
Returns the number of characters added.
Parameter Description key Specifies the character that will be appended.
public void clear();Deletes all the text from the edit control.
Return Value:
No return value.
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.
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.
Parameter Description key Specifies the character that will be inserted. iPos Specifies the character index where the character will be inserted.
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.
Parameter Description key Specifies the character that will be inserted. iPos Specifies the character index where the character will be inserted.
public boolean isReadOnly();Determines whether the control is read-only.
Return Value:
Returns true if the READONLY style is set; otherwise, returns false.
public boolean keyDown(Event evt, int key);Processes a key down event.
Return Value:
Returns true if the event was handled; otherwise, returns false.
Parameter Description evt The event posted to the control. key The key that was pressed.
public void remove(int iPos, int numberToRemove);Delete one or more characters from the edit control.
Return Value:
No return value.
Parameter Description iPos Specifies the character index where the characters will be deleted. numberToRemove Specifies the number of characters that will be deleted.
public void setMaxBufferSize(int newMax);Sets the maximum number of characters that the control can hold.
Return Value:
No return value.
Parameter Description newMax Specifies the new maximum number of characters that the control can hold.
public void setReadOnly(boolean ro);Changes the read-only attribute of the control.
Parameter Description ro If true, the READONLY style is set; otherwise, it is removed.
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.