[Laszlo-dev] For Review: Change 20090103-hqm-t Summary: make swf9 hyperlinks be enabled when 'clickable' is asserted
Henry Minsky
hminsky at laszlosystems.com
Sat Jan 3 14:31:10 PST 2009
Yeah, the hand cursor ought to only show up over the hyperlinks.
For the LINK event, I think it is OK to install the TextEvent.LINK
handler by default on all text sprites, it doesn't
really cost anything. That just leaves the question about what to do
about mouseEnabled.
Maybe we need to say that you need to have selectable=true in order to
be able to click on hyperlinks?
Because in swf9, if you have selectable=false,
LzTextSprite.setSelectable() currently forces mouseEnabled = false on
the TextField, which disables the hyperlinks.
On Sat, Jan 3, 2009 at 5:12 PM, André Bargull <andre.bargull at udo.edu> wrote:
> Your testcase doesn't work in swf8, in fact you must not set clickable to
> `true` or textlinks won't work for swf8. And there is another disadvantage
> if you tie textlinks to clickable attribute: you can no longer distinguish
> textlinks from normal text, because a handpointer is now used for the whole
> text object.
>
>
> On 1/3/2009 9:40 PM, Henry Minsky wrote:
>>
>> If we go with this approach, I guess I'll need to add code to the swf8
>> and DHTML LzTextSprite to disable
>> text link event handling on hyperlinks when clickable is set to false.
>>
>>
>> On Sat, Jan 3, 2009 at 3:38 PM, Henry Minsky <henry.minsky at gmail.com>
>> wrote:
>>>
>>> This is a proposed fix for the missing hyperlink functionality. I thought
>>> it
>>> would make sense to tie the
>>> hyperlink function to the 'clickable' attribute, since that happens to
>>> set
>>> mouseEnabled in swf9 anyway.
>>>
>>> This has the benefit of disabling the hyperlinks if you set
>>> clickable=false
>>> on a text field.
>>>
>>>
>>> Change 20090103-hqm-t by hqm at badtzmaru.home on 2009-01-03 15:32:03 EST
>>> in /Users/hqm/openlaszlo/trunk4
>>> for http://svn.openlaszlo.org/openlaszlo/trunk
>>>
>>> Summary: make swf9 hyperlinks be enabled when 'clickable' is asserted
>>>
>>> New Features:
>>>
>>> Bugs Fixed: LPP-7551
>>>
>>> Technical Reviewer: andre
>>> QA Reviewer: max
>>> Doc Reviewer: (pending)
>>>
>>> Documentation:
>>>
>>> Release Notes:
>>>
>>> In order to use hyperlinks, the 'clickable' attribute must be enabled
>>> on a text field. The HTML used for a hyperlink is created by using the
>>> cross-platform LzText.makeTextLink(TEXT, VALUE) method. The "ontextlink"
>>> event will be sent with VALUE when the link is clicked.
>>>
>>> Details:
>>>
>>> + makes the LzTextSprite.setClickable method also enable the hyperlink
>>> event-handler
>>>
>>>
>>> Tests:
>>>
>>> <canvas debug="true">
>>> <text multiline="true" width="150" clickable="true">
>>> <handler name="oninit" >
>>> this.format("click %s or %s", this.makeTextLink("here", "opt1"),
>>> this.makeTextLink("here", "opt2"));
>>> </handler>
>>> <handler name="ontextlink" args="val" >
>>> this.addFormat("\noption %d was clicked", val == "opt1" ? 1 : 2);
>>> </handler>
>>> </text>
>>> </canvas>
>>>
>>>
>>> Files:
>>> M WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
>>>
>>> Changeset:
>>> http://svn.openlaszlo.org/openlaszlo/patches/20090103-hqm-t.tar
>>>
>>
>>
>>
>
>
--
Henry Minsky
Software Architect
hminsky at laszlosystems.com
More information about the Laszlo-dev
mailing list