How to create a vertical slider in MXML?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to create a vertical slider in MXML?

Justin Mclean
Hi,

Anyone manage to get a vertical sider to work / create one in MXML?

I thought creating a slider with a SliderView and a VerticalSliderLayout and a VSliderMouseController would work but it doesn’t and seems a little verbose.

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:js="library://ns.apache.org/royale/basic"
                xmlns:b="org.apache.royale.html.beads.*"
                xmlns:c="org.apache.royale.html.beads.controllers.*"
                xmlns:l="org.apache.royale.html.beads.layouts.*">

   <js:valuesImpl>
       <js:SimpleCSSValuesImpl/>
   </js:valuesImpl>

    <js:beads>
        <js:ApplicationDataBinding />
    </js:beads>

   <js:initialView>
       <js:View width="200" height="200">
           <js:Container>
               <js:beads>
                   <js:HorizontalLayout />
               </js:beads>

               <js:Slider id="s" minimum="0" maximum="100" snapInterval="5">
                   <js:view>
                       <b:SliderView />
                   </js:view>
                    <js:beads>
                        <l:VerticalSliderLayout />
                        <c:VSliderMouseController />
                    </js:beads>
               </js:Slider>

               <js:Label text="{s.value}" />
           </js:Container>
       </js:View>
   </js:initialView>
</js:Application>

Thanks,
Justin
Reply | Threaded
Open this post in threaded view
|

Re: How to create a vertical slider in MXML?

Peter Ent
I added HSlider and VSlider to the Express package to make it easier to
use them. Maybe I forgot to the put the slider mouse controllers into the
basic manifest because you should not need to make more namespaces to use
them.

‹peter

On 12/14/17, 10:09 PM, "Justin Mclean" <[hidden email]> wrote:

>Hi,
>
>Anyone manage to get a vertical sider to work / create one in MXML?
>
>I thought creating a slider with a SliderView and a VerticalSliderLayout
>and a VSliderMouseController would work but it doesn¹t and seems a little
>verbose.
>
><?xml version="1.0" encoding="utf-8"?>
><js:Application
>xmlns:fx="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2F
>ns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Cpent%40adobe.com%7C41725c98ffad4
>c4a6c8708d543694551%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636489041
>771571447&sdata=OlspsX8lbVEtU4SY7KCwespQSeUmIWbAV%2FNsq1U7Pyw%3D&reserved=
>0"
>                xmlns:js="library://ns.apache.org/royale/basic"
>                xmlns:b="org.apache.royale.html.beads.*"
>                xmlns:c="org.apache.royale.html.beads.controllers.*"
>                xmlns:l="org.apache.royale.html.beads.layouts.*">
>
>   <js:valuesImpl>
>       <js:SimpleCSSValuesImpl/>
>   </js:valuesImpl>
>
>    <js:beads>
>        <js:ApplicationDataBinding />
>    </js:beads>
>
>   <js:initialView>
>       <js:View width="200" height="200">
>           <js:Container>
>               <js:beads>
>                   <js:HorizontalLayout />
>               </js:beads>
>
>               <js:Slider id="s" minimum="0" maximum="100"
>snapInterval="5">
>                   <js:view>
>                       <b:SliderView />
>                   </js:view>
>                    <js:beads>
>                        <l:VerticalSliderLayout />
>                        <c:VSliderMouseController />
>                    </js:beads>
>               </js:Slider>
>
>               <js:Label text="{s.value}" />
>           </js:Container>
>       </js:View>
>   </js:initialView>
></js:Application>
>
>Thanks,
>Justin

Reply | Threaded
Open this post in threaded view
|

Re: How to create a vertical slider in MXML?

Justin Mclean
Hi,

> I added HSlider and VSlider to the Express package to make it easier to
> use them. Maybe I forgot to the put the slider mouse controllers into the
> basic manifest because you should not need to make more namespaces to use
> them.

I was trying to work out why VSlider doesn’t seem to work in some cases and also see if it has the same issue that a horizontal slider has when you click on the thumb. (It does btw.)

No issue I think I can just use CSS to change the bead classes and and the Slider in express to work out what is going wrong rather than trying to do in in MXML.

Thanks,
Justin