text formatting with answer commend

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

Jellobus
Posts: 317
Joined: Tue Dec 10, 2013 2:53 pm

text formatting with answer commend

Post by Jellobus » Mon Jul 07, 2014 5:44 am

Hi All :D

Is it possible to add image, set textstyle and text formatting with answer commend??

for example,

Code: Select all

answer "Delete it" with "OK" or "Cancel"
1. "Delete it" aligns left by default but I like to set it align center.
2. I like to make "Cancel" bold and in Red color.
3. I like to put image into answer pop up

I tried htmltext like

Code: Select all

on mouseUp
   get the htmltext of field "DeleteIt" ##field "DeleteIt" contains "Delete  it"  texts are in Blue color and center aligned
   answer it with the htmltext of field "Ok" or the htmltext of field "Cancel" ## texts in field "Cancel" are in bold & Red color
end mouseUp
##no idea to put image into answer pop up
It seems not working in this way...

Any suggestions?


Cheers!

Louis

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9665
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: text formatting with answer commend

Post by dunbarx » Mon Jul 07, 2014 4:08 pm

Hi.

You can add an image, see the dictionary. For the other tweaks, check out:

http://forums.livecode.com/viewtopic.ph ... and#p98187

I think you may consider rolling your own with a small modal stack. This is simple to do, and nobody will be able to tell the difference. You will script either the standard functionality of the button(s) or be able to do much more.

You OK with doing this?

Craig Newman

Jellobus
Posts: 317
Joined: Tue Dec 10, 2013 2:53 pm

Re: text formatting with answer commend

Post by Jellobus » Tue Jul 08, 2014 3:38 am

Hi Craig,

Yes its easier to make own modal stack but I need answer pop-up above a native multiline.. my own answer pop-up won't be visible when a multiline is being used.

The link is not exist anymore(Link in the link). Could you give me another source, if you don't mind?

thanks a lot!!

Louis

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: text formatting with answer commend

Post by Klaus » Tue Jul 08, 2014 11:17 am

Jellobus wrote:... above a native multiline...
So this is meant for iOS/Android?
It might be a good idea to note this fact the next time! 8)

Since the mobile platform only allows ONE stack to be open, a custom modal window/stack will not work here!

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9665
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: text formatting with answer commend

Post by dunbarx » Tue Jul 08, 2014 2:13 pm

I did not know you meant this for mobil as well.

The link works for me. It shows the use of HTML tags to format the dialog. For example:

answer "<p align="&"right"&">this is some text</p>"

Craig

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: text formatting with answer commend

Post by Klaus » Tue Jul 08, 2014 5:15 pm

Or just:

Code: Select all

answer "<p align=right>this is some text</p>"
:D

Jellobus
Posts: 317
Joined: Tue Dec 10, 2013 2:53 pm

Re: text formatting with answer commend

Post by Jellobus » Wed Jul 09, 2014 6:24 am

Hi Klaus, dunbarx :D

I can't create my own button with colors because a native multiline will be a top layer always.
so Is there no way to customize color of characters with answer dialogue on mobile platform?
I will need "Cancel" or "Delete" (with Bold & red color) option above a native multiline.

Cheers,

Louis

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: text formatting with answer commend

Post by sphere » Tue Oct 28, 2014 3:40 pm

Hello,

i'm trying to figuring this out too, because the answer field is now giving the same color as the stack.

The above link leads to this link http://ftp.runrev.com/forums/viewtopic. ... 43&p=19915
which is not valid anymore.
Tried also some color commands who are in the dictionary like

Code: Select all

on mouseUp
   put "this is a nice color" into tExtkleurtje
   answer tExtkleurtje
   set the foregroundColor of this field to "#114499"
   answer tExtkleurtje
     
end mouseUp
any help on this is appreciated !

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: text formatting with answer commend

Post by Klaus » Tue Oct 28, 2014 4:05 pm

Hi sphere,

here the correct link:
http://forums.livecode.com//viewtopic.p ... 43&p=19915

Code: Select all

on mouseUp
   put "this is a nice color" into tExtkleurtje
   answer tExtkleurtje
   set the foregroundColor of this field to "#114499"
   answer tExtkleurtje     
end mouseUp
No idea what this should do with color?

1. tExtkleurtje is a variable that is filled in the first line.
2. No other line does change this anyhow.
3. A variable PER SE cannot be colored!
4. "ANSWER..." will open anohter STACK on the dektop and iOS, so what exspect you to happen?
5. Setting a foregroundcolor of a field does not affect any ANSWER dialog calls.

Yolu HAVE to play around with HTML to make the dialog colorful somehow!


Best

Klaus

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: text formatting with answer commend

Post by sphere » Tue Oct 28, 2014 4:43 pm

Thanks Klaus for your answer.
I also tried some html things.

Thanks for getting the correct link :)

ok lets play aruond with it :mrgreen:

if i get it done what i want i'll put it here, thanks.!

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: text formatting with answer commend

Post by sphere » Tue Oct 28, 2014 11:08 pm

ok had a little play:

Code: Select all

on mouseUp
  # look in dictionary HTMLText
   answer "<p> <B> <i> <h1> <threedbox> <font color=white bgcolor=red>  This is how you do it !  </font></threedbox>  </i> </B></p>"
 end mouseUp
still not exactly what i wanted because now only the background color of the text itself is different.
I want to have the color of the text white and the background of the whole field red.

but ok it's a step in the right direction.

cheers !

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: text formatting with answer commend

Post by [-hh] » Wed Oct 29, 2014 8:48 am

Code: Select all

on mouseUp
  set itemdelimiter to "#"; answer last item of the script of me
end mouseUp

# Not all font faces show both of bold and italic
#
<p bgcolor="255,0,0" align="center">
<font face="Verdana" color="255,255,255" size="32">
<b><i>  This is <br>  how you <br> do it! </i></b></font></p>
For a better vertical spacing at end you may try "<hr>" just before "</b>".
 
Attachments
answer2.jpg
Changed in above: bgcolor="58,134,197", face="Marker Felt Wide"
answer2.jpg (19.13 KiB) Viewed 10191 times
shiftLock happens

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: text formatting with answer commend

Post by sphere » Wed Oct 29, 2014 5:52 pm

Looks great !
Thanks -hh now i can play some more :)

theresap72
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 13
Joined: Wed May 04, 2011 3:34 pm

Re: text formatting with answer commend

Post by theresap72 » Fri May 01, 2015 4:07 pm

This is great information. Is there anyway to format text in an answer dialog for iOS?

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: text formatting with answer commend

Post by sphere » Thu May 28, 2015 11:48 am

Does this not work in iOS?
as this is html to format the text.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”