Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2005
    Posts
    15

    Text editing through paragraph

    While I love the paragraph object, I am unable to select its text and copy it to the clipboard.

    I want to load a file to an object and be able to select its text. The only solution I have found to this is to dynamicly create a web page from the file Code looks like this:
    Code:
    <textarea style="width:100%; height:100%>"..MyFile.."</textarea>
    Now this is ugly because it embeds an html doc with scroll bars(disabled) and then the texarea also gets scroll bars.
    I messed around with the textbox object but I can not get it to write out the new lines with \r\n.
    I would much rather use paragraph because it looks awesome!!
    Any ideas or inputs for me?

    -Nirus

  2. #2
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    HI. Whenever I include "selectable" text in an application I tend to do so using an input object. Hope that helps...

  3. #3
    Join Date
    Feb 2005
    Posts
    15
    Only problem with the input box, I am having trouble readin and existing file to it. I am having problems parsing new lines to \r\n. Not only that but I would like to make a a syntaxt highlighter for files containing code. That kinda limits the input ox I think. I should have mentioned that

    -Nirus

  4. #4
    Join Date
    Jul 2004
    Posts
    34
    Have you tried loading the text to a variable and then using the lable, or whatever other object your are using, with that variable?

  5. #5
    Join Date
    Feb 2005
    Posts
    15
    Here is my solution for now. But it looks bad with all the scrollbars. I only want 1. This also gives limitation because it is in a web object.
    Code:
    SelectedFile = ListBox.GetSelected("sourcebox");
    if(SelectedFile)then
    	local strFolderName = "";
    	local strText = ListBox.GetItemText("sourcebox", SelectedFile[1]);
    	local strPath = ListBox.GetItemData("sourcebox", SelectedFile[1]);
    	strcode = TextFile.ReadToString(strPath);
    	strcode = "<html><head></head><body topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0><textarea style=\"width:100%; height:98%; background-color:#E3E3E3; color:#008000;\">"..strcode.."</textarea></body></html>";
    
    TextFile.WriteFromString("AutoPlay\\Docs\\koad.html", strcode, false);
    Web.LoadURL("filecode", "AutoPlay\\Docs\\koad.html");
    end
    Have you tried loading the text to a variable and then using the lable, or whatever other object your are using, with that variable?
    I think what you mean here is just getting the text to display on the object. Yes I can get the text to go where I want but I can not select it unless it is in an inputbox. With input boxes, I can not seem to parse the string to make new lines into \r\n

    -Brent

  6. #6
    Join Date
    May 2003
    Location
    Pendleton, Oregon
    Posts
    1,038
    If I understand your question correctly, then Brett has built a great example that shows you exactly how to do what you're after.

    Check it out

    http://www.indigorose.com/forums/sho...le+text+editor
    Last edited by JimS; 02-16-2005 at 03:10 PM.
    Add-ons for AMS. Toolbar Buttons Galore, System Animations, the Window Construction Kit, and more.
    Visit Acme-Tek

Similar Threads

  1. how to add text formatting in paragraph?
    By andre in forum AutoPlay Media Studio 5.0
    Replies: 7
    Last Post: 12-20-2004, 03:44 PM
  2. Example: Loading Paragraph Text Using a Timer
    By Jonas DK in forum AutoPlay Media Studio 5.0 Examples
    Replies: 7
    Last Post: 11-25-2004, 05:10 PM
  3. Centred text in paragraph object.
    By longedge in forum AutoPlay Media Studio 5.0
    Replies: 8
    Last Post: 09-22-2004, 11:37 AM
  4. Autosizing text in Paragraph objects
    By spacesurfer in forum AutoPlay Media Studio 5.0
    Replies: 7
    Last Post: 09-06-2004, 03:24 AM
  5. HOWTO: Display Conditional Text Based Upon a List Box Selection
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-15-2002, 10:54 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