diff options
Diffstat (limited to 'examples/apps/uidesigner/vfdprops.pas')
-rw-r--r-- | examples/apps/uidesigner/vfdprops.pas | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/examples/apps/uidesigner/vfdprops.pas b/examples/apps/uidesigner/vfdprops.pas index 7e033d24..a46b73c5 100644 --- a/examples/apps/uidesigner/vfdprops.pas +++ b/examples/apps/uidesigner/vfdprops.pas @@ -139,6 +139,11 @@ type procedure EditStringList(sl: TStringList); procedure GetEnumPropValueList(wg: TObject; const APropName: string; sl: TStringList); +const + DefUndoOnPropExit = False; + +var + UndoOnPropExit: Boolean = DefUndoOnPropExit; implementation @@ -280,7 +285,13 @@ end; procedure TGeneralPropertyEditor.EditExit(Sender: TObject); begin if FOrigValue <> edit.Text then - edit.Text := FOrigvalue; + if UndoOnPropExit then + edit.Text := FOrigvalue + else + begin + UpdateProperty(nil); + FOrigValue := edit.Text; + end; end; procedure TGeneralPropertyEditor.EditKeyPressed(Sender: TObject; @@ -291,6 +302,10 @@ begin UpdateProperty(nil); FOrigValue := edit.Text; end + else if (keycode=keyEscape) then + begin + edit.Text := FOrigValue; + end else inherited; end; |