RxFPC:TRxCloseFormValidator - add new property - IgnoreDisabled - ignore disabled controls on check form

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4146 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2015-05-20 12:20:54 +00:00
parent 8adf987bf9
commit e706371e5d

View File

@ -85,6 +85,7 @@ type
TRxCloseFormValidator = class(TComponent)
private
FErrorMsgCaption: string;
FIgnoreDisabled: boolean;
FOnCloseQuery : TCloseQueryEvent;
FItems:TValidateItems;
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
@ -103,6 +104,7 @@ type
published
property ErrorMsgCaption:string read FErrorMsgCaption write FErrorMsgCaption;
property Items:TValidateItems read GetItems write SetItems;
property IgnoreDisabled:boolean read FIgnoreDisabled write FIgnoreDisabled default false;
end;
implementation
@ -242,6 +244,9 @@ begin
Result:=true;
if not Assigned(FControl) then exit;
if (not FControl.Enabled) and (TRxCloseFormValidator(TValidateItems(Collection).Owner).IgnoreDisabled) then
exit;
if Assigned(FOnValidate) then
FOnValidate( TRxCloseFormValidator(TValidateItems(Collection).Owner), FControl, Result)
else