Recent

Author Topic: Insert check mark symbol  (Read 4666 times)

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis
Insert check mark symbol
« on: April 21, 2018, 02:44:00 pm »
How to: add check-mark symbol to string?
Thanks

taazz

  • Hero Member
  • *****
  • Posts: 5368
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis
Re: Insert check mark symbol
« Reply #2 on: April 21, 2018, 02:59:15 pm »
Thanks but how to use? I tried : hexStr(e29c93) -- error

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Insert check mark symbol
« Reply #3 on: April 21, 2018, 03:04:05 pm »
on windows there is handy utility called character map open it select a font that supports the character (https://www.fileformat.info/info/unicode/char/2713/fontsupport.htm) and copy it from there. Keep in mind that the font you use on your app must support that character too.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis
Re: Insert check mark symbol
« Reply #4 on: April 21, 2018, 03:08:44 pm »
Thank you very much!
Best regards

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: Insert check mark symbol
« Reply #5 on: April 21, 2018, 03:31:25 pm »
on windows there is handy utility called character map
Not only in Windows, also in Lazarus: Menu "Edit" > "Insert from Character Map". Keep page "Unicode" selected, in the combobox "Range" scroll down to "Dingbats". Find the checkmark in the 2nd row. Just click on it to insert it in the code editor at the current cursor position.

Or, in code, you can add it to a string like this
Code: Pascal  [Select][+][-]
  1. const
  2.   UTF8_CHECKMARK = #$E2#$9C#$93;
  3. var
  4.   s: String;
  5. begin
  6.   s := UTF8_CHECKMARK + ' This item is checked.';
« Last Edit: April 21, 2018, 03:34:25 pm by wp »

lainz

  • Hero Member
  • *****
  • Posts: 4449
    • https://lainz.github.io/
Re: Insert check mark symbol
« Reply #6 on: April 21, 2018, 03:32:07 pm »
I've tested that character on Windows 7, Windows 10 and Ubuntu, and these have it with the default font.

You can just copy and paste it in the lazarus source code editor, place it in a constant or variable to use it quickly.

Edit, I'm using like this:

Code: Pascal  [Select][+][-]
  1. MDBUTTONBALLOTBOXWITHCHECK: string = '✓'; //'☑';
« Last Edit: April 21, 2018, 04:11:36 pm by lainz »

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis
Re: Insert check mark symbol
« Reply #7 on: April 23, 2018, 01:09:41 pm »
Lainz, wp, thank you very much.
Perfect!
« Last Edit: April 23, 2018, 01:14:38 pm by exdatis »

 

TinyPortal © 2005-2018