RE: [flexcoders] mx.controls.Text control not autosizing -
Thanks for the reply Alex - I think I may have used the wrong terminology in my initial question. When I said Content I was referring to Text or it's Text Property. I hope that changes things, if this question was to be re-addressed once again. I say that because why would a UIComponent need to ever handle the resizing of a Text component (in my specific situation)? The Text component should have intimate knowledge about the actual Text contained within it. And again, per the Flex Docs, if the Width and Height values are left blank, the control should size itself around it's Text. Now if I wanted the control to base it's width and height on it's parent container, than I'd completely understand where you are coming from. Like I said, I hope this changes things a little, and hope you can take a crack at this question again :) Many thanks, Mike From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alex Harui Sent: Wednesday, April 16, 2008 8:43 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] mx.controls.Text control not autosizing - Children are sized by their parent, so you custom UIComponent will have to setActualSize on the Text appropriately From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mike Anderson Sent: Wednesday, April 16, 2008 3:21 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] mx.controls.Text control not autosizing - Hello All, I know there's been some discussion recently, regarding TextFields and having them grow automatically around their content. The TextInput and TextArea Controls must be extended in order to get this type of functionality - but what about the Text Control? It's my understanding that the Text Control will automatically size itself around it's content. In my case, I am not using the mx.controls.Text inside a MXML Component, it's being added as a Child inside of a Custom UIComponent. Per the Flex 3.0 Documentation: If you leave both the width and the height unspecified, Flex calculates them based on any explicit line breaks in the text, with no wordwrapping within lines. Is there something that I'm missing regarding this control? Thank you all in advance for any advice on this, Mike
RE: [flexcoders] mx.controls.Text control not autosizing -
My understanding is still that the mx.controls.Text is parented by a UIComponent. The UIComponent is therefore responsible for the size of the Text. Parents size children in Flex. If the actual text you want to display requires wordwrapping, it is likely that you'll have to pick a width for the Text because word-wrapped text can be any size. Typically, the UIComponent parent gets the measuredWidth/Height of the child control and uses that information, plus its own size, to determine the size of the child. A good example is how wordwrapping is handled in ListItemRenderer. -Alex From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mike Anderson Sent: Thursday, April 17, 2008 9:25 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] mx.controls.Text control not autosizing - Thanks for the reply Alex - I think I may have used the wrong terminology in my initial question. When I said Content I was referring to Text or it's Text Property. I hope that changes things, if this question was to be re-addressed once again. I say that because why would a UIComponent need to ever handle the resizing of a Text component (in my specific situation)? The Text component should have intimate knowledge about the actual Text contained within it. And again, per the Flex Docs, if the Width and Height values are left blank, the control should size itself around it's Text. Now if I wanted the control to base it's width and height on it's parent container, than I'd completely understand where you are coming from. Like I said, I hope this changes things a little, and hope you can take a crack at this question again :) Many thanks, Mike From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alex Harui Sent: Wednesday, April 16, 2008 8:43 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] mx.controls.Text control not autosizing - Children are sized by their parent, so you custom UIComponent will have to setActualSize on the Text appropriately From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mike Anderson Sent: Wednesday, April 16, 2008 3:21 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] mx.controls.Text control not autosizing - Hello All, I know there's been some discussion recently, regarding TextFields and having them grow automatically around their content. The TextInput and TextArea Controls must be extended in order to get this type of functionality - but what about the Text Control? It's my understanding that the Text Control will automatically size itself around it's content. In my case, I am not using the mx.controls.Text inside a MXML Component, it's being added as a Child inside of a Custom UIComponent. Per the Flex 3.0 Documentation: If you leave both the width and the height unspecified, Flex calculates them based on any explicit line breaks in the text, with no wordwrapping within lines. Is there something that I'm missing regarding this control? Thank you all in advance for any advice on this, Mike
[flexcoders] mx.controls.Text control not autosizing -
Hello All, I know there's been some discussion recently, regarding TextFields and having them grow automatically around their content. The TextInput and TextArea Controls must be extended in order to get this type of functionality - but what about the Text Control? It's my understanding that the Text Control will automatically size itself around it's content. In my case, I am not using the mx.controls.Text inside a MXML Component, it's being added as a Child inside of a Custom UIComponent. Per the Flex 3.0 Documentation: If you leave both the width and the height unspecified, Flex calculates them based on any explicit line breaks in the text, with no wordwrapping within lines. Is there something that I'm missing regarding this control? Thank you all in advance for any advice on this, Mike
RE: [flexcoders] mx.controls.Text control not autosizing -
Children are sized by their parent, so you custom UIComponent will have to setActualSize on the Text appropriately From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mike Anderson Sent: Wednesday, April 16, 2008 3:21 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] mx.controls.Text control not autosizing - Hello All, I know there's been some discussion recently, regarding TextFields and having them grow automatically around their content. The TextInput and TextArea Controls must be extended in order to get this type of functionality - but what about the Text Control? It's my understanding that the Text Control will automatically size itself around it's content. In my case, I am not using the mx.controls.Text inside a MXML Component, it's being added as a Child inside of a Custom UIComponent. Per the Flex 3.0 Documentation: If you leave both the width and the height unspecified, Flex calculates them based on any explicit line breaks in the text, with no wordwrapping within lines. Is there something that I'm missing regarding this control? Thank you all in advance for any advice on this, Mike