mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 00:29:09 +02:00
Grids: implement option to set ParentColor and ParentFont of the internal cell editor.
This commit is contained in:
parent
5a0ff3af30
commit
675ad02215
@ -121,7 +121,9 @@ type
|
|||||||
|
|
||||||
TGridOption2 = (
|
TGridOption2 = (
|
||||||
goScrollToLastCol, // Allow scrolling to last column (so that last column can be LeftCol)
|
goScrollToLastCol, // Allow scrolling to last column (so that last column can be LeftCol)
|
||||||
goScrollToLastRow // Allow scrolling to last row (so that last row can be TopRow)
|
goScrollToLastRow, // Allow scrolling to last row (so that last row can be TopRow)
|
||||||
|
goEditorParentColor, // Set editor's ParentColor to True
|
||||||
|
goEditorParentFont // Set editor's ParentFont to True
|
||||||
);
|
);
|
||||||
TGridOptions2 = set of TGridOption2;
|
TGridOptions2 = set of TGridOption2;
|
||||||
|
|
||||||
@ -1981,6 +1983,9 @@ uses
|
|||||||
{$WARN IMPLICIT_STRING_CAST_LOSS OFF}
|
{$WARN IMPLICIT_STRING_CAST_LOSS OFF}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
type
|
||||||
|
TWinControlAccess = Class(TWinControl); //used in TCustomGrid.DoEditorShow
|
||||||
|
|
||||||
const
|
const
|
||||||
MULTISEL_MODIFIER = {$IFDEF Darwin}ssMeta{$ELSE}ssCtrl{$ENDIF};
|
MULTISEL_MODIFIER = {$IFDEF Darwin}ssMeta{$ELSE}ssCtrl{$ENDIF};
|
||||||
|
|
||||||
@ -7383,6 +7388,7 @@ begin
|
|||||||
Editor.Visible:=False;
|
Editor.Visible:=False;
|
||||||
{$ifdef dbgGrid}DebugLnExit('grid.DoEditorHide [',Editor.ClassName,'] END');{$endif}
|
{$ifdef dbgGrid}DebugLnExit('grid.DoEditorHide [',Editor.ClassName,'] END');{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomGrid.DoEditorShow;
|
procedure TCustomGrid.DoEditorShow;
|
||||||
var
|
var
|
||||||
ParentChanged: Boolean;
|
ParentChanged: Boolean;
|
||||||
@ -7409,6 +7415,14 @@ begin
|
|||||||
else
|
else
|
||||||
FStringEditor.Alignment:=taLeftJustify;
|
FStringEditor.Alignment:=taLeftJustify;
|
||||||
end;
|
end;
|
||||||
|
TWinControlAccess(FEditor).ParentColor := (goEditorParentColor in Options2);
|
||||||
|
TWinControlAccess(FEditor).ParentFont := (goEditorParentFont in Options2);
|
||||||
|
if (FEditor is TCompositeCellEditor) then
|
||||||
|
begin
|
||||||
|
TWinControlAccess(TCompositeCellEditor(FEditor).ActiveControl).ParentColor := (goEditorParentColor in Options2);
|
||||||
|
TWinControlAccess(TCompositeCellEditor(FEditor).ActiveControl).ParentFont := (goEditorParentFont in Options2);
|
||||||
|
end;
|
||||||
|
|
||||||
Editor.Visible:=True;
|
Editor.Visible:=True;
|
||||||
if Focused and Editor.CanFocus then
|
if Focused and Editor.CanFocus then
|
||||||
Editor.SetFocus;
|
Editor.SetFocus;
|
||||||
|
Loading…
Reference in New Issue
Block a user