ValEdit: override TValueListStrings.SetTextStr: Don't show editor while changing values. Edited cell would not be changed.

git-svn-id: trunk@39469 -
This commit is contained in:
bart 2012-12-06 23:13:17 +00:00
parent 9f01fe7db9
commit bca930e0c9

View File

@ -16,6 +16,8 @@ type
TValueListStrings = class(TStringList)
private
FOwner: TValueListEditor;
protected
procedure SetTextStr(const Value: string); override;
public
constructor Create(AOwner: TValueListEditor);
destructor Destroy; override;
@ -206,6 +208,20 @@ implementation
{ TValueListStrings }
procedure TValueListStrings.SetTextStr(const Value: string);
var
IsShowingEditor: Boolean;
begin
with FOwner do begin
// Don't show editor while changing values. Edited cell would not be changed.
IsShowingEditor := goAlwaysShowEditor in Options;
Options := Options - [goAlwaysShowEditor];
inherited SetTextStr(Value);
if IsShowingEditor then
Options := Options + [goAlwaysShowEditor];
end;
end;
constructor TValueListStrings.Create(AOwner: TValueListEditor);
begin
inherited Create;