I have found an annoying bug in TAdvStringGrid component. When I enter a text, followed by a < character, and some more text, e.g. "a<a", then moving the cursor down and up again, the text before the < is duplicated. So, after the first move, we have "aa<a", after the second we have "aaaa<a" and so on.
The problem does not occur on an empty and new AdvStringGrid, but with the special settings, I needed, it occurs. May have to do with html tag editing or checking.
I have extracted the component I used without any event procedure, just in a plain test form.
Please copy and paste the following sections to the 2 files Unit1.pas and Unit1.frm with the given file names and you may check and reproduce my bug.
The HTML tag editing is switched off. So what setting causes the bug?
Thanks in advance for your help!
//---------------------- Unit1.pas --------------------------------------------
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, AdvObj, BaseGrid, AdvGrid, StdCtrls;
type
TForm1 = class(TForm)
editornew: TAdvStringGrid;
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
end.
//-------------------------------------------------------------------------------
//---------------------- Unit1.dfm --------------------------------------------
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 354
ClientWidth = 672
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object editornew: TAdvStringGrid
Left = 0
Top = 0
Width = 672
Height = 354
Cursor = crDefault
Align = alClient
ColCount = 7
DefaultColWidth = 100
FixedCols = 3
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goColSizing, goEditing, goTabs, goThumbTracking]
ScrollBars = ssBoth
TabOrder = 0
ActiveRowColor = clYellow
HoverRowCells = [hcNormal, hcSelected]
HintShowLargeText = True
HTMLKeepLineBreak = False
ActiveCellFont.Charset = DEFAULT_CHARSET
ActiveCellFont.Color = clHighlightText
ActiveCellFont.Height = -11
ActiveCellFont.Name = 'Tahoma'
ActiveCellFont.Style = [fsBold]
ActiveCellColor = clHighlight
ColumnHeaders.Strings = (
'Line'
'Address'
'TS'
'Bytes'
'Labels'
'Commands'
'Comments')
ControlLook.FixedGradientHoverFrom = clGray
ControlLook.FixedGradientHoverTo = clWhite
ControlLook.FixedGradientDownFrom = clGray
ControlLook.FixedGradientDownTo = clSilver
ControlLook.DropDownHeader.Font.Charset = DEFAULT_CHARSET
ControlLook.DropDownHeader.Font.Color = clWindowText
ControlLook.DropDownHeader.Font.Height = -11
ControlLook.DropDownHeader.Font.Name = 'Tahoma'
ControlLook.DropDownHeader.Font.Style = []
ControlLook.DropDownHeader.Visible = True
ControlLook.DropDownHeader.Buttons = <>
ControlLook.DropDownFooter.Font.Charset = DEFAULT_CHARSET
ControlLook.DropDownFooter.Font.Color = clWindowText
ControlLook.DropDownFooter.Font.Height = -11
ControlLook.DropDownFooter.Font.Name = 'Tahoma'
ControlLook.DropDownFooter.Font.Style = []
ControlLook.DropDownFooter.Visible = True
ControlLook.DropDownFooter.Buttons = <>
EnableHTML = False
EnhTextSize = True
Filter = <>
FilterDropDown.Font.Charset = DEFAULT_CHARSET
FilterDropDown.Font.Color = clWindowText
FilterDropDown.Font.Height = -11
FilterDropDown.Font.Name = 'Tahoma'
FilterDropDown.Font.Style = []
FilterDropDown.TextChecked = 'Checked'
FilterDropDown.TextUnChecked = 'Unchecked'
FilterDropDownClear = '(All)'
FilterEdit.TypeNames.Strings = (
'Starts with'
'Ends with'
'Contains'
'Not contains'
'Equal'
'Not equal'
'Larger than'
'Smaller than'
'Clear')
FilterNormalCellsOnly = False
FixedColWidth = 100
FixedRowHeight = 22
FixedFont.Charset = DEFAULT_CHARSET
FixedFont.Color = clWindowText
FixedFont.Height = -11
FixedFont.Name = 'Tahoma'
FixedFont.Style = [fsBold]
FloatFormat = '%.2f'
HoverButtons.Buttons = <>
HoverButtons.Column = 3
HoverButtons.Position = hbLeftFromColumnRight
MouseActions.AutoFocus = True
MouseActions.CaretPositioning = True
MouseActions.DirectEdit = True
MouseActions.SizeFixedCol = True
Navigation.AlwaysEdit = True
Navigation.AdvanceDirection = adTopBottom
Navigation.AppendOnArrowDown = True
Navigation.CursorWalkEditor = True
Navigation.ImproveMaskSel = True
Navigation.HomeEndKey = heFirstLastRow
PrintSettings.DateFormat = 'dd/mm/yyyy'
PrintSettings.Font.Charset = DEFAULT_CHARSET
PrintSettings.Font.Color = clWindowText
PrintSettings.Font.Height = -11
PrintSettings.Font.Name = 'Tahoma'
PrintSettings.Font.Style = []
PrintSettings.FixedFont.Charset = DEFAULT_CHARSET
PrintSettings.FixedFont.Color = clWindowText
PrintSettings.FixedFont.Height = -11
PrintSettings.FixedFont.Name = 'Tahoma'
PrintSettings.FixedFont.Style = []
PrintSettings.HeaderFont.Charset = DEFAULT_CHARSET
PrintSettings.HeaderFont.Color = clWindowText
PrintSettings.HeaderFont.Height = -11
PrintSettings.HeaderFont.Name = 'Tahoma'
PrintSettings.HeaderFont.Style = []
PrintSettings.FooterFont.Charset = DEFAULT_CHARSET
PrintSettings.FooterFont.Color = clWindowText
PrintSettings.FooterFont.Height = -11
PrintSettings.FooterFont.Name = 'Tahoma'
PrintSettings.FooterFont.Style = []
PrintSettings.PageNumSep = '/'
SearchFooter.FindNextCaption = 'Find &next'
SearchFooter.FindPrevCaption = 'Find &previous'
SearchFooter.Font.Charset = DEFAULT_CHARSET
SearchFooter.Font.Color = clWindowText
SearchFooter.Font.Height = -11
SearchFooter.Font.Name = 'Tahoma'
SearchFooter.Font.Style = []
SearchFooter.HighLightCaption = 'Highlight'
SearchFooter.HintClose = 'Close'
SearchFooter.HintFindNext = 'Find next occurrence'
SearchFooter.HintFindPrev = 'Find previous occurrence'
SearchFooter.HintHighlight = 'Highlight occurrences'
SearchFooter.MatchCaseCaption = 'Match case'
SelectionColor = clHighlight
SelectionTextColor = clHighlightText
ShowSelection = False
ShowDesignHelper = False
SortSettings.DefaultFormat = ssAutomatic
Version = '7.7.1.0'
ColWidths = (
100
100
100
100
100
100
100)
RowHeights = (
22
22
22
22
22
22
22
22
22
22)
end
end
//--------------------------------------------------------------------