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