mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 12:59:12 +02:00
LCL: moved the creation of interface specific TCustomMemo.Lines from CreateHandle to InitializeWnd, so that Lines are interfaces specific in TCustomEdit.CreateWnd, a proper fix for r21115 #2a16a46258
git-svn-id: trunk@21116 -
This commit is contained in:
parent
2a16a46258
commit
8b7dbf4939
@ -116,13 +116,13 @@ begin
|
|||||||
RegisterCustomMemo;
|
RegisterCustomMemo;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomMemo.CreateHandle;
|
procedure TCustomMemo.InitializeWnd;
|
||||||
var
|
var
|
||||||
NewStrings : TStrings;
|
NewStrings : TStrings;
|
||||||
begin
|
begin
|
||||||
//DebugLn('[TCustomMemo.CreateHandle] A ',FLines.ClassName);
|
//DebugLn('[TCustomMemo.InitializeWnd] A ',FLines.ClassName);
|
||||||
inherited CreateHandle;
|
inherited InitializeWnd;
|
||||||
//DebugLn('[TCustomMemo.CreateHandle] B ',DbgSName(Self),' ',FLines.ClassName,' FLines.Count=',dbgs(FLines.Count));
|
//DebugLn('[TCustomMemo.InitializeWnd] B ',DbgSName(Self),' ',FLines.ClassName,' FLines.Count=',dbgs(FLines.Count));
|
||||||
|
|
||||||
// fetch/create the interface item list
|
// fetch/create the interface item list
|
||||||
NewStrings := TWSCustomMemoClass(WidgetSetClass).GetStrings(Self);
|
NewStrings := TWSCustomMemoClass(WidgetSetClass).GetStrings(Self);
|
||||||
@ -135,10 +135,10 @@ begin
|
|||||||
// new item list is the interface item list
|
// new item list is the interface item list
|
||||||
FLines:= NewStrings;
|
FLines:= NewStrings;
|
||||||
|
|
||||||
//DebugLn('[TCustomMemo.CreateHandle] END ',DbgSName(Self),' ',FLines.ClassName,' FLines.Count=',dbgs(FLines.Count));
|
//DebugLn('[TCustomMemo.InitializeWnd] END ',DbgSName(Self),' ',FLines.ClassName,' FLines.Count=',dbgs(FLines.Count));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomMemo.DestroyHandle;
|
procedure TCustomMemo.FinalizeWnd;
|
||||||
var
|
var
|
||||||
NewStrings : TStrings;
|
NewStrings : TStrings;
|
||||||
begin
|
begin
|
||||||
@ -155,7 +155,7 @@ begin
|
|||||||
// new item list is the internal item list
|
// new item list is the internal item list
|
||||||
FLines:= NewStrings;
|
FLines:= NewStrings;
|
||||||
end;
|
end;
|
||||||
inherited DestroyHandle;
|
inherited FinalizeWnd;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomMemo.RealGetText: TCaption;
|
function TCustomMemo.RealGetText: TCaption;
|
||||||
|
@ -206,10 +206,6 @@ begin
|
|||||||
if not WSCheckHandleAllocated(ACustomEdit, 'SetSelStart') then
|
if not WSCheckHandleAllocated(ACustomEdit, 'SetSelStart') then
|
||||||
Exit;
|
Exit;
|
||||||
|
|
||||||
// temporary fix, exit is Lines is not a TGTk2MemoStrings
|
|
||||||
if not (TCustomMemo(ACustomEdit).Lines is TGtk2MemoStrings) then
|
|
||||||
exit;
|
|
||||||
|
|
||||||
MemoStrings := TCustomMemo(ACustomEdit).Lines as TGtk2MemoStrings;
|
MemoStrings := TCustomMemo(ACustomEdit).Lines as TGtk2MemoStrings;
|
||||||
MemoStrings.QueueCursorMove(NewStart);
|
MemoStrings.QueueCursorMove(NewStart);
|
||||||
end;
|
end;
|
||||||
@ -222,10 +218,6 @@ begin
|
|||||||
if not WSCheckHandleAllocated(ACustomEdit, 'SetSelLength') then
|
if not WSCheckHandleAllocated(ACustomEdit, 'SetSelLength') then
|
||||||
Exit;
|
Exit;
|
||||||
|
|
||||||
// temporary fix, exit is Lines is not a TGTk2MemoStrings
|
|
||||||
if not (TCustomMemo(ACustomEdit).Lines is TGtk2MemoStrings) then
|
|
||||||
exit;
|
|
||||||
|
|
||||||
MemoStrings := TCustomMemo(ACustomEdit).Lines as TGtk2MemoStrings;
|
MemoStrings := TCustomMemo(ACustomEdit).Lines as TGtk2MemoStrings;
|
||||||
MemoStrings.QueueSelectLength(NewLength);
|
MemoStrings.QueueSelectLength(NewLength);
|
||||||
end;
|
end;
|
||||||
|
@ -789,8 +789,8 @@ type
|
|||||||
function StoreScrollBars: boolean;
|
function StoreScrollBars: boolean;
|
||||||
protected
|
protected
|
||||||
class procedure WSRegisterClass; override;
|
class procedure WSRegisterClass; override;
|
||||||
procedure CreateHandle; override;
|
procedure InitializeWnd; override;
|
||||||
procedure DestroyHandle; override;
|
procedure FinalizeWnd; 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;
|
function GetCachedText(var CachedText: TCaption): boolean; override;
|
||||||
|
Loading…
Reference in New Issue
Block a user