madtux666
01-07-2009, 07:58 AM
Hi lads,
I have experienced problem with scrollbar that does not scroll dynamically created views. I have provided sample code. Please notice that second (orange) view will not update scrollbar after creating views. It is definitely a bug, any ideas? Do you have a workaround? I have checked classes responsible for scrollbar functionality, it is pretty big piece of code, it will be very difficult to rewrite it ;-)
<canvas width="800" height="800">
<simplelayout axis="y" spacing="10"/>
<view name="staticview" width="500" height="200" bgcolor="yellow" clip="true">
<view name="container">
<simplelayout axis="y" spacing="2"/>
<view width="100" height="50" bgcolor="red"/>
<view width="100" height="50" bgcolor="red"/>
<view width="100" height="50" bgcolor="red"/>
<view width="100" height="50" bgcolor="red"/>
<view width="100" height="50" bgcolor="red"/>
<view width="100" height="50" bgcolor="red"/>
<view width="100" height="50" bgcolor="red"/>
<view width="100" height="50" bgcolor="red"/>
<view width="100" height="50" bgcolor="red"/>
<view width="100" height="50" bgcolor="red"/>
</view>
<scrollbar/>
</view>
<view name="dynamicview" width="500" height="200" bgcolor="orange" clip="true">
<scrollbar/>
</view>
<button name="createViews" text="Create 10 views in dynamicView">
<handler name="onclick">
<![CDATA[
//create contaier view with
var newview= new LzView(canvas.dynamicview, { name: 'container',
width: 150 } );
//with layout
new lz.simplelayout(newview, { axis: 'y',
spacing: 2 } );
//create child views
for( var i= 0; i< 10; i++)
new LzView(newview, { width: 100,
height: 50,
bgcolor: '0x0000FF' } );
Debug.write( 'Scrollbar is still disabled' );
Debug.write();
Debug.write( 'dynamicview.container subviews:', dynamicview.container.subviews );
Debug.write( 'dynamicview.container.height:', dynamicview.container.height );
]]>
</handler>
</button>
</canvas>
Thanks for any comments.
Regards,
Madtux
I have experienced problem with scrollbar that does not scroll dynamically created views. I have provided sample code. Please notice that second (orange) view will not update scrollbar after creating views. It is definitely a bug, any ideas? Do you have a workaround? I have checked classes responsible for scrollbar functionality, it is pretty big piece of code, it will be very difficult to rewrite it ;-)
<canvas width="800" height="800">
<simplelayout axis="y" spacing="10"/>
<view name="staticview" width="500" height="200" bgcolor="yellow" clip="true">
<view name="container">
<simplelayout axis="y" spacing="2"/>
<view width="100" height="50" bgcolor="red"/>
<view width="100" height="50" bgcolor="red"/>
<view width="100" height="50" bgcolor="red"/>
<view width="100" height="50" bgcolor="red"/>
<view width="100" height="50" bgcolor="red"/>
<view width="100" height="50" bgcolor="red"/>
<view width="100" height="50" bgcolor="red"/>
<view width="100" height="50" bgcolor="red"/>
<view width="100" height="50" bgcolor="red"/>
<view width="100" height="50" bgcolor="red"/>
</view>
<scrollbar/>
</view>
<view name="dynamicview" width="500" height="200" bgcolor="orange" clip="true">
<scrollbar/>
</view>
<button name="createViews" text="Create 10 views in dynamicView">
<handler name="onclick">
<![CDATA[
//create contaier view with
var newview= new LzView(canvas.dynamicview, { name: 'container',
width: 150 } );
//with layout
new lz.simplelayout(newview, { axis: 'y',
spacing: 2 } );
//create child views
for( var i= 0; i< 10; i++)
new LzView(newview, { width: 100,
height: 50,
bgcolor: '0x0000FF' } );
Debug.write( 'Scrollbar is still disabled' );
Debug.write();
Debug.write( 'dynamicview.container subviews:', dynamicview.container.subviews );
Debug.write( 'dynamicview.container.height:', dynamicview.container.height );
]]>
</handler>
</button>
</canvas>
Thanks for any comments.
Regards,
Madtux