Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 15 of 15
  1. #1
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770

    Just obe little question I need help with if you can

    I have a little project I did and all seems to work find but someone ask me if when you highlight the word the word would be in the code ?
    like this [ B ]Fat[ /B ] (space it so it would show up)
    Code:
    Input.SetText("Input1", "");
    text = Input.GetText("Input1");
    Clipboard.CopyText(text);
    So any word put in to the input1 would then have the bbcode around it when highlighted . right now if you add a word it will get over written .

    Oh the text is coming from the name of the button.
    Last edited by bobbie; 03-12-2006 at 11:43 AM.

  2. #2
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    Anyone know how to do this?
    Like to give out the new one with the fix.

  3. #3
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    I'm not sure I understand the specific question.

  4. #4
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    Well if you look at where you post here you see all the bbcodes just about the post area.
    If you click and drag on a word then click one of the icons about the post it will add the bbcode to the word.
    I want to do the samething with the words in the inputbox.
    Attached Images

  5. #5
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    OK here's a very basic example, no error checking, etc. If you want to make it account for line breaks, etc. then check into the 3rd parameter of Input.GetSelection "Linenum". All code is on the button's "On Click" event. If the code seems complicated just break it down bit by bit, the concept is that we get the selection start and end points and then get the input text, then simply apply string formatting accordingly.
    Attached Files

  6. #6
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    FYI Just updated the attachment with multiple buttons.

  7. #7
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    Ok thank you .. going to check it out now.

    Thank you .. just what I wanted..
    Last edited by bobbie; 03-12-2006 at 01:35 PM.

  8. #8
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Bear in mind this isn't the most elegant way to do it, it's just a crude example to illustrate the concept. It's pretty easy to adapt to a function though, which is the best approach with any code that you will be using more than once within your project such as this. So that would be the way to go.

  9. #9
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    When I try to add the copy to clipboard it gives an error ?
    Clipboard.CopyText(Mytext);

    ---------------------------
    Error
    ---------------------------
    On Click, Line 4: Argument 1 must be a string.
    ---------------------------
    OK
    ---------------------------
    Code:
    mySelection = Input.GetSelection("Input1");
    myText = Input.GetText("Input1");
    Input.SetText("Input1", String.Left(myText, mySelection.Start - 1)..""..String.Mid(myText, mySelection.Start, (mySelection.End - mySelection.Start) + 1)..""..String.Right(myText, (String.Length(myText) - mySelection.End)));
    Clipboard.CopyText(Mytext);

  10. #10
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    You mistyped the variable name. Always double check that first in the case of an error.

  11. #11
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    I see that now . lol
    myText
    How can I add a msg if they don't select the word?


    ---------------------------
    Error
    ---------------------------
    On Click, Line 3: attempt to index global `mySelection' (a nil value)
    ---------------------------
    OK
    ---------------------------

  12. #12
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    One more thing. it is not copying the bbcode part just the word that is type in the input box?

  13. #13
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Not sure, you'll have to check it and fix it and experiment to meet your needs, as I said in my earlier post, there is no error checking, etc.

  14. #14
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    Guess thats as far as I go with this then.

  15. #15
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    I wouldn't give up so easy. Get in there and read the code, then try and code the features you desire. If you have a specific problem with your code, post it someone will help fix it. A little effort goes a long way on something as simple as this. FWIW the examples I post are intended solely to help you learn how to code the features yourself. The idea being that if you have some working code to start with, you can chop it up and figure out the variation which works best for your actual project.

Similar Threads

  1. Kiosk Mode Window Manipulation Question
    By travisperkins in forum AutoPlay Media Studio 6.0
    Replies: 13
    Last Post: 03-06-2006, 07:40 AM
  2. Basic Flash question
    By aae991 in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 03-09-2005, 09:46 PM
  3. FlashMX vs AMS5 Data Arrays question
    By Martin_SBT in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 01-19-2004, 09:05 AM
  4. question about sound mp3
    By Rapido78840 in forum AutoPlay Media Studio 4.0
    Replies: 4
    Last Post: 10-10-2003, 11:19 AM
  5. ** Question for all AutoPlay Menu Studio Users **
    By Ted in forum AutoPlay Menu Studio 3.0
    Replies: 4
    Last Post: 10-09-2000, 09:09 AM

Posting Permissions

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