[SOLVED] Property Inspector Contents section

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
anmldr
Posts: 459
Joined: Tue Sep 11, 2012 11:13 pm

[SOLVED] Property Inspector Contents section

Post by anmldr » Mon Oct 08, 2012 11:07 pm

Is the content that you can put in this area HTML? If it is not HTML, then how do you add a hyperlink? In some of the scripting conferences, I have seen that some of the text can be hyperlinks.

Linda
Last edited by anmldr on Tue Oct 09, 2012 4:37 pm, edited 1 time in total.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Property Inspector Contents section

Post by Mark » Tue Oct 09, 2012 1:02 am

Hi Linda,

Select the text in a field and choose Link from the Text menu.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10324
Joined: Wed May 06, 2009 2:28 pm

Re: Property Inspector Contents section

Post by dunbarx » Tue Oct 09, 2012 1:10 am

Hi.



Not sure what you are asking. When setting the textStyle of several words to "link" that "group" of text is treated as a single word upon such things as "the clicktext". So you can then treat this "grouped" text as a hyperlink if you want. Is that what you meant?

The "contents" in the inspector pertains to dataGrids, table fields, etc. What did you have in mind in that regard?

Do I have any of this right?

Craig Newman

anmldr
Posts: 459
Joined: Tue Sep 11, 2012 11:13 pm

Re: Property Inspector Contents section

Post by anmldr » Tue Oct 09, 2012 2:52 pm

Mark wrote:Select the text in a field and choose Link from the Text menu.
That is a start. At least it turned blue like a hyperlink and is underlined but I do not see where to enter what to link to...

For instance if there were words "I am a link" that you want to be a hyperlink, you select that text and choose Link from the Text menu. It never gives you a choice for you to enter something like "http://www.mysite.com". All that it does is to change the text color to blue and underline it.

Linda

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Property Inspector Contents section

Post by Klaus » Tue Oct 09, 2012 2:59 pm

Hi Linda,
It never gives you a choice for you to enter something like "http://www.mysite.com".
All that it does is to change the text color to blue and underline it.
Yes, that is correct!

You need to add a script to that field with the link in it and catch the "linkclicked" message.
Like this, which presume that you only have internet links (http://www....):

Code: Select all

on linkclicked tLink
  launch url tLink
end linkclicked
Best

Klaus

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Property Inspector Contents section

Post by Mark » Tue Oct 09, 2012 3:04 pm

Hi Linda,

There are several ways to do this. You could set the htmlText property of a field to, for example,

Code: Select all

<p>some text <a href="http://somelink.com">this is a link"</a> some text</p>.
You can do this by copying this piece of htmlText and executing the following line from the message box:

Code: Select all

set the htmlText of fld x to the clipboardData["text"]
but there are many more possible ways to set the htmlText property. You just can't do this in the properties inspector.

Another possibility is to execute syntax like this:

Code: Select all

set the linkText of word 3 to 7 of fld x to "http://somelink.com"
Now you can add the following script to your field:

Code: Select all

on linkClicked theLink
  launch URL theLink
end linkClicked
If you don't set a link but instead just select some text and choose Link from the menu, you could do this:

Code: Select all

on linkClicked theLink
  if theLink is "I am a link" then
    lunch URL "http://economy-x-talk.com"
  else
    beep
  end if
end linkClicked
Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

anmldr
Posts: 459
Joined: Tue Sep 11, 2012 11:13 pm

[SOLVED] Property Inspector Contents section

Post by anmldr » Tue Oct 09, 2012 4:37 pm

Great! Hopefully, I am starting to "get it".

Linda

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: [SOLVED] Property Inspector Contents section

Post by Klaus » Tue Oct 09, 2012 4:45 pm

Go, Linda, Go! :)

Post Reply