Closed hopewise closed 10 years ago
Scroll widget has boolean properties hScroll
and vScroll
. To disable vertical scrolling set scroll.vScroll = false
.
As for DnD, i have an idea, but can't test it right now. The idea is to drag widget on every mouseDown
, but cancel dragging on start scrolling.
<Scroll vScroll="false" on-beforeScroll="if( $Dnd.current != null ) $Dnd.current.drop(true);">
<Container>
<Component on-mouseDown="$Dnd.drag($this, $Lib.current.stage);"/>
<Component on-mouseDown="$Dnd.drag($this, $Lib.current.stage);"/>
<Component on-mouseDown="$Dnd.drag($this, $Lib.current.stage);"/>
</Container>
</Scroll>
In general it's up to you to decide when to trigger DnD.drag(draggedElement)
, so you can add some code which will check if user is moving vertically and execute DnD.drag()
in this case.
Thanks, I will try it .. is there a scroll velocity fade out effect? On Nov 12, 2013 4:58 PM, "RealyUniqueName" notifications@github.com wrote:
Scroll widget has boolean properties hScroll and vScroll. To disable vertical scrolling set scroll.vScroll = false.
As for DnD, i have an idea, but can't test it right now. The idea is to drag widget on every mouseDown, but cancel dragging on start scrolling.
In general it's up to you to decide when to trigger DnD.drag(draggedElement), so you can add some code which will check if user is moving vertically and execute DnD.drag() in this case.
— Reply to this email directly or view it on GitHubhttps://github.com/RealyUniqueName/StablexUI/issues/83#issuecomment-28299598 .
Yes, there is such effect.
Did you delete your questions? I'll answer anyway :) Perhaps this will be useful for anyone else.
scroll.refresh()
after.null
like <Scroll vBar="null" />
or make them invisible <Scroll vBar-visible="false" />
I agree it's a good idea to hide vBar/hBar automatically if vScroll/hScroll set to false.
oh sorry, I deleted the question not to bother you as I found the answer ..
By the way, scroll bars are hard to get dragged by touch, I tried to DPS the scaleY of hBar .. they are slim .. On Nov 16, 2013 4:51 PM, "RealyUniqueName" notifications@github.com wrote:
Did you delete your questions? I'll answer anyway :) Perhaps this will be useful for anyone else.
- If you add elements to scroll container manually (via haxe code) you need to call scroll.refresh() after.
- To hide vertical/horizontal bar, you need to set them to null like <Scroll vBar="null" /> or make them invisible
I agree it's a good idea to hide vBar/hBar automatically if vScroll/hScroll set to false.
— Reply to this email directly or view it on GitHubhttps://github.com/RealyUniqueName/StablexUI/issues/83#issuecomment-28628091 .
Is there an example about setting the ui of scroll bars? On Nov 16, 2013 5:50 PM, "Samir Sabri" as3now@gmail.com wrote:
oh sorry, I deleted the question not to bother you as I found the answer ..
By the way, scroll bars are hard to get dragged by touch, I tried to DPS the scaleY of hBar .. they are slim .. On Nov 16, 2013 4:51 PM, "RealyUniqueName" notifications@github.com wrote:
Did you delete your questions? I'll answer anyway :) Perhaps this will be useful for anyone else.
- If you add elements to scroll container manually (via haxe code) you need to call scroll.refresh() after.
- To hide vertical/horizontal bar, you need to set them to null like <Scroll vBar="null" /> or make them invisible
I agree it's a good idea to hide vBar/hBar automatically if vScroll/hScroll set to false.
— Reply to this email directly or view it on GitHubhttps://github.com/RealyUniqueName/StablexUI/issues/83#issuecomment-28628091 .
Beautiful! On Nov 16, 2013 7:55 PM, "RealyUniqueName" notifications@github.com wrote:
Take a look: http://ui.stablex.ru/demo/scrolling.swf Source: https://github.com/RealyUniqueName/StablexUI/tree/master/samples/scrolling
— Reply to this email directly or view it on GitHubhttps://github.com/RealyUniqueName/StablexUI/issues/83#issuecomment-28631886 .
Is it a must to define the Scroll w& h to work properly? will it work when using percentages?
On Sat, Nov 16, 2013 at 8:59 PM, Samir Sabri as3now@gmail.com wrote:
Beautiful! On Nov 16, 2013 7:55 PM, "RealyUniqueName" notifications@github.com wrote:
Take a look: http://ui.stablex.ru/demo/scrolling.swf Source: https://github.com/RealyUniqueName/StablexUI/tree/master/samples/scrolling
— Reply to this email directly or view it on GitHubhttps://github.com/RealyUniqueName/StablexUI/issues/83#issuecomment-28631886 .
Samir Sabri Software Architect& Developer www.dcaclab.com Jordan-Middle East
Yes, you have somehow define size of Scroll itself either with w/h
or
with widthPt/heightPt
.
Imagine Scroll is a viewport or window. You can't see anything through your
window if it has zero size :)
So if you use percentage to set Scroll size, make sure parent of scroll
also has non-zero size.
2013/11/16 hopewise notifications@github.com
Is it a must to define the Scroll w& h to work properly? will it work when using percentages?
On Sat, Nov 16, 2013 at 8:59 PM, Samir Sabri as3now@gmail.com wrote:
Beautiful! On Nov 16, 2013 7:55 PM, "RealyUniqueName" notifications@github.com wrote:
Take a look: http://ui.stablex.ru/demo/scrolling.swf Source:
https://github.com/RealyUniqueName/StablexUI/tree/master/samples/scrolling
— Reply to this email directly or view it on GitHub< https://github.com/RealyUniqueName/StablexUI/issues/83#issuecomment-28631886>
.
Kind Regards,
Samir Sabri Software Architect& Developer www.dcaclab.com Jordan-Middle East
— Reply to this email directly or view it on GitHubhttps://github.com/RealyUniqueName/StablexUI/issues/83#issuecomment-28632494 .
С уважением, Александр Кузьменко
Careful, I found that vBar="null" will cause TypeError: Error #1009: Cannot access a property or method of a null object reference. So, vBar-visible="false" is the way to do it currently ..
Is it possible to control the hBar location? currently its align to bottom, I want to move it up by 10 pixels? found it, UIBuilder.get('topMenuScroller').as(Scroll).hBar.bottom = 10;
Also, I've noticed this behavior: https://gist.github.com/hopewise/7508824
In which case you got TypeError: Error #1009 ? I can't reproduce it.
When I set skin of slider & bars, did you try it at your scroll example? On Nov 17, 2013 12:49 PM, "RealyUniqueName" notifications@github.com wrote:
In which case you got TypeError: Error #1009 ? I can't reproduce it.
— Reply to this email directly or view it on GitHubhttps://github.com/RealyUniqueName/StablexUI/issues/83#issuecomment-28646299 .
Yes, i did. It works fine for me. What target reports this error, what are your versions of openfl libs? As for the issue in your gist, can you try with this branch? https://github.com/RealyUniqueName/StablexUI/tree/bugfix
Did you try to set properties for bar which was set to null? :)
Would I just update stablexui? On Nov 17, 2013 1:55 PM, "RealyUniqueName" notifications@github.com wrote:
Yes, i did. It works fine for me. What target reports this error, what are your versions of openfl libs? As for the issue in your gist, can you try with this branch? https://github.com/RealyUniqueName/StablexUI/tree/bugfix
— Reply to this email directly or view it on GitHubhttps://github.com/RealyUniqueName/StablexUI/issues/83#issuecomment-28647190 .
I am on openfl 1.1.1, sorry, I read branch as batch .. I was driving ..
As for my gist issue, I totally changed the approach, so that I dont need to remove and add childs from HBox .. better for performance too at native targets..
The target of null error was flash.. On Nov 17, 2013 1:55 PM, "RealyUniqueName" notifications@github.com wrote:
Yes, i did. It works fine for me. What target reports this error, what are your versions of openfl libs? As for the issue in your gist, can you try with this branch? https://github.com/RealyUniqueName/StablexUI/tree/bugfix
— Reply to this email directly or view it on GitHubhttps://github.com/RealyUniqueName/StablexUI/issues/83#issuecomment-28647190 .
If it's not hard to reproduce old approach , can you test it with recent fixes of StablexUI?
You can update with this command:
haxelib git stablexui https://github.com/RealyUniqueName/StablexUI.git
ops! after I tried haxelib git stablexui https://github.com/RealyUniqueName/StablexUI.git I get Class not found : ru.stablex.ui.UIBuilder
Also, haxelib list will shows: actuate: [1.6.3] 1.7.0 dcaclab_types: [1.0] hscript: [2.0.1] hxlibc: [1.0.0] hxtools: [1.1.6] openfl: [1.1.1] openfl-html5-dom: [1.1.1] openfl-native: [1.1.4] openfl-samples: [1.1.0] rox-i18n: [1.0.0] stablexui: 1.0.12 git [dev:C:\Motion-Twin\haxe\lib/stablexui/git] swf: [1.1.1]
Any idea?
I had to remove stablexui and install directly from haxelib, I got version 1.0.14 The shifting is still on when ever I remove a child from HBox which is a child of Scroll
Also, notice the shift to down behavior in action, when I dragged dropped all components to board: ( see the buttons text and icons how shifted, see the fuse component behind the bar )
Here is a gist of my xmls to investigate further: https://gist.github.com/hopewise/7514030
I've submitted fixes to haxelib, you can now upgrade with haxelib upgrade stablexui
Can you suggest a solution here please: http://www.openfl.org/index.php?cID=14954
On Sun, Nov 17, 2013 at 6:24 PM, RealyUniqueName notifications@github.comwrote:
I've submitted fixes to haxelib, you can now upgrade with haxelib upgrade stablexui
— Reply to this email directly or view it on GitHubhttps://github.com/RealyUniqueName/StablexUI/issues/83#issuecomment-28650346 .
Samir Sabri Software Architect& Developer www.dcaclab.com Jordan-Middle East
Sorry, I can confirm that when remove child from HBox, the shift still happens, I thought it was fixed as I used another approach ..
I can't reproduce these issues. Is it possible to show me full project?
Ok, I will clean up sensitive code, do a new private repo& add you as contributor ..
Or, I can send you zip file by email? On Nov 18, 2013 11:39 AM, "RealyUniqueName" notifications@github.com wrote:
I can't reproduce these issues. Is it possible to show me full project?
— Reply to this email directly or view it on GitHubhttps://github.com/RealyUniqueName/StablexUI/issues/83#issuecomment-28684960 .
Any way you are comfortable with
Oh, here is email if you decide to send a zip: alex [at] stablex.ru
I checked your project. Here are the reasons of those issues:
_1. "Scroll width exceeded its parent width when used widthPt=100"
225 + 1000
pixels.
If you want this scroll to take the rest of parents width left after buttons (onOffButton, deleteButton, deleteAllButton) you need to use layout like this:<HBox widthPt="100" layout:Column-cols="[Utils.DPS(70), Utils.DPS(70), Utils.DPS(70), -1]" layout:Column-fit="true" layout:Column-cellPadding="5">
<Button id="'onOffButton'" .../>
<Button id="'deleteButton'" .../>
<Button id="'deleteAllButton'" .../>
<Scroll ...>...</Scroll>
</HBox>
Utils.DPS(70)
is width of your buttons set in defaults.xml Buttons->OnOff section
_2. Components shifting on removeChild from HBox
HBox.autoHeight
which means HBox will adopt height according to height of children. But children-buttons in this HBox has heightPt=100 (set by defaults.xml Button->OnOff section) which means height of these buttons will be set to height of parent (your HBox). This HBox also has a padding = 5. So here is what happens on removeChild():Thanks for explanation, I fixed the shifting issue, but when I tried your suggestion at point 2 above, I got recursion overflow error, did you try it at the project sample? here is what I got:
Error: Error #2094: Event dispatch recursion overflow. at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at ru.stablex.ui.widgets::Widget/_onResize()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:389] at ru.stablex.ui.widgets::Widget/resize()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:338] at ru.stablex.ui.layouts::Column/arrangeChildren()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\layouts\Column.hx:98] at ru.stablex.ui.widgets::Widget/applyLayout()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:222] at ru.stablex.ui.widgets::Widget/refresh()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:233] at ru.stablex.ui.widgets::Box/refresh()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Box.hx:147] at ru.stablex.ui.widgets::Box/_onChildResize()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Box.hx:578] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at ru.stablex.ui.widgets::Widget/_onResize()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:389] at ru.stablex.ui.widgets::Widget/resize()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:338] at ru.stablex.ui.layouts::Column/arrangeChildren()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\layouts\Column.hx:98] at ru.stablex.ui.widgets::Widget/applyLayout()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:222] at ru.stablex.ui.widgets::Widget/refresh()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:233] at ru.stablex.ui.widgets::Box/refresh()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Box.hx:147] at ru.stablex.ui.widgets::Box/_onChildResize()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Box.hx:578] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at ru.stablex.ui.widgets::Widget/_onResize()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:389] at ru.stablex.ui.widgets::Widget/resize()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:338] at ru.stablex.ui.layouts::Column/arrangeChildren()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\layouts\Column.hx:98] at ru.stablex.ui.widgets::Widget/applyLayout()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:222] at ru.stablex.ui.widgets::Widget/refresh()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:233] at ru.stablex.ui.widgets::Box/refresh()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Box.hx:147] at ru.stablex.ui.widgets::Box/_onChildResize()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Box.hx:578] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at ru.stablex.ui.widgets::Widget/_onResize()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:389] at ru.stablex.ui.widgets::Widget/resize()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:338] at ru.stablex.ui.layouts::Column/arrangeChildren()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\layouts\Column.hx:98] at ru.stablex.ui.widgets::Widget/applyLayout()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:222] at ru.stablex.ui.widgets::Widget/refresh()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:233] at ru.stablex.ui.widgets::Box/refresh()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Box.hx:147] at ru.stablex.ui.widgets::Box/_onChildResize()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Box.hx:578] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at ru.stablex.ui.widgets::Widget/_onResize()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:389] at ru.stablex.ui.widgets::Widget/resize()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:338] at ru.stablex.ui.layouts::Column/arrangeChildren()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\layouts\Column.hx:98] at ru.stablex.ui.widgets::Widget/applyLayout()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:222] at ru.stablex.ui.widgets::Widget/refresh()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:233] at ru.stablex.ui.widgets::Box/refresh()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Box.hx:147] at ru.stablex.ui.widgets::Box/_onChildResize()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Box.hx:578] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at ru.stablex.ui.widgets::Widget/_onResize()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:389] at ru.stablex.ui.widgets::Widget/resize()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:338] at ru.stablex.ui.layouts::Column/arrangeChildren()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\layouts\Column.hx:98] at ru.stablex.ui.widgets::Widget/applyLayout()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:222] at ru.stablex.ui.widgets::Widget/refresh()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:233] at ru.stablex.ui.widgets::Box/refresh()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Box.hx:147] at ru.stablex.ui.widgets::Box/_onChildResize()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Box.hx:578] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at ru.stablex.ui.widgets::Widget/_onResize()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:389] at ru.stablex.ui.widgets::Widget/resize()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:338] at ru.stablex.ui.layouts::Column/arrangeChildren()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\layouts\Column.hx:98] at ru.stablex.ui.widgets::Widget/applyLayout()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:222] at ru.stablex.ui.widgets::Widget/refresh()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Widget.hx:233] at ru.stablex.ui.widgets::Box/refresh()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Box.hx:147] at ru.stablex.ui.widgets::Box/_onChildResize()[C:\Motion-Twin\haxe\lib\stablexui\1,0,15\ru\stablex\ui\widgets\Box.hx:578] at flash.events::EventDispatcher/dispatchEventFunction()
On Tue, Nov 19, 2013 at 12:52 AM, RealyUniqueName notifications@github.comwrote:
I checked your project. Here are the reasons of those issues:
"Scroll width exceeded its parent width when used widthPt=100" 2.
Your scroll is inside of HBox which has another children. Those children has some width, so Scroll is positioned not in left=0, but in left=225. Since you set your scroll to be 100% of parent's width (which is 1000px), right edge of your scroll is at 225 + 1000 pixels. If you want this scroll to take the rest of parents width left after buttons (onOffButton, deleteButton, deleteAllButton) you need to use layout like this:
... Utils.DPS(70) is width of your buttons set in defaults.xml Buttons->OnOff section 3.
Components shifting on removeChild from HBox
- Height of your HBox is not set. This enables HBox.autoHeight which means HBox will adopt height according to height of children. But children-buttons in this HBox has heightPt=100 (set by defaults.xml Button->OnOff section) which means height of these buttons will be set to height of parent (your HBox). This HBox also has a padding = 5. So here is what happens on removeChild(): (1) Child is removed (2) Since HBox.autoHeight == true, height of HBox is recalculated. At this point HBox.h == 110 (3) Resize event is dispatched by HBox (4) Children-buttons catch this event and set their own height to 110 (100% of parent's height) (5) HBox see the change of height of children and recalculates own height as maxChildHeight + paddingTop + paddingBottom (both paddings are 5px). Thus HBox became 120px (10 pixels bigger than initial size) To avoid this behavior you need either set HBox.autoHeight to false (by defining height) or set fixed height of buttons.
Reply to this email directly or view it on GitHubhttps://github.com/RealyUniqueName/StablexUI/issues/83#issuecomment-28741812 .
Samir Sabri Software Architect& Developer www.dcaclab.com Jordan-Middle East
Since i set width and height of HBox with w/h or widthPt/heightPt, i did not experience this issue. However this recursion should be fixed in StablexUI. Till this will be fixed, you can also define width/height of HBox to workaround this.
Thanks very much for support, I look forward new release ..
On Tue, Nov 19, 2013 at 9:11 AM, RealyUniqueName notifications@github.comwrote:
Since i set width and height of HBox with w/h or widthPt/heightPt, i did not experience this issue. However this recursion should be fixed in StablexUI. Till this will be fixed, you can also defin width/height of HBox to workaround this.
— Reply to this email directly or view it on GitHubhttps://github.com/RealyUniqueName/StablexUI/issues/83#issuecomment-28768424 .
Samir Sabri Software Architect& Developer www.dcaclab.com Jordan-Middle East
I know that we can use Scroll widget's first child as a container to the scrolled widgets. But what if I want to apply custom drag & drop logic on scrolled widgets? Would there be interference between events of drag/drop and scrolling?
As a UX, I want scrolling to take action only when user moves his finger horizontally, and drag/drop take action when moving finger vertically .. would this be possible? what do you suggest?