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:
vincents 2009-08-06 10:21:33 +00:00
parent 2a16a46258
commit 8b7dbf4939
3 changed files with 9 additions and 17 deletions

View File

@ -116,13 +116,13 @@ begin
RegisterCustomMemo;
end;
procedure TCustomMemo.CreateHandle;
procedure TCustomMemo.InitializeWnd;
var
NewStrings : TStrings;
begin
//DebugLn('[TCustomMemo.CreateHandle] A ',FLines.ClassName);
inherited CreateHandle;
//DebugLn('[TCustomMemo.CreateHandle] B ',DbgSName(Self),' ',FLines.ClassName,' FLines.Count=',dbgs(FLines.Count));
//DebugLn('[TCustomMemo.InitializeWnd] A ',FLines.ClassName);
inherited InitializeWnd;
//DebugLn('[TCustomMemo.InitializeWnd] B ',DbgSName(Self),' ',FLines.ClassName,' FLines.Count=',dbgs(FLines.Count));
// fetch/create the interface item list
NewStrings := TWSCustomMemoClass(WidgetSetClass).GetStrings(Self);
@ -135,10 +135,10 @@ begin
// new item list is the interface item list
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;
procedure TCustomMemo.DestroyHandle;
procedure TCustomMemo.FinalizeWnd;
var
NewStrings : TStrings;
begin
@ -155,7 +155,7 @@ begin
// new item list is the internal item list
FLines:= NewStrings;
end;
inherited DestroyHandle;
inherited FinalizeWnd;
end;
function TCustomMemo.RealGetText: TCaption;

View File

@ -206,10 +206,6 @@ begin
if not WSCheckHandleAllocated(ACustomEdit, 'SetSelStart') then
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.QueueCursorMove(NewStart);
end;
@ -222,10 +218,6 @@ begin
if not WSCheckHandleAllocated(ACustomEdit, 'SetSelLength') then
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.QueueSelectLength(NewLength);
end;

View File

@ -789,8 +789,8 @@ type
function StoreScrollBars: boolean;
protected
class procedure WSRegisterClass; override;
procedure CreateHandle; override;
procedure DestroyHandle; override;
procedure InitializeWnd; override;
procedure FinalizeWnd; override;
function RealGetText: TCaption; override;
procedure RealSetText(const Value: TCaption); override;
function GetCachedText(var CachedText: TCaption): boolean; override;