Page 1 of 2

text formatting with answer commend

Posted: Mon Jul 07, 2014 5:44 am
by Jellobus
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

Re: text formatting with answer commend

Posted: Mon Jul 07, 2014 4:08 pm
by dunbarx
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

Re: text formatting with answer commend

Posted: Tue Jul 08, 2014 3:38 am
by Jellobus
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

Re: text formatting with answer commend

Posted: Tue Jul 08, 2014 11:17 am
by Klaus
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!

Re: text formatting with answer commend

Posted: Tue Jul 08, 2014 2:13 pm
by dunbarx
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

Re: text formatting with answer commend

Posted: Tue Jul 08, 2014 5:15 pm
by Klaus
Or just:

Code: Select all

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

Re: text formatting with answer commend

Posted: Wed Jul 09, 2014 6:24 am
by Jellobus
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

Re: text formatting with answer commend

Posted: Tue Oct 28, 2014 3:40 pm
by sphere
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 !

Re: text formatting with answer commend

Posted: Tue Oct 28, 2014 4:05 pm
by Klaus
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

Re: text formatting with answer commend

Posted: Tue Oct 28, 2014 4:43 pm
by sphere
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.!

Re: text formatting with answer commend

Posted: Tue Oct 28, 2014 11:08 pm
by sphere
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 !

Re: text formatting with answer commend

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

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>".
 

Re: text formatting with answer commend

Posted: Wed Oct 29, 2014 5:52 pm
by sphere
Looks great !
Thanks -hh now i can play some more :)

Re: text formatting with answer commend

Posted: Fri May 01, 2015 4:07 pm
by theresap72
This is great information. Is there anyway to format text in an answer dialog for iOS?

Re: text formatting with answer commend

Posted: Thu May 28, 2015 11:48 am
by sphere
Does this not work in iOS?
as this is html to format the text.