Hi TMS,
I've got a situation with "TADVCOLUMNGRID".
It seems
that any "DefaultRowHeight" < 17 causes the "Caret" (the edit cursor
position indicator) to not be displayed. I've confirmed this through
various tests and have yet to find a solution. (IE confirmed that this
is the only variable that is different from one test to the next and
trying values 1-16 resulting in hidden/missing caret, and 18-30
resulting in expected behavior). The component which we are replacing
with yours was able to display the caret regardless of the row size (or
at least when the DefaultRowHeight was set to 16).
Reproducing
the issue should just be a matter of dropping this component onto a new
form within a new application setting: Options = [goEditing],
DefaultRowHeight = 16. Caret is missing (in my experience).
Is there a solution for this?
This is actually a Windows problem. If you drop a regular TEdit on the form and set the height less than the height of the font, you will see that the caret also disappears. This limitation is actually in Windows edit controls.
I suppose now the challenge will be for me to create a work-around to match the functionality we had previously... I'm not sure how they made this work in "TopGrid". I have tested reducing the DefaultRowHeight in that component to 16, 14, 12 etc. and still the caret is shown (even though the lower half of the text is chopped off my the next row)... The font is 10 point Arial Bold.
To have a caret for smaller row heights, decrease the font size.
As you can determine with a TEdit, when the height of the control in relation to the size of the font is too small,
Windows doesn't display a caret.
I think for now I'll just increase the DefaultRowHeight by 1 or 2 pixels. Reducing the font from 10 point to 8 point would negatively impact the user experience. Are there any cell margin values that can be controls cells? perhaps the available space for the caret could be increased by 1 pixel somewhere without increasing the cell size?
There are no margins that can be customized. As far as I see, with the default font, row height of 17 is the smallest to still show a caret.