mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-24 01:59:42 +01:00
ValEdit: Fix not updating cell in TValueListStrings.Put when goAlwaysShowEditor in Options and current
editor is TCompositeCellEditor. git-svn-id: trunk@40376 -
This commit is contained in:
parent
d2b9d862ef
commit
729e3e2fdb
@ -293,6 +293,9 @@ procedure Register;
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
type
|
||||||
|
TCompositeCellEditorAccess = class(TCompositeCellEditor);
|
||||||
|
|
||||||
{ TItemProp }
|
{ TItemProp }
|
||||||
|
|
||||||
|
|
||||||
@ -489,15 +492,27 @@ end;
|
|||||||
procedure TValueListStrings.Put(Index: Integer; const S: String);
|
procedure TValueListStrings.Put(Index: Integer; const S: String);
|
||||||
var
|
var
|
||||||
IndexToRow: Integer;
|
IndexToRow: Integer;
|
||||||
MustHideShowingEditor: Boolean;
|
MustHideShowingEditor, EditorHasFocus: Boolean;
|
||||||
|
WC: TwinControl;
|
||||||
begin
|
begin
|
||||||
// ToDo: Check validity of key
|
// ToDo: Check validity of key
|
||||||
IndexToRow := Index + FGrid.FixedRows;
|
IndexToRow := Index + FGrid.FixedRows;
|
||||||
|
if (FGrid.Editor is TCompositeCellEditor) then
|
||||||
|
begin
|
||||||
|
WC := TCompositeCellEditorAccess(FGrid.Editor).GetActiveEditor;
|
||||||
|
if (WC is TCustomEdit) then
|
||||||
|
EditorHasFocus := TCustomEdit(WC).Focused
|
||||||
|
else
|
||||||
|
EditorHasFocus := False;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
EditorHasFocus := FGrid.Editor.Focused;
|
||||||
MustHideShowingEditor := (goAlwaysShowEditor in FGrid.Options) and
|
MustHideShowingEditor := (goAlwaysShowEditor in FGrid.Options) and
|
||||||
FGrid.Editor.Visible and
|
FGrid.Editor.Visible and
|
||||||
(IndexToRow = FGrid.Row) and
|
(IndexToRow = FGrid.Row) and
|
||||||
//if editor is Focussed, we are editing a cell, so we cannot hide!
|
//if editor is Focussed, we are editing a cell, so we cannot hide!
|
||||||
(not FGrid.Editor.Focused);
|
(not EditorHasFocus);
|
||||||
|
|
||||||
//debugln('TValueListStrings.Put: MustHideShowingEditor=',DbgS(MustHideShowingEditor));
|
//debugln('TValueListStrings.Put: MustHideShowingEditor=',DbgS(MustHideShowingEditor));
|
||||||
if MustHideShowingEditor then FGrid.Options := FGrid.Options - [goAlwaysShowEditor];
|
if MustHideShowingEditor then FGrid.Options := FGrid.Options - [goAlwaysShowEditor];
|
||||||
inherited Put(Index, S);
|
inherited Put(Index, S);
|
||||||
@ -950,8 +965,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
type
|
|
||||||
TCompositeCellEditorAccess = class(TCompositeCellEditor);
|
|
||||||
|
|
||||||
function TValueListEditor.GetDefaultEditor(Column: Integer): TWinControl;
|
function TValueListEditor.GetDefaultEditor(Column: Integer): TWinControl;
|
||||||
procedure SetGridEditorReadOnly(Ed: TwinControl; RO: Boolean);
|
procedure SetGridEditorReadOnly(Ed: TwinControl; RO: Boolean);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user