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'
|
Caption = 'Options editor'
|
||||||
ClientHeight = 493
|
ClientHeight = 493
|
||||||
ClientWidth = 559
|
ClientWidth = 559
|
||||||
|
OnCloseQuery = FormCloseQuery
|
||||||
inherited Back: TPanel
|
inherited Back: TPanel
|
||||||
Height = 493
|
Height = 493
|
||||||
Width = 559
|
Width = 559
|
||||||
|
|
|
@ -33,6 +33,7 @@ type
|
||||||
selCat: TTreeView;
|
selCat: TTreeView;
|
||||||
procedure btnAcceptClick(Sender: TObject);
|
procedure btnAcceptClick(Sender: TObject);
|
||||||
procedure btnCancelClick(Sender: TObject);
|
procedure btnCancelClick(Sender: TObject);
|
||||||
|
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||||
procedure inspectorEditorFilter(Sender: TObject; aEditor: TPropertyEditor;
|
procedure inspectorEditorFilter(Sender: TObject; aEditor: TPropertyEditor;
|
||||||
var aShow: boolean);
|
var aShow: boolean);
|
||||||
procedure inspectorModified(Sender: TObject);
|
procedure inspectorModified(Sender: TObject);
|
||||||
|
@ -204,6 +205,20 @@ begin
|
||||||
.optionedEvent(oeeCancel);
|
.optionedEvent(oeeCancel);
|
||||||
end;
|
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:
|
procedure TCEOptionEditorWidget.inspectorEditorFilter(Sender: TObject;aEditor:
|
||||||
TPropertyEditor; var aShow: boolean);
|
TPropertyEditor; var aShow: boolean);
|
||||||
begin
|
begin
|
||||||
|
|
Loading…
Reference in New Issue