Joined: 12 Dec 2007
|Posted: Wed Jan 28, 2009 5:34 pm Post subject: Behavior of DefaultStyles.CurrentLine
|(TSyntaxMemo 2.60; both Delphi 2007 and 2009),
1) I'm experimenting with the properties in DefaultStyles.CurrentLine, and most of them don't seem to have any effect. Only the BorderColorXxx and BorderTypeXxx properties seem to work. Other styling properties have no effect, for example:
DefaultStyles.CurrentLine.Font.Style (or Size),
If I pick the correct FormatType, and if there is some memo text entered in the designer, the properties are honored correctly at design time, but not at runtime. Only the border type and color specified in the designer are used at runtime.
The styles do work when specified in code, e.g. in the form's OnCreate event:
with SyntaxMemo1.DefaultStyles.CurrentLine do
Enabled := true;
FormatFlags := [ffBold,ffItalic,ffUnderline,ffStrikeOut,ffReadOnly,ffHidden,ffFontName,ffFontSize,ffFontCharset,ffVertAlign];
FormatType := ftFontAttr;
BgColor := clMoneyGreen;
Font.Size := 12;
Most of the properties specified in the designer are present in the DFM file, however FormatFlags does not seem to be stored in DFM. Could this be the source of the problem?
2) A separate issue with the CurrentLine marker: regardless of the style settings, the movement of the marker is different in this version than it was before. Initially, the first line is marked as current. If I now move the caret down using the arrow keys, the current line marker doesn't follow the caret, but stays on the first line. The marker is only moved to the current line when I start typing / editing text.
(Edited to add:)
For bug (2), please check if you can confirm the following behavior:
a) after enabling the current line marker, run the program and click the top line of text. The top line will be highlighted.
b) using the arrow keys, move the caret one or more lines down. (The highlight does not follow the caret, even though it should).
c) Click the line containing the caret.
Result: both the top line and the clicked line are highlighted.
Expected result: only the clicked line should be highlighted.
Screenshot of the final result: http://www.tranglos.com/curline_dblmark.png
The problem (2) does not occur if soDrawCurLineFocus is set in Options, so perhaps this behavior is intended? What then is the interaction between DefaultStyles.CurrentLine.Enabled and soDrawCurLineFocus? Shouldn't there be only one of these two settings?
Thanks in advance for any hints,