Jump to content


Photo

Feature Request : HTML-text in NxAlertWindow?


  • Please log in to reply
17 replies to this topic

#1 bargmann

bargmann
  • Members
  • 6 posts

Posted 12 May 2008 - 09:41 AM

Would it be possible to get HTML-text in the AlertWindow???
...that would be really nice...
For example, I have made this little gmail-notifier-thingie, and showing a preview of a new mail would be nice, with different font-styles for sender, subject, and summary... This can be done with the HTML, right...

Edit : Just found a "bug" in HTML-label... It seems that it does NOT react to more than one "<br>" in a row, meaning I cannot have an empty line (?)
Edit 2 : Nevermind, it just needs to contain a space, then an empty line is shown...

Further Edit : Kind-of-bug in NxAlertWindow
procedure TNxAlertWindow.MouseUp is kind of wrong...
I have created som AlertWindows dynamically, and the only way to get thos free'd again, is doing it in the OnClose-event.
That works fine, unless you click the close-button on the Alert, because the MouseUp check for close-button-click and afterwards check for options-link-click (and then you get an AV, cause the Alert has been free'd)...
Just reversing these two checks solves the problem... aka. checking for close-button-click as the last thing in the MouseUp....

/Bargmann

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 12 May 2008 - 11:31 AM

Hello Bargman,

I have fix MouseUp bug as you say. I will most probably add Html support for AlertWindow, but this will be controled by Boolean property. Something like HtmlText: Boolean.

Best regards
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 bargmann

bargmann
  • Members
  • 6 posts

Posted 12 May 2008 - 11:32 AM

Great!!!!
Thanks...

#4 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 06 June 2008 - 07:42 PM

html in alert window:
adding several <br> (in order to have a space line) has no effect
i want it to have a space line but this doesnt happen

#5 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 07 June 2008 - 06:31 PM

Hello Emailaya,

I will work on it to fix it.

Best regards
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.

#6 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 09 June 2008 - 08:59 PM

was this fixed in the last release?

#7 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 09 June 2008 - 09:27 PM

Hello Emailaya,

No it is not, but I have already fix it.

Inside ProcessHTML in NxSharedCommon.pas find part of code similar to:

CODE
    if Tag = htBr then
    begin
      Inc(Y, VertSpace);
      Y := 0; // <------- delete
      X := Rect.Left + 2;
    end else


and delete line Y := 0 within.

I hope that now is fine.

regards
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.

#8 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 09 June 2008 - 09:37 PM

in my code it looks like this:
if Tag = htBr then
begin
Inc(Y, VertSpace);
VertSpace := 0;
X := Rect.Left + 2;
end else


so should i remove VertSpace := 0;?

#9 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 09 June 2008 - 09:51 PM

ok, the above seems to do the trick

#10 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 16 June 2008 - 05:59 PM

is it possible to give a different background for the text?
<font color="red">blah</font>
draws blah in red which is good
but i want to give a blue background to it
is it possible?

#11 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 16 June 2008 - 08:39 PM

Hello,

I am not sure about tag name to use, maybe SPAN tag.

Best regards
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.

#12 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 16 June 2008 - 09:00 PM

i looked at: NxSharedCommon unit
and i didnt find a tag that affects the brush.color which is the background


this is the code to affect the background in html: <span STYLE="background-color: blue">
but it doesnt work in nxalertwindow
i guess this should be added manually
mayb instead of all this, a simple attribute called: "bgcolor" which will be placed inside <font> tag
will do the job by affecting the brush.color

what do u think?

#13 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 16 June 2008 - 09:38 PM

Hello,

It will be hard to parse style property quickly with current code. I will need some time to finish this feature. If there is some similar tag, I will be glad to add it. Something like mark or something similar.

regards
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.

#14 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 16 June 2008 - 10:23 PM

currently u parse correctly the attribute COLOR and set canvas.font.color accordingly, this works great
cant u add 1 more attribute called BGCOLOR and set canvas.brush.color accordingly?

#15 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 17 June 2008 - 02:59 PM

Hello Emailaya,

I will see what I can do. If there is some more standard way this will be better. I will also look about parsing Style param.

regards
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.

#16 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 17 June 2008 - 05:03 PM

style has allot more options (attributes) other than the "background-color: <color>" which is the tag for changing the background color

if u want it fast and simple, u can use the bgcolor
if u want to make it more complex, u can use the style attribute

#17 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 17 June 2008 - 11:53 PM

Hello Emailaya,

I think that I will go with BGColor. It will be to much complicated to implement Style for such as small tasks like html column.

regards
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.

#18 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 18 June 2008 - 12:17 AM

html column and nxAlertWindow
u have my vote for this smile.gif




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users