Scrollbar question
#1
I've got a textbox that's controlled by a scrollbar and I want to show a page up & down arrow only when where are more pages either way but can't figure out any way to achieve it.

I've tried Container(scrollbar_id).HasNext and IntegerGreaterThan(Container(scrollbar_id).NumPages,9) (9 being the max number of lines visible) but neither work.

Any ideas?

Thanks.
Reply
#2
if at all, then it would be "Container(container_id).HasNext" or "IntegerGreaterThan(Container(container_id).NumItems,9)" (which would probably equal to "IntegerGreaterThan(Container(container_id).NumPages,1)". Using NumItems or NumPages still wouldnt work properly because it doesnt take the actual focused position into account.
If "Container(container_id).HasNext" (or just "Container.HasNext") does not work then report back and I´ll give it another try. Wink

EDIT: oops, forget that answer, forgot that youre dealing with a textbox when writing the answer Big Grin (if it works with the id of the textbox I would be surprised, but also worth a try)

The only other thing I can imagine for now is to add a fake scrollbar with <showonepage>true</showonepage> and use control.IsVisible(fake_scroll_bar_id) then.
That approach cannot distinguish between HasNext and HasPrevious though.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#3
I tried all of those combinations but nothing is returned from either the scrollbar or the textbox.

I had to do it the long-winded way using a pen and paper and some calculations -

Code:
<include name="ArrowUpVisible">
    <visible>StringCompare(System.CurrentControl,1/10) | StringCompare(System.CurrentControl,2/11) | StringCompare(System.CurrentControl,3/12) |  StringCompare(System.CurrentControl,4/13) | StringCompare(System.CurrentControl,5/14) | StringCompare(System.CurrentControl,6/15) | StringCompare(System.CurrentControl,7/16) | StringCompare(System.CurrentControl,8/17) | StringCompare(System.CurrentControl,9/18) | StringCompare(System.CurrentControl,9/19) | StringCompare(System.CurrentControl,9/20) | StringCompare(System.CurrentControl,9/21) | StringCompare(System.CurrentControl,9/22) | StringCompare(System.CurrentControl,9/23) | StringCompare(System.CurrentControl,9/24) | StringCompare(System.CurrentControl,9/25) | StringCompare(System.CurrentControl,9/26) | StringCompare(System.CurrentControl,9/27) | StringCompare(System.CurrentControl,0/18) | StringCompare(System.CurrentControl,10/19) | StringCompare(System.CurrentControl,1/19) | StringCompare(System.CurrentControl,11/20) | StringCompare(System.CurrentControl,2/20) | StringCompare(System.CurrentControl,12/21) | StringCompare(System.CurrentControl,3/21) | StringCompare(System.CurrentControl,13/22) | StringCompare(System.CurrentControl,4/22) | StringCompare(System.CurrentControl,14/23) | StringCompare(System.CurrentControl,5/23) | StringCompare(System.CurrentControl,15/24) | StringCompare(System.CurrentControl,6/24) | StringCompare(System.CurrentControl,16/25) | StringCompare(System.CurrentControl,7/25) | StringCompare(System.CurrentControl,17/26) | StringCompare(System.CurrentControl,8/26) | StringCompare(System.CurrentControl,18/27) | StringCompare(System.CurrentControl,9/27)</visible>
</include>
<include name="ArrowDownVisible">
    <visible>StringCompare(System.CurrentControl,0/10) | StringCompare(System.CurrentControl,0/11) | StringCompare(System.CurrentControl,0/12) |  StringCompare(System.CurrentControl,0/13) | StringCompare(System.CurrentControl,0/14) | StringCompare(System.CurrentControl,0/16) | StringCompare(System.CurrentControl,0/17) | StringCompare(System.CurrentControl,0/18) | StringCompare(System.CurrentControl,9/18) | StringCompare(System.CurrentControl,0/19) | StringCompare(System.CurrentControl,1/19) | StringCompare(System.CurrentControl,9/19) | StringCompare(System.CurrentControl,0/20) | StringCompare(System.CurrentControl,2/20) | StringCompare(System.CurrentControl,9/20) | StringCompare(System.CurrentControl,0/21) | StringCompare(System.CurrentControl,3/21) | StringCompare(System.CurrentControl,9/21) | StringCompare(System.CurrentControl,0/22) | StringCompare(System.CurrentControl,4/22) | StringCompare(System.CurrentControl,9/22) | StringCompare(System.CurrentControl,0/23) | StringCompare(System.CurrentControl,5/23) | StringCompare(System.CurrentControl,9/23) | StringCompare(System.CurrentControl,0/24) | StringCompare(System.CurrentControl,6/24) | StringCompare(System.CurrentControl,9/24) | StringCompare(System.CurrentControl,0/25) | StringCompare(System.CurrentControl,7/25) | StringCompare(System.CurrentControl,9/25) | StringCompare(System.CurrentControl,0/26) | StringCompare(System.CurrentControl,8/26) | StringCompare(System.CurrentControl,9/26) | StringCompare(System.CurrentControl,0/27) | StringCompare(System.CurrentControl,9/27)</visible>
</include>

This covers me up to 27 lines (the max I found was 22) but I still think we should be able to use HasNext and HasPrevious for scrollbars.
Reply
#4
And the results -

Image

Image
Reply
#5
(2014-11-06, 13:31)Hitcher Wrote: I tried all of those combinations but nothing is returned from either the scrollbar or the textbox.

I had to do it the long-winded way using a pen and paper and some calculations -

Code:
<include name="ArrowUpVisible">
    <visible>StringCompare(System.CurrentControl,1/10) | StringCompare(System.CurrentControl,2/11) | StringCompare(System.CurrentControl,3/12) |  StringCompare(System.CurrentControl,4/13) | StringCompare(System.CurrentControl,5/14) | StringCompare(System.CurrentControl,6/15) | StringCompare(System.CurrentControl,7/16) | StringCompare(System.CurrentControl,8/17) | StringCompare(System.CurrentControl,9/18) | StringCompare(System.CurrentControl,9/19) | StringCompare(System.CurrentControl,9/20) | StringCompare(System.CurrentControl,9/21) | StringCompare(System.CurrentControl,9/22) | StringCompare(System.CurrentControl,9/23) | StringCompare(System.CurrentControl,9/24) | StringCompare(System.CurrentControl,9/25) | StringCompare(System.CurrentControl,9/26) | StringCompare(System.CurrentControl,9/27) | StringCompare(System.CurrentControl,0/18) | StringCompare(System.CurrentControl,10/19) | StringCompare(System.CurrentControl,1/19) | StringCompare(System.CurrentControl,11/20) | StringCompare(System.CurrentControl,2/20) | StringCompare(System.CurrentControl,12/21) | StringCompare(System.CurrentControl,3/21) | StringCompare(System.CurrentControl,13/22) | StringCompare(System.CurrentControl,4/22) | StringCompare(System.CurrentControl,14/23) | StringCompare(System.CurrentControl,5/23) | StringCompare(System.CurrentControl,15/24) | StringCompare(System.CurrentControl,6/24) | StringCompare(System.CurrentControl,16/25) | StringCompare(System.CurrentControl,7/25) | StringCompare(System.CurrentControl,17/26) | StringCompare(System.CurrentControl,8/26) | StringCompare(System.CurrentControl,18/27) | StringCompare(System.CurrentControl,9/27)</visible>
</include>
<include name="ArrowDownVisible">
    <visible>StringCompare(System.CurrentControl,0/10) | StringCompare(System.CurrentControl,0/11) | StringCompare(System.CurrentControl,0/12) |  StringCompare(System.CurrentControl,0/13) | StringCompare(System.CurrentControl,0/14) | StringCompare(System.CurrentControl,0/16) | StringCompare(System.CurrentControl,0/17) | StringCompare(System.CurrentControl,0/18) | StringCompare(System.CurrentControl,9/18) | StringCompare(System.CurrentControl,0/19) | StringCompare(System.CurrentControl,1/19) | StringCompare(System.CurrentControl,9/19) | StringCompare(System.CurrentControl,0/20) | StringCompare(System.CurrentControl,2/20) | StringCompare(System.CurrentControl,9/20) | StringCompare(System.CurrentControl,0/21) | StringCompare(System.CurrentControl,3/21) | StringCompare(System.CurrentControl,9/21) | StringCompare(System.CurrentControl,0/22) | StringCompare(System.CurrentControl,4/22) | StringCompare(System.CurrentControl,9/22) | StringCompare(System.CurrentControl,0/23) | StringCompare(System.CurrentControl,5/23) | StringCompare(System.CurrentControl,9/23) | StringCompare(System.CurrentControl,0/24) | StringCompare(System.CurrentControl,6/24) | StringCompare(System.CurrentControl,9/24) | StringCompare(System.CurrentControl,0/25) | StringCompare(System.CurrentControl,7/25) | StringCompare(System.CurrentControl,9/25) | StringCompare(System.CurrentControl,0/26) | StringCompare(System.CurrentControl,8/26) | StringCompare(System.CurrentControl,9/26) | StringCompare(System.CurrentControl,0/27) | StringCompare(System.CurrentControl,9/27)</visible>
</include>

This covers me up to 27 lines (the max I found was 22) but I still think we should be able to use HasNext and HasPrevious for scrollbars.
That's a lot of StringCompare's for just... two arrows !. IMHO you should dump them and use a classic scrollbar.
Reply
#6
Solved it an easier way if anyone wants to use it in the future.

Up arrow -

Code:
<visible>IntegerGreaterThan(Container(ID_OF_TEXTBOX).CurrentPage,1)</visible>

Down arrow -

Code:
<visible>!StringCompare(Container(ID_OF_TEXTBOX).CurrentPage,Container(ID_OF_TEXTBOX).NumPages)</visible>
Reply

Logout Mark Read Team Forum Stats Members Help
Scrollbar question0