Jump to content


Photo

Changes in Cell.Hint


  • Please log in to reply
3 replies to this topic

#1 Falcon

Falcon
  • Members
  • 29 posts

Posted 31 January 2021 - 03:41 PM

Hello Boki,

can you explain to me how to use tnxhint in conjunction with tnxstylessheet?
I want to change the font size in the Cell.Hint.

Thanks in advance

Karl-Heinz



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 31 January 2021 - 08:21 PM

Hi,

Please try something like this. It seems that there is a bug that happens in this scenario so I will fix it, but maybe this can be good starting point for your need.

 

object Form2: TForm2
  Left = 0
  Top = 0
  Caption = 'Form2'
  ClientHeight = 242
  ClientWidth = 472
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object Button1: TButton
    Left = 208
    Top = 88
    Width = 75
    Height = 25
    Hint = '<div class="bigtext">This is an example. <b>Big</b> text</div>'
    Caption = 'Button1'
    ParentShowHint = False
    ShowHint = True
    TabOrder = 0
  end
  object NxHint61: TNxHint6
    StylesSheet = NxStylesSheet61
    Left = 216
    Top = 136
  end
  object NxStylesSheet61: TNxStylesSheet6
    Rules = <
      item
        FontSize = '14'
        Name = 'bigtext'
        Selector = skClass
      end>
    Left = 320
    Top = 128
  end
end

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 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 01 February 2021 - 01:14 PM

I think that I have fixed the issue. Here is the fix, but it will be included in the next update:

 

procedure TNxHintWindow6.ActivateHint(Rect: TRect; const AHint: string);
begin
  with Rect do
  begin
    Canvas.Font.Assign(Self.Font); // <====== new line

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.

#4 Falcon

Falcon
  • Members
  • 29 posts

Posted 01 February 2021 - 08:58 PM

Thank you, it works perfectly






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users