 | | Wide Studio Object Reference
| |
Class Name
WSCvifield
Specification of methods
addString method
- Form
- void addString(char* var)
- Function
- Adds the specified string to the input text.
- Description
-
- Parameters
-
- Return value
- Nothing.
- Notice
- If you want to replace the string,
use the property WSClabelString.
- Samples
-
//add string.
newvifi_000->addString("add string");
getBuf method
- Form
- WSCushort* getBuf()
- Function
- Returns the internal text input buffer.
- Description
-
- Parameters
- Nothing.
- Return value
- Returns the internal buffer.
- Notice
- Do not delete the buffer.
It becomes invalid when the buffer is
changed by the keyboard input,
so it is better that you copy the return buffer to another.
The text is UCS2 code.
- Samples
-
//get internal UCS2 text buffer.
WSCushort* buf = newvifi_000->getBuf();
onActivate method
- Form
- void onActivate()
- Function
- It executes this method
when scrolling is done.
- Description
- Instead of the event procedure
by the WSEV_ACTIVATE trigger,
the WSEV_ACTIVATE event can be handled
by overloading of this method.
- Parameters
- Nothing.
- Return value
- Nothing.
- Notice
- If needed, overload this method on the sub classes.
- Samples
-
void new_class::onActivate(){
//do something when scrolling is done.
//call the method of the parent class.
old_class::onActivate();
}
onValueChange method
- Form
- void onValueChanged()
- Function
- It executes this method
when the input text is changed.
- Description
- Instead of the event procedure
by the WSEV_VALUE_CH trigger,
the WSEV_VALUE_CH event can be handled
by overloading of this method.
- Parameters
- Nothing.
- Return value
- Nothing.
- Notice
- If needed, overload this method on the sub classes.
- Samples
-
void new_class::onValueChange(){
//do something when the value is changed.
//call the method of the parent class.
old_class::onValueChange();
}
onKey() method
- Form
- void onKey(WSDkeyboard* keyboard,WSCbool keydown);
- Function
- It executes this method
when the key is pressed and released.
- Description
- Instead of the event procedure
by the WSEV_KEY_PRESS/RELEASE trigger,
the WSEV_KEY_PRESS/RELEASE event can be handled
by overloading of this method.
- Parameters
-
(in)WSDkeyboard* keyboard | Keyboard instance |
(in)WSCbool keydown | True = Press,False = Release |
- Return value
- Nothing.
- Notice
-
- Samples
-
void new_class::onKey(WSDkeyboard* keyboard,WSCbool keydown){
//a key is pressed.
if (keydown != False){
//get key.
long key = keyboard->getKey();
//get input text.
WSCstring str = keyboard->getText();
}
//call the method of the parent class.
old_class::onKey(keyboard,keydown);
}
onKeyHook() method
- Form
- void onKeyHook(WSDkeyboard* keyboard);
- Function
- It executes this method
to hook the input key.
- Description
- Instead of the event procedure
by the WSEV_KEY_HOOK trigger,
the WSEV_KEY_HOOK event can be handled
by overloading of this method.
- Parameters
-
(in)WSDkeyboard* keyboard | Keyboard instance |
- Return value
- Nothing.
- Notice
-
- Samples
-
void new_class::onKeyHook(WSDkeyboard* keyboard){
//get the input text.
WSCstring str = keyboard->getText();
//It is possible to
//replace the text with keyboard->setText(...)
//call the method of the parent class.
old_class::onKey(keyboard,keydown);
}
replaceSelectedString() method
- Form
- void replaceSelectedString(char* str,long encoding = WS_EN_DEFAULT);
- Function
- Replace the selected string.
- Description
-
- Parameters
-
(in)char* str | New string to replace |
(in)long encoding | Encoding of new string |
Default encoding is WS_EN_DEFAULT.
Refer to WSCstring(char*,long) about the available encoding.
- Return value
- Nothing.
- Notice
-
- Samples
-
//replace the selected string with the specified string.
newvifi_000->replaceSelectedString("replace string");
getSelectedString() method
- Form
- WSCstring getSelectedString()
- Function
- Returns the selected string.
- Description
-
- Parameters
- Nothing.
- Return value
- Returns the selected string.
- Notice
-
- Samples
-
//get the selected string.
WSCstring stext = newvifi_000->getSelectedString();
getString() method
- Form
- WSCstring getString()
- Function
- Returns the input string.
- Description
-
- Parameters
- Nothing.
- Return value
- Returns the input string.
- Notice
-
- Samples
-
//get the input string.
WSCstring text = newvifi_000->getString();
deleteSelectedString() method
- Form
- void deleteSelectedString()
- Function
- Deletes the selected string.
- Description
-
- Parameters
- Nothing.
- Return value
-
- Notice
-
- Samples
-
//delete the selected string.
newvifi_000->deleteSelectedString();
setSelect() method
- Form
- long setSelect(long pos,long len)
- Function
- Make the string selected.
- Description
- Make the string of specified position and length selected.
- Parameters
-
(in)long pos | the start position of the select string |
(in)long len | Length of the select string |
- Return value
- Returns WS_NO_ERR if it successed,returns WS_ERR if not.
- Notice
-
- Samples
-
//make the string selected from beginning to the fifth charactor.
newvifi_000->setSelectedString(0,5);
getSelectedPos() method
- Form
- long setSelectedPos()
- Function
- Returns the position of the selected string.
- Description
-
- Parameters
- Nothing.
- Return value
- Returns the position of the selected string.
- Notice
-
- Samples
-
//get the position of the selected string.
long pos = newvifi_000->setSelectedPos();
Document Release 3.20 For Use with Wide Studio Release 3.20, Spring 2003 Wide Stuido Home | Up to Copyright(C) T. Hirabayashi, 1999-2003 | | Last modified: February 3, 2003 | |