[Laszlo-dev] For Review: Change 20090203-maxcarlson-q Summary: [UPDATE 5] Implement LFC end of kernel scrolling API

P T Withington ptw at laszlosystems.com
Tue Feb 3 18:47:12 PST 2009


Max:  Please read the reference that you sent me.  It clearly shows  
that scrollmax refers to the _top_ line in the view, not the _bottom_,  
whereas scrollHeight (by definition, because I defined it that way)  
refers to the bottom pixel.

Part of the problem is that the kernels were not sending the correct  
value for scrollHeight, hence the LFC was setting the wrong value for  
scrollmax.

The revised change I just sent out fixes these issues.

On 2009-02-03, at 21:39EST, Max Carlson wrote:

> We don't want to perturb the values coming from the runtime by  
> subtracting the height/width because they're already derived from  
> the original runtime value - which must be correct!   Since they  
> produce the right value for scrollheight, they must produce produce  
> the right value for maxscroll since one is just the pixel value  
> version of the other.
>
> In other words, the runtime is already computing the value  
> correctly, so we don't need to mess with it.
>
> I'll go back to my original change set and send it out...
>
> P T Withington wrote:
>> Max and I disagree on how maxscroll should be computed.  I claim  
>> (referring to his doc http://tinyurl.com/ddyj3j) that maxscroll is  
>> the line number of the line that will be at the top of the field  
>> when the last line of the content is the bottom line of the field,  
>> hence the computation of maxscroll from scrollHeight should be:
>> maxscroll = Math.max(1, (scrollHeight - height)/lineHeight);
>> I forgot the max in my version, so he was seeing negative  
>> maxscrolls, which made him believe my computation was wrong.
>> I am going to make one more set of tweaks...
>> On 2009-02-03, at 10:34EST, Henry Minsky wrote:
>>> This looks good, but I'm seeing a bunch of warnings in the  
>>> debugger in swf8/9
>>>
>>>
>>> INFO: /LzDebugWindow/@middle/@content/@textpane.Function is
>>> deprecated.  Use /LzDebugWindow/@middle/@content/@textpane.Function
>>> instead
>>> INFO: /LzDebugWindow/@middle/@content/@textpane.Function is
>>> deprecated.  Use /LzDebugWindow/@middle/@content/@textpane.Function
>>> instead
>>> INFO: /LzDebugWindow/@middle/@content/@textpane.Function is
>>> deprecated.  Use /LzDebugWindow/@middle/@content/@textpane.Function
>>> instead
>>> INFO: /LzDebugWindow/@middle/@content/@textpane.Function is
>>> deprecated.  Use /LzDebugWindow/@middle/@content/@textpane.Function
>>> instead
>>> INFO: /LzDebugWindow/@middle/@content/@textpane.Function is
>>> deprecated.  Use /LzDebugWindow/@middle/@content/@textpane.Function
>>> instead
>>> WARNING: negative value for updateLineAttribute maxscroll -17 0
>>>
>>>
>>> On Tue, Feb 3, 2009 at 8:56 AM, Max Carlson <max at openlaszlo.org>  
>>> wrote:
>>>> Change 20090203-maxcarlson-q by maxcarlson at Bank.local on  
>>>> 2009-02-03 04:58:12
>>>> PST
>>>>  in /Users/maxcarlson/openlaszlo/trunk-clean
>>>>  for http://svn.openlaszlo.org/openlaszlo/trunk
>>>>
>>>> This change includes debugging code to warn for negative scroll/ 
>>>> maxscroll
>>>> values.  At least for the scrollinputtext (updated to use the  
>>>> undocumented
>>>> scrollheight attr so it works) maxscroll never matches the value  
>>>> in the
>>>> sprite...  I think it's fine to doc scrollheight and use it, but  
>>>> maxscroll
>>>> should be correct for backward compatibility.  I still think my  
>>>> previous
>>>> change is correct.
>>>>
>>>> Summary: [UPDATE 5] Implement LFC end of kernel scrolling API
>>>>
>>>> Bugs Fixed: LPP-6580  scrolledittext doesn't work in 4.1 (partial)
>>>>
>>>> Technical Reviewer: ptw (pending)
>>>> QA Reviewer: hminsky (pending)
>>>>
>>>> Details:
>>>>  LzSprite.*, LaszloView, LaszloCanvas: Add linescrolling
>>>>  capability, unify capabilities as a sprite instance var.
>>>>
>>>>  swf/LzTextSprite.as: Turn on warnUndefinedReferences so we can
>>>>  debug this.  Stop making all sorts of undefined references.
>>>>  Actually compute `lineheight`.  Use that to implement the
>>>>  pixel/line kernel API.  Convert __updatefieldsize to use the new
>>>>  scrollevent kernel API.
>>>>
>>>>  swf9/LzTextSprite: Add primitive version of setX/YScroll, add  
>>>> callbacks
>>>>  to mirror swf8 version
>>>>
>>>>  swf9/LzInputTextSprite: Elimanate duplicate scroll attribute
>>>>
>>>>  LzInputText: Set tsprite in __makeSprite
>>>>
>>>>  LzText: Implement new kernel scrolling API.  Cache tsprite for
>>>>  efficiency.
>>>>
>>>>  newcontent: Silence warnings.
>>>>
>>>>  scrolledittext: Update to eliminate warnings, use build-in  
>>>> lineheight
>>>>
>>>>  newvscrollbar-test/scrolledittext-test: Improve tests
>>>>
>>>>  basescrollbar.lzx - Don't update scroll pos unless it's needed
>>>>
>>>> Tests:
>>>>  Compiles in swf9, smokecheck in 3 runtimes, component debugger in
>>>>  swf8/9, component sampler in 3 runtimes.  scrolledittext- 
>>>> test.lzx runs
>>>>  consistently across swf8/9.
>>>>
>>>> Files:
>>>> M      WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as
>>>> M      WEB-INF/lps/lfc/kernel/swf/LzSprite.as
>>>> M      WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
>>>> M      WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
>>>> M      WEB-INF/lps/lfc/kernel/swf9/LzInputTextSprite.as
>>>> M      WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
>>>> M      WEB-INF/lps/lfc/views/LzInputText.lzs
>>>> M      WEB-INF/lps/lfc/views/LzText.lzs
>>>> M      WEB-INF/lps/lfc/views/LaszloView.lzs
>>>> M      WEB-INF/lps/lfc/views/LaszloCanvas.lzs
>>>> M      WEB-INF/lps/config/lps.properties
>>>> M      lps/components/debugger/newcontent.lzx
>>>> M      lps/components/incubator/scrolledittext.lzx
>>>> M      lps/components/incubator/test/newvscrollbar-test.lzx
>>>> M      lps/components/incubator/test/scrolledittext-test.lzx
>>>> M      lps/components/base/basescrollbar.lzx
>>>>
>>>> Changeset:
>>>> http://svn.openlaszlo.org/openlaszlo/patches/20090203-maxcarlson-q.tar
>>>>
>>>
>>>
>>>
>>> -- 
>>> Henry Minsky
>>> Software Architect
>>> hminsky at laszlosystems.com
>
> -- 
> Regards,
> Max Carlson
> OpenLaszlo.org



More information about the Laszlo-dev mailing list