diff --git a/lcl/include/custommemo.inc b/lcl/include/custommemo.inc index 582a9870e0..009b327da9 100644 --- a/lcl/include/custommemo.inc +++ b/lcl/include/custommemo.inc @@ -162,6 +162,16 @@ begin FLines.Assign(Value); end; +procedure TCustomMemo.SetSelText(const Val: string); +begin + Lines.BeginUpdate; + try + inherited SetSelText(Val); + finally + Lines.EndUpdate; + end; +end; + {------------------------------------------------------------------------------ procedure TCustomMemo.SetScrollbars(const Value : TScrollStyle); ------------------------------------------------------------------------------} diff --git a/lcl/interfaces/win32/win32memostrings.inc b/lcl/interfaces/win32/win32memostrings.inc index fbbeca62b1..db070c0c95 100644 --- a/lcl/interfaces/win32/win32memostrings.inc +++ b/lcl/interfaces/win32/win32memostrings.inc @@ -15,6 +15,7 @@ TWin32MemoStrings = class(TStrings) function GetCount: integer; override; function Get(Index : Integer) : string; override; //procedure SetSorted(Val : boolean); virtual; + procedure SetUpdateState(Updating: Boolean); override; public constructor Create(Handle: HWND; TheOwner: TWinControl); destructor Destroy; override; @@ -82,6 +83,13 @@ begin Setlength(Result, len); end; +procedure TWin32MemoStrings.SetUpdateState(Updating: Boolean); +begin + Windows.SendMessage(fHandle, WM_SETREDRAW, WPARAM(not Updating), 0); + if not Updating then + Windows.InvalidateRect(fHandle, nil, TRUE); +end; + constructor TWin32MemoStrings.Create(Handle: HWND; TheOwner: TWinControl); begin inherited Create; diff --git a/lcl/stdctrls.pp b/lcl/stdctrls.pp index 768201d3cd..0bee40a8b0 100644 --- a/lcl/stdctrls.pp +++ b/lcl/stdctrls.pp @@ -729,6 +729,7 @@ type procedure RealSetText(const Value: TCaption); override; function GetCachedText(var CachedText: TCaption): boolean; override; procedure SetLines(const Value: TStrings); + procedure SetSelText(const Val: string); override; procedure SetWantTabs(const NewWantTabs: boolean); procedure SetWordWrap(const Value: boolean); procedure SetScrollBars(const Value: TScrollStyle);