blob: 7783762e35fea1a40c6a0a7e1a8cb25cf791a716 [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--
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.
-->
<mx:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark"
width="800" height="600"
creationComplete="flash.text.TextRenderer.displayMode=flash.text.TextDisplayMode.CRT">
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
@font-face{
src: url("../../../../../Assets/Fonts/PT_Serif/PT_Serif-Web-Regular.ttf");
fontFamily: ArialEmbedded;
embedAsCFF: true;
}
@font-face{
src: url("../../../../../Assets/Fonts/PT_Serif/PT_Serif-Web-Bold.ttf");
fontWeight: bold;
fontFamily: ArialEmbedded;
embedAsCFF: true;
}
@font-face{
src: url("../../../../../Assets/Fonts/PT_Serif/PT_Serif-Web-Italic.ttf");
fontStyle: italic;
fontFamily: ArialEmbedded;
embedAsCFF: true;
}
@font-face{
src: url("../../../../../Assets/Fonts/Open_Sans/OpenSans-Regular.ttf");
fontFamily: veraEmbedded;
embedAsCFF: false;
}
@font-face{
src: url("../../../../../Assets/Fonts/Open_Sans/OpenSans-Bold.ttf");
fontWeight: bold;
fontFamily: veraEmbedded;
embedAsCFF: false;
}
@font-face{
src: url("../../../../../Assets/Fonts/Open_Sans/OpenSans-Italic.ttf");
fontStyle: italic;
fontFamily: veraEmbedded;
embedAsCFF: false;
}
@font-face {
src: url("../../../../../Assets/Fonts/Lobster_Two/LobsterTwo-Regular.ttf");
fontFamily: ArnoEmbedded;
embedAsCFF: true;
}
mx|Panel {
fontAntiAliasType: "normal";
fontFamily: veraEmbedded;
fontLookup: "embeddedCFF";
headerHeight:36;
}
mx|TitleWindow {
fontAntiAliasType: "normal";
fontFamily: veraEmbedded;
fontLookup: "embeddedCFF";
headerHeight:36;
}
mx|Label {
fontAntiAliasType: "normal";
fontFamily: veraEmbedded;
fontLookup: "embeddedCFF";
}
s|Label {
fontAntiAliasType: "normal";
fontFamily: ArialEmbedded;
fontLookup: "embeddedCFF";
}
s|RichText {
fontAntiAliasType: "normal";
fontFamily: ArialEmbedded;
fontLookup: "embeddedCFF";
}
.paddedBox {
paddingLeft: 20;
paddingRight: 20;
paddingTop: 20;
paddingBottom: 20;
backgroundColor: #CCCCCC;
backgroundAlpha: 1.0;
}
</fx:Style>
<fx:Script>
<![CDATA[
import spark.components.Label;
import mx.core.Container;
import mx.events.FlexEvent;
import mx.managers.PopUpManager;
import comps.TestTitleWindow;
import mx.core.IFlexDisplayObject;
public var richTextAtRuntime:spark.components.RichText;
[Bindable]
public var labelStr:String="Retail sales jumped in August, spurred by widespread gains beyond the increases of autos and gasoline that economists expected";
public var thePopUp:IFlexDisplayObject;
public function addNewRichText(container:Container,content:String):void
{
richTextAtRuntime=new spark.components.RichText();
richTextAtRuntime.text=content;
var num:Number=container.numElements;
container.addElementAt(richTextAtRuntime,num);
}
public function removeRichText():void
{
var parent:DisplayObjectContainer;
if (richTextAtRuntime!=null)
{
parent=richTextAtRuntime.parent;
trace("###parent="+parent);
if (parent!=null)
{
parent.addEventListener("remove",removeChildListener);
parent.removeChild(richTextAtRuntime);
}else
richTextAtRuntime=null;
}
dispatchEvent(new FlexEvent("richTextReset"));
}
public function removeChildListener(evt:FlexEvent):void
{
if (evt.currentTarget==richTextAtRuntime)
{
richTextAtRuntime=null;
dispatchEvent(new FlexEvent("richTextReset"));
}
}
public function showPopUp():IFlexDisplayObject{
if (thePopUp==null)
{
thePopUp = PopUpManager.createPopUp(this, TestTitleWindow);
}
return thePopUp;
}
public function hidePopUp():void{
if(thePopUp != null)
{
PopUpManager.removePopUp(thePopUp);
thePopUp=null;
}
}
public function resetTextValue():void{
myRichText0.text="this is a richText in mx application";
myRichText1.text="this is a richText in HBox";
myRichText2.text=labelStr;
myRichText3.text="richText in Form";
myRichText5.text="inside of controlBar";
}
]]>
</fx:Script>
<s:RichText id="myRichText0" text="this is a richText in mx application"/>
<mx:HBox id="myHBox" height="150" width="300">
<s:RichText id="myRichText1" text="this is a richText in HBox" rotation="45"/>
</mx:HBox>
<mx:Panel id="myPanel" height="150" width="300">
<s:RichText id="myRichText2" text="{labelStr}"/>
</mx:Panel>
<mx:Form id="myForm" height="150" width="300">
<mx:FormItem label="Available">
<s:Button />
</mx:FormItem>
<mx:FormItem label="Comments">
<s:RichText id="myRichText3" text="richText in Form" />
</mx:FormItem>
</mx:Form>
<mx:ControlBar id="myControlBar" height="150" width="300">
<mx:Label id="haloLabel2" text="I am a halo label" />
<s:RichText id="myRichText5" text="inside of controlBar" />
</mx:ControlBar>
</mx:Application>