Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 17 total
Thread Formatted text - ideas?
Sun, Dec 4 2016 2:19 PMPermanent Link

Uli Becker

One of the features I'm really missing in EWB is to display (HTML-)
formatted text like the attached screenshot shows.

As a workaround I'd like to display such text-boxes in a TBrowser
control, but I have no idea how to get the height/width of the actual
content.
Does anyone know how to calculate the space to embed such a "frame" in
an EWB form?

@Tim: is it possible to add a "justify" property to wrapped text of a
TLabel? And also: would it be possible to make the space between lines
editable? With some fonts it looks quite squeezed.

Thanks.

Uli





Attachments: Clip2.png
Mon, Dec 5 2016 4:07 PMPermanent Link

Steve Gill

Avatar

<< One of the features I'm really missing in EWB is to display (HTML-)
formatted text like the attached screenshot shows. >>

For me this is a major thing missing from EWB.  The ability to format the text in labels (eg. bold, italics, hyperlinks) is a really important feature that I use extensively when building websites (not web apps) with another product.

= Steve
Mon, Dec 5 2016 5:17 PMPermanent Link

Walter Matte

Tactical Business Corporation

You can format the whole label with   bold, italic, underline ... see in Font - Style

Walter
Mon, Dec 5 2016 5:45 PMPermanent Link

Uli Becker

Walter,

<<
You can format the whole label with   bold, italic, underline ... see in Font - Style
>>

That's not what we talked about.

Uli
Tue, Dec 6 2016 3:59 AMPermanent Link

Matthew Jones

Steve Gill wrote:

> The ability to format the text in labels (eg. bold, italics, hyperlinks) is a really important feature

It has been discussed before, with the main problem being that if you can put "any" HTML into the DOM, you could break things completely. One little mistake in the label and you have a major fail.

I suspect though that it wouldn't be impossible for someone to make such a component as proof of concept. I would suggest using something like markdown to do the encoding, to ensure safe transition.

For the moment though, the layout features offer a lot of what is needed. I often use a label, link, label all aligned next to each other to provide a link in text.

--

Matthew Jones
Tue, Dec 6 2016 5:49 AMPermanent Link

Uli Becker

Matthew,

at least at the moment the only way to accomplish that seems to be to
use a kind of "frame", i.e. a TBrowser control and display
html-formatted text within this control.

I don't mind doing so, but (I'm not an expert in web-programming): is it
possible to calculate the space the TBrowser control needs, just to
display it's content? Knowing that, it would be no problem to fit one or
more TBrowser controls within the layout of an EWB form.

I really need this (and I think some others as well).

Thanks Uli
Tue, Dec 6 2016 6:35 AMPermanent Link

Matthew Jones

Uli Becker wrote:

> TBrowser

The problem you have with this is that you can't interact with the main page any more (as I understand it). Maybe you can, but it is no longer plain HTML then.


--

Matthew Jones
Tue, Dec 6 2016 7:50 AMPermanent Link

Uli Becker

Matthew,

> The problem you have with this is that you can't interact with the
main page any more (as I understand it). Maybe you can, but it is no
longer plain HTML then.

I don't need any interaction - I just have to display a box with
html-formatted text within my EWB form (font.colors and hyperlinks). The
question is, how to calculate the needed space for that (if that's
possible anyways).

Uli
Tue, Dec 6 2016 8:34 AMPermanent Link

Matthew Jones

Uli Becker wrote:

> The question is, how to calculate the needed space for that (if that's possible anyways).

You can use TInterfaceManager.ContentWidth to get a fairly good idea, but it depends a little on the font you are using, and of course that might not be accurate as it will either be browser default or you use CSS to set it.

I've found it very good for EWB controls, but sometimes need to add a fudge factor for borders etc.

The "random content" I show in some dialogs for background info comes from the web server, so I've not had to do this specific task I don't think.

--

Matthew Jones
Tue, Dec 6 2016 11:33 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< As a workaround I'd like to display such text-boxes in a TBrowser control, but I have no idea how to get the height/width of the actual content. Does anyone know how to calculate the space to embed such a "frame" in
an EWB form? >>

There are a lot of problems with doing this in a TBrowser (an iframe element) because of issues with borders, scrollbars, etc.  A better solution is to use a straight-up div element internally.  However, you're not going to be able to do that without a lot of work that involves hacking up the WebUI unit to add support for auto-sizing such an element.  I can certainly see about adding such a feature.  It would allow you to input HTML to be displayed at run-time, but wouldn't be supported at design-time (it would show a placeholder).

The general problem is that EWB is 100% absolutely-positioned.  It's why the performance is so snappy - it never relies on the browser for positioning/layout/flow so that it can control when/how the layout occurs.  This type of situation is an either-or proposition - you either let the browser handle everything, or you have EWB handle everything.  Otherwise EWB would have to implement the entire browser layout engine at design-time, and the browser layout features are not very compatible with traditional desktop GUI development in terms of workflow, etc.

<< @Tim: is it possible to add a "justify" property to wrapped text of a TLabel? And also: would it be possible to make the space between lines editable? With some fonts it looks quite squeezed. >>

The problem is that GDI+ does not support justification as a text format, thus I would need to implement it, and it's tricky because of how GDI+ performs text measurement, so it's been put on the back-burner for a while.

Tim Young
Elevate Software
www.elevatesoft.com
Page 1 of 2Next Page »
Jump to Page:  1 2
Image