http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/MultiPanel.as ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/MultiPanel.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/MultiPanel.as new file mode 100644 index 0000000..774031a --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/MultiPanel.as @@ -0,0 +1,206 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// +package flashx.textLayout.ui +{ + import flash.events.MouseEvent; + + import mx.controls.Button; + import mx.core.EdgeMetrics; + import mx.core.LayoutContainer; + import mx.core.ScrollPolicy; + import mx.effects.Resize; + import mx.events.ResizeEvent; + + [Style(name="openDuration", type="Number", format="Time", inherit="no")] + [Style(name="closeDuration", type="Number", format="Time", inherit="no")] + [Style(name="headerTextAlign", type="String", inherit="no")] + + public class MultiPanel extends LayoutContainer { + + [Embed (source="assets/header_close_icon.png")] + private static var ICON_CLOSE:Class; + + [Embed (source="assets/header_open_icon.png")] + private static var ICON_OPEN:Class; + + private static var SPACING_TOP:uint = 10; + private static var SPACING_BOTTOM:uint = 5; + private var _headerButton:Button = null; + private var _openedChanged:Boolean = false; + private var _opened:Boolean = true; + private var _viewMetrics:EdgeMetrics; + private var resize:Resize; + + public function MultiPanel() { + super(); + + this.verticalScrollPolicy = ScrollPolicy.OFF; + this.horizontalScrollPolicy = ScrollPolicy.OFF; + + addEventListener("PropertyEditorChanged", onPropertyEditorChange); + } + + protected function createOrReplaceHeaderButton():void { + if(_headerButton) { + _headerButton.removeEventListener(MouseEvent.CLICK, headerButton_clickHandler); + + if(rawChildren.contains(_headerButton)) + rawChildren.removeChild(_headerButton); + } + + _headerButton = new Button(); + applyHeaderButtonStyles(_headerButton); + _headerButton.addEventListener(MouseEvent.CLICK, headerButton_clickHandler); + rawChildren.addChild(_headerButton); + } + + protected function applyHeaderButtonStyles(button:Button):void { + button.setStyle("textAlign", getStyle("headerTextAlign")); + button.styleName = "multiPanelHeader"; + button.height = getStyle("headerHeight"); + button.label = label; + + if(_opened) + button.setStyle('icon', ICON_OPEN); + else + button.setStyle('icon', ICON_CLOSE); + } + + override public function set label(value:String):void { + super.label = value; + if(_headerButton) _headerButton.label = value; + } + + public function get opened():Boolean { + return _opened; + } + + [Bindable] + public function set opened(value:Boolean):void { + var old:Boolean = _opened; + + _opened = value; + _openedChanged = _openedChanged || old != _opened; + + if(_openedChanged && initialized) { + measure(); + runResizeEffect(); + + invalidateProperties(); + } + } + + override public function styleChanged(styleProp:String):void { + super.styleChanged(styleProp); + + if(styleProp == "headerTextAlign") { + applyHeaderButtonStyles(_headerButton); + } + + invalidateDisplayList(); + } + + override protected function createChildren():void { + super.createChildren(); + + createOrReplaceHeaderButton(); + } + + override protected function commitProperties():void { + super.commitProperties(); + + if(_openedChanged) { + if(_opened) + _headerButton.setStyle('icon', ICON_OPEN); + else + _headerButton.setStyle('icon', ICON_CLOSE); + + _openedChanged = false; + } + } + + override protected function updateDisplayList(w:Number, h:Number):void { + super.updateDisplayList(w, h); + + _headerButton.move(0,0); + _headerButton.setActualSize(w, _headerButton.getExplicitOrMeasuredHeight()); + } + + override public function get viewMetrics():EdgeMetrics { + if (!_viewMetrics) + _viewMetrics = new EdgeMetrics(0, 0, 0, 0); + + var edgeMetrics:EdgeMetrics = _viewMetrics; + var parentEdgeMetrics:EdgeMetrics = super.viewMetrics; + + edgeMetrics.left = parentEdgeMetrics.left; + edgeMetrics.top = parentEdgeMetrics.top + SPACING_TOP; + edgeMetrics.right = parentEdgeMetrics.right; + edgeMetrics.bottom = parentEdgeMetrics.bottom + SPACING_BOTTOM; + + var headerHeight:Number = _headerButton.getExplicitOrMeasuredHeight(); + if (!isNaN(headerHeight)) { + edgeMetrics.top += headerHeight; + } + + return edgeMetrics; + } + + override protected function measure():void { + super.measure(); + + if(!_opened) { + //only the height of the header button + measuredHeight = _headerButton.getExplicitOrMeasuredHeight(); + } + } + + protected function runResizeEffect():void { + if(resize && resize.isPlaying) + resize.end(); + + var duration:Number = _opened ? getStyle("openDuration") : getStyle("closeDuration"); + if(duration == 0) { + this.setActualSize(getExplicitOrMeasuredWidth(), measuredHeight); + + invalidateSize(); + invalidateDisplayList(); + } + else { + resize = new Resize(this); + resize.heightTo = Math.min(maxHeight, measuredHeight); + resize.duration = duration; + resize.play(); + } + } + + protected function headerButton_clickHandler(event:MouseEvent):void { + opened = !_opened; + } + + private function onPropertyEditorChange(event:Event):void { + // Make sure that the panel exists and is open before doing anything + if(initialized && _opened) { + measure(); + runResizeEffect(); + invalidateProperties(); + } + } + } +}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/MultiPanelHeaderSkin.as ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/MultiPanelHeaderSkin.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/MultiPanelHeaderSkin.as new file mode 100644 index 0000000..f5043a3 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/MultiPanelHeaderSkin.as @@ -0,0 +1,58 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// + +package flashx.textLayout.ui +{ + import mx.skins.RectangularBorder; + import mx.utils.GraphicsUtil; + import flash.display.LineScaleMode; + import flash.display.CapsStyle; + + public class MultiPanelHeaderSkin extends RectangularBorder + { + public function MultiPanelHeaderSkin() + { + super(); + } + + override protected function updateDisplayList(w:Number, h:Number):void + { + super.updateDisplayList(w, h); + + var fillColors:Array = [0x000000, 0x000000]; + var fillAlphas:Array = [1.0, 1.0]; + var borderColor:uint = 0x2A2A2A; + var borderAlpha:Number = 1.0; + + if (getStyle("fillColors") != undefined) + fillColors = getStyle("fillColors"); + if (getStyle("fillAlphas") != undefined) + fillAlphas = getStyle("fillAlphas"); + if (getStyle("borderColor") != undefined) + borderColor = getStyle("borderColor"); + if (getStyle("borderAlpha") != undefined) + borderAlpha = getStyle("borderAlpha"); + + graphics.clear(); + drawRoundRect(0,0,w, h, null, fillColors, fillAlphas, verticalGradientMatrix(0,0,w,h)); + graphics.lineStyle(1, borderColor, borderAlpha, true, LineScaleMode.NONE, CapsStyle.SQUARE); + graphics.drawRect(0, 0, w-1, h); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/PanelWithEdgeBars.as ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/PanelWithEdgeBars.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/PanelWithEdgeBars.as new file mode 100644 index 0000000..1d55c59 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/PanelWithEdgeBars.as @@ -0,0 +1,266 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// + +package flashx.textLayout.ui +{ + import flash.geom.Rectangle; + + import mx.binding.utils.*; + import mx.containers.Canvas; + import mx.core.UIComponent; + import mx.events.ResizeEvent; + + public class PanelWithEdgeBars extends Canvas + { + public function PanelWithEdgeBars() + { + super(); + addEventListener(ResizeEvent.RESIZE, onResize); + } + + public function set mainPanel(inPanel:UIComponent):void + { + if (mMainPanel == null) + { + mMainPanel = inPanel; + ArrangeContents(); + } + else if (mMainPanel != inPanel) + throw new Error("Can't set main panel more than once."); + } + + public function get mainPanel():UIComponent + { + return mMainPanel; + } + + public function set topBar(inBar:UIComponent):void + { + if (mTopBar == null && inBar != null) + { + mTopBar = inBar; + ArrangeContents(); + var watcherSetter:ChangeWatcher = BindingUtils.bindSetter(includeInLayoutChanged, mTopBar, "includeInLayout"); + } + else if (mTopBar != inBar) + throw new Error("Can't set any edge bar more than once."); + } + + public function get topBar():UIComponent + { + return mTopBar; + } + + public function set rightBar(inBar:UIComponent):void + { + if (mRightBar == null && inBar != null) + { + mRightBar = inBar; + ArrangeContents(); + var watcherSetter:ChangeWatcher = BindingUtils.bindSetter(includeInLayoutChanged, mRightBar, "includeInLayout"); + } + else if (mRightBar != inBar) + throw new Error("Can't set any edge bar more than once."); + } + + public function get rightBar():UIComponent + { + return mRightBar; + } + + public function set bottomBar(inBar:UIComponent):void + { + if (mBottomBar == null && inBar != null) + { + mBottomBar = inBar; + ArrangeContents(); + var watcherSetter:ChangeWatcher = BindingUtils.bindSetter(includeInLayoutChanged, mBottomBar, "includeInLayout"); + } + else if (mBottomBar != inBar) + throw new Error("Can't set any edge bar more than once."); + } + + public function get bottomBar():UIComponent + { + return mBottomBar; + } + + public function set leftBar(inBar:UIComponent):void + { + if (mLeftBar == null && inBar != null) + { + mLeftBar = inBar; + ArrangeContents(); + var watcherSetter:ChangeWatcher = BindingUtils.bindSetter(includeInLayoutChanged, mLeftBar, "includeInLayout"); + } + else if (mLeftBar != inBar) + throw new Error("Can't set any edge bar more than once."); + } + + public function get leftBar():UIComponent + { + return mLeftBar; + } + + public function set edgeInset(inInset:Number):void + { + mEdgeInset = inInset; + ArrangeContents(); + } + + public function get edgeInset():Number + { + return mEdgeInset; + } + + public function set gap(inGap:Number):void + { + mGap = inGap; + ArrangeContents(); + } + + public function get gap():Number + { + return mGap; + } + + public function set leftInset(inInset:Number):void + { + mLeftInset = inInset; + ArrangeContents(); + } + + public function get leftInset():Number + { + return mLeftInset; + } + + public function set topInset(inInset:Number):void + { + mTopInset = inInset; + ArrangeContents(); + } + + public function get topInset():Number + { + return mTopInset; + } + + public function set rightInset(inInset:Number):void + { + mRightInset = inInset; + ArrangeContents(); + } + + public function get rightInset():Number + { + return mRightInset; + } + + public function set bottomInset(inInset:Number):void + { + mBottomInset = inInset; + ArrangeContents(); + } + + public function get bottomInset():Number + { + return mBottomInset; + } + + private function onResize(evt:ResizeEvent):void + { + ArrangeContents(); + } + + private function includeInLayoutChanged(val:Boolean):void { + ArrangeContents(); + } + + private function ArrangeContents():void + { + var space:Rectangle = new Rectangle(0, 0, width, height); + for (var i:int = numChildren - 1; i >= 0; --i) + { + var child:UIComponent = getChildAt(i) as UIComponent; + if (child && child.includeInLayout) + { + var inset:Number; + if (child == mTopBar) + { + inset = mTopInset ? mTopInset : mEdgeInset; + child.x = space.x; + child.width = space.width; + child.y = space.y; + child.height = inset; + space.y += inset + mGap; + space.height -= inset + mGap; + } + else if (child == mRightBar) + { + inset = mRightInset ? mRightInset : mEdgeInset; + child.x = space.right - inset; + child.width = inset; + child.y = space.y; + child.height = space.height; + space.width -= inset + mGap; + } + else if (child == mBottomBar) + { + inset = mBottomInset ? mBottomInset : mEdgeInset; + child.x = space.x; + child.width = space.width; + child.y = space.bottom - inset; + child.height = inset; + space.height -= inset + mGap; + } + if (child == mLeftBar) + { + inset = mLeftInset ? mLeftInset : mEdgeInset; + child.x = space.x; + child.width = inset; + child.y = space.y; + child.height = space.height; + space.x += inset + mGap; + space.width -= inset + mGap; + } + } + } + if (mMainPanel) + { + mMainPanel.x = space.x; + mMainPanel.y = space.y; + mMainPanel.width = space.width; + mMainPanel.height = space.height; + } + } + + private var mTopBar:UIComponent = null; + private var mRightBar:UIComponent = null; + private var mBottomBar:UIComponent = null; + private var mLeftBar:UIComponent = null; + private var mMainPanel:UIComponent = null; + private var mEdgeInset:Number = 16; + private var mLeftInset:Number = 0; + private var mRightInset:Number = 0; + private var mTopInset:Number = 0; + private var mBottomInset:Number = 0; + private var mGap:Number = 1; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/VellumGUIStyles.css ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/VellumGUIStyles.css b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/VellumGUIStyles.css new file mode 100644 index 0000000..8756a92 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/VellumGUIStyles.css @@ -0,0 +1,254 @@ +/* + * 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. + */ +@namespace s "library://ns.adobe.com/flex/spark"; +@namespace "library://ns.adobe.com/flex/mx"; +@namespace bxf "bxf.ui.controls.*"; +@namespace tlfui "flashx.textLayout.ui.rulers.*"; + +bxf|BxPopupMenu +{ + borderSkin: ClassReference("flashx.textLayout.ui.styles.PopupMenuSkin"); + borderStyle: "solid"; + backColor: "0xd9d9d9"; + backAlpha: "1.0"; + lineColor: "0x000000"; + lineAlpha: "0.9"; + lineWidth: "1"; + rollOverColor: "0x0000b0"; + rollOverAlpha: "1.0"; + selectionColor: "0x0000b0"; + selectionAlpha: "0.8"; + separatorAlpha: "0.1"; + separatorColor: "0xffffff"; + separatorThickness: "1"; + color: "0x2e2e2e"; + textSelectedColor: "0xffffff"; + textRollOverColor: "0xffffff"; + leftIconGap: "5"; + rightIconGap: "5"; + openDuration: "10"; + closeDuration: "10"; +} + +CheckBox +{ + textRollOverColor: #000000; +} + + +TabNavigator { + tabHeight: 18; + backgroundColor: #d6d6d6; + tabStyleName: "myTabs"; + firstTabStyleName: "myTabs"; + lastTabStyleName: "myTabs"; + selectedTabTextStyleName: "mySelectedTabs"; +} + + +tlfui|TabMarker +{ + borderSkin: ClassReference("flashx.textLayout.ui.rulers.TabMarkerSkin"); + borderStyle: "solid"; +} + +tlfui|ParagraphPropertyMarker +{ + borderSkin: ClassReference("flashx.textLayout.ui.rulers.ParagraphPropertyMarkerSkin"); + borderStyle: "solid"; +} + +.stringPropertyEditor { + color: #262626; + fontFamily: "Myriad Pro"; + fontSize: 12; +} + +.myTabs { + cornerRadius: 0; + fillColors: #b0b0b0, #989898; + backgroundColor: #d9d9d9; + borderColor: #666666; + color: #181818; + textRollOverColor: #000000; + themeColor: #484848; + fontFamily: "Myriad Pro"; + fontSize: 10; + fontWeight: "bold"; +} + +.mySelectedTabs { + color: #202020; + textRollOverColor: #202020; + fontFamily: "Myriad Pro"; + fontSize: 10; + fontWeight: "bold"; +} + +.comboPropEditorValue +{ + fontFamily: "Myriad Pro"; + fontWeight: "bold"; +} + +.unitComboValue +{ + fontFamily: "Myriad Pro"; + fontWeight: "bold"; +} + + +.toggleIconButton { + cornerRadius: 2; +} + +.toggleButtonRow { + horizontalGap: 2; +} + +.iconButtonGroup { + cornerRadius: 2; + horizontalGap: 20; +} + +.multiPanel { + headerHeight: 17; + border-style: solid; + border-color: #D6D6D6; + headerTextAlign: "left"; + openDuration: 200; + closeDuration: 200; + paddingTop: 0; + + fontFamily: "Myriad Pro"; + font-size: 12px; + letter-spacing: 0px; + color: #2A2A2A; +} + +.multiPanelHeader { + upSkin: ClassReference("flashx.textLayout.ui.MultiPanelHeaderSkin"); + downSkin: ClassReference("flashx.textLayout.ui.MultiPanelHeaderSkin"); + overSkin: ClassReference("flashx.textLayout.ui.MultiPanelHeaderSkin"); + disabledSkin: ClassReference("flashx.textLayout.ui.MultiPanelHeaderSkin"); + fillAlphas: 1,1; + fillColors: #c8c8c8, #b8b8b8; + borderAlpha: 1; + borderColor: #D6D6D6; + cornerRadius: 0; + + padding-left: 3; + padding-top: 5px; + + fontFamily: "Myriad Pro"; + font-size: 11px; + letter-spacing: 0px; + color: #262626; +} + +.hotTextStyle { + fontFamily: "Myriad Pro"; + fontWeight: "bold"; + color: #0071BC; + backColor: #D9D9D9; + text-decoration: none; + border-bottom: solid 1px; +} + +.fontComboStyle { + fontFamily: "Helvetica"; + fontWeight: "normal"; + fontSize: 12; + openDuration: 10; + closeDuration: 10; + + padding-top: -10; + + upSkin: Embed(source="assets/combo_drop_down_arrow.png"); + disabledSkin: Embed(source="assets/combo_drop_down_arrow.png"); + overSkin: Embed(source="assets/combo_drop_down_arrow.png"); + disabledSkin: Embed(source="assets/combo_drop_down_arrow.png"); + editableUpSkin: Embed(source="assets/combo_drop_down_arrow.png"); + editableDisabledSkin: Embed(source="assets/combo_drop_down_arrow.png"); + editableOverSkin: Embed(source="assets/combo_drop_down_arrow.png"); + editableDisabledSkin: Embed(source="assets/combo_drop_down_arrow.png"); + arrowButtonWidth: 18; + + cornerRadius: 2; + borderColor: #737373; + + textInputStyleName: "fontComboTextInputStyle"; +} + +.fontDropDownStyle { + fontFamily: "Helvetica"; + fontWeight: "normal"; + fontSize: 12; + borderColor: #66ffff; + backgroundColor: #D6D6D6; + verticalScrollBarStyleName: scrollbarStyle; +} + +.fontComboTextInputStyle { + borderStyle: solid; + borderColor: #737373; +} + +.scrollbarStyle { + thumbUpSkin: ClassReference("flashx.textLayout.ui.styles.ScrollbarThumbUpSkin"); + thumbOverSkin: ClassReference("flashx.textLayout.ui.styles.ScrollbarThumbOverSkin"); + thumbDownSkin: ClassReference("flashx.textLayout.ui.styles.ScrollbarThumbUpSkin"); + trackSkin: ClassReference("flashx.textLayout.ui.styles.ScrollbarTrackSkin"); + upArrowUpSkin: Embed(source="assets/scroll_arrow_up.png"); + upArrowDownSkin: Embed(source="assets/scroll_arrow_up.png"); + upArrowOverSkin: Embed(source="assets/scroll_arrow_up_over.png"); + upArrowDisabledSkin: Embed(source="assets/scroll_arrow_up.png"); + downArrowUpSkin: Embed(source="assets/scroll_arrow_down.png"); + downArrowOverSkin: Embed(source="assets/scroll_arrow_down_over.png"); + downArrowDownSkin: Embed(source="assets/scroll_arrow_down.png"); + downArrowDisabledSkin: Embed(source="assets/scroll_arrow_down.png"); + + + trackFill: #CECECE; + trackFillAlpha: 1.0; + trackStroke: #7B7B7B; + trackStrokeAlpha: 1.0; + + thumbFill: #DFDFDF; + thumbFillAlpha: 1.0; + thumbStroke: #F4F4F4; + thumbStrokeAlpha: 1.0; + + thumbOverFill: #E5E5E5; + thumbOverFillAlpha: 1.0; + thumbOverStroke: #F4F4F4; + thumbOverStrokeAlpha: 1.0; +} + +@font-face +{ + src: url("assets/Fonts.swf"); + fontFamily: "Myriad Pro"; +} + +@font-face +{ + src: url("assets/Fonts.swf"); + fontFamily: "Myriad Pro"; + fontWeight: "bold"; +} + http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_down_over.png ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_down_over.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_down_over.png new file mode 100644 index 0000000..a209b46 Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_down_over.png differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_up_over.png ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_up_over.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_up_over.png new file mode 100644 index 0000000..5e37d0f Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_up_over.png differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/combo_drop_down_arrow.png ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/combo_drop_down_arrow.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/combo_drop_down_arrow.png new file mode 100644 index 0000000..1b905e8 Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/combo_drop_down_arrow.png differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/header_close_icon.png ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/header_close_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/header_close_icon.png new file mode 100644 index 0000000..e55928c Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/header_close_icon.png differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/header_open_icon.png ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/header_open_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/header_open_icon.png new file mode 100644 index 0000000..d3a1b42 Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/header_open_icon.png differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down.png ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down.png new file mode 100644 index 0000000..f5d8145 Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down.png differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down_over.png ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down_over.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down_over.png new file mode 100644 index 0000000..ef66ac6 Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down_over.png differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up.png ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up.png new file mode 100644 index 0000000..1d3828d Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up.png differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up_over.png ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up_over.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up_over.png new file mode 100644 index 0000000..2147d32 Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up_over.png differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/AdvancedTextPropertyEditor.as ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/AdvancedTextPropertyEditor.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/AdvancedTextPropertyEditor.as new file mode 100644 index 0000000..145c721 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/AdvancedTextPropertyEditor.as @@ -0,0 +1,190 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// + +package flashx.textLayout.ui.inspectors +{ + import flash.text.engine.*; + + import flashx.textLayout.formats.FormatValue; + import flashx.textLayout.formats.TextLayoutFormat; + import flashx.textLayout.tlf_internal; + use namespace tlf_internal; + + public class AdvancedTextPropertyEditor extends DynamicTextPropertyEditor + { + public function AdvancedTextPropertyEditor() + { + var recipe:XML = + <recipe> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/DigitCase=Digit Case:"> + <property name={TextInspectorController.DIGIT_CASE_UIPROP}/> + <choice display="Default" value={flash.text.engine.DigitCase.DEFAULT}/> + <choice display="Lining" value={flash.text.engine.DigitCase.LINING}/> + <choice display="Old Style" value={flash.text.engine.DigitCase.OLD_STYLE}/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/DigitWidth=Digit Width:"> + <property name={TextInspectorController.DIGIT_WIDTH_UIPROP}/> + <choice display="Default" value={flash.text.engine.DigitWidth.DEFAULT}/> + <choice display="Proportional" value={flash.text.engine.DigitWidth.PROPORTIONAL}/> + <choice display="Tabular" value={flash.text.engine.DigitWidth.TABULAR}/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/DominantBaseline=Dominant Baseline:"> + <property name={TextInspectorController.DOMINANT_BASELINE_UIPROP}/> + <choice display="Auto" value={FormatValue.AUTO}/> + <choice display="Roman" value={flash.text.engine.TextBaseline.ROMAN}/> + <choice display="Ascent" value={flash.text.engine.TextBaseline.ASCENT}/> + <choice display="Descent" value={flash.text.engine.TextBaseline.DESCENT}/> + <choice display="Ideographic Top" value={flash.text.engine.TextBaseline.IDEOGRAPHIC_TOP}/> + <choice display="Ideographic Center" value={flash.text.engine.TextBaseline.IDEOGRAPHIC_CENTER}/> + <choice display="Ideographic Bottom" value={flash.text.engine.TextBaseline.IDEOGRAPHIC_BOTTOM}/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/AlignmentBaseline=Alignment Baseline:"> + <property name={TextInspectorController.ALIGNMENT_BASELINE_UIPROP}/> + <choice display="Roman" value={flash.text.engine.TextBaseline.ROMAN}/> + <choice display="Ascent" value={flash.text.engine.TextBaseline.ASCENT}/> + <choice display="Descent" value={flash.text.engine.TextBaseline.DESCENT}/> + <choice display="Ideographic Top" value={flash.text.engine.TextBaseline.IDEOGRAPHIC_TOP}/> + <choice display="Ideographic Center" value={flash.text.engine.TextBaseline.IDEOGRAPHIC_CENTER}/> + <choice display="Ideographic Bottom" value={flash.text.engine.TextBaseline.IDEOGRAPHIC_BOTTOM}/> + <choice display="Use Dominant" value={flash.text.engine.TextBaseline.USE_DOMINANT_BASELINE}/> + </editor> + </row> + <row> + <editor type="hotnumberunit" label="$$$/stage/TextEditing/Label/BaselineShift=Baseline Shift:"> + <property name={TextInspectorController.BASELINE_SHIFT_UIPROP}/> + <defaultunit>pix</defaultunit> + <numericunit displayname="%" + min={TextLayoutFormat.baselineShiftProperty.minPercentValue} + max={TextLayoutFormat.baselineShiftProperty.maxPercentValue} + default="0" + decimals="1"/> + <numericunit displayname="pix" + min={TextLayoutFormat.baselineShiftProperty.minNumberValue} + max={TextLayoutFormat.baselineShiftProperty.maxNumberValue} + default="0" + decimals="1"/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/Ligatures=Ligatures:"> + <property name={TextInspectorController.LIGATURE_LEVEL_UIPROP}/> + <choice display="Minimum" value={flash.text.engine.LigatureLevel.MINIMUM}/> + <choice display="Common" value={flash.text.engine.LigatureLevel.COMMON}/> + <choice display="Uncommon" value={flash.text.engine.LigatureLevel.UNCOMMON}/> + <choice display="Exotic" value={flash.text.engine.LigatureLevel.EXOTIC}/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/Rotation=Rotation:"> + <property name={TextInspectorController.TEXT_ROTATION_UIPROP}/> + <choice display="0 degrees" value={flash.text.engine.TextRotation.ROTATE_0}/> + <choice display="90 degrees" value={flash.text.engine.TextRotation.ROTATE_90}/> + <choice display="180 degrees" value={flash.text.engine.TextRotation.ROTATE_180}/> + <choice display="270 degrees" value={flash.text.engine.TextRotation.ROTATE_270}/> + <choice display="auto" value={flash.text.engine.TextRotation.AUTO}/> + </editor> + </row> + <row> + <editor type="hotnumber" label="$$$/stage/TextEditing/Label/Alpha=Alpha:" suffix="%"> + <property name={TextInspectorController.TEXT_ALPHA_UIPROP} + minValue="0" + maxValue="100" + convertToPercent="yes"/> + </editor> + </row> + <row> + <editor type="hotnumber" label="$$$/stage/TextEditing/Label/BackgroundAlpha=Background alpha:" suffix="%"> + <property name={TextInspectorController.BACKGROUND_ALPHA_UIPROP} + minValue="0" + maxValue="100" + convertToPercent="yes"/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/Break=Break:"> + <property name={TextInspectorController.BREAK_OPPORTUNITY_UIPROP}/> + <choice display="All" value={flash.text.engine.BreakOpportunity.ALL}/> + <choice display="Any" value={flash.text.engine.BreakOpportunity.ANY}/> + <choice display="Auto" value={flash.text.engine.BreakOpportunity.AUTO}/> + <choice display="No Break" value={flash.text.engine.BreakOpportunity.NONE}/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/Lacale=Locale:"> + <property name={TextInspectorController.LOCALE_UIPROP}/> + <choice display="Arabic" value="ar"/>, + <choice display="Bengali" value="bn"/>, + <choice display="Bulgarian" value="bg"/>, + <choice display="Catalan" value="ca"/>, + <choice display="Chinese, Simplified (China)" value="zh-CN"/>, + <choice display="Chinese, Traditional (Taiwan)" value="zh-TW"/>, + <choice display="Croatian" value="hr"/>, + <choice display="Czech" value="cs"/>, + <choice display="Danish" value="da"/>, + <choice display="Dutch" value="nl"/>, + <choice display="English" value="en"/>, + <choice display="Estonian" value="et"/>, + <choice display="Finnish" value="fi"/>, + <choice display="French" value="fr"/>, + <choice display="German" value="de"/>, + <choice display="Greek" value="el"/>, + <choice display="Gujarati" value="gu"/>, + <choice display="Hindi" value="hi"/>, + <choice display="Hebrew" value="he"/>, + <choice display="Hungarian" value="hu"/>, + <choice display="Italian" value="it"/>, + <choice display="Japanese" value="ja"/>, + <choice display="Korean" value="ko"/>, + <choice display="Latvian" value="lv"/>, + <choice display="Lithuanian" value="lt"/>, + <choice display="Marathi" value="mr"/>, + <choice display="Norwegian" value="no"/>, + <choice display="Persian" value="fa"/>, + <choice display="Polish" value="pl"/>, + <choice display="Portuguese" value="pt"/>, + <choice display="Punjabi" value="pa"/>, + <choice display="Romanian" value="ro"/>, + <choice display="Russian" value="ru"/>, + <choice display="Slovak" value="sk"/>, + <choice display="Slovenian" value="sl"/>, + <choice display="Spanish" value="es"/>, + <choice display="Swedish" value="sv"/>, + <choice display="Tamil" value="ta"/>, + <choice display="Telugu" value="te"/>, + <choice display="Thai" value="th"/>, + <choice display="Turkish" value="tr"/>, + <choice display="Ukrainian" value="uk"/>, + <choice display="Urdu" value="ur"/>, + <choice display="Vietnamese" value="vi"/> + </editor> + </row> + </recipe>; + + super(recipe); + } + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/AntiAliasPropertyEditor.as ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/AntiAliasPropertyEditor.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/AntiAliasPropertyEditor.as new file mode 100644 index 0000000..af0fc66 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/AntiAliasPropertyEditor.as @@ -0,0 +1,51 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// + +package flashx.textLayout.ui.inspectors +{ + import flash.text.AntiAliasType; + import flash.text.engine.CFFHinting; + import flash.text.engine.RenderingMode; + + public class AntiAliasPropertyEditor extends DynamicTextPropertyEditor + { + public function AntiAliasPropertyEditor() + { + var recipe:XML = + <recipe> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/Antialias=Antialias:"> + <property name={TextInspectorController.RENDERING_MODE_UIPROP}/> + <choice display="Normal" value={flash.text.engine.RenderingMode.NORMAL}/> + <choice display="CFF" value={flash.text.engine.RenderingMode.CFF}/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/GridFit=Grid Fit:"> + <property name={TextInspectorController.CFF_HINTING_UIPROP}/> + <choice display="None" value={flash.text.engine.CFFHinting.NONE}/> + <choice display="Horizontal stem" value={flash.text.engine.CFFHinting.HORIZONTAL_STEM}/> + </editor> + </row> + </recipe>; + super(recipe); + } + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/CharacterPropertyEditor.as ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/CharacterPropertyEditor.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/CharacterPropertyEditor.as new file mode 100644 index 0000000..6581152 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/CharacterPropertyEditor.as @@ -0,0 +1,179 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// + +package flashx.textLayout.ui.inspectors +{ + import flash.text.engine.*; + + import flashx.textLayout.formats.TextLayoutFormat; + import flashx.textLayout.tlf_internal; + use namespace tlf_internal; + + public class CharacterPropertyEditor extends DynamicTextPropertyEditor + { + [Embed(source="./assets/bold_icon.png")] + private var boldIcon:Class; + + [Embed(source="./assets/italic_icon.png")] + private var italicIcon:Class; + + [Embed(source="./assets/underline_icon.png")] + private var underlineIcon:Class; + + [Embed(source="./assets/strikethrough_icon.png")] + private var strikethroughIcon:Class; + + [Embed(source="./assets/superscript_icon.png")] + private var superscriptIcon:Class; + + [Embed(source="./assets/subscript_icon.png")] + private var subscriptIcon:Class; + + [Embed(source="./assets/tcy_icon.png")] + private var tcyIcon:Class; + + public function CharacterPropertyEditor() + { + var recipe:XML = + <recipe> + <row> + <editor type="fontPicker" label="$$$/stage/TextEditing/Label/Font=Font:"> + <property name={TextInspectorController.FONT_FAMILY_UIPROP}/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/FontLookup=Lookup:"> + <property name={TextInspectorController.FONT_LOOKUP_UIPROP}/> + <choice display="Device" value={flash.text.engine.FontLookup.DEVICE}/> + <choice display="Embedded CFF" value={flash.text.engine.FontLookup.EMBEDDED_CFF}/> + </editor> + </row> + <row> + <editor type="hotnumber" label="$$$/stage/TextEditing/Label/Size=Size:" decimals="1" enforcePrecision="no"> + <property name={TextInspectorController.FONT_SIZE_UIPROP} + minValue={TextLayoutFormat.fontSizeProperty.minValue} + maxValue={TextLayoutFormat.fontSizeProperty.maxValue}/> + </editor> + <editor type="hotnumberunit" label="$$$/stage/TextEditing/Label/Leading=Leading:"> + <property name={TextInspectorController.LINE_HEIGHT_UIPROP}/> + <defaultunit>pix</defaultunit> + <numericunit displayname="%" + min={TextLayoutFormat.lineHeightProperty.minPercentValue} + max={TextLayoutFormat.lineHeightProperty.maxPercentValue} + default="120"/> + <numericunit displayname="pix" + min={TextLayoutFormat.lineHeightProperty.minNumberValue} + max={TextLayoutFormat.lineHeightProperty.maxNumberValue} + default="14" + decimals="1"/> + </editor> + </row> + <row style="toggleButtonRow"> + <editor type="toggleButton" style="toggleIconButton" iconClass="boldIcon" width="17" commit="yes"> + <property name={TextInspectorController.FONT_WEIGHT_UIPROP} falseValue="normal" trueValue="bold"/> + </editor> + <editor type="toggleButton" style="toggleIconButton" iconClass="italicIcon" width="17" commit="yes"> + <property name={TextInspectorController.FONT_STYLE_UIPROP} falseValue="normal" trueValue="italic"/> + </editor> + <editor type="toggleButton" style="toggleIconButton" iconClass="underlineIcon" width="17" commit="yes"> + <property name={TextInspectorController.TEXT_DECORATION_UIPROP} falseValue="none" trueValue="underline"/> + </editor> + <editor type="toggleButton" style="toggleIconButton" iconClass="strikethroughIcon" width="17" commit="yes"> + <property name={TextInspectorController.LINE_THROUGH_UIPROP}/> + </editor> + <editor type="toggleButton" style="toggleIconButton" iconClass="superscriptIcon" width="17" commit="yes"> + <property name={TextInspectorController.BASELINE_SHIFT_SUPER_UIPROP} falseValue="0" trueValue={flashx.textLayout.formats.BaselineShift.SUPERSCRIPT}/> + </editor> + <editor type="toggleButton" style="toggleIconButton" iconClass="subscriptIcon" width="17" commit="yes"> + <property name={TextInspectorController.BASELINE_SHIFT_SUB_UIPROP} falseValue="0" trueValue={flashx.textLayout.formats.BaselineShift.SUBSCRIPT}/> + </editor> + <editor type="toggleButton" style="toggleIconButton" iconClass="tcyIcon" width="17" commit="yes"> + <property name={TextInspectorController.TCY_UIPROP}/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/Kerning=Kerning:"> + <property name={TextInspectorController.KERNING_UIPROP}/> + <choice display="On" value={flash.text.engine.Kerning.ON}/> + <choice display="Off" value={flash.text.engine.Kerning.OFF}/> + <choice display="Auto" value={flash.text.engine.Kerning.AUTO}/> + </editor> + </row> + <row> + <editor type="hotnumberunit" label="$$$/stage/TextEditing/Label/Tracking=Track R:"> + <property name={TextInspectorController.TRACKING_RIGHT_UIPROP}/> + <defaultunit>pix</defaultunit> + <numericunit displayname="%" + min={TextLayoutFormat.trackingRightProperty.minPercentValue} + max={TextLayoutFormat.trackingRightProperty.maxPercentValue} + default="0"/> + <numericunit displayname="pix" + min={TextLayoutFormat.trackingRightProperty.minNumberValue} + max={TextLayoutFormat.trackingRightProperty.maxNumberValue} + default="0" + decimals="1"/> + </editor> + </row> + <row> + <editor type="hotnumberunit" label="$$$/stage/TextEditing/Label/Tracking=Track L:"> + <property name={TextInspectorController.TRACKING_LEFT_UIPROP}/> + <defaultunit>pix</defaultunit> + <numericunit displayname="%" + min={TextLayoutFormat.trackingLeftProperty.minPercentValue} + max={TextLayoutFormat.trackingLeftProperty.maxPercentValue} + default="0"/> + <numericunit displayname="pix" + min={TextLayoutFormat.trackingLeftProperty.minNumberValue} + max={TextLayoutFormat.trackingLeftProperty.maxNumberValue} + default="0" + decimals="1"/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/Case=Case:"> + <property name={TextInspectorController.TYPOGRAPHIC_CASE_UIPROP}/> + <choice display="Default" value={flashx.textLayout.formats.TLFTypographicCase.DEFAULT}/> + <choice display="Caps to Small Caps" value={flashx.textLayout.formats.TLFTypographicCase.CAPS_TO_SMALL_CAPS}/> + <choice display="Upper" value={flashx.textLayout.formats.TLFTypographicCase.UPPERCASE}/> + <choice display="Lower" value={flashx.textLayout.formats.TLFTypographicCase.LOWERCASE}/> + <choice display="Lowercase to Small Caps" value={flashx.textLayout.formats.TLFTypographicCase.LOWERCASE_TO_SMALL_CAPS}/> + </editor> + </row> + <row> + <editor type="color" label="$$$/stage/TextEditing/Label/Color=Color:"> + <property name={TextInspectorController.COLOR_UIPROP}/> + </editor> + <editor type="color" label="$$$/stage/TextEditing/Label/BackgroundColor=Background color:"> + <property name={TextInspectorController.BGCOLOR_UIPROP}/> + </editor> + </row> + </recipe>; + + super(recipe); + SetIcon("boldIcon", boldIcon); + SetIcon("italicIcon", italicIcon); + SetIcon("underlineIcon", underlineIcon); + SetIcon("strikethroughIcon", strikethroughIcon); + SetIcon("superscriptIcon", superscriptIcon); + SetIcon("subscriptIcon", subscriptIcon); + SetIcon("tcyIcon", tcyIcon); + } + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/DynamicTextPropertyEditor.as ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/DynamicTextPropertyEditor.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/DynamicTextPropertyEditor.as new file mode 100644 index 0000000..e3a931a --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/DynamicTextPropertyEditor.as @@ -0,0 +1,74 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// + +package flashx.textLayout.ui.inspectors +{ + import bxf.ui.inspectors.DynamicPropertyEditorBase; + + import mx.events.PropertyChangeEvent; + + public class DynamicTextPropertyEditor extends DynamicPropertyEditorBase + { + public function DynamicTextPropertyEditor(inRecipe:XML) + { + super(inRecipe); + TextInspectorController.Instance().addEventListener(SelectionUpdateEvent.SELECTION_UPDATE, onSelectionUpdate); + addEventListener(DynamicPropertyEditorBase.MODELCHANGED_EVENT, onFormatValueChanged, false, 0, true); + addEventListener(DynamicPropertyEditorBase.MODELEDITED_EVENT, onFormatValueChanged, false, 0, true); + } + + public function set active(inActive:Boolean):void + { + if (mActive != inActive) + { + mActive = inActive; + if (mActive) + TextInspectorController.Instance().forceBroadcastFormats(); + } + } + + public function get active():Boolean + { + return mActive; + } + + private function onSelectionUpdate(e:SelectionUpdateEvent):void + { + if (mActive) + { + reset(); + for (var id:String in e.format) + { + if (e.format[id].length == 1) + properties[id] = e.format[id][0]; + else + properties[id] = e.format[id]; + } + rebuildUI(); + } + } + + private function onFormatValueChanged(e:PropertyChangeEvent):void + { + TextInspectorController.Instance().SetTextProperty(e.property as String, e.newValue); + } + + private var mActive:Boolean = false; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/LinkPropertyEditor.as ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/LinkPropertyEditor.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/LinkPropertyEditor.as new file mode 100644 index 0000000..33bb311 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/LinkPropertyEditor.as @@ -0,0 +1,50 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// + +package flashx.textLayout.ui.inspectors +{ + public class LinkPropertyEditor extends DynamicTextPropertyEditor + { + public function LinkPropertyEditor() + { + var recipe:XML = + <recipe> + <row> + <editor type="string" label="$$$/stage/TextEditing/Label/linkURL=URL:" width="150"> + <property name={TextInspectorController.LINK_URL_UIPROP}/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/linkTarget=Target:"> + <property name={TextInspectorController.LINK_TARGET_UIPROP}/> + <choice display="_blank" value={"_blank"}/> + <choice display="_self" value={"_self"}/> + <choice display="_parent" value={"_parent"}/> + <choice display="_top" value={"_top"}/> + </editor> + <editor type="checkbox" label="$$$/stage/TextEditing/Label/linkExtend=Extend:"> + <property name={TextInspectorController.LINK_EXTEND_UIPROP}/> + </editor> + </row> + </recipe>; + super(recipe); + } + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/ParagraphPropertyEditor.as ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/ParagraphPropertyEditor.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/ParagraphPropertyEditor.as new file mode 100644 index 0000000..4b8a8cc --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/ParagraphPropertyEditor.as @@ -0,0 +1,226 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// + +package flashx.textLayout.ui.inspectors +{ + import flash.text.engine.*; + + import flashx.textLayout.formats.Direction; + import flashx.textLayout.formats.FormatValue; + import flashx.textLayout.formats.TextJustify; + import flashx.textLayout.formats.TextLayoutFormat; + import flashx.textLayout.tlf_internal; + import flashx.textLayout.formats.LeadingModel; + use namespace tlf_internal; + + public class ParagraphPropertyEditor extends DynamicTextPropertyEditor + { + [Embed(source="./assets/align_start_icon.png")] + private var alignStartIcon:Class; + + [Embed(source="./assets/align_end_icon.png")] + private var alignEndIcon:Class; + + [Embed(source="./assets/align_left_icon.png")] + private var alignLeftIcon:Class; + + [Embed(source="./assets/align_center_icon.png")] + private var alignCenterIcon:Class; + + [Embed(source="./assets/align_right_icon.png")] + private var alignRightIcon:Class; + + [Embed(source="./assets/align_justify_icon.png")] + private var alignJustifyIcon:Class; + + [Embed(source="./assets/align_last_left_icon.png")] + private var alignLastLeftIcon:Class; + + [Embed(source="./assets/align_last_center_icon.png")] + private var alignLastCenterIcon:Class; + + [Embed(source="./assets/align_last_right_icon.png")] + private var alignLastRightIcon:Class; + + public function ParagraphPropertyEditor() + { + var recipe:XML = + <recipe> + <row> + <editor type="multiIconButton" style="iconButtonGroup" label="$$$/stage/TextEditing/Label/Alignment=Alignment:"> + <property name={TextInspectorController.TEXT_ALIGN_UIPROP}/> + <button icon="alignStartIcon" value="start"/> + <button icon="alignEndIcon" value="end"/> + <button icon="alignLeftIcon" value="left"/> + <button icon="alignCenterIcon" value="center"/> + <button icon="alignRightIcon" value="right"/> + <button icon="alignJustifyIcon" value="justify"/> + </editor> + </row> + <row> + <editor type="multiIconButton" style="iconButtonGroup" label="$$$/stage/TextEditing/Label/LastLine=Last Line:"> + <property name={TextInspectorController.TEXT_ALIGN_LAST_UIPROP}/> + <button icon="alignStartIcon" value="start"/> + <button icon="alignEndIcon" value="end"/> + <button icon="alignLastLeftIcon" value="left"/> + <button icon="alignLastCenterIcon" value="center"/> + <button icon="alignLastRightIcon" value="right"/> + <button icon="alignJustifyIcon" value="justify"/> + </editor> + </row> + <row> + <editor type="hotnumber" label="$$$/stage/TextEditing/Label/Indent=Text Indent:" decimals="1" enforcePrecision="no"> + <property name={TextInspectorController.TEXT_INDENT_UIPROP} + minValue={TextLayoutFormat.textIndentProperty.minValue} + maxValue={TextLayoutFormat.textIndentProperty.maxValue}/> + </editor> + </row> + <row> + <editor type="hotnumber" label="$$$/stage/TextEditing/Label/Left=Start Indent:" decimals="1" enforcePrecision="no"> + <property name={TextInspectorController.START_INDENT_UIPROP} + minValue={TextLayoutFormat.paragraphStartIndentProperty.minValue} + maxValue={TextLayoutFormat.paragraphStartIndentProperty.maxValue}/> + </editor> + <editor type="hotnumber" label="$$$/stage/TextEditing/Label/Right=End:" decimals="1" enforcePrecision="no"> + <property name={TextInspectorController.END_INDENT_UIPROP} + minValue={TextLayoutFormat.paragraphEndIndentProperty.minValue} + maxValue={TextLayoutFormat.paragraphEndIndentProperty.maxValue}/> + </editor> + </row> + <row> + <editor type="hotnumber" label="$$$/stage/TextEditing/Label/Before=Space Before:" decimals="1" enforcePrecision="no"> + <property name={TextInspectorController.SPACE_BEFORE_UIPROP} + minValue={TextLayoutFormat.paragraphSpaceBeforeProperty.minValue} + maxValue={TextLayoutFormat.paragraphSpaceBeforeProperty.maxValue}/> + </editor> + <editor type="hotnumber" label="$$$/stage/TextEditing/Label/After=After:" decimals="1" enforcePrecision="no"> + <property name={TextInspectorController.SPACE_AFTER_UIPROP} + minValue={TextLayoutFormat.paragraphSpaceAfterProperty.minValue} + maxValue={TextLayoutFormat.paragraphSpaceAfterProperty.maxValue}/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/justRule=Just. Rule:"> + <property name={TextInspectorController.JUSTIFICATION_RULE_UIPROP}/> + <choice display="Auto" value={FormatValue.AUTO}/> + <choice display="Roman" value={flashx.textLayout.formats.JustificationRule.SPACE}/> + <choice display="East Asian" value={flashx.textLayout.formats.JustificationRule.EAST_ASIAN}/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/textJust=Text Justify:"> + <property name={TextInspectorController.TEXT_JUSTIFY_UIPROP}/> + <choice display="Inter-word" value={flashx.textLayout.formats.TextJustify.INTER_WORD}/> + <choice display="Distribute" value={flashx.textLayout.formats.TextJustify.DISTRIBUTE}/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/justStyle=Just. Style:"> + <property name={TextInspectorController.JUSTIFICATION_STYLE_UIPROP}/> + <choice display="Auto" value={FormatValue.AUTO}/> + <choice display="Prioritize Least Adjustment" value={flash.text.engine.JustificationStyle.PRIORITIZE_LEAST_ADJUSTMENT}/> + <choice display="Push in Kinsoku" value={flash.text.engine.JustificationStyle.PUSH_IN_KINSOKU}/> + <choice display="Push out Only" value={flash.text.engine.JustificationStyle.PUSH_OUT_ONLY}/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/direction=Direction:"> + <property name={TextInspectorController.DIRECTION_UIPROP}/> + <choice display="Left to Right" value={flashx.textLayout.formats.Direction.LTR}/> + <choice display="Right to Left" value={flashx.textLayout.formats.Direction.RTL}/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/leadingModel=Leading Model:"> + <property name={TextInspectorController.LEADING_MODEL_UIPROP}/> + <choice display="Roman; Up" value={flashx.textLayout.formats.LeadingModel.ROMAN_UP}/> + <choice display="Ideographic Top; Up" value={flashx.textLayout.formats.LeadingModel.IDEOGRAPHIC_TOP_UP}/> + <choice display="Ideographic Center; Up" value={flashx.textLayout.formats.LeadingModel.IDEOGRAPHIC_CENTER_UP}/> + <choice display="Ideographic Top; Down" value={flashx.textLayout.formats.LeadingModel.IDEOGRAPHIC_TOP_DOWN}/> + <choice display="Ideographic Center; Down" value={flashx.textLayout.formats.LeadingModel.IDEOGRAPHIC_CENTER_DOWN}/> + <choice display="Ascent-Descent; Up" value={flashx.textLayout.formats.LeadingModel.ASCENT_DESCENT_UP}/> + <choice display="Approximate TextField" value={flashx.textLayout.formats.LeadingModel.APPROXIMATE_TEXT_FIELD}/> + <choice display="Auto" value={flashx.textLayout.formats.LeadingModel.AUTO}/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/Lacale=Locale:"> + <property name={TextInspectorController.PARA_LOCALE_UIPROP}/> + <choice display="Arabic" value="ar"/>, + <choice display="Bengali" value="bn"/>, + <choice display="Bulgarian" value="bg"/>, + <choice display="Catalan" value="ca"/>, + <choice display="Chinese, Simplified (China)" value="zh-CN"/>, + <choice display="Chinese, Traditional (Taiwan)" value="zh-TW"/>, + <choice display="Croatian" value="hr"/>, + <choice display="Czech" value="cs"/>, + <choice display="Danish" value="da"/>, + <choice display="Dutch" value="nl"/>, + <choice display="English" value="en"/>, + <choice display="Estonian" value="et"/>, + <choice display="Finnish" value="fi"/>, + <choice display="French" value="fr"/>, + <choice display="German" value="de"/>, + <choice display="Greek" value="el"/>, + <choice display="Gujarati" value="gu"/>, + <choice display="Hindi" value="hi"/>, + <choice display="Hebrew" value="he"/>, + <choice display="Hungarian" value="hu"/>, + <choice display="Italian" value="it"/>, + <choice display="Japanese" value="ja"/>, + <choice display="Korean" value="ko"/>, + <choice display="Latvian" value="lv"/>, + <choice display="Lithuanian" value="lt"/>, + <choice display="Marathi" value="mr"/>, + <choice display="Norwegian" value="no"/>, + <choice display="Persian" value="fa"/>, + <choice display="Polish" value="pl"/>, + <choice display="Portuguese" value="pt"/>, + <choice display="Punjabi" value="pa"/>, + <choice display="Romanian" value="ro"/>, + <choice display="Russian" value="ru"/>, + <choice display="Slovak" value="sk"/>, + <choice display="Slovenian" value="sl"/>, + <choice display="Spanish" value="es"/>, + <choice display="Swedish" value="sv"/>, + <choice display="Tamil" value="ta"/>, + <choice display="Telugu" value="te"/>, + <choice display="Thai" value="th"/>, + <choice display="Turkish" value="tr"/>, + <choice display="Ukrainian" value="uk"/>, + <choice display="Urdu" value="ur"/>, + <choice display="Vietnamese" value="vi"/> + </editor> + </row> + </recipe>; + + super(recipe); + + SetIcon("alignStartIcon", alignStartIcon); + SetIcon("alignEndIcon", alignEndIcon); + SetIcon("alignLeftIcon", alignLeftIcon); + SetIcon("alignCenterIcon", alignCenterIcon); + SetIcon("alignRightIcon", alignRightIcon); + SetIcon("alignJustifyIcon", alignJustifyIcon); + SetIcon("alignLastLeftIcon", alignLastLeftIcon); + SetIcon("alignLastCenterIcon", alignLastCenterIcon); + SetIcon("alignLastRightIcon", alignLastRightIcon); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/SelectionUpdateEvent.as ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/SelectionUpdateEvent.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/SelectionUpdateEvent.as new file mode 100644 index 0000000..f8bde2f --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/SelectionUpdateEvent.as @@ -0,0 +1,41 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// + +package flashx.textLayout.ui.inspectors +{ + import flash.events.Event; + + public class SelectionUpdateEvent extends Event + { + public static const SELECTION_UPDATE:String = "selectionUpdate"; + + public function SelectionUpdateEvent(inFormat:Object) + { + super(SELECTION_UPDATE); + mFormat = inFormat; + } + + public function get format():Object + { + return mFormat; + } + + private var mFormat:Object; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TabPropertyEditor.as ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TabPropertyEditor.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TabPropertyEditor.as new file mode 100644 index 0000000..4118857 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TabPropertyEditor.as @@ -0,0 +1,64 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// + +package flashx.textLayout.ui.inspectors +{ + import bxf.ui.inspectors.DynamicPropertyEditorBase; + + import flash.text.engine.*; + + import flashx.textLayout.formats.TabStopFormat; + import flashx.textLayout.tlf_internal; + use namespace tlf_internal; + + public class TabPropertyEditor extends DynamicPropertyEditorBase + { + public function TabPropertyEditor() + { + var recipe:XML = + <recipe> + <row> + <editor type="checkbox" label="$$$/stage/TextEditing/Label/showRuler=Show Ruler" labelSide="right"> + <property name="rulervisible"/> + </editor> + <editor type="hotnumber" label="$$$/stage/TextEditing/Label/tabPosition=Position:" decimals="1" enforcePrecision="no"> + <property name={TabStopFormat.positionProperty.name} + minValue={TabStopFormat.positionProperty.minValue} + maxValue={TabStopFormat.positionProperty.maxValue}/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/tabType=Tab Type:"> + <property name={TabStopFormat.alignmentProperty.name}/> + <choice display="Start" value={flash.text.engine.TabAlignment.START}/> + <choice display="Center" value={flash.text.engine.TabAlignment.CENTER}/> + <choice display="End" value={flash.text.engine.TabAlignment.END}/> + <choice display="Align" value={flash.text.engine.TabAlignment.DECIMAL}/> + </editor> + <editor type="string" label="$$$/stage/TextEditing/Label/tabAlign=Align to:" width="50"> + <property name={TabStopFormat.decimalAlignmentTokenProperty.name}/> + </editor> + </row> + </recipe>; + + super(recipe); + } + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TextContainerPropertyEditor.as ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TextContainerPropertyEditor.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TextContainerPropertyEditor.as new file mode 100644 index 0000000..36d62f8 --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TextContainerPropertyEditor.as @@ -0,0 +1,151 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// + +package flashx.textLayout.ui.inspectors +{ + import flash.text.engine.*; + + import flashx.textLayout.formats.FormatValue; + import flashx.textLayout.formats.TextLayoutFormat; + import flashx.textLayout.tlf_internal; + use namespace tlf_internal; + + public class TextContainerPropertyEditor extends DynamicTextPropertyEditor + { + [Embed(source="./assets/cont_align_top_icon.png")] + private var contAlignTopIcon:Class; + + [Embed(source="./assets/cont_align_middle_icon.png")] + private var contAlignMiddleIcon:Class; + + [Embed(source="./assets/cont_align_bottom_icon.png")] + private var contAlignBottomIcon:Class; + + [Embed(source="./assets/cont_align_justify_icon.png")] + private var contAlignJustifyIcon:Class; + + public function TextContainerPropertyEditor() + { + var recipe:XML = + <recipe> + <row> + <editor type="multiIconButton" style="iconButtonGroup" label="$$$/stage/TextEditing/Label/Container/Alignment=Alignment:"> + <property name={TextInspectorController.VERTICAL_ALIGN_UIPROP}/> + <button icon="contAlignTopIcon" value="top"/> + <button icon="contAlignMiddleIcon" value="middle"/> + <button icon="contAlignBottomIcon" value="bottom"/> + <button icon="contAlignJustifyIcon" value="justify"/> + </editor> + </row> + <row> + <editor type="hotnumberunit" label="$$$/stage/TextEditing/Label/NumColumns=Columns:"> + <property name={TextInspectorController.COLUMN_COUNT_UIPROP}/> + <defaultunit>count</defaultunit> + <numericunit displayname="count" + min={TextLayoutFormat.columnCountProperty.minValue} + max={TextLayoutFormat.columnCountProperty.maxValue} + default="1"/> + <enumval displayname="Auto" value={flashx.textLayout.formats.FormatValue.AUTO}/> + </editor> + </row> + <row> + <editor type="hotnumberunit" label="$$$/stage/TextEditing/Label/ColumnWidth=Column Width:"> + <property name={TextInspectorController.COLUMN_WIDTH_UIPROP}/> + <defaultunit>pix</defaultunit> + <numericunit displayname="pix" + min={TextLayoutFormat.columnWidthProperty.minValue} + max={TextLayoutFormat.columnWidthProperty.maxValue} + default="200"/> + <enumval displayname="Auto" value={flashx.textLayout.formats.FormatValue.AUTO}/> + </editor> + <editor type="hotnumber" label="$$$/stage/TextEditing/Label/ColumnGap=Gap:" decimals="1" enforcePrecision="no"> + <property name={TextInspectorController.COLUMN_GAP_UIPROP} + minValue={TextLayoutFormat.columnGapProperty.minValue} + maxValue={TextLayoutFormat.columnGapProperty.maxValue}/> + </editor> + </row> + <row label="$$$/stage/TextEditing/Label/ContainerGeometry=Geometry:"/> + <row> + <editor type="hotnumber" label="$$$/stage/TextEditing/Label/PaddingLeft=Left:" decimals="1" enforcePrecision="no"> + <property name={TextInspectorController.PADDING_LEFT_UIPROP} + minValue={TextLayoutFormat.paddingLeftProperty.minValue} + maxValue={TextLayoutFormat.paddingLeftProperty.maxValue}/> + </editor> + <editor type="hotnumber" label="$$$/stage/TextEditing/Label/PaddingTop=Top:" decimals="1" enforcePrecision="no"> + <property name={TextInspectorController.PADDING_TOP_UIPROP} + minValue={TextLayoutFormat.paddingTopProperty.minValue} + maxValue={TextLayoutFormat.paddingTopProperty.maxValue}/> + </editor> + </row> + <row> + <editor type="hotnumber" label="$$$/stage/TextEditing/Label/PaddingRight=Right:" decimals="1" enforcePrecision="no"> + <property name={TextInspectorController.PADDING_RIGHT_UIPROP} + minValue={TextLayoutFormat.paddingRightProperty.minValue} + maxValue={TextLayoutFormat.paddingRightProperty.maxValue}/> + </editor> + <editor type="hotnumber" label="$$$/stage/TextEditing/Label/PaddingBottom=Bottom:" decimals="1" enforcePrecision="no"> + <property name={TextInspectorController.PADDING_BOTTOM_UIPROP} + minValue={TextLayoutFormat.paddingBottomProperty.minValue} + maxValue={TextLayoutFormat.paddingBottomProperty.maxValue}/> + </editor> + </row> + <row> + <editor type="hotnumberunit" label="$$$/stage/TextEditing/Label/FirstBaseline=First Line Offset:"> + <property name={TextInspectorController.FIRST_BASELINE_UIPROP}/> + <defaultunit>pix</defaultunit> + <numericunit displayname="pix" + min={TextLayoutFormat.firstBaselineOffsetProperty.minValue} + max={TextLayoutFormat.firstBaselineOffsetProperty.maxValue} + default="1"/> + <enumval displayname="Auto" value={flashx.textLayout.formats.BaselineOffset.AUTO}/> + <enumval displayname="Ascent" value={flashx.textLayout.formats.BaselineOffset.ASCENT}/> + <enumval displayname="Line Height" value={flashx.textLayout.formats.BaselineOffset.LINE_HEIGHT}/> + </editor> + </row> + <!-- <row label="$$$/stage/TextEditing/Label/Border=Border:"> + <editor type="combo" label="$$$/stage/TextEditing/Label/BorderStyle=Style:"> + <property name={TextInspectorController.BORDER_STYLE_UIPROP}/> + <choice display="None" value={text.BorderStyle.NONE}/> + <choice display="Solid" value={text.BorderStyle.SOLID}/> + <choice display="Innie" value={text.BorderStyle.INSET}/> + <choice display="Outie" value={text.BorderStyle.OUTSET}/> + </editor> + </row> + <row> + <editor type="hotnumber" label="$$$/stage/TextEditing/Label/BorderThickness=Thickness:" decimals="0" enforcePrecision="yes"> + <property name={TextInspectorController.BORDER_THICKNESS_UIPROP} + minValue={TextLayoutFormat.borderThicknessProperty.minValue} + maxValue={TextLayoutFormat.borderThicknessProperty.maxValue}/> + </editor> + <editor type="color" label="$$$/stage/TextEditing/Label/BorderColor=Color:"> + <property name={TextInspectorController.BORDER_COLOR_UIPROP}/> + </editor> + </row> --> + </recipe>; + + super(recipe); + + SetIcon("contAlignTopIcon", contAlignTopIcon); + SetIcon("contAlignMiddleIcon", contAlignMiddleIcon); + SetIcon("contAlignBottomIcon", contAlignBottomIcon); + SetIcon("contAlignJustifyIcon", contAlignJustifyIcon); + } + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TextFlowPropertyEditor.as ---------------------------------------------------------------------- diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TextFlowPropertyEditor.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TextFlowPropertyEditor.as new file mode 100644 index 0000000..9b9530a --- /dev/null +++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TextFlowPropertyEditor.as @@ -0,0 +1,71 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// + +package flashx.textLayout.ui.inspectors +{ + import flashx.textLayout.formats.BlockProgression; + import flashx.textLayout.formats.LineBreak; + + public class TextFlowPropertyEditor extends DynamicTextPropertyEditor + { + public function TextFlowPropertyEditor() + { + var recipe:XML = + <recipe> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/LineProgression=Orientation:"> + <property name={TextInspectorController.BLOCK_PROGRESSION_UIPROP}/> + <choice display="Horizontal" value={flashx.textLayout.formats.BlockProgression.TB}/> + <choice display="Vertical" value={flashx.textLayout.formats.BlockProgression.RL}/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/direction=Direction:"> + <property name={TextInspectorController.FLOW_DIRECTION_UIPROP}/> + <choice display="Left to Right" value={flashx.textLayout.formats.Direction.LTR}/> + <choice display="Right to Left" value={flashx.textLayout.formats.Direction.RTL}/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/Linebreak=Line Breaks:"> + <property name={TextInspectorController.LINE_BREAK_UIPROP}/> + <choice display="Auto Line Wrap" value={flashx.textLayout.formats.LineBreak.TO_FIT}/> + <choice display="Hard Breaks Only" value={flashx.textLayout.formats.LineBreak.EXPLICIT}/> + </editor> + </row> + <row> + <editor type="combo" label="$$$/stage/TextEditing/Label/vertScroll=V. Scroll:"> + <property name={TextInspectorController.VERTICAL_SCROLL_UIPROP}/> + <choice display="Off" value="off"/> + <choice display="On" value="on"/> + <choice display="Auto" value="auto"/> + </editor> + <editor type="combo" label="$$$/stage/TextEditing/Label/horzScroll=H. Scroll:"> + <property name={TextInspectorController.HORIZONTAL_SCROLL_UIPROP}/> + <choice display="Off" value="off"/> + <choice display="On" value="on"/> + <choice display="Auto" value="auto"/> + </editor> + </row> + </recipe>; + super(recipe); + } + + } +} \ No newline at end of file