Hello Sazna,
please add following steps to the above described steps 1..10:
Step 11: Open the method onCharacterKey and remove following code lines:
// Precede all special control signs with the '%' escape sign. Otherwise
// the user can't input nor see them
if (( ch == '^' ) || ( ch == '~' ) || ( ch == '\xAD' ) || ( ch == '%' ))
str = "%" + ch;
Step 12: Open the method OnSetString and remove following code lines:
var int32 inx = str.find( '%', 0 );
// The special '%' escape sign is not visible until there is other
// '%' sign in front of it. Convert all '%' signs into '%%' sequences
while ( inx >= 0 )
{
str = str.insert( "%", inx );
inx = str.find( '%', inx + 2 );
}
inx = str.find( '^', 0 );
// The special '^' control sign is not visible until there is a '%'
// sign in front of it. Convert all '^' signs into '%^' sequences
while ( inx >= 0 )
{
str = str.insert( "%", inx );
inx = str.find( '^', inx + 2 );
}
inx = str.find( '~', 0 );
// The special '~' control sign is not visible until there is a '%'
// sign in front of it. Convert all '~' signs into '%~' sequences
while ( inx >= 0 )
{
str = str.insert( "%", inx );
inx = str.find( '~', inx + 2 );
}
inx = str.find( '\xAD', 0 );
// The special '\xAD' hyphen sign is not visible until there is a '%'
// sign in front of it. Convert all '\xAD' hyphen signs into '%\xAD'
// sequences
while ( inx >= 0 )
{
str = str.insert( "%", inx );
inx = str.find( '\xAD', inx + 2 );
}
Step 13: Open the method OnGetString and remove following code lines:
// In the following steps remove any special text view control signs
// which are usually used to control the text flow. The resulting string
// should contain the 'pure' text only.
var int32 inx = str.find( '%', 0 );
// The special control/escape signs are not visible until there is a
// '%' sign in front of them. Remove all superfluous '%' signs
while ( inx >= 0 )
{
str = str.remove( inx, 1 );
inx = str.find( '%', inx + 1 );
}
Step 14: Open the method onDeleteKey and remove following code lines:
// The sign was a special control sign? In this case the sign comes
// together with the preceding '%' escape sign - otherwise the user
// couldn't see the sign
if ( ch == '%' )
count = 2;
Step 15: Open the method onBackspaceKey and remove following code lines:
// The sign was a special control sign? In this case the sign comes
// together with the preceding '%' escape sign - otherwise the user
// couldn't see the sign
if (( ch == '^' ) || ( ch == '~' ) || ( ch == '%' ))
count = 2;
The above code sections exist to handle the characters ^ ~ and % which are handled exceptionally by the Text view. However, in your application the Text view will display only * characters. The special handling is not necessary and interfering with the steps 1..10.
I hope it provides the desired behavior.
Best regards
Paul Banach