OI: Revert r49480 #27f9198058 and update text value in OI control in a better way. Issue #23918.

git-svn-id: trunk@49489 -
This commit is contained in:
juha 2015-07-02 18:50:29 +00:00
parent 5e208cb2dd
commit fe64bb3834
2 changed files with 10 additions and 3 deletions

View File

@ -1221,6 +1221,8 @@ begin
if (not ASelection.ForceUpdate) and FSelection.IsEqual(ASelection) then exit;
OldSelectedRowPath:=PropertyPath(ItemIndex);
if FCurrentEdit = ValueEdit then
ValueEditExit(Self);
ItemIndex:=-1;
ClearRows;
FSelection.Assign(ASelection);
@ -1553,7 +1555,8 @@ var CurRow: TOIPropertyGridRow;
begin
if (pgsUpdatingEditControl in FStates) or not IsCurrentEditorAvailable then exit;
CurRow:=Rows[FItemIndex];
SetRowValue(true);
if paAutoUpdate in CurRow.Editor.GetAttributes then
SetRowValue(true);
end;
procedure TOICustomPropertyGrid.ValueEditMouseUp(Sender: TObject;

View File

@ -110,6 +110,9 @@ type
one component is selected. Some properties are not
appropriate for multi-selection (e.g. the Name
property).
paAutoUpdate: Causes the SetValue method to be called on each
change made to the editor instead of after the change
has been approved (e.g. the Caption property).
paReadOnly: Value is not allowed to change. But if paDialog is set
a Dialog can change the value. This disables only the
edit and combobox in the object inspector.
@ -231,6 +234,7 @@ type
paDynamicSubProps,
paDialog,
paMultiSelect,
paAutoUpdate,
paSortList,
paReadOnly,
paRevertable,
@ -5180,7 +5184,7 @@ end;
function TCaptionPropertyEditor.GetAttributes: TPropertyAttributes;
begin
Result := [paMultiSelect, paRevertable];
Result := [paMultiSelect, paAutoUpdate, paRevertable];
end;
{ TStringsPropertyEditor }
@ -5267,7 +5271,7 @@ end;
function TStringMultilinePropertyEditor.GetAttributes: TPropertyAttributes;
begin
Result := [paMultiSelect, paDialog, paRevertable];
Result := [paMultiSelect, paDialog, paRevertable, paAutoUpdate];
end;
{ TCursorPropertyEditor }