Jump to content


Photo

TNxHTMLColumn and different link colors


  • Please log in to reply
6 replies to this topic

#1 array81

array81

    Senior Member

  • Members
  • PipPip
  • 290 posts
  • Gender:Male

Posted 09 April 2017 - 04:31 PM

Is it possible have links with different color on the same TNxHTMLColumn (in in general in all "HTML components")?

 

I have try to use TNXStylesSheet but without succes. I can only change color for all link (the same color).

 

Besides is not possible select a custom color, why?



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 09 April 2017 - 05:32 PM

Hi,

Maybe you can give id to the element and then stylize it?

Then update following code in NxHTML6.pas

procedure TNxStylesSheet6.AssignStyle(Tag: TNxHTMLTag; var Style: TNxCSSStyle);
var
  i: Integer;
begin
  for i := 0 to Pred(Rules.Count) do
  begin
    if Rules[i].Name <> '' then

      case Rules[i].Selector of

        skID:
          if Rules[i].Name = Param[Tag, tpId] then
          begin
            Rules[i].AssignToStyle(Style);
          end;

        skTag:
          if StrToTag(Rules[i].Name) = Tag.Kind then
          begin
            Rules[i].AssignToStyle(Style);
          end;

        skClass:
          if Rules[i].Name = Param[Tag, tpClass] then
          begin
            Rules[i].AssignToStyle(Style);
          end;

      end;
  end;
end;
Please tell me how it works.
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 array81

array81

    Senior Member

  • Members
  • PipPip
  • 290 posts
  • Gender:Male

Posted 09 April 2017 - 08:30 PM

I think "id" and "a" tag don't work.

 

I have this style:

 

linktag.png

 

I have assigned to column and then use this HTML code:

<a id="redTag" href="test">test</a>

The link is always blue.



#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 09 April 2017 - 10:48 PM

Hi,

Did you tried to update my procedure I attached?
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.

#5 array81

array81

    Senior Member

  • Members
  • PipPip
  • 290 posts
  • Gender:Male

Posted 09 April 2017 - 11:30 PM

Hi,

Did you tried to update my procedure I attached?

I have edit the code but the result is the same.



#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 10 April 2017 - 08:39 PM

Hi,

Hm, for some reason work for me. I will test it more and go back to you.
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.

#7 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 10 April 2017 - 09:04 PM

Hi,

For some reason when I have 2 parameters (href and id) one of them is deleted.

I will fix it, sorry for problems.
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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users