Recent

Author Topic: Hint - Font size  (Read 1690 times)

J-G

  • Hero Member
  • *****
  • Posts: 953
Hint - Font size
« on: May 10, 2022, 06:31:41 pm »
Can this be modified? - either at design or run time.

I can set the text of a [Hint] at design-time and modify it at Run-time but the 'default' is somewhat small so it would be useful to enlarge it. It wouldn't matter whether it was a global or local change though naturally local would be more flexible.
FPC 3.0.0 - Lazarus 1.6 &
FPC 3.2.2  - Lazarus 2.2.0 
Win 7 Ult 64

Josh

  • Hero Member
  • *****
  • Posts: 1274
Re: Hint - Font size
« Reply #1 on: May 10, 2022, 07:43:53 pm »
in formcreate event add

 
Code: Pascal  [Select][+][-]
  1. screen.HintFont.Name:='arial';
  2. screen.HintFont.size:=16;
  3. screen.HintFont.Color:=clRed;    
« Last Edit: May 10, 2022, 08:14:48 pm by josh »
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

J-G

  • Hero Member
  • *****
  • Posts: 953
Re: Hint - Font size
« Reply #2 on: May 10, 2022, 09:37:56 pm »
Thanks Josh  -  I'd been trying to do it by  [Object].hint.  ----  which would be 'local'.  I hadn't thought to look at 'screen. ....'

Regrettably - it doesn't work  :(

The options do appear in the .properties list so I can select .HintFont & .Size or .Color but the hints that I've already set up show no change (I haven't changed the 'name', just the size & colour).

« Last Edit: May 11, 2022, 12:52:27 pm by J-G »
FPC 3.0.0 - Lazarus 1.6 &
FPC 3.2.2  - Lazarus 2.2.0 
Win 7 Ult 64

J-G

  • Hero Member
  • *****
  • Posts: 953
Re: Hint - Font size
« Reply #3 on: May 11, 2022, 02:36:51 pm »
After some further research - still without success - I've now found that a TEdit has a [TextHint] Property (along with .color & .style) and I can set this at run-time but I still can't display the value set.

The Object Inspector exposition includes the phrase "Hint only (and always if showhint = true) displays a baloontip when the mouse is over the control." showhint is set = true but I see no 'Baloontip' when the mouse is over the control  - - -  I do see the 'Hint' that is set in [Hint] of course  - - -  and my 'Logic' suggests that I'm missing something or there is an inbuilt conflict in having the two 'properties'.

Solving this apparent paradox would not provide a total solution to my dilema though since the specific object that started my quest is a TLable which doesn't have a [TextHint] property.

FPC 3.0.0 - Lazarus 1.6 &
FPC 3.2.2  - Lazarus 2.2.0 
Win 7 Ult 64

Zvoni

  • Hero Member
  • *****
  • Posts: 2327
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: Hint - Font size
« Reply #5 on: May 11, 2022, 03:27:06 pm »
I wonder what you are doing. The Screen properties are not listed in the Object Inspector. Set them by code, for example in the OnCreate event of the form - see attachment.

Zvoni

  • Hero Member
  • *****
  • Posts: 2327
Re: Hint - Font size
« Reply #6 on: May 11, 2022, 03:41:46 pm »
After some further research - still without success - I've now found that a TEdit has a [TextHint] Property (along with .color & .style) and I can set this at run-time but I still can't display the value set.

The Object Inspector exposition includes the phrase "Hint only (and always if showhint = true) displays a baloontip when the mouse is over the control." showhint is set = true but I see no 'Baloontip' when the mouse is over the control  - - -  I do see the 'Hint' that is set in [Hint] of course  - - -  and my 'Logic' suggests that I'm missing something or there is an inbuilt conflict in having the two 'properties'.

Solving this apparent paradox would not provide a total solution to my dilema though since the specific object that started my quest is a TLable which doesn't have a [TextHint] property.
The "TextHint"-Property is not the Baloon-Tip (and has nothing to do with "ShowHint" either!)

"TextHint" is the/a text shown inside the the TEDit as long as the TEDit is empty!
Common "color" of that hint is light gray
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

Josh

  • Hero Member
  • *****
  • Posts: 1274
Re: Hint - Font size
« Reply #7 on: May 11, 2022, 05:00:09 pm »
just a note from memory.

Using the hint overide method only works on windows if you do not have windows manifest selected in project option.

If i remember correctly J-G was using 1.6, so i cannot test the screen.hintfont method with that version.

I have used the Screen.hintfont method before to increase the size, although to be honest it is best left alone, as if you start changing these you will get more users of your app complaining that you are not obeying the settings that they have set up in their environment.

The best way to get accurate information on the forum is to post something wrong and wait for corrections.

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: Hint - Font size
« Reply #8 on: May 11, 2022, 05:29:54 pm »
You are right: In v1.6.4 the Screen.HintFont is not yet working, but in v1.8.4 it is.

J-G

  • Hero Member
  • *****
  • Posts: 953
Re: Hint - Font size
« Reply #9 on: May 12, 2022, 01:01:06 am »
The "TextHint"-Property is not the Baloon-Tip (and has nothing to do with "ShowHint" either!)

"TextHint" is the/a text shown inside the the TEDit as long as the TEDit is empty!
Common "color" of that hint is light gray
You've confirmed my suspicions Zvoni  -  the exposition confused rather than enlightened me  %)

If i remember correctly J-G was using 1.6, so i cannot test the screen.hintfont method with that version.

I have used the Screen.hintfont method before to increase the size, although to be honest it is best left alone, as if you start changing these you will get more users of your app complaining that you are not obeying the settings that they have set up in their environment.
You are absolutely correct Josh (about 1.6).

On that front, I have downloaded FPCUPdeluxe and have made three attempts to install 'Stable'. I do understand that it's not 'Instant' but after over an hour & a half it is still showing [Not Responding] with the Windows "I'm working" Circle still revolving.

After setting my 'Install Directory', I've left the selections on the [Basic] screen at [Stable] in both cases. On the [Cross] Tab I've selected i386 & Windows then returned to the [Basic] screen and clicked 'FPC+Laz'

Looking in the 'Install' Folder I do see 2 .ini files along with a .log & .en.po file.  After Clicking 'FPC+Laz' I see a 'warning' about open SSL library which is going to be downloaded.

From past reports of how good FPCUPdeluxe is,  I wasn't expecting a problem  :o
FPC 3.0.0 - Lazarus 1.6 &
FPC 3.2.2  - Lazarus 2.2.0 
Win 7 Ult 64

 

TinyPortal © 2005-2018