Replace horizontal scroll in a spark list?

I've gotten myself confused...
1. I create a new component based on Spark List, "MyList.mxml"
2. I open it, and in design view I say "create copy of skin"
3. I open ListSkin1.mxml.
I want to replace the scroll bar with a custom skinned one. I am not sure where to do this...
1. I create a new component based on HScrollBar "MyScrollbar.mxml"
Now what?  Where so I specify in the List component -- or its skin -- do I specify the new scroll bar?

OK, this is a little crude, but seems to work (and was a lot less complex than I initially thought). My main app looks like this:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/halo">
    <fx:Style>
        @namespace s "library://ns.adobe.com/flex/spark";
        s|List s|Scroller {
            horizontalScrollPolicy: on;
            verticalScrollPolicy: on;
        s|List s|HScrollBar {
            skinClass: ClassReference("TrackThumbOnlyHSBSkin");
    </fx:Style>
    <s:List id="list" width="100" height="100" horizontalCenter="0" verticalCenter="0">
        <s:dataProvider>
            <s:ArrayList>
                <fx:Object label="The quick brown fox jumps over the lazy dog" />
                <fx:Object label="One" />
                <fx:Object label="Two" />
                <fx:Object label="Three" />
                <fx:Object label="Four" />
                <fx:Object label="Five" />
                <fx:Object label="Six" />
                <fx:Object label="Seven" />
                <fx:Object label="Eight" />
                <fx:Object label="Nine" />
            </s:ArrayList>
        </s:dataProvider>
    </s:List>
</s:Application>
And my custom HScrollBar skin, TrackThumbOnlyHSBSkin.mxml, is as follows:
<?xml version="1.0" encoding="utf-8"?>
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
             xmlns:s="library://ns.adobe.com/flex/spark"
             xmlns:fb="http://ns.adobe.com/flashbuilder/2009"
             minWidth="35" minHeight="15"
             alpha.disabled="0.5" alpha.inactive="0.5">
    <s:states>
        <s:State name="normal" />
        <s:State name="disabled" />
        <s:State name="inactive" />
    </s:states>
    <fx:Metadata>
        <![CDATA[
        [HostComponent("spark.components.HScrollBar")]
        ]]>
    </fx:Metadata>
    <fx:Script fb:purpose="styling">
        <![CDATA[
            /* Define the skin elements that should not be colorized.
            For scroll bar, the skin itself is colorized but the individual parts are not. */
            static private const exclusions:Array = ["track", "thumb"];
            override public function get colorizeExclusions():Array {
                return exclusions;
            override protected function initializationComplete():void {
                useBaseColor = true;
                super.initializationComplete();
        ]]>
    </fx:Script>
    <!--- Defines the skin class for the HScrollBarSkin's track. The default skin class is HScrollBarTrackSkin. -->
    <s:Button id="track" left="0" right="0" width="54"
              focusEnabled="false"
              skinClass="spark.skins.spark.HScrollBarTrackSkin"
              baseColor="haloGreen"/>
    <!--- Defines the skin class for the HScrollBarSkin's thumb. The default skin class is HScrollBarThumbSkin. -->
    <s:Button id="thumb"
              focusEnabled="false" visible.inactive="false"
              skinClass="spark.skins.spark.HScrollBarThumbSkin"
              baseColor="haloBlue"/>
</s:SparkSkin>
So I was wrong. I didnt need a custom List skin, or Scroller skin... just the one custom HScrollBar skin (and presumably a custom VScrollBar skin -- and possibly more skins depending on how custom you want the scrollbar left/right top/bottom buttons and/or thumb/track skins).
Peter

Similar Messages

  • Problem with Horizontal Scroll on java.awt.List

    I use the same code for a General Application as a CDC Application.
    I have no problem at all with the General Application but on the CDC I can't scroll to the right (horizontal).
    Why do I get this problem on the CDC application and not on a regular application?
    I use the PP-1.0 Profile for the CDC application. Does it not support horizontal scroll on java.awt.List?
    This is the code:
    * Main.java
    * Created on den 22 augusti 2007, 10:52
    package cdcapplication6;
    * @author  Erik Rothman
    public class Main extends java.awt.Frame {
        /** Creates new form Main */
        public Main() {
            initComponents();
              for (int i = 0; i < 10; i++) {
                   list1.add("Short text");
                   list1.add("Some very long text indeed. Some very long text indeed.");
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                         
        private void initComponents() {
            list1 = new java.awt.List();
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            add(list1, java.awt.BorderLayout.CENTER);
            pack();
        }// </editor-fold>                       
        /** Exit the Application */
        private void exitForm(java.awt.event.WindowEvent evt) {                         
            System.exit(0);
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new Main().setVisible(true);
        // Variables declaration - do not modify                    
        private java.awt.List list1;
        // End of variables declaration                  
    }

    I use the same code for a General Application as a CDC Application.
    I have no problem at all with the General Application but on the CDC I can't scroll to the right (horizontal).
    Why do I get this problem on the CDC application and not on a regular application?
    I use the PP-1.0 Profile for the CDC application. Does it not support horizontal scroll on java.awt.List?
    This is the code:
    * Main.java
    * Created on den 22 augusti 2007, 10:52
    package cdcapplication6;
    * @author  Erik Rothman
    public class Main extends java.awt.Frame {
        /** Creates new form Main */
        public Main() {
            initComponents();
              for (int i = 0; i < 10; i++) {
                   list1.add("Short text");
                   list1.add("Some very long text indeed. Some very long text indeed.");
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                         
        private void initComponents() {
            list1 = new java.awt.List();
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            add(list1, java.awt.BorderLayout.CENTER);
            pack();
        }// </editor-fold>                       
        /** Exit the Application */
        private void exitForm(java.awt.event.WindowEvent evt) {                         
            System.exit(0);
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new Main().setVisible(true);
        // Variables declaration - do not modify                    
        private java.awt.List list1;
        // End of variables declaration                  
    }

  • Adding only a horizontal scrollbar to a Spark List

    I have a Spark list which may be wider than the application container.  I want to have a horizontal scrollbar if and only if the content is wider than the screen.
    <s:List id="timeline" itemRenderer="com.thismoment.TimeLineRenderer"
                contentBackgroundAlpha="0" borderVisible="false">
            <s:layout>
                <s:HorizontalLayout clipAndEnableScrolling="true" />
            </s:layout>
        </s:List>
    With this code, I get a vertical scrollbar as well.  I only want horizontal.

    hi,
    In your list create a custom skin, then find the scroller line in your new skin and add verticalScrollPolicy="Off"
        <s:Scroller left="0" top="0" right="0" bottom="0" id="scroller" minViewportInset="1" hasFocusableChildren="false" verticalScrollPolicy="off">
    David

  • Horizontal scroll bar in AWT List

    I need to shrink the width of my list by putting a horizontal scroll bar. Does anyone know how to add one onto my list component

    The code looks like this. I can really use some help here.
    Label grp = new Label("Group By:");
         buildConstraints(constraints, 0, 2, 1, 1, 1, 1);
         gridbag.setConstraints(grp, constraints);
         add(grp);
         grplist = new List(4, false);
    buildConstraints(constraints, 1, 2, 1, 1, 1, 1);
         gridbag.setConstraints(grplist, constraints);
         for(i = 0; i <= number_of_fields; i++){
              grplist.add(data[0]);
    add(grplist);
         data6 = new Checkbox("6 sigma data",false);
         buildConstraints(constraints, 1, 12, 1, 1, 1, 1);
         gridbag.setConstraints(data6, constraints);
         add(data6);
         show = new Checkbox("Show values",false);
         buildConstraints(constraints, 1, 13, 1, 1, 1, 1);
         gridbag.setConstraints(show, constraints);
         add(show);
         aver = new Checkbox("Plot Average",false);
         buildConstraints(constraints, 1, 14, 1, 1, 1, 1);
         gridbag.setConstraints(aver, constraints);
         add(aver);
         remove(aver);

  • Horizontal Scroll bar in a list Box?

    Hi,
    I have a requirement in Adobe Designer where my List Box should also show Horizontal Scroll bar in it.
    Is it possible?
    Thanks.

    Thanks Debadas,
    But i need both (Horizontal & Vertical) the scroll bars and depending on the data length either or both should be visible, without changing the data visiblity or text rotation.
    Regards,

  • Horizontal scroll bar muti select list

    Hi,
    I have a multi select list the size of which is restricted doe to other items on the page but some of the values in the lov are wider that the display area, is it possible to get a scroll bar at the bottom so users can scroll alaong and see the few values that are too big.
    Thanks Andy

    The code looks like this. I can really use some help here.
    Label grp = new Label("Group By:");
         buildConstraints(constraints, 0, 2, 1, 1, 1, 1);
         gridbag.setConstraints(grp, constraints);
         add(grp);
         grplist = new List(4, false);
    buildConstraints(constraints, 1, 2, 1, 1, 1, 1);
         gridbag.setConstraints(grplist, constraints);
         for(i = 0; i <= number_of_fields; i++){
              grplist.add(data[0]);
    add(grplist);
         data6 = new Checkbox("6 sigma data",false);
         buildConstraints(constraints, 1, 12, 1, 1, 1, 1);
         gridbag.setConstraints(data6, constraints);
         add(data6);
         show = new Checkbox("Show values",false);
         buildConstraints(constraints, 1, 13, 1, 1, 1, 1);
         gridbag.setConstraints(show, constraints);
         add(show);
         aver = new Checkbox("Plot Average",false);
         buildConstraints(constraints, 1, 14, 1, 1, 1, 1);
         gridbag.setConstraints(aver, constraints);
         add(aver);
         remove(aver);

  • Capture a "scrolling" event in spark List (Flex 4)

    after hours trying to find a scroller thumb drag event, i'm left stumped. Is ther any way to dispatch an event when the scrollbar of a List component is scrolling? or even better, to capture the scroll thumb dragStart and dragComplete events? thanks in advance -b

    You could detect when the scroll position of the viewport goes sufficiently below zero and then call your refresh logic from there.
    Here's an example of how to detect scroll position changes:
    http://stackoverflow.com/questions/4390725/flex-4-scroller/4425091#4425091

  • Spark list horizontal scroller doesn't actualize when rows is set lesser than list container

    Hello,
    The size of the Image control is set larger than that of its parent Group  container. By default, the child extends past the boundaries of the parent  container. Rather than allow the child to extend past the boundaries of the  parent container, the Scroller specifies to clip the child to the boundaries and  display scroll bars.
    In the spark list, when I change the list dataProvider and the size of the Image control is set lesser than that of its parent Group  container, the horizontal scroller doesn't actualize.
    thanks.

    <!-- Simple example to demonstrate the Spark List component -->
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" applicationComplete="comp()" width="260" height="400">
        <fx:Script>
            <![CDATA[
        import mx.collections.*;
        public var dpArray:Array;
        [Bindable]
        public var dpCol:ArrayCollection;
        public function handleClick():void {
            dpCol.removeAll();
            dpCol.addItem({ label:"spark test" });
            dpCol.addItem({ label:"spark text" });
        public function comp():void {
            dpCol = new ArrayCollection(dpArray);
            dpCol.addItem({ label:"spark list horizontal scroller doesn't actualize when rows is set lesser than list container" });
            dpCol.addItem({ label:"spark test" });
            dpCol.addItem({ label:"spark text" });
             ]]>
        </fx:Script>
        <s:Panel title="List">
            <s:VGroup left="20" right="20" top="20" bottom="20">
                <s:List width="200" id="lis" dataProvider="{dpCol}" height="120"/>
                <s:Button id="button1" label="Click here!" width="100" fontSize="12" click="handleClick();"/>
            </s:VGroup>
        </s:Panel>
    </s:Application>

  • Spark list, scroller horizontal ne s'adapte pas à la largeur du texte

    Bonjour,
    dans un composant spark list, le barre de défilement horizonta s'affiche si le texte est plus large que la taille de la liste, si je modifie ma liste et que le texte est inférieur à la taille de la liste la barre de défilement horizontal devrait disparaître or ce n'est pas le cas, il garde la taille précédente, existe-il un moyen de forcer sa réactualisation.
    merci

    Bonjour,
    dans un composant spark list, le barre de défilement horizonta s'affiche si le texte est plus large que la taille de la liste, si je modifie ma liste et que le texte est inférieur à la taille de la liste la barre de défilement horizontal devrait disparaître or ce n'est pas le cas, il garde la taille précédente, existe-il un moyen de forcer sa réactualisation.
    merci

  • Animated Horizontal Spark List

    Hello,
    how could I animate a Horizontal Spark List and enable the Mouse-Wheel for it ?
    I like to scroll with the intervall size of the page, to get started with it I enabled snapping and set the stepsize to thewidth of the itemRenderer/List.
    How to animate this now ?
    http://wensauer.info/flex/AnimatedHorizontalSparkList/ (view source enabled)
    As you can see when you reach the last item and keep scrolling there is some pixels overhead so that you can scroll the content freely.
    How to fix this ?
    Colclusion:
    * how to enable mousewheell for the horizontal scroller (swap function with the vertical?)
    * how to animate a  spark list
    * how to remove pixel overhead
    Any Help is welcome!
    Marc

    Ok,
    I solved some questions myself.
    It is working so far to a certain extend.
    When I scroll to fast with the mouse wheel the auxilary slider gets out of sync with the List.
    Is there a way to only start a new animation once the current is finished ? can I lock it somehow or put them into a queue?
    http://www.wensauer.info/flex/AnimatedHorizontalSparkListII/
    The best way woulkd be that I can use the scrollbar of the scroller, but when I enable snapping, the animation isnt working anymore.
    Idea ? Noone ?

  • Horizontal Scroll in list component

    Hi,
    I'm using a list component which is populated from a textbox.  I've set the horizontal scroll policy to auto and also to on however  the scroll either doesn't appear (in the case of auto) or doesn't move (in the case of on).  Is there a setting which I need to modify to have the horizontal scroll working normally?
    Thanks

    I tried the invalidate method as follows but nothing happened:
    mylist.invalidate();
    Not sure if I explained myself well, I just want the horizontal scrollbar to appear and be able to move it when one or more items in the list are long and thus not all visible...thanks

  • Horizontal grid lines color in a spark List

    Hello,
    How to change horizontal grid lines color in a spark List using css
    Thanks

    Hello,
    How to change horizontal grid lines color in a spark List using css
    Thanks

  • How to smooth scroll a Spark List using the mouse wheel

    I've got my Spark List smooth scrolling nicely if I grab the scrollbar thumb and drag it. But when using the mouse wheel, it's jumping itemrenderer by itemrenderer.
    Is there any way to get this to smooth scroll?  I'm using a List with variableRowHeight = true.
    Thanks.

    This thread demonstrates how to customize mouse wheel scrolling:
    http://forums.adobe.com/message/2783736
    An enhancement was recently added that will allow for customizing the behavior without needing to subclass.  See this bug for the details:
    http://bugs.adobe.com/jira/browse/SDK-26432

  • Help with code for inserting horizontal scroll bar in photo gallery in Business Catalyst site?

    Hi,
    I am using Business Catalyst and Dreamweaver to create a trial site.
    I am not sure if this is the correct forum to post this request but anyway I have inserted a photo gallery module at the bottom of the sidebar in the homepage of my test site.
    Can anyone advise on whether jquery or any other code can be inserted into the page or module code that will replace the "next" hyperlink below the first 4 photos with a horizontal scroll bar at bottom of the gallery so users can just scroll through all 12 images ?
    Kind Regards, Matt.
    http://craftime-bs6.businesscatalyst.com/

    Alyssa,
    Have you tried putting this rule back as it was originally:
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */
    ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
        left: auto; /*was 9px*/
        color: #EF9CCF;
        background-color: #FFF;
    That is, changing your 9px back to auto.
    And giving  us a link (as you did) is much better than printing out the code for us! Thanks!
    Beth

  • My horizontal scroll bar went missing when I maximise the window. How do I fix them?

    My horizontal scroll bar went missing when I maximise the window. How do I fix them? I tried everything; such as auto hide the task bar. Even with this, I still can't see the horizontal scroll bar. I even tried the following and I still can't see the horizontal scroll bar.
    1) In a new tab, type or paste about:config in the address bar and press Enter. Click the button promising to be careful.
    (2) In the search box above the list, type or paste dom and pause while the list is filtered
    (3) Double-click the dom.disable_window_open_feature.scrollbars preference to switch it from false to true. By choosing true, you disable sites from deciding whether there can be scrollbars on a window, and Firefox uses its standard behavior for the page.
    If you want to always get other bars, here are the corresponding settings:
    Menu Bar: dom.disable_window_open_feature.menubar
    Navigation Toolbar: dom.disable_window_open_feature.toolbar
    Bookmarks Toolbar: dom.disable_window_open_feature.personalbar
    Please help.

    Can you post a screen shot?
    Taking a Screen shot; '''''Windows > Start >''''' search box '''''> Snipping Tool'''''.
    Save the picture(s) to your desktop. Now look at the '''Reply''' box below.
    Do you see the button under it that says '''Browse'''? Click it and then select
    the screen shot(s) from the desktop.

Maybe you are looking for

  • Safari 5.1.7, OSX 10.7.4, can't print from safari but ok w/other apps

    I recently upgraded the Safari program as well as the OSX update. Now the Safari print dialog displays "No Printer Selected" and will not allow a printer to be selected. I do get a PDE error that says that the AdobePDFPDE800 bundle isn't working. But

  • MacBook Pro Retina Display 15" Late 2013 after 10.9.3 Update

    All, Thank you in advance for your time, support and recommendations. After the install of the latest Maverick update on May 16, 2014 to 10.9.3, the following issues began. - Upon boot my screen will turn a lavender color and then back to the normal

  • How can I convert a .dat to a .zip on a Mac?

    Hi - I friend wanted me to update his company's website which runs on a MS Exchange Server/Sharepoint set up.  He zipped all the html, jpeg, and assorted text files and attached that zip file to an email.  When I received it on my Mac it had been con

  • Got latest update. Now can't compose email

    just got update. went to compose e-mail. can enter who e-mail is going to and can enter on subject line but cannot enter text. Turned computer off and re-started - same problem.

  • Bold 9930 restarting problem

    hi, Inspite of updating the device software several times the restarting problem still prevails. Kindly advise, Regards Sunny