Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread TLabel word wrap issue
Tue, Nov 17 2015 11:59 AMPermanent Link

Uli Becker

If a TLabel contains this text e.g.:

---
https://entry.axa.de/kunde/myaxa/public/entry/kkcEingang.do

Line2
Line3
---

word wrap doesn't work at runtime. At designtime it looks as expected.

Please see the attached screenshots.

Thanks. Uli



Attachments: Clip1.png Clip2.png
Tue, Nov 17 2015 1:17 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< word wrap doesn't work at runtime. At designtime it looks as expected. >>

It looks like this is just down to a different word-wrapping logic.  I'll have to see if I can reconcile the two.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Nov 17 2015 2:59 PMPermanent Link

Uli Becker

Tim,

> It looks like this is just down to a different word-wrapping logic.  I'll have to see if I can reconcile the two.

Hopefully with the designtime logic. Smile

Uli
Wed, Nov 18 2015 9:12 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< Hopefully with the designtime logic. Smile>>

Yes, I was able to make the runtime behave like designtime by using the CSS word-wrap property (break-word).

The fix will be in the next build, but here's the hot-fix:

In the WebUI unit:

procedure TElement.ApplyStyle(AChanges: TSet;
                             ASelective: Boolean=True);
begin
  { Don't use with statement in this method - Chrome can't optimize
    it and not using it shaves off some time on mobile !!! }

  if (not FDOMElementInit) then
     begin
     { Must always set these properties !! }
     FDOMElement.style.boxSizing:=OrientationTypeToStr(otBounds);
     FDOMElement.style.position:=CSS_VALUE_ABSOLUTE;
     FDOMElement.style.margin:=PixelsToStr(0);
     FDOMElement.style.outline:=PixelsToStr(0);
     FDOMElement.style.msTouchAction:=CSS_VALUE_NONE;
     FDOMElement.style.touchAction:=CSS_VALUE_NONE;
     if (FDOMElement.style.font='') then
        FDOMElement.style.font:=FFont.GetStyle;
     if (FDOMElement.style.textAlign='') then
        FDOMElement.style.textAlign:=FFormat.GetAlignStyle;
     if (FDOMElement.style.whiteSpace='') then
        FDOMElement.style.whiteSpace:=FFormat.GetWhiteSpaceStyle;
     if (FDOMElement.style.overflowX='') and (FOverflowX <> otAuto) then
        FDOMElement.style.overflowX:=OverflowTypeToStr(FOverflowX);
     if (FDOMElement.style.overflowY='') and (FOverflowY <> otAuto) then
        FDOMElement.style.overflowY:=OverflowTypeToStr(FOverflowY);
     if (FDOMElement.style.wordWrap='') then  <<<<<<<<<<<<<<<<<<<<<<<<<<<<< Add
        FDOMElement.style.wordWrap:=CSS_VALUE_BREAKWORD; <<<<<<<<<<< Add

and CSS_VALUE_BREAKWORD is in the WebDOM unit:

  CSS_VALUE_PRE = 'pre';
  CSS_VALUE_PREWRAP = 'pre-wrap';

  CSS_VALUE_BREAKWORD = 'break-word';  <<<<<<<<<<<<<<<<<<<<<<< Add

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Nov 18 2015 11:31 AMPermanent Link

Uli Becker

Tim,

> The fix will be in the next build, but here's the hot-fix:

Great, thank you.

Uli
Image