Grids: Remove unneccesary TCompositeCellEditor.GetActiveEditor (introduced in r40375 #d2b9d862ef),

make GetActiveControl protected instead.

git-svn-id: trunk@40415 -
This commit is contained in:
bart 2013-02-26 16:32:57 +00:00
parent f3fc3a03ef
commit 5d55b90f96
2 changed files with 3 additions and 18 deletions

View File

@ -278,7 +278,6 @@ type
FCol,FRow: Integer;
FEditors: array of TEditorItem;
procedure DispatchMsg(msg: TGridMessage);
function GetActiveControl: TWinControl;
function GetMaxLength: Integer;
procedure SetMaxLength(AValue: Integer);
protected
@ -292,10 +291,10 @@ type
procedure CMControlChange(var Message: TLMEssage); message CM_CONTROLCHANGE;
procedure msg_SetPos(var Msg: TGridMessage); message GM_SETPOS;
procedure msg_GetGrid(var Msg: TGridMessage); message GM_GETGRID;
function GetActiveControl: TWinControl;
procedure VisibleChanging; override;
function SendChar(AChar: TUTF8Char): Integer;
procedure WndProc(var TheMessage : TLMessage); override;
function GetActiveEditor: TWinControl;
public
destructor Destroy; override;
procedure AddEditor(aEditor: TWinControl; aAlign: TAlign; ActiveCtrl:boolean);
@ -12012,20 +12011,6 @@ begin
inherited WndProc(TheMessage);
end;
function TCompositeCellEditor.GetActiveEditor: TWinControl;
var
i: Integer;
begin
Result := nil;
for i := 0 to Length(FEditors) - 1 do
begin
if FEditors[i].ActiveControl then
begin
Result := FEditors[i].Editor;
Exit;
end;
end;
end;
function TCompositeCellEditor.DoUTF8KeyPress(var UTF8Key: TUTF8Char): boolean;
begin

View File

@ -502,7 +502,7 @@ begin
IndexToRow := Index + FGrid.FixedRows;
if (FGrid.Editor is TCompositeCellEditor) then
begin
WC := TCompositeCellEditorAccess(FGrid.Editor).GetActiveEditor;
WC := TCompositeCellEditorAccess(FGrid.Editor).GetActiveControl;
if (WC is TCustomEdit) then
EditorHasFocus := TCustomEdit(WC).Focused
else
@ -1024,7 +1024,7 @@ begin
end;
esEllipsis: begin
result := EditorByStyle(cbsEllipsis);
SetGridEditorReadOnly(TCompositeCellEditorAccess(result).GetActiveEditor, ItemProp.ReadOnly);
SetGridEditorReadOnly(TCompositeCellEditorAccess(result).GetActiveControl, ItemProp.ReadOnly);
end;
esPickList: begin
result := EditorByStyle(cbsPickList);