Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 14 total
Thread Autosize logic funny
Wed, May 10 2017 8:41 AMPermanent Link

Matthew Jones

I have a TLabel, topleft, stretch right. The text is more than will fit the space, so I have WordWrap turned on.

If I have the Auto-Height set true, then it sizes for a single line and truncates the text. If I have auto-height turned off, it auto-sizes to fit the wrapped text.

That seems illogical to me. If it is set to wrap, then the height should include the wrap calculation. In essence, either wrapping overrides the auto-height, or turning off auto-height should stop the wrap, and turning it on take account.

--

Matthew Jones
Wed, May 10 2017 8:57 AMPermanent Link

Walter Matte

Tactical Business Corporation


Layout and AutoSIze can counteract each other.

Walter
Wed, May 10 2017 9:42 AMPermanent Link

Matthew Jones

Walter Matte wrote:

> Layout and AutoSIze can counteract each other.

I can see how that would happen, but in this case there is no reason for them to be fighting. And indeed, it sort of comes down to a priority doesn't it - which one is more important. But then, what is the purpose of autosize height? Indeed, the help says "Specifies that the height of the UI element or control should be automatically set based upon the height of its content and/or the height of any child UI elements or controls." To me, that says that if the content is word wrapped, then the height should include that part of the content.

--

Matthew Jones
Wed, May 10 2017 10:25 AMPermanent Link

Raul

Team Elevate Team Elevate

On 5/10/2017 9:42 AM, Matthew Jones wrote:
> I can see how that would happen, but in this case there is no reason for them to be fighting. And indeed, it sort of comes down to a priority doesn't it - which one is more important.

This one is interesting - what you're asking would require multiple
passes on the control sizing if i'm reading this right.

IMHO layout would have to be applied first but then if it's not wide
enough you'd like auto height to kick in as well for the label and make
it taller (which would have to re-trigger layout logic again and so it goes)

Raul



Wed, May 10 2017 10:34 AMPermanent Link

Matthew Jones

I'm not asking for a lot - turn off auto-height and it already auto-sizes the height for the wrapped text. So all I'm asking for is the auto-height to consider the wrapped text too. Turning off the auto-size height causes the text to wrap and the height to be adjusted, and the rest of the layout takes account of it. So it is perfect in that mode. But tell it you actually want auto-height and it gets it wrong. That's all.

--

Matthew Jones
Wed, May 10 2017 11:43 AMPermanent Link

Raul

Team Elevate Team Elevate

On 5/10/2017 10:34 AM, Matthew Jones wrote:
> I'm not asking for a lot - turn off auto-height and it already auto-sizes the height for the wrapped text.

That's not what i'm seeing. If i set wrap, turn off auto-height and set
layout of topleft stretch to right then it's single line of text for me
that is visible as the label content changes and grows beyond width.

Stretch to bottom-right is only way i get more than single line of text

Raul

Wed, May 10 2017 11:49 AMPermanent Link

Matthew Jones

Raul wrote:

> That's not what i'm seeing. If i set wrap, turn off auto-height and set layout of topleft stretch to right then it's single line of text for me that is visible as the label content changes and grows beyond width.

Odd! I'm using 2.06 build 9. It may be that the consumption affects it too - if I change it from Bottom then it doesn't do things the same.

This is my form data:


           { "ClassName": "TLabel",
              "Name": "lblMergeQty",
              "Properties": {
                 "Top": 24,
                 "Left": 24,
                 "Height": 22,
                 "Width": 56,
                 "Animations": {  },
                 "AutoSize": { "Height": true },
                 "Background": {  },
                 "Border": {  },
                 "Corners": {  },
                 "Caption": "The quantity of the existing job item is %quantity% (\"%existunit%\"). Please specify the quantity you require:",
                 "Constraints": {  },
                 "DisplayOrder": 0,
                 "Font": { "Name": "Segoe UI", "Color": 4285562249 },
                 "Format": { "Wrap": true },
                 "Layout": { "Consumption": 7, "Position": 1, "Stretch": 5 },
                 "LayoutOrder": 0,
                 "Margins": { "Left": 12, "Top": 24, "Bottom": 12 },
                 "OutsetShadow": {  },
                 "Padding": {  } } },

--

Matthew Jones
Wed, May 10 2017 2:36 PMPermanent Link

Raul

Team Elevate Team Elevate

On 5/10/2017 11:49 AM, Matthew Jones wrote:
> Odd! I'm using 2.06 build 9. It may be that the consumption affects it too - if I change it from Bottom then it doesn't do things the same.

I'm on 2.0.6 Build 1 - i don't think there is build 9.

> This is my form data:
>                   "AutoSize": { "Height": true },

You still have auto height on which i had off and you had consumption
down and i had none. otherwise label is same.

I actually re-tested and it works OK here and i'm seeing opposite
results from you which is more curious.

Wrap=on, auto size all off, layout top left stretch to right - i see
single line of text always and it truncates (or actually looks like it
shows the last line every time).

if i now turn auto size height on leaving rest same then it wraps
properly and label grows down.

I populate label runtime to make sure i see runtime behaviour.


Raul
Thu, May 11 2017 3:55 AMPermanent Link

Uli Becker

Matthew,

> If I have the Auto-Height set true, then it sizes for a single line and truncates the text. If I have auto-height turned off, it auto-sizes to fit the wrapped text.

I just tested that here. Result: you have to set the label's
autosize.width to false when using a layout stretch. Then everything
works as expected.

Uli
Thu, May 11 2017 4:00 AMPermanent Link

Matthew Jones

Raul wrote:

> I'm on 2.0.6 Build 1 - i don't think there is build 9.

That is definitely what it is saying in Help About here.

--

Matthew Jones
Page 1 of 2Next Page »
Jump to Page:  1 2
Image