TextAlign on TextFlow with contentWidth >; compositionWidth
Hello
I encounter problem behaviour. Any subject a TextFlow text aligns to the right (textAlign = 'right', textAlign = 'end' & direction = "ltr" or textAlign = 'start' & direction = "rtl") and the TextFlow, ContainerController compositionWidth is smaller that the contentWidth, the text is positioned outside of the scrollable range.
In other words, with a textAlign = right, the text will move to the point more to the right of the the ContainerController compositionWidth and continue on the right, but the scrolling view extends to the left (this can be shown by selecting the text visible through the mouse, and then dragging the mouse to the right).
Below a test application to demonstrate this problem, which is a modification of the sample application of Mihai Corlan is located here:
http://corlan.org/2009/02/12/how-to-add-a-ScrollBar-to-text-layout-framework/
I have not tested this on the latest versions of the weekly (only build 360 and the couple the next). This happens in the Gumbo, Flex 3.2 and 3.3 Flex.
<? XML version = "1.0" encoding = "utf-8"? >
" < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "layout ="vertical"horizontalAlign ="left"creationComplete =" init () "> "
< mx:Script >
<! [CDATA]
Import flashx.textLayout.formats.LineBreak;
import flash.events.Event;
Import mx.events.MoveEvent;
Import flashx.textLayout.container.IContainerController;
Import flashx.textLayout.events.CompositionCompletionEvent;
Import flashx.textLayout.edit.UndoManager;
Import flashx.textLayout.edit.EditManager;
Import flashx.textLayout.events.StatusChangeEvent;
Import flashx.textLayout.container.DisplayObjectContainerController;
Import flashx.textLayout.conversion.TextFilter;
Import flashx.textLayout.elements.TextFlow;
[Bindable]
protected var tfTextAlignStr:String = "undefined";
[Bindable]
public static var public _imgClass: Class;
private var _textContainer:Sprite = null;
protected var _textFlowStr:String = "Bacon is a cut of meat from the sides, belly, or back of +.
"a pig, then dry, smoked, or both. Meat from other animals, ' + '.
"such as beef, lamb, chicken, goat or Turkey, may also be cut off," +
"cured, or otherwise prepared resemble bacon." Bacon can be ' + '.
"eaten fried, baked, or grilled, or used as a minor ingredient +.
"to flavor dishes. Bacon is also used for the Bard and fat ' + '.
"roasts, especially game birds. The word is derived from the «+»
"" 'Old high German bacho, meaning \"buttock\', \"ham\ ', or \"side of" +.
"bacon,------" and cognate with Bacon of old French. [1] " +
'' The USDA defines bacon as the hardened belly of a swine carcass\ \"the; " +
"the other pieces so the characteristics must be separately qualified +.
'(e.g., pork \"smoked along bacon\')... If bacon is USDA certified, ' + '.
"then she has been treated for trichinella, [2] a parasite"+ ".
"the roundworm that can be destroyed by heating, freezing, drying, +.
"or smoking. [3] " +
"In continental Europe, this part of the pig is usually not +.
"smoked like bacon is in America; It is used primarily in cubes ' + '.
"(bacon) as a cooking ingredient, a value both as a source of"+ ".
"fat and for its flavor. In Italy, this is called pancetta and ' + '.
"are usually cooked in small cubes or served raw and finely"+ ".
'sliced as part of an antipasto.';
private var _textFlow:TextFlow;
private var _controller:IContainerController;
private function init (): void
{
_textContainer = new Sprite();
canvas.rawChildren.addChild (_textContainer);
_controller = new DisplayObjectContainerController (_textContainer, canvas.width, canvas.height);
_textFlow = TextFilter.importToFlow (_textFlowStr, TextFilter.PLAIN_TEXT_FORMAT);
_textFlow.lineBreak = LineBreak.EXPLICIT;
_textFlow.flowComposer.addController (_controller);
_textFlow.addEventListener (CompositionCompletionEvent.COMPOSITION_COMPLETE, composeListener);
_textFlow.addEventListener (Event.SCROLL, scrollTextFlow);
adding features to Select/Edit/Copy/Paste/Undo
_textFlow.interactionManager = new EditManager (new UndoManager());
initialize from a selection before the first character
_textFlow.interactionManager.setSelection (0,0);
_textFlow.flowComposer.updateAllContainers ();
tfTextAlignStr = _textFlow.getStyle ("textAlign");
}
/**
* the composition of the text was finished;
* now I see if I have my text overflow the container
*/
private void composeListener(event:CompositionCompletionEvent):void
{
var textWidth:int = Math.ceil (_controller.contentWidth);
var textHeight:int = Math.ceil (_controller.contentHeight);
If (textWidth < _controller.compositionWidth)
{
Scroll.Enabled = false;
}
on the other
{
Scroll.enabled = true;
scroll.minScrollPosition = 0;
textWidth = scroll.maxScrollPosition - _controller.compositionWidth;
}
}
/**
* listener for the scroll bar scroll event
*/
private void scrollListener(event:Event):void
{
_textFlow.removeEventListener (Event.SCROLL, scrollTextFlow);
_controller.horizontalScrollPosition = scroll.scrollPosition;
_textFlow.addEventListener (Event.SCROLL, scrollTextFlow);
}
/**
* listener for the scroll of the text flow container event
*/
private void scrollTextFlow(event:Event):void
{
scroll.removeEventListener (Event.SCROLL, scrollListener);
scroll.scrollPosition = Math.ceil (_controller.horizontalScrollPosition);
scroll.addEventListener (Event.SCROLL, scrollListener);
}
private function toggleTFTextAlign (): void
{
tfTextAlignStr = tfTextAlignStr == 'right '? "the left": "right";
_textFlow.SetStyle ("TextAlign", tfTextAlignStr);
tfTextAlignStr = _textFlow.getStyle ("textAlign");
_textFlow.flowComposer.updateAllContainers ();
}
[]] >
< / mx:Script >
< mx:VBox = "20" x y = "20" >
< mx:Canvas id = "canvas" width = "200" height = "24" backgroundColor = "#ffffff" / >
< mx:HScrollBar id = "scroll" width = "200" scroll = "scrollListener (event)" / >
< / mx:VBox >
< mx:HBox >
< mx:Button id = "taBtn1" label = "{tfTextAlignStr}" click = "toggleTFTextAlign ()" / >
< / mx:HBox >
< / mx:Application >
It's something I'll have to examine more in detail on when I'm back, I think it has been fixed in recent versions (we fixed issues than its similar). You might try this again with the latest Gumbo.
Tags: Adobe Open Source
Similar Questions
-
How to convert an xml to a string for a textflow
Hello
usually I use string type fields to feed the textFlows.
now for comfort Visual, I want to store in the file in XML format and the thing was successful, but when I want to use them I have problems, because the XML formatting creates line spacing that I don't want.
for example:
" < TextFlow columnCount ="inherit"columnGap ="inherit"columnWidth ="inherit"lineBreak ="toFit"paddingBottom ="4"paddingLeft ="4"paddingRight, paddingTop ="4"="4"paragraphSpaceAfter = '15' paragraphSpaceBefore ="0"verticalAlign ="top"id ="flow"whiteSpaceCollapse ="preserve"xmlns =" http://ns.Adobe.com/TextLayout/2008 ">
< linkActiveFormat >
< TextLayoutFormat color = "#cc00cc" fontWeight = "bold" = "underline" textDecoration / >
< / linkActiveFormat >
< linkHoverFormat >
< TextLayoutFormat color = "#cc0000" fontWeight = "bold" = "underline" textDecoration / >
< / linkHoverFormat >
< linkNormalFormat >
< TextLayoutFormat color = "#000099" fontWeight = "bold" = 'none' textDecoration / >
< / linkNormalFormat >
< p color = "#990099" fontSize = "15" >
< span > Gestione dei con translations TLF e Testo classico </span >
< /p >
< p color = "#666555" fontFamily = "Arial" fontSize = "14" >
< span > Novità introdotte con Ultima version di Flash CS5 sono molteplici, una di queste novita if i campi di testo. </span >
< /p >
< p color = "#990099" fontSize = "15" >
c < span > Cosa'e da sapere sul Text Layout Framework (TLF)? </span >
< img id = "1 |" emot | 0"height ="18"width = source"18"="[object Bitmap]"/ >
< span > < / span >
< /p >
< p color = "#666555" fontFamily = "Arial" fontSize = "14" >
Che respect al Testo Classico, </span > < span >
< /p >
< / TextFlow >
perform:
init--------------------------------------------------------------
Gestione dei con translations TLF e Testo classico
Novità introdotte con Ultima version di Flash CS5 sono molteplici, una di queste novita if i campi di testo.
C cosa'e da sapere sul Text Layout Framework (TLF)?
Che respect al Testo Classico,
--------------------------------------------------------------------- end
Instead of:
init--------------------------------------------------------------
Gestione dei con translations TLF e Testo classicoNovità introdotte con Ultima version di Flash CS5 sono molteplici, una di queste novita if i campi di testo.C cosa'e da sapere sul Text Layout Framework (TLF)?Che respect al Testo Classico,--------------------------------------------------------------------- end
like I want to.Now I see that with spark.utils I can use importFromXML to convert to a textFlow with collapse of the line in excess, but unfortunately the spark of class is not visible in Flash/as3.Can you help me?Thanks in advanceJean-Paulconfig = new Configuration();
format = new TextLayoutFormat (config.textFlowInitialFormat);
format.whiteSpaceCollapse = "collapse."
config.textFlowInitialFormat = format;
collapsingTextLayoutImporter = TextConverter.getImporter)
TextConverter.TEXT_LAYOUT_FORMAT, config);Flex SDK is opensource. Scrap of code above comes from spark.utils.TextFlowUtil.
-
I have a custom editor built in flash that I want to convert it to Text Layout Framework.
I have all content in containers, but when I do an export in XML format, I want to know what content is displayed in this container.
I tried to do it through al the textlines in the textflow. I can get all the textline objects, but cannot get the content and formatting information.
Could someone give me a hint on how to do this? Already, I'd be happy if I could make a separate export for each container.
Thanks for your response!
Arend.
You have a TLF TextFlow with several containers of connected, and you want to export each container as an independent TextFlow? If so, I suggest copying the text in each container in a separate TextFlow and then export the TextFlow resulting. You can browse the containers in the IFlowComposer and for each container, create a new TextFlow by calling deepCopy on it. I expect that the code could look like this:
var pos:int = 0;
for (var i: int = 0; i< textflow.flowcomposer.numcontrollers;="">
{
var controller: ContainerController = textFlow.flowComposer.getControllerAtIndex (i);
var newTextFlow:TextFlow = textFlow.deepCopy (pos, pos + controller.textLength);
var exportedXML:XML is TextFilter.export (newTextFlow, TextFilter.TEXT_LAYOUT_FORMAT, ConversionType.XML_TYPE);.
POS += controller.textLength;
}
This is coded memory and I have not compiled or tested, but it should give you an idea how to do it. If I misunderstood your question, please let me know.
-robin
-
Hello
I have an app where I would create a TextFlow with a title and body text such as:
Title of topic
Lorem ipsum dolor sit amet, adipiscing elit computer. CRAs posuere posuere sem...
And I would like the body of the text in multiple columns. I created a unique TextFlow in a single text box and added the columnWidth and columnGap settings to a div containing the body of the text, but I only have one column for the body of the text. If I set the columnWidth and columnGap on the entire TextFlow, I get several columns, but I don't want the title text in a single column. I can create two text box controls in a VGroup and only set the column of the control for the body, but it seems that it should be unnecessary.
-Brian
<? XML version = "1.0" encoding = "utf-8"? >
< name s:Application = "RichEditableTextExample".
' xmlns:fx = ' http://ns.Adobe.com/MXML/2009 "
xmlns:s = "library://ns.adobe.com/flex/spark".
xmlns:MX = "library://ns.adobe.com/flex/mx" >
< s:Panel title = "TextArea TLF"
Width = "90%" height = "90%".
horizontalCenter = red '0' = '0' >
< s:TextArea id = "ta1" textAlign = "left" width = "600" >
< s:textFlow >
< s:TextFlow >
< s textAlign = "center" > < s:span fontWeight = "bold" > text field < / s:span > < / s >
< s:div columnWidth = "100" columnGap = "10" >
< s > Lorem ipsum dolor sit amet, adipiscing elit computer. CRAs posuere posuere sem, EU, orci quis congue mattis. Curabitur pulvinar tellus venenatis ipsum lobortis tempus. Vestibule, eros, bibendum at aliquet UT total. < / s >
< / s:div >
< / s:TextFlow >
< / s:textFlow >
< / s:TextArea >
< / s:Panel >
< / s:Application >bldrbldr wrote:
I can create two text box controls in a VGroup and only set the column of the control for the body, but it seems that it should be unnecessary.
It should be unnecessary, but right now that's the only way to get what you want. We do not yet allow elements riding on the columns, but this is a feature we want to add later.
-
Hello
Let's say I want to create a term align tab in position 200 as a tab stop, according to AS3 reference http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flashx/textLayout/eleme nts/FlowElement.html #tabStops, I have an attribute of tabStops = 'E200 '. However, when I tried setting up of this situation in the demo of text layout editor to http://labs.adobe.com/technologies/textlayout/demos/ and clicked markup, I get tabStops attribute = "align: end, position: 200 ' instead.
I tried to import a < TextFlow > with tabStops = "align: end, position: 200 ' < p >, and, even if I don't get an error, the tab does not appear to have created. If I try to set this value to a tabStop property to an instance of ParagraphElement, I get an error output. The "E200" format works in both cases.
Is the markup generated by the demo expired or not correct? Or is the tabStops = "align: end, position: 200" format used in certain situations?
Thanks for the info.
Will be
This demo is very obsolete. You can find a version to update on our SourceForge site:
http://sourceforge.NET/projects/tlf.Adobe/files/current/flow.swf/download
-
I got a TextFlow with an image in the first line (before the first character), and the picture is cut on top. I checked the
_controller.verticalScrollPosition and he's not under a specific number. The text is displayed correctly so I guess the size of the images is ignored and the top of the text is the position of scroll further down.
In the image as an attachment, you can see that the scroll bar shows that the position is greater than 0, but I can't scroll above.
Is this a bug or I do something wrong?
Thanks in advance
What a coincidence! I was watching this just bug today. It's a TLF bug, and a fix should be coming your way shortly.
-robin
-
Question No. 1: Is it possible to tell EditManager do something on the Enter key event and not move the text caret to the bottom line at the same time?
Question 2: Is it possible to say EditManager to limit user input to a certain amount of characters, something similar to maxChars of TextField?
Question 3: How to get the text represented by the TextFlow in XML format with extra spaces?
For example: I write ' Hello world ' and then select 'Hello' world and changes its color to blue. If I export text form the TextFlow as XML I get the following:
"< whiteSpaceCollapse flow: TextFlow ="preserve"xmlns:flow =" http://ns.adobe.com/textLayout/2008 "> "
< direction of flow: p = "rtl" marginLeft = marginRight '2' = '3' marginTop '5' = >
< flow: span color = '0 x 6699' > Hello < / flow: span >
World < flow: span > < / flow: span >
< / flow: p >
< / flow: TextFlow >
With no space before the word "world", as it should be (but at the same time, I see on my screen space is actually in the editing area between the words 'Hello' and 'world' after I changed the color).
I use after the export operation:
XML.ignoreWhitespace = false;
var textXML:XML = new XML (TextFilter.export (tf, TextFilter.TEXT_LAYOUT_FORMAT, ConversionType.XML_TYPE));
Where 'tf' is a variable that contains my TextFlow instance.
Here are a couple of quick pointers:
(1) see Configuration.manageEnterKey. You pass a Configuration object in when you create a new TextFlow. If the Configuration you spend (or the defaultConfiguration if you do not specify one) has manageEnterKey set to false, TLF will not handle the Enter key. You can then attach your own event listener and how you want to manage.
(2) Yes, but I think that you may need to get the latest version of TLF in the Gumbo release for this work. Basically, you will need to attach to the FlowOperationEnd event and remove obtained additional characters inserted or pasted. What you call in the handler EditManager FlowOperationEnd will be cancelled with the original operation as a single atomic transaction.
(3) this isn't a complete answer, but some tips of what to look for: when you convert an XML string, you must make sure that XML.prettyPrint is turned off, or it will insert extra white space. IgnoreWhiteSpace must also be set to false, because that will cause spaces to remove from start and end spans first check these two things.
I hope this helps!
-
Hello
I need help with a problem. I have a few groups of text. For example ("HELLO", 'HOW ARE YOU', 'FINE'). I need to see the them as if they were just a great text ("HELLO HOW ARE YOU FINE"), but anytime I need to know that one is selected, the modification, the new text, the format (it can be changed), etc.
I did it with a TextField using a separator tank (which makes invisible), but it did not work very well (and he also had problems with the images). So I decided to try this framework. My idea was to use a GroupElement for each text (such as DivElement). I have a textFlow with all text, but anytime I can see DivElement is selected.
However, this approach has a problem, I need to have:
-Groups that have more than one paragraph. (< div > < p > paragraph 1 < /p > < p > paragraph 2 < /p > < / div >) and
-Several groups into one paragraph (< p > < div > Group 1 < / div > < div > Group 2 < / div > < / p >)
A DivElement cannot be a child of an element ParagraphElement. In addition, if you use 2 DivElements, you get 2 paragraph (not what I need for the latter).
Is there a way to do this? Maybe extend a class?
Thank you very much
MartinI think what you want to do is make them each spans in a single paragraph. With the most recent TLF builds all FlowElements including support for SpanElement property ID give a unique id to every SpanElement, and they merge. Should work in markup as well.
-
Run-time error when you set the textFlow to a TextArea with specific size
Hi all
When you try to set the textFlow of a Textrea with a specific size (412 x 258) the flash player crashes due to a loop of 15 sec. Could you please help me on this?
Please find the code below:
<? 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/MX "minWidth =" 955 "minHeight =" 600 "
creationComplete = "init ()" "
>
< fx:Script >
<! [CDATA]
Import flashx.textLayout.conversion.TextConverter;
private " var tfText:String = ' < TextFlow columnCount ="inherit"columnGap ="inherit"columnWidth ="inherit"lineBreak ="inherit"paddingBottom ="inherit"paddingLeft ="inherit"paddingRight ="inherit"paddingTop ="inherit"verticalAlign ="inherit"whiteSpaceCollapse ="preserve"xmlns ="http://ns.adobe.com/textLayout/2008"> < p color ="#000000"direction ="ltr"fontFamily ="Arial"fontSize = '12' justificationRule = ="auto"justificationStyle = 'auto' kerning 'auto' leadingModel = 'auto' paragraphEndIndent = '0' paragraphSpaceAfter = '0' paragraphSpaceBefore = '0' paragraphStartIndent = '0' textAlign ="justify"textAlignLast ="DΘmarrer' textIndent = '0' textJustify = "interWord" trackingRight = '0' > < alignmentBaseline span = "useDominantBaseline" backgroundAlpha = '1' backgroundColor = "transparent" baselineShift = '0' = 'auto' = "horizontalStem" color = cffHinting breakOpportunity "#000000" digitCase = 'default' digitWidth = 'default' dominantBaseline = "auto" fontFamily = "Arial" fontLookup = "embeddedCFF" fontSize = "11" fontStyle = 'normal' fontWeight = 'normal' kerning = "auto" ligatureLevel = 'common' lineHeight = "120%" crossed out = 'false' local = "en" renderingMode = "cff" textAlpha = "1" textDecoration = "none" textRotation = "auto" trackingLeft = '0' trackingRight = '0' typographicCase = "default" > THE VAGUENESS NEW BEAUTIFUL </span > < / p > < p color = "#000000" direction = "ltr" fontFamily = "Arial" fontSize = "12" justificationRule = "auto" justificationStyle = 'auto' kerning = "auto" = "auto" paragraphEndIndent = leadingModel "" ""» "0" paragraphSpaceAfter "0" = paragraphSpaceBefore = "0" paragraphStartIndent = "0" textAlign = "justify" textAlignLast = "DΘmarrer' textIndent = '0' textJustify ="interWord"trackingRight = '0' > < span alignmentBaseline ="useDominantBaseline"backgroundAlpha ="1"backgroundColor ="transparent"baselineShift = '0' breakOpportunity ="auto"cffHinting ="horizontalStem"color ="#000000"digitCase = 'default' digitWidth = 'default' dominantBaseline ="auto"fontFamily ="Arial"fontLookup ="embeddedCFF"fontSize ="11"fontStyle ="italic"fontWeight ="normal"kerning ="auto"ligatureLevel = lineHeight 'common' ="120% "bar ="false"local = 'fr' renderingMode ="cff"textAlpha ="1"textDecoration ="none"textRotation = 'auto' = '0' = '0' trackingRight trackingLeft typographicCase ="default"> how can I Learn to love the non-predictability of the world ? </span > < / p > < p color = "#000000" direction = "ltr" fontFamily = "Arial" fontSize = "12" justificationRule = "auto" justificationStyle = 'auto' kerning = "auto" leadingModel = "auto" paragraphEndIndent = '0' paragraphSpaceAfter = '0' paragraphSpaceBefore = "0" paragraphStartIndent = "0" textAlign = "justify" textAlignLast = "DΘmarrer' textIndent = '0' textJustify ="interWord"trackingRight = '0' > < span alignmentBaseline ="useDominantBaseline"backgroundAlpha ="1"backgroundColor ="transparent"baselineShift = '0' breakOpportunity ="auto"cffHinting ="horizontalStem"color =" #000000 "digitCase = 'default' digitWidth = 'default' dominantBaseline ="auto"fontFamily ="Arial"fontLookup ="embeddedCFF"fontSize ="11"fontStyle = 'normal' fontWeight = 'normal' kerning ="auto"ligatureLevel = '". " common lineHeight"="120% "crossed out = 'false' local ="en"renderingMode ="cff"textAlpha ="1"textRotation ="auto"trackingLeft = '0' trackingRight = '0' typographicCase ="default"> < / span > < / p > < p color =" #000000 "direction ="ltr"fontFamily ="Arial"fontSize ="12"justificationRule ="auto"justificationStyle = 'auto' kerning ="auto"leadingModel ="auto"paragraphEndIndent = '0' paragraphSpaceAfter = '0' paragraphSpaceBefore ="0"paragraphStartIndent ="0"textAlign ="justify"textAlignLast ="DΘmarrer' textIndent = '0' textJustify = "interWord" trackingRight = '0' > < span alignmentBaseline = "useDominantBaseline" backgroundAlpha = "1" backgroundColor = "transparent" baselineShift = '0' breakOpportunity = "auto" cffHinting = "horizontalStem" color = "#000000" digitCase = ""» default"digitWidth = 'default' dominantBaseline ="auto"fontFamily ="Arial"fontLookup ="embeddedCFF"fontSize ="11"fontStyle = 'normal' fontWeight = 'normal' kerning ="auto"ligatureLevel = lineHeight 'common' ="120% "bar ="false"local = 'fr' renderingMode ="cff"textAlpha ="1"textRotation ="auto"trackingLeft = '0' trackingRight = '0' typographicCase ="default"> nothing is as it is forever. Over and over again, everything changes. Again and again, the unexpected happens, chaos breaks out constantly. Things never remain in order, things can never be effectively planned! </span > < / p > < p color = "#000000" direction = "ltr" fontFamily = "Arial" fontSize = "12" justificationRule = "auto" justificationStyle = 'auto' kerning = "auto" leadingModel = "auto" paragraphEndIndent = '0' paragraphSpaceAfter = '0' paragraphSpaceBefore = "0" paragraphStartIndent = "0" textAlign = "justify" textAlignLast = "DΘmarrer' textIndent = '0' textJustify ="interWord"trackingRight = '0' > < span alignmentBaseline ="useDominantBaseline"backgroundAlpha ="1"backgroundColor ="transparent"baselineShift = '0' breakOpportunity ="auto"cffHinting ="horizontalStem"color =" #000000 "digitCase = 'default' digitWidth = 'default' dominantBaseline ="auto"fontFamily ="Arial"fontLookup ="embeddedCFF"fontSize ="11"fontStyle = 'normal' fontWeight = 'normal' kerning ="auto"ligatureLevel = '". " «"common' lineHeight =" 120% "bar ="false"local = 'fr' renderingMode ="cff"textAlpha ="1"textRotation = 'auto' = '0' = '0' trackingRight trackingLeft typographicCase ="default"> < / span > < /p > < p color =" #000000 "direction ="ltr"fontFamily ="Arial"fontSize ="12"justificationRule ="auto"justificationStyle = 'auto' kerning ="auto"leadingModel ="auto"paragraphEndIndent = '0' paragraphSpaceAfter = '0' paragraphSpaceBefore ="0"paragraphStartIndent ="0"textAlign ="justify"textAlignLast ="DΘmarrer' textIndent = '0' textJustify = "interWord" trackingRight = '0' > < span alignmentBaseline = "useDominantBaseline" backgroundAlpha = "1" backgroundColor = "transparent" baselineShift = '0' = 'auto' = "horizontalStem" color = cffHinting breakOpportunity "#000000" digitCase = "" ""» "default" digitWidth ="default" dominantBaseline = "auto" fontFamily = "Arial" fontLookup = "embeddedCFF" fontSize = "11" fontStyle = 'normal' fontWeight = 'normal' kerning = "auto" ligatureLevel = lineHeight 'common' = "120%" left = "false" local = 'fr' renderingMode = "cff" textAlpha = "1" textRotation = "auto" trackingLeft = "0" = "0" = "default" typographicCase trackingRight > the problem of contingency, of non-predictability of the personal and professional development, is problematic for many people. Constantly, they consider themselves questioned existentially. – Delite describes six effective ideas to overcome this problem. With a new attitude to this problem: </span > < / p > < p color = "#000000" direction = "ltr" fontFamily = "Arial" fontSize = "12" justificationRule = "auto" justificationStyle = 'auto' kerning = "auto" leadingModel = "auto" paragraphEndIndent = '0' paragraphSpaceAfter = '0' paragraphSpaceBefore = "0" paragraphStartIndent = "0" textAlign = "justify" textAlignLast = "DΘmarrer' textIndent = '0' textJustify ="interWord"trackingRight = '0' > < span alignmentBaseline = backgroundAlpha"useDominantBaseline"="1"backgroundColor ="transparent"baselineShift = '0' breakOpportunity ="auto"cffHinting ="horizontalStem"color ="#000000"digitCase = 'default' digitWidth = 'default' dominantBaseline ="auto"fontFamily ="Arial"fontLookup ="embeddedCFF"fontSize ="11 ". fontStyle = 'normal' fontWeight = 'normal' kerning = "auto" ligatureLevel = 'common' lineHeight = "120%" left = 'false' local = "en" renderingMode = "cff" textAlpha = "1" textRotation = 'auto' = '0' = '0' trackingRight trackingLeft typographicCase = "default" > < / span > < / p > < p color = "#000000" direction = "ltr" fontFamily = "Arial" fontSize = "12" justificationRule = "auto" justificationStyle = 'auto' kerning = "auto" leadingModel = "auto" paragraphEndIndent = '0' paragraphSpaceAfter = '0' paragraphSpaceBefore = "0" paragraphStartIndent = "0" textAlign = "justify" textAlignLast = "DΘmarrer' textIndent = '0' textJustify ="interWord"trackingRight = '0' > < span alignmentBaseline ="useDominantBaseline"backgroundAlpha ="1"backgroundColor ="transparent"baselineShift = '0 '. breakOpportunity = "auto" cffHinting = "horizontalStem" color = "#000000" digitCase = 'default' digitWidth = 'default' dominantBaseline = "auto" fontFamily = "Arial" fontLookup = "embeddedCFF" fontSize = "11" fontStyle = 'normal' fontWeight = 'normal' kerning = "auto" ligatureLevel = 'common' lineHeight = "120%" left = "false" local = 'fr' renderingMode = "cff" textAlpha = "1" textRotation = "auto" trackingLeft = '0' trackingRight = '0' typographicCase = "default" > 1. Idea: we are children of evolution < / span > < / p > < p color = "#000000" direction = "ltr" fontFamily = "Arial" fontSize = "12" justificationRule = "auto" justificationStyle = 'auto' kerning = "auto" leadingModel = "auto" paragraphEndIndent = '0' paragraphSpaceAfter = '0' paragraphSpaceBefore = "0" paragraphStartIndent = "0" textAlign = "justify" textAlignLast = 'start' textIndent = '0' textJustify = "interWord" trackingRight = '0' > < span alignmentBaseline = "useDominantBaseline" backgroundAlpha = "1" backgroundColor = "transparent" baselineShift = '0' breakOpportunity = "auto" cffHinting = "horizontalStem" color = "#000000" digitCase = 'default' digitWidth = 'default' dominantBaseline = "auto" fontFamily = "Arial" fontLookup = "embeddedCFF" fontSize = "11" fontStyle = 'normal' "". " "fontWeight =" normal kerning "="auto"ligatureLevel = 'common' lineHeight ="120% "bar ="false"local = 'fr' renderingMode ="cff"textAlpha ="1"textRotation ="auto"trackingLeft = '0' trackingRight = '0' typographicCase ="default"> 2. Idea: Primal fear AND trust based </span > < / p > < p color = "#000000" direction = "ltr" fontFamily = "Arial" fontSize = "12" justificationRule = "auto" justificationStyle = 'auto' kerning = "auto" leadingModel = "auto" paragraphEndIndent = '0' paragraphSpaceAfter = '0' paragraphSpaceBefore = "0" paragraphStartIndent = "0" textAlign = "justify" textAlignLast = "DΘmarrer' textIndent = '0' textJustify ="interWord"trackingRight = '0' > < span alignmentBaseline ="useDominantBaseline"backgroundAlpha ="1"backgroundColor ="transparent"baselineShift = '0' breakOpportunity ="auto"cffHinting ="horizontalStem"color =" #000000 "digitCase = 'default' digitWidth = 'default' dominantBaseline ="auto"fontFamily ="Arial"fontLookup ="embeddedCFF"fontSize ="11"fontStyle =" "" "» "normal" fontWeight ="normal kerning" = "auto" ligatureLevel = 'common' lineHeight = "120%" bar = "false" local = 'fr' renderingMode = "cff" textAlpha = "1" textRotation = "auto" trackingLeft = '0' trackingRight = '0' typographicCase = "default" > 3. Idea: a reasonable attitude work </span > < / p > < p color = "#000000" direction = "ltr" fontFamily = "Arial" fontSize = "12" justificationRule = "auto" justificationStyle = 'auto' kerning = "auto" leadingModel = "auto" paragraphEndIndent = '0' paragraphSpaceAfter = '0' paragraphSpaceBefore = "0" paragraphStartIndent = "0" textAlign = "justify" textAlignLast = 'start' textIndent = '0' textJustify = "interWord" trackingRight = '0' > < span alignmentBaseline = "useDominantBaseline" backgroundAlpha = "1" backgroundColor = "transparent" baselineShift = '0' breakOpportunity = 'auto' cffHinting = "horizontalStem" color = "#000000" digitCase = 'default' digitWidth = 'default' dominantBaseline = "auto" fontFamily = "Arial" fontLookup = "embeddedCFF" fontSize = "11" fontStyle = "" ' "." "normal" fontWeight ="normal kerning" = "auto" ligatureLevel = 'common' lineHeight = "120%" bar = "false" local = 'fr' renderingMode = "cff" textAlpha = "1" textRotation = "auto" trackingLeft = '0' trackingRight = '0' typographicCase = "default" > 4. Idea: the illusion of the virtues secondary </span > < / p > < p color = "#000000" direction = "ltr" fontFamily = "Arial" fontSize = "12" justificationRule = "auto" justificationStyle = 'auto' kerning = "auto" leadingModel = "auto" paragraphEndIndent = '0' paragraphSpaceAfter = '0' paragraphSpaceBefore = "0" paragraphStartIndent = "0" textAlign = "justify" textAlignLast = "DΘmarrer' textIndent = '0' textJustify ="interWord"trackingRight = '0' > < span alignmentBaseline ="useDominantBaseline"backgroundAlpha ="1"backgroundColor ="transparent"baselineShift = '0' breakOpportunity ="auto"cffHinting ="horizontalStem"color =" #000000 "digitCase = 'default' digitWidth = 'default' dominantBaseline ="auto"fontFamily ="Arial"fontLookup ="embeddedCFF"fontSize ="11"fontStyle = 'normal' '"» "fontWeight =" normal kerning "="auto"ligatureLevel = 'common' lineHeight ="120% "bar ="false"local = 'fr' renderingMode ="cff"textAlpha ="1"textRotation ="auto"trackingLeft = '0' trackingRight = '0' typographicCase ="default"> 5. Idea: The end of self-pity </span > < / p > < p color = "#000000" direction = "ltr" fontFamily = "Arial" fontSize = "12" justificationRule = "auto" justificationStyle = 'auto' kerning = "auto" leadingModel = "auto" paragraphEndIndent = '0' paragraphSpaceAfter = '0' paragraphSpaceBefore = "0" paragraphStartIndent = "0" textAlign = "justify" textAlignLast = 'start' textIndent = '0' textJustify = "interWord" trackingRight = '0' > < span alignmentBaseline = "useDominantBaseline" backgroundAlpha = "1" backgroundColor = "transparent" = "0" baselineShift breakOpportunity = "auto" cffHinting = "horizontalStem" color = "#000000" digitCase = 'default' digitWidth = 'default' dominantBaseline = "auto" fontFamily = "Arial" fontLookup = "embeddedCFF" fontSize = "11". fontStyle = 'normal' fontWeight = 'normal' kerning = "auto" = "common" ligatureLevel lineHeight = "120%" bar = "false" local = 'fr' renderingMode = "cff" textAlpha = '1' = 'auto' trackingLeft textRotation = '0' trackingRight = '0' typographicCase = "default" > 6. Idea: Love the life </span > < / p > < p color = "#000000" direction = "ltr" fontFamily = "Arial" fontSize = "12" justificationRule = "auto" justificationStyle = 'auto' kerning = "auto" leadingModel = "auto" paragraphEndIndent = '0' paragraphSpaceAfter = '0' paragraphSpaceBefore = "0" paragraphStartIndent = "0" textAlign = "justify" textAlignLast = "DΘmarrer' textIndent = '0' textJustify ="interWord"trackingRight = '0' > < span alignmentBaseline ="useDominantBaseline"backgroundAlpha ="1"backgroundColor ="transparent"baselineShift = '0' breakOpportunity ="auto"cffHinting ="horizontalStem"color ="#000000"digitCase = 'default' digitWidth = 'default' dominantBaseline ="auto"fontFamily ="Arial"fontLookup ="embeddedCFF"fontSize ="11"fontStyle = 'normal' fontWeight =. 'normal' kerning = "auto" ligatureLevel = lineHeight 'common' = "120%" left = "false" local = 'fr' renderingMode = "cff" textAlpha = "1" textDecoration = "underline" textRotation = "auto" trackingLeft = '0' trackingRight = '0' typographicCase = "default" > read more here < / span > < / p > < p color = "#000000" direction = "ltr" fontFamily = "Arial" fontSize = "12" justificationRule = "auto" justificationStyle = 'auto' kerning = "auto" leadingModel = "auto" paragraphEndIndent = '0' paragraphSpaceAfter = '0' paragraphSpaceBefore = "0" paragraphStartIndent = "0" textAlign = "justify" textAlignLast = "DΘmarrer' textIndent = '0' textJustify ="interWord"trackingRight = '0' > < span alignmentBaseline ="useDominantBaseline"backgroundAlpha ="1"backgroundColor = 'transparent'"» «"baselineShift = '0' breakOpportunity =" Auto "cffHinting ="horizontalStem"color =" #000000 "digitCase = 'default' digitWidth = 'default' dominantBaseline ="auto"fontFamily ="Arial"fontLookup ="embeddedCFF"fontSize ="11"fontStyle = 'normal' fontWeight = 'normal' kerning = 'auto' = 'common' lineHeight ="120% "ligatureLevel crossed out ="false"local = 'fr' renderingMode ="cff"textAlpha ="1"textDecoration ="underline"textRotation = 'auto' = '0' '0' = trackingRight trackingLeft typographicCase ="default"> < / span > < /p > < / TextFlow > ';"»
private function init():void{}
ce . richText.textFlow = TextConverter.importToFlow (this.tfText, TextConverter.TEXT_LAYOUT_FORMAT);
trace ()this. richText.text)
}
[]] >
< / fx:Script >
< s:TextArea " name =" richText " id=" richText " x=" 0 " y=" 0 "width = » 412 "height = » 258 "
horizontalScrollPolicy ="
Auto "verticalScrollPolicy =" " Auto "selectable =" " true "
borderVisible ="
fake "editable =" " fake "contentBackgroundAlpha =" " 0 "paddingRight =" 15 "
renderingMode ="
SBB "fontLookup =" " embeddedCFF "cffHinting =" " horizontalStem " />
< / s:Application >
The details of the error:
: Error #1502: a script is run for longer than the default timeout of 15 seconds period.
to flashx.textLayout.compose::BaseCompose/fitLineToParcel() [C:\Vellum\branches\v1\1.1\dev\ou tput\openSource\textLayout\src\flashx\textLayout\compose\BaseCompose.as:536]
to flashx.textLayout.compose::ComposeState/composeNextLine() [C:\Vellum\branches\v1\1.1\dev\o utput\openSource\textLayout\src\flashx\textLayout\compose\ComposeState.as:312]
to flashx.textLayout.compose::BaseCompose/composeParagraphElementIntoLines() [C:\Vellum\branc hes\v1\1.1\dev\output\openSource\textLayout\src\flashx\textLayout\compose\BaseCompose.as:3 95]
at::ComposeState/composeParagraphElement() [C:\Vellum\branches\v1\1.1\dev\output\openSource\textLayout\src\flashx\textLayout\compose\ComposeState.as:272] flashx.textLayout.compose
to flashx.textLayout.compose::BaseCompose/composeBlockElement() [C:\Vellum\branches\v1\1.1\de v\output\openSource\textLayout\src\flashx\textLayout\compose\BaseCompose.as:219]
to flashx.textLayout.compose::BaseCompose/composeInternal() [C:\Vellum\branches\v1\1.1\dev\ou tput\openSource\textLayout\src\flashx\textLayout\compose\BaseCompose.as:372]
to flashx.textLayout.compose::ComposeState/composeInternal() [C:\Vellum\branches\v1\1.1\dev\o utput\openSource\textLayout\src\flashx\textLayout\compose\ComposeState.as:134]
to flashx.textLayout.compose::BaseCompose/composeTextFlow() [C:\Vellum\branches\v1\1.1\dev\ou tput\openSource\textLayout\src\flashx\textLayout\compose\BaseCompose.as:339]
to flashx.textLayout.compose::ComposeState/composeTextFlow() [C:\Vellum\branches\v1\1.1\dev\o utput\openSource\textLayout\src\flashx\textLayout\compose\ComposeState.as:102]
at flashx.textLayout.compose::StandardFlowComposer/ http://ns.Adobe.com/TextLayout/internal/2008:callTheComposer ([C:\Vellum\branches\v1\1.1\ dev\output\openSource\textLayout\src\flashx\textLayout\compose\StandardFlowComposer.as:678])
to flashx.textLayout.compose::StandardFlowComposer/internalCompose() [C:\Vellum\branches\v1\1.1\dev\output\openSource\textLayout\src\flashx\textLayout\compose\StandardFlowComposer.as: 758]
to flashx.textLayout.compose::StandardFlowComposer/compose() [C:\Vellum\branches\v1\1.1\dev\o utput\openSource\textLayout\src\flashx\textLayout\compose\StandardFlowComposer.as:821]
to flashx.textLayout.container::TextContainerManager/compose() [C:\Vellum\branches\v1\1.1\dev \output\openSource\textLayout\src\flashx\textLayout\container\TextContainerManager.as:1207]
to flashx.textLayout.container::TextContainerManager/updateContainer() [C:\Vellum\branches\v1 \1.1\dev\output\openSource\textLayout\src\flashx\textLayout\container\TextContainerManager .as:1294]
to spark.components::RichEditableText/updateDisplayList() [E:\dev\4.x\frameworks\projects\spa rk\src\spark\components\RichEditableText.as:2601]
at mx.core::UIComponent/validateDisplayList() [E:\dev\4.x\frameworks\projects\framework\src\m x\core\UIComponent.as:8709]
at mx.managers::LayoutManager/validateDisplayList() [E:\dev\4.x\frameworks\projects\framework \src\mx\managers\LayoutManager.as:663]
at mx.managers::LayoutManager/doPhasedInstantiation() [E:\dev\4.x\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:736]
at mx.managers::LayoutManager/doPhasedInstantiationCallback() [E:\dev\4.x\frameworks\projects \framework\src\mx\managers\LayoutManager.as:1072]
Thank you for your support!
This bug should be fixed in the 4.5 SDK. Please use the latest version of the SDK.
My environment is FlashBuilder 4.5 premium and its SDK 4.5 default value. Everything goes well on my machine.
Thank you
-
TextFlow elements style with CSS
I'm just trying to get my head on how to style of the individual of the TextFlow elements as you would in HTML/CSS where your markup contains no style information - just pure markup. And CSS formats the items when you export the text.
Specifically, I want to put a BackgroundColor on my LinkElements.
I began the exploration of the Configuration class with its properties linkNormalFormatDefault and linkHoverFormatDefault. It worked basically, except that I couldn't get a background color to show, and he introduced a bunch of style tags cooked in markup - so if I had to save this markup in a database these styles would still be there the next time I visited.
So in order to keep the markup clean and free of built in a style, I explored the SimpleEditorWithCSS sample that comes with the framework for example. It uses textFlow.formatResolver to css styles secret to their formats in the TextFlow. Seems cool and all that I want, but I can't seem to style links (or the < flow: tags href). I changed the CSSFormatResolver.as to try to get to the style LinkElements, but can't seem to.
Is there an easier way to go about this?
BackgroundColor applies only when it is set on a LeafElement and backgroundColor inherits the default question.
You could solve this problem with the formatResolver checking chain relative to each item for a LinkElement and then returning a TextLayoutFormat with backgroundColor = "inherit".
Then the LeafElement will inherit the LinkElements backgroundColor.
I see that Configuration.linkNormalFormatDefault etc. effects to export setting. It affects exports, if you set the property to a FlowElement element. Note the Configuration must be created and initialized before the constructor TextFlow. Any changes after that will not show the new TextFlow.
Hope that helps,
Richard
-
Text direction does not work in pure AS3 project built with Flash CS5
No idea why it does not work? The rest LTR text direction no matter what I do. I tried moving when the text is printed with no luck.
This text is the only difference I get:
Trademark < police = "Lucida Sans Unicode" >® < / make >Is rendered as:
® Registered TRADEMARKprotected function configureText(title:String):void
{
this.textField = new TLFTextField();
this.textField.autoSize = TextFieldAutoSize.LEFT;
this.textField.mouseChildren = false;
this.textField.mouseEnabled = false;
this.textField.selectable = false;
this.textField.wordWrap = false;
this.textField.htmlText = title;
var format:TextLayoutFormat = new TextLayoutFormat();
format.color = this.defaultTextColor;
format.direction = Direction.RTL;
format.fontFamily = "Arial";
format.fontSize = this.size - 4;
format.textAlign = TextAlign.RIGHT;
this.textField.textFlow.hostFormat = format;
this.textField.textFlow.flowComposer.updateAllControllers();
this.addChild(this.textField);
}
Update with Flash CS5 11.0.2.489
The characters that are part of left right scripts are defined by default left to right. The characters that are part of right to left scripts (for example, Arabic or Hebrew) are defined right to the left. Characters such as punctuation (or the registered trademark symbol) is set according to the default direction. So in your example the trademark symbol filed out on the other side because his game rtl. Had you set the Arabic or Hebrew, it would come out right on the left. The default direction is also used to determine if the dash, for example, should go left or right.
You want your English text to come out right on the left? What effect you are trying to get?
Thank you
-robin
-
Problem with creating a container with the single line of text
Hi ~
I'm overwhelmed with a following problem.
Problem: I need to create a container with a single line of text. As I learn from the TLF API, there is no way to do that so he left only in a way that looks like this:
Assuming that textFlow object is to create
var container: Sprite = new Sprite();
var width: Number = 500; It has specified the value
var height: Number = 300; just estimate is sufficient for a normal line height
var controller: DisplayObjectContainerController = new DisplayObjectContainerController (container, width, height);
controller.verticalScrollPolicy = ScrollPolicy.OFF;
textFlow.flowComposer.addController (controller); textFlow.flowComposer.composeContainer (textFlow.flowComposer.getControllerIndex (controlled r));
find the first line of the top in the created container
var textFlowLine:TextFlowLine = textFlow.flowComposer.findLineAtPosition (controller.absoluteStart, false);
var calLineHeight:Number = textFlowLine.textHeight + 8; 8 this is just a test value
controller.setCompositionSize (width, calLineHeight);
textFlow.flowComposer.updateContainer (_textFlow.flowComposer.getControllerIndex (Controller));
In this way, she first calculate first line height giving enough space for the controller
and cope, after that there adjust the height of the container again and then updates.
It's so fresh generals I guess
If anyone has more simple or just how?
In regards to a single line. I think you can set the lineBreak on the TextFlow to "explicit". In this case lines only break to return to the line and the point ends.
If you want to be changed, take a look at the TextLineFactory APIs. NaN set in the width/height of the limit and it gets filled. It is a more lightweight way to create TextLines.
Take a look at the properties DisplayObjectContainerControllers compositionWidth and compositionHeight full TextFlows as in your code using. You still want to use explicit line breaks.
Hope that helps!
Richard -
changing value of text with the cursor
Hi you all
I need a help from your side
I have created a slider and change the size of the listview text with the cursor
Here is my code
Slider { id: slider fromValue: 8.0 toValue: 16.0 value: 8.0 layoutProperties: StackLayoutProperties { spaceQuota: 0.1 } preferredWidth: 200.0 maxWidth: 250.0 preferredHeight: 20.0 visible: true enabled: false horizontalAlignment: HorizontalAlignment.Center onImmediateValueChanged: { // descriptionText is the id of label descriptionText.textStyle.fontSize = FontSize.PointValue descriptionText.textStyle.fontSizeValue = immediateValue } } /***********************************************************************// i am adding data to listview using remote source Container { id: listviewContainer layout: StackLayout { } ListView { id: myListView1 dataModel: dataModel1 //{ // source: "asset:///models/xmldata.xml" // } // Use a ListItemComponent to determine which property in the // data model is displayed for each list item listItemComponents: [ ListItemComponent { type: "item" Container { rightPadding: 20 leftPadding: 20 horizontalAlignment: HorizontalAlignment.Center verticalAlignment: VerticalAlignment.Center layout: StackLayout { orientation: LayoutOrientation.TopToBottom } Container { topPadding: 40 horizontalAlignment: HorizontalAlignment.Fill layout: DockLayout { } // The Item content container Container { verticalAlignment: VerticalAlignment.Top horizontalAlignment: HorizontalAlignment.Right layout: StackLayout { orientation: LayoutOrientation.RightToLeft } } } // Description text label Label { id: descriptionText // // objectName: descriptionText // leftMargin: 20 horizontalAlignment: HorizontalAlignment.Right verticalAlignment: VerticalAlignment.Top text : ListItemData.des textStyle.color: Color.create("#868686") textStyle.textAlign: TextAlign.Justify multiline: true textFormat: TextFormat.Plain textStyle.fontSizeValue: 8.0 } } } ] } attachedObjects: [ GroupDataModel { id: dataModel1 // Sort the data in the data model by the "pubDate" field, in // descending order, without any automatic grouping sortingKeys: [ "date" ] //[ "pubDate" ] sortedAscending: false grouping: ItemGrouping.None }, DataSource { id: dataSource1 objectName: "" // Load the XML data from a remote data source, specifying that the // "item" data items should be loaded source:"http://10.121.10.139/simplehtmldom/getdescnews.php?newsid="+dataSource1.objectName query: "/news/property/" type: DataSourceType.Xml onDataLoaded: { // After the data is loaded, clear any existing items in the data // model and populate it with the new data dataModel1.clear(); dataModel1.insert(data) myIndicator12321.setRunning(false); myIndicator12321.setVisible(false); // dataModel.insert(data) } } ] } // in the end i am calling on creating complete onCreationCompleted: { // When the top-level Page is created, direct the data source to start // loading data dataSource1.load(); }
problem I am facing is, it does not find the descriptionText variable, which is the id of the label
can someone help?
OK, the problem is that listItemComponents attached to a control, such as ListView have their own context. ListItemComponent documentation refers to what I think. If you must do the following:
1. do you have a property that is defined as an attribute of the ListView
2 bind your fontSizeValue to listItemComponent tag to the ListView. Note, however, to do this, you need to get a reference to the ListView using your label ListItem.view is found in the container. Not obvious, I know.
3. do you have your cursor to update the property you have defined for the ListView.
Cursor---> p_font_size ListView property<---------->---------->
Like this:
{To ListView
ID: myListView1
property real p_font_size: 10listItemComponents:]
{ListItemComponent}
type: 'point '.
ID: sample{Of container
ID: mainListViewContainer{Label
ID: descriptionText..........
textStyle.fontSize: FontSize.PointValue
textStyle.fontSizeValue: mainListViewContainer.ListItem.view.p_font_size}
and elsewhere on your page
Slider {}
ID: sliderfromValue: 8.0
toValue: 16.0
value: 8.0
layoutProperties: {StackLayoutProperties}
spaceQuota: 0.1
}
preferredWidth: 200.0
maxWidth: 250,0
preferredHeight: 20.0
visible: true
enabled: true
horizontalAlignment: PonImmediateValueChanged: {}
myListView1.p_font_size = immediateValue
}
}I test it and it works. Please make this response as the solution if it works for you too :-)
-
problems with the visibility of the label
Hi, I have a few labels for the info I get from strings in c, they work fine until I put the fake of visibility, now wind and rain works correctly but the values of the others give me different things, pressure gives me NaN and moisture/visibility gives me bb::cascades:label(0x862...)
This is the code for the QML
attachedObjects:[ ExternalIP { id : jsonweather onNameChanged: { weatherDataCity.text = name; } onDescriptionChanged: { weatherDataCondition.text = description; } onHumidityChanged: { weatherDataHumidity.text = humidity + "%"; } onTempChanged: { weatherDataTemperature.text = Math.round(temp); } onPressureChanged: { weatherDataPressure.text = Math.round(pressure) + " mBar"; } onSpeedChanged: { weatherDataWind.text = speed; } onDegdirectionChanged: { weatherDataWindDir.text = degdirection; } onVisibilityChanged: { weatherDataVisibility.text = visibility + " km"; } onPrecipChanged: { weatherDataPrecip.text = precip + " mm"; } onUnitsChanged: { weatherDataUnits.text = "°" + units; } } ] Label { visible: false id:humidity text:"humidity:" textStyle.fontSize: FontSize.PointValue textStyle.fontSizeValue: 10 layoutProperties: AbsoluteLayoutProperties { positionX: 40 positionY: 670 } } Label { visible: false id:weatherDataHumidity text:"" textStyle.fontSize: FontSize.PointValue textStyle.fontSizeValue: 10 layoutProperties: AbsoluteLayoutProperties { positionX: 245 positionY: 670 } horizontalAlignment: HorizontalAlignment.Right } Label { visible: false id:pressure text: "pressure:" textStyle.fontSize: FontSize.PointValue textStyle.fontSizeValue: 10 layoutProperties: AbsoluteLayoutProperties { positionX: 40 positionY: 713 } } Label { visible: false id: weatherDataPressure text: "" textStyle.fontSize: FontSize.PointValue textStyle.fontSizeValue: 10 layoutProperties: AbsoluteLayoutProperties { positionX: 250 positionY: 713 } } Label { visible: false id: wind text: "wind:" textStyle.fontSize: FontSize.PointValue textStyle.fontSizeValue: 10 layoutProperties: AbsoluteLayoutProperties { positionX: 40 positionY: 805 } } Label { visible: false id: weatherDataWind text: "" textStyle.fontSize: FontSize.PointValue textStyle.fontSizeValue: 10 layoutProperties: AbsoluteLayoutProperties { positionX: 170 positionY: 805 } } Label { visible: false id:weatherDataWindDir text:"" textStyle.fontSize: FontSize.PointValue textStyle.fontSizeValue: 10 layoutProperties: AbsoluteLayoutProperties { positionX: 360 positionY: 805 } textStyle.textAlign: TextAlign.Left } Label { visible: false id: visibility text: "visibility:" textStyle.fontSize: FontSize.PointValue textStyle.fontSizeValue: 10 layoutProperties: AbsoluteLayoutProperties { positionX: 40 positionY: 760 } } Label { visible: false id:weatherDataVisibility text: "" textStyle.fontSize: FontSize.PointValue textStyle.fontSizeValue: 10 layoutProperties: AbsoluteLayoutProperties { positionX: 230 positionY: 760 } } Label { visible: false id: rain text: "rain:" textStyle.fontSize: FontSize.PointValue textStyle.fontSizeValue: 10 layoutProperties: AbsoluteLayoutProperties { positionX: 40 positionY: 845 } } Label { visible: false id:weatherDataPrecip text: "" textStyle.fontSize: FontSize.PointValue textStyle.fontSizeValue: 10 layoutProperties: AbsoluteLayoutProperties { positionX: 150 positionY: 845 } } } Container { background: Color.Transparent horizontalAlignment: HorizontalAlignment.Right verticalAlignment: VerticalAlignment.Bottom bottomPadding: 35.0 rightPadding: 35.0 ImageButton { defaultImageSource: "asset:///images/compassbutton.png" horizontalAlignment: HorizontalAlignment.Right verticalAlignment: VerticalAlignment.Bottom onClicked: { humidity.visible = !humidity.visible pressure.visible = !pressure.visible visibility.visible = !visibility.visible wind.visible = !wind.visible rain.visible = !rain.visible weatherDataPrecip.visible = !weatherDataPrecip.visible weatherDataWind.visible = !weatherDataWind.visible weatherDataPressure.visible = !weatherDataPressure.visible weatherDataHumidity.visible = !weatherDataHumidity.visible weatherDataWindDir.visible = !weatherDataWindDir.visible weatherDataVisibility.visible = !weatherDataVisibility.visible } } }
any suggestions?
you gave your labels the same ID as your properties. That's why you get NaN/component.toString etc.
because Math.round (visibility) with visibility being your label, obviously gives you NaN
Give all your labels a name with 'label' at the end, for example "visibilityLabel".
-
Hi, im having trouble changing the X translation on a label with an if statement, the application quits when joining the change of text in my case, here are my code
Label { visible: true id:battery text: "" translationY: 45 translationX: -33 textStyle.fontWeight: FontWeight.W400 textStyle.fontSize: FontSize.PointValue textStyle.fontSizeValue:7 horizontalAlignment: HorizontalAlignment.Right textStyle.textAlign: TextAlign.Left onTextChanged: { if (_battery.level = 100){ translationXChanged(-27) } }
and _battery object
BatteryInfo { id: batteryinfo onLevelChanged: { battery.text = level + "%" } }
any suggestions?
Hmm, like others on this forum, you seem to confuse in the difference between the assignment and comparison.
A unique = means assign the value on the right to the left object/variable.
A double == means compare the object on the right with the object on the left.
Your if statement will return true as you actually ask the if statement if you can assign a value of 100 to a variable. However the battery level can be read only so the crash.
@greenmr I see you thinking should I put a more technically accurate explanation and also mention = but please don't let's keep things simple.
Maybe you are looking for
-
To archive my e-mail files until I decided to switch to Thunderbird, I create regular folders in windows and drag and drop emails to outlook express in the appropriate folders. The "update" column displays the original date of the email... which is w
-
When I click on sleep, the montor goes off and it connects me on, but actually sleep like before. Any ideas on what is happening here? Thank you. (Y530)
-
password BIOS HP compaq mini 110
Hello everyone. Can you help me get the password of the bios. I can't boot from my laptop HP Compaq Mini 110. After 3 hours of presentation bad password I have: CNU01843VN. Is there any master password which can help me to recover my laptop? Thank yo
-
C3180 all-in-One: re = install
EU all-in-one type C3180 for 5 years. Good.Had to uninstall. Efforts to re - install keep failing. Message implementation. Please correct RUN As. I am only user and administrator, so can not understand the problem. Tells me to remove the disc, close
-
VPN using globally routable addresses
Hello We need to configure a VPN site to site with a customer who will not use the RFC1918 addresses for our endpoint source / destinations. So we asked us NAT these devices in our assigned overall Internet block. My question is, will this work? Our