Recent

Author Topic: Question mark as ThousandSeparator  (Read 4101 times)

krzynio

  • Full Member
  • ***
  • Posts: 110
    • Krzynio's home page
Question mark as ThousandSeparator
« on: February 14, 2014, 06:41:10 pm »
Hello!
I wrote my own OnDrawColumnCell event where text displayed is this way:
Code: [Select]

if Column.Alignment = taRightJustify then
     TextOut( RightX(Rect.Right, Column.Field.DisplayText, gZlec.Canvas), Rect.Top+2, Column.Field.DisplayText)
  else if Column.Alignment = taCenter then
     TextOut( CenterX(REct.Left, Rect.Right, Column.Field.DisplayText, gZlec.Canvas), Rect.Top+2, Column.Field.DisplayText)
  else
  TextOut( Rect.Left+2, Rect.Top+2, Column.Field.DisplayText)

Sometimes Thousand separator displayed is as question mark '?' instead of space ' '.
Example ion attachment.
I do not know why and when.
Has someone any suggestions?

Regards,
Krzysztof


Debian 12.8 x64, / Windows 11 PL - latest updates
Lazarus 3.6

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Question mark as ThousandSeparator
« Reply #1 on: February 14, 2014, 07:00:50 pm »
What is the code behind Column.Field.DisplayText?

krzynio

  • Full Member
  • ***
  • Posts: 110
    • Krzynio's home page
Re: Question mark as ThousandSeparator
« Reply #2 on: February 14, 2014, 07:45:37 pm »
I don't know. The code is standard from TDBGrid component. Lazarus is 1.2RC2 fpc is 2.6.2. Column is a parameter from OnDrawColumnCell event from this grid. Display format is set under column editor of DBGrid component as #,##0. Thousend separator is set at the beginning of the program as ThousandSeparator:=' '. 
Debian 12.8 x64, / Windows 11 PL - latest updates
Lazarus 3.6

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Question mark as ThousandSeparator
« Reply #3 on: February 15, 2014, 12:32:41 am »
You could try adding
Code: [Select]
uses Lazlogger;
to your uses clause, and insert something like
Code: [Select]
if Pos('?', Column.Field.DisplayText) > 0 then
    DebugLn('=> ? entry for '+Column.Field.AsString);
into your OnDrawColumnCell() code
to identify and collect together the data that is causing the display problem, and see if there is some pattern that connects the items that are being displayed incorrectly that might lead you to the cause.

krzynio

  • Full Member
  • ***
  • Posts: 110
    • Krzynio's home page
Re: Question mark as ThousandSeparator
« Reply #4 on: February 15, 2014, 08:35:22 am »
Thank you very much, I have to learn about this feature and will test it for sure.
Debian 12.8 x64, / Windows 11 PL - latest updates
Lazarus 3.6

 

TinyPortal © 2005-2018