Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 12 of 12
  1. #1
    Join Date
    Dec 2007
    Posts
    16

    Commands in RichText?

    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.

  2. #2
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    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(thisfalse);
    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 
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  3. #3
    Join Date
    Dec 2007
    Posts
    16
    Quote Originally Posted by C B programming and webdesign View Post
    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(thisfalse);
    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 
    it's not working :(
    when i type /quit or /minimize it says Unrecognized command! :(
    Help!

  4. #4
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    no not when you type but after you've pressed enter...

    besides that type it right... cos it works fine with me...
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  5. #5
    Join Date
    Dec 2007
    Posts
    16
    Quote Originally Posted by C B programming and webdesign View Post
    no not when you type but after you've pressed enter...

    besides that type it right... cos it works fine with me...
    I pressed Enter also when i typed /quit but it's showing that message :(

  6. #6
    Join Date
    Dec 2007
    Posts
    16
    can u post it as an example then maybe it should work

  7. #7
    Join Date
    Aug 2003
    Posts
    2,427
    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?

  8. #8
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Quote Originally Posted by longedge View Post
    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.
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  9. #9
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Here you go... example
    Attached Files
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  10. #10
    Join Date
    Aug 2003
    Posts
    2,427
    Quote Originally Posted by C B programming and webdesign View Post
    i've put if(e_Key==13)then in there... so it'll only fire on Pressing return/enter
    Ah.. yes sorry, I should've checked the virtual key codes.

  11. #11
    Join Date
    Dec 2007
    Posts
    16
    thnx now it's working

  12. #12
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Quote Originally Posted by longedge View Post
    Ah.. yes sorry, I should've checked the virtual key codes.
    Ah well don't worry, i had a delete function in a listbox once but i forgot its keycode... so on every key i deleted an item in the listbox
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

Similar Threads

  1. Hi is there any commands or dll to send telnet commands?
    By mrdude in forum AutoPlay Media Studio 7.5
    Replies: 0
    Last Post: 06-02-2008, 03:44 PM
  2. Displaying Plugin + RichText troubles
    By DericLanza in forum AutoPlay Media Studio 7.5
    Replies: 3
    Last Post: 05-22-2008, 12:42 PM
  3. i need example for text editor in richtext
    By lnd in forum AutoPlay Media Studio 7.5
    Replies: 1
    Last Post: 04-02-2008, 12:17 AM
  4. Flash fs commands
    By fredkauf in forum AutoPlay Media Studio 5.0
    Replies: 6
    Last Post: 02-02-2004, 05:53 PM
  5. Setting Multiple FS Commands
    By johndove1 in forum AutoPlay Media Studio 4.0
    Replies: 1
    Last Post: 01-31-2003, 03:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts