mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 07:59:44 +02:00
fixed showing contents of TMemo, if it contained text in design mode (bug #1053)
git-svn-id: trunk@7690 -
This commit is contained in:
parent
787523db4d
commit
defdd14239
@ -967,6 +967,7 @@ type
|
||||
function GetAction: TBasicAction; virtual;
|
||||
function RealGetText: TCaption; virtual;
|
||||
procedure RealSetText(const Value: TCaption); virtual;
|
||||
function GetCachedText(var CachedText: TCaption): boolean; virtual;
|
||||
procedure SetAction(Value: TBasicAction); virtual;
|
||||
procedure SetColor(Value: TColor); virtual;
|
||||
procedure SetEnabled(Value: Boolean); virtual;
|
||||
|
@ -3175,6 +3175,12 @@ begin
|
||||
Perform(CM_TEXTCHANGED, 0, 0);
|
||||
end;
|
||||
|
||||
function TControl.GetCachedText(var CachedText: TCaption): boolean;
|
||||
begin
|
||||
CachedText := FCaption;
|
||||
Result:= true;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
TControl SetText
|
||||
------------------------------------------------------------------------------}
|
||||
|
@ -143,6 +143,11 @@ begin
|
||||
Lines.Text := Value;
|
||||
end;
|
||||
|
||||
function TCustomMemo.GetCachedText(var CachedText: TCaption): boolean;
|
||||
begin
|
||||
Result:= false;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCustomMemo.SetLines
|
||||
Params:
|
||||
|
@ -3953,6 +3953,8 @@ end;
|
||||
created. Place cached property code here.
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TWinControl.InitializeWnd;
|
||||
var
|
||||
CachedText: string;
|
||||
begin
|
||||
Assert(False, Format('Trace:[TWinControl.InitializeWnd] %s', [ClassName]));
|
||||
// set all cached properties
|
||||
@ -3978,7 +3980,8 @@ begin
|
||||
|
||||
// Delay the setting of text until it is completely loaded
|
||||
if not (csLoading in ComponentState) then begin
|
||||
TWSWinControlClass(WidgetSetClass).SetText(Self, FCaption);
|
||||
if GetCachedText(CachedText) then
|
||||
TWSWinControlClass(WidgetSetClass).SetText(Self, CachedText);
|
||||
InvalidatePreferredSize;
|
||||
end;
|
||||
|
||||
@ -4045,10 +4048,13 @@ end;
|
||||
procedure TWinControl.Loaded;
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TWinControl.Loaded;
|
||||
var
|
||||
CachedText: string;
|
||||
begin
|
||||
if HandleAllocated then begin
|
||||
// Set cached caption
|
||||
TWSWinControlClass(WidgetSetClass).SetText(Self, FCaption);
|
||||
if GetCachedText(CachedText) then
|
||||
TWSWinControlClass(WidgetSetClass).SetText(Self, CachedText);
|
||||
InvalidatePreferredSize;
|
||||
|
||||
if [wcfColorChanged,wcfFontChanged]*FWinControlFlags<>[] then begin
|
||||
|
@ -668,6 +668,7 @@ type
|
||||
procedure DestroyHandle; override;
|
||||
function RealGetText: TCaption; override;
|
||||
procedure RealSetText(const Value: TCaption); override;
|
||||
function GetCachedText(var CachedText: TCaption): boolean; override;
|
||||
procedure SetLines(const Value: TStrings);
|
||||
procedure SetWordWrap(const Value: boolean);
|
||||
procedure SetScrollBars(const Value: TScrollStyle);
|
||||
|
Loading…
Reference in New Issue
Block a user