Is it possible to create some commands in RichText
for ex. when u will type /quit the application will exit when u type /minimize the application will minimize etc.
Professional Software Development Tools
Is it possible to create some commands in RichText
for ex. when u will type /quit the application will exit when u type /minimize the application will minimize etc.
well... if you had a one line richtext you could do this
PHP Code:--On Key event of richtext
if(e_Key==13)then
sCommand=RichText.GetText(this, false);
if(sCommand=="/quit")then
Application.Exit(0);
elseif(sCommand=="/minimize")then
Application.Minimize();
else
Dialog.Message("Error", "Unrecognized command!");
end
RichText.SetText(this, "", false);
end
no not when you type but after you've pressed enter...
besides that type it right... cos it works fine with me...
can u post it as an example then maybe it should work
Just guessing, 'On Key' events usually occur as soon as a key has been pressed so the first character would trigger the event wouldn't it?
i've put if(e_Key==13)then in there... so it'll only fire on Pressing return/enter
Code:if(e_Key==13)then --Checking if Enter/Return == pressed sCommand=RichText.GetText(this, false); sCommand=String.Replace(sCommand, "\r\n", "", false) if(sCommand=="/quit")then Application.Exit(0); elseif(sCommand=="/minimize")then Application.Minimize(); else Dialog.Message("Error", "Unrecognized command!"); end RichText.SetText(this, "", false); end
Last edited by Imagine Programming; 07-01-2008 at 11:27 AM.
Here you go... example![]()
thnx now it's working