Jump to content


Photo

NxHTMLLabel and ProcessHTML


  • Please log in to reply
2 replies to this topic

#1 deonvn

deonvn

    Senior Member

  • Honorable Members
  • PipPip
  • 313 posts

Posted 31 March 2015 - 10:02 AM

Hi Boki

 

There are bugs in the way that the HTML for the various HTML controls (NxAlertWindow, NxHTMLLabel, NxInfoPanel, NxHTMLColumn etc) is rendered (see attached Image1). It looks like the problem is related to the fact that you set VertSpace := 0 in the Breakline procedure inside the ProcessHTML function in NxSharedCommon. (Refer to attached Image2 to see what the rendered HTML should look like).

 

The second issue (which I have mentioned before) is the way in which the AutoSize property on NxHTMLLabel works:

 

The way it works now is that if you set AutoSize := True, then the label will automatically grow in both width and height to accommodate the HTML text. In a lot of situations however, I would like the label to automatically adjust its height only, but for the width to remain fixed (a message box where the width of the window is fixed, for example). At the moment, if I set AutoSize to False then the label size doesn't change at all, and if I set AutoSize to True then the height and the width will change. That basically makes the AutoSize property unusable.

 

What you need is a WordWrap property like the one on a normal label. If AutoSize is True and WordWrap is False, then the label can grow in width and height in order to accommodate the text (like it does now). However, if AutoSize is True and WordWrap is True, then the width must remain fixed, the text must be wrapped according to the control's width, and the height must grow to accommodate the height of the text. See the attached images that demonstrate the difference.

 

I will e-mail you copies of NxSharedCommon and NxCollection (I don't want to attach the source files here) where I have made changes to fix these issues (search the files for $IFDEF DVN and $IFNDEF DVN to see the changes). Those are just quick "hacks" to get it working for now - obviously you will want to implement things in your own way. I am only providing those as an example of what I talking about.

 

Regards,

 

Deon

Attached Files



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 31 March 2015 - 10:08 AM

Thanks Deon, waiting for your mail.

 

For v6 I have made this rendering routines from ground. Maybe you can to try them too?


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 deonvn

deonvn

    Senior Member

  • Honorable Members
  • PipPip
  • 313 posts

Posted 31 March 2015 - 04:17 PM

Hi Boki

 

I haven't installed V6 yet. I'll try it out as soon as I get time. Will let you know :)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users