Importing and editing text in a field...

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
LndRvr
Posts: 3
Joined: Tue Jan 20, 2015 1:53 am

Importing and editing text in a field...

Post by LndRvr » Fri Feb 20, 2015 3:31 am

What is the easiest way to import some text to a field and then be able to edit font/size/color? The field would just be text for the user to read. No action is required. I have imported via Controls but I can't edit.

Also, can I import the HTML for the text so that colors and fonts are exactly like the webpage that I am getting the text? Basically, I am creating a mobile version of a website. Maybe there is an easy way to do this. Lastly, I assume that if a website is accessed via a mobile device, the mobile device can "chose" a mobile display of the HTML. Correct?

Any guidance on these issues is much appreciated. It seems that I remember reading about using a substack to save the text for display in the stack.

Thanks in advance for your help!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Creating and Editing a Text card...

Post by Simon » Fri Feb 20, 2015 4:11 am

Hi LndRvr,
Check out HTMLText in the dictionary for the supported tags.

For simple pages go get this, it'll help a lot
http://forums.livecode.com/viewtopic.ph ... es#p100173

Code: Select all

on mouseUp
set the HTMLText of field "myField" to --pasted stuff
end mouseUp
Now with that you can use whatever HTML editor you like and just create the page, then copy the HTML (get rid of all the "<!DOCTYPE html PUBLIC ..." stuff) and paste it into that thing hit the button and Presto!

Oh, all that tool does is convert the quotes to work in liveCode you might not need it.
Bad <a href="http://mySite.com/index.html">
Good "<a href="&quote&"http://mySite.com/index.html"&quote&">"

OK Found Klaus's method:

Code: Select all

function q theString
  return QUOTE & theString & QUOTE
end q
That may fit your style better

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Importing and editing text in a field...

Post by Simon » Fri Feb 20, 2015 4:13 am

ooops, please don't double post :)
We can stick with this one
http://forums.livecode.com/viewtopic.php?f=4&t=23286

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

LndRvr
Posts: 3
Joined: Tue Jan 20, 2015 1:53 am

Re: Importing and editing text in a field...

Post by LndRvr » Fri Feb 20, 2015 4:15 am

yeah, I first posted in the "announcements" by accident. Sorry for the double post.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Importing and editing text in a field...

Post by FourthWorld » Fri Feb 20, 2015 4:59 am

This is the better location - threads merged here.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jiml
Posts: 339
Joined: Sat Dec 09, 2006 1:27 am

Re: Importing and editing text in a field...

Post by jiml » Fri Feb 20, 2015 5:56 pm

Also, can I import the HTML for the text so that colors and fonts are exactly like the webpage that I am getting the text? Basically, I am creating a mobile version of a website. Maybe there is an easy way to do this.
Why not just use a mobile browser control? Then the webpage will be displayed just as a browser would display it.
Lastly, I assume that if a website is accessed via a mobile device, the mobile device can "chose" a mobile display of the HTML. Correct?
Yes, if the page is designed to be 'responsive'.

Jim Lambert

LndRvr
Posts: 3
Joined: Tue Jan 20, 2015 1:53 am

Re: Importing and editing text in a field...

Post by LndRvr » Sat Feb 21, 2015 1:54 am

Jim,

How would I know if a website is "responsive"?

Will (LndRvr)

jiml
Posts: 339
Joined: Sat Dec 09, 2006 1:27 am

Re: Importing and editing text in a field...

Post by jiml » Sat Feb 21, 2015 6:00 pm

Looking at a webpage on a desktop browser then on a mobile device is one way to check.
http://en.wikipedia.org/wiki/Responsive_web_design

Post Reply