mirror of https://gitlab.com/basile.b/dexed.git
option editor, warn about unsaved changes on close
This commit is contained in:
parent
0c1862c9ba
commit
01a15e610f
|
@ -7,6 +7,7 @@ inherited CEOptionEditorWidget: TCEOptionEditorWidget
|
|||
Caption = 'Options editor'
|
||||
ClientHeight = 493
|
||||
ClientWidth = 559
|
||||
OnCloseQuery = FormCloseQuery
|
||||
inherited Back: TPanel
|
||||
Height = 493
|
||||
Width = 559
|
||||
|
|
|
@ -33,6 +33,7 @@ type
|
|||
selCat: TTreeView;
|
||||
procedure btnAcceptClick(Sender: TObject);
|
||||
procedure btnCancelClick(Sender: TObject);
|
||||
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||
procedure inspectorEditorFilter(Sender: TObject; aEditor: TPropertyEditor;
|
||||
var aShow: boolean);
|
||||
procedure inspectorModified(Sender: TObject);
|
||||
|
@ -204,6 +205,20 @@ begin
|
|||
.optionedEvent(oeeCancel);
|
||||
end;
|
||||
|
||||
procedure TCEOptionEditorWidget.FormCloseQuery(Sender: TObject;
|
||||
var CanClose: boolean);
|
||||
begin
|
||||
if fCatChanged then
|
||||
begin
|
||||
CanClose := dlgOkCancel(
|
||||
'The modifications of the current category are not validated, ' +
|
||||
'discard them and continue ?' ) = mrOk;
|
||||
if CanClose then
|
||||
btnCancelClick(nil);
|
||||
end
|
||||
else CanClose := true;
|
||||
end;
|
||||
|
||||
procedure TCEOptionEditorWidget.inspectorEditorFilter(Sender: TObject;aEditor:
|
||||
TPropertyEditor; var aShow: boolean);
|
||||
begin
|
||||
|
|
Loading…
Reference in New Issue