You've already forked lazarus-ccr
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:
@ -85,6 +85,7 @@ type
|
|||||||
TRxCloseFormValidator = class(TComponent)
|
TRxCloseFormValidator = class(TComponent)
|
||||||
private
|
private
|
||||||
FErrorMsgCaption: string;
|
FErrorMsgCaption: string;
|
||||||
|
FIgnoreDisabled: boolean;
|
||||||
FOnCloseQuery : TCloseQueryEvent;
|
FOnCloseQuery : TCloseQueryEvent;
|
||||||
FItems:TValidateItems;
|
FItems:TValidateItems;
|
||||||
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||||
@ -103,6 +104,7 @@ type
|
|||||||
published
|
published
|
||||||
property ErrorMsgCaption:string read FErrorMsgCaption write FErrorMsgCaption;
|
property ErrorMsgCaption:string read FErrorMsgCaption write FErrorMsgCaption;
|
||||||
property Items:TValidateItems read GetItems write SetItems;
|
property Items:TValidateItems read GetItems write SetItems;
|
||||||
|
property IgnoreDisabled:boolean read FIgnoreDisabled write FIgnoreDisabled default false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -242,6 +244,9 @@ begin
|
|||||||
Result:=true;
|
Result:=true;
|
||||||
if not Assigned(FControl) then exit;
|
if not Assigned(FControl) then exit;
|
||||||
|
|
||||||
|
if (not FControl.Enabled) and (TRxCloseFormValidator(TValidateItems(Collection).Owner).IgnoreDisabled) then
|
||||||
|
exit;
|
||||||
|
|
||||||
if Assigned(FOnValidate) then
|
if Assigned(FOnValidate) then
|
||||||
FOnValidate( TRxCloseFormValidator(TValidateItems(Collection).Owner), FControl, Result)
|
FOnValidate( TRxCloseFormValidator(TValidateItems(Collection).Owner), FControl, Result)
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user