apache-flexactionscripttoolbarflex-mx

Flex toolbar element


Is there any Toolbar exists in Flex like c# ToolBar (http://msdn.microsoft.com/en-us/library/ms752063.aspx)

I'm using HBox and clipAndEnableScrolling = true

But I need to have scrolling when content is wider, like c# does


Solution

  • By default, no it doesnt. There might be some components out there that other folks have built though. I have always just rolled my own as needed. I would probably do something like the below. I am sure there are better ways, but brute force works for my needs and hopefully it will help you.

    <s:HGroup width="100%">
            <s:Button label="scroll left" click="scrollLeftClick()"/>
            <s:Scroller width="100%" horizontalScrollPolicy="off">
                <s:HGroup>
                    <s:Button label="button"/>
                    <s:Button label="button"/>
                    <s:Button label="button"/>
                    <s:Button label="button"/>
                    <s:Button label="button"/>
                    <s:Button label="button"/>
                    ...//as many more buttons as needed
                </s:HGroup>
            </s:Scroller>
            <s:Button label="scroll right" click="scrollRightClick()"/>
        </s:HGroup>
    

    Then as a seperator, you can always use the below in between the buttons:

    <s:Line height="100%">
                        <s:stroke>
                            <s:SolidColorStroke weight="2"/>
                        </s:stroke>
                    </s:Line>
    

    Then just add functions for scrollLeft and scrollRight to move the scrollerPosition and all will be right with the world... in theory anyways.