| <?xml version="1.0"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| <!-- controls\bar\SBarSimple.mxml --> |
| <s:Module xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:s="library://ns.adobe.com/flex/spark" |
| xmlns:mx="library://ns.adobe.com/flex/mx"> |
| |
| <fx:Script> |
| <![CDATA[ |
| import mx.events.ScrollEvent; |
| |
| private function vbarScroll():void { |
| log.text = "VScrollBar properties summary:" + '\n' + |
| "------------------------------------" + '\n' + |
| "Current scroll position: " + |
| bar.value + '\n' + |
| "The maximum scroll position: " + |
| bar.maximum + '\n' + |
| "The minimum scroll position: " + |
| bar.minimum; |
| |
| rect.height = bar.value; |
| } |
| private function hbarScroll():void { |
| log.text = "HScrollBar properties summary:" + '\n' + |
| "------------------------------------" + '\n' + |
| "Current scroll position: " + |
| hbar.value + '\n' + |
| "The maximum scroll position: " + |
| hbar.maximum + '\n' + |
| "The minimum scroll position: " + |
| hbar.minimum; |
| |
| rect.width = hbar.value; |
| } |
| ]]> |
| </fx:Script> |
| |
| <s:Panel title="VScrollBar and HScrollBar Sample" width="100%" height="100%"> |
| |
| <s:layout> |
| <s:HorizontalLayout paddingLeft="10" paddingRight="10" paddingTop="10" paddingBottom="10" /> |
| </s:layout> |
| |
| <s:VGroup> |
| <s:Label |
| width="100%" |
| text="Drag the ScrollBar controls to change the size of the Rectangle graphic."/> |
| |
| <s:HGroup> |
| <s:VScrollBar id="bar" |
| height="180" |
| minimum="0" |
| maximum="{bar.height}" |
| stepSize="10" |
| pageSize="10" |
| value="{rect.height}" |
| change="vbarScroll()"/> |
| <s:Rect id="rect" width="50" height="20"> |
| <s:fill> |
| <s:LinearGradient rotation="90"> |
| <s:GradientEntry color="#6191c3"/> |
| <s:GradientEntry color="#6191c3"/> |
| <s:GradientEntry alpha=".3"/> |
| </s:LinearGradient> |
| </s:fill> |
| </s:Rect> |
| </s:HGroup> |
| <s:HScrollBar id="hbar" width="180" value="{rect.width}" |
| minimum="0" maximum="{hbar.width}" stepSize="10" pageSize="10" change="hbarScroll()"/> |
| </s:VGroup> |
| <s:VGroup width="200"> |
| <s:TextArea id="log" editable="false" height="88"/> |
| |
| <s:Label text="The ScrollBar controls (HScrollBar and VScrollBar) can be used stand-alone, but typically you would combine it as part of |
| another group of components to provide scrolling functionality. "/> |
| </s:VGroup> |
| |
| </s:Panel> |
| |
| </s:Module> |