Page 1 of 1

Bug in SignatureBoxWrapper

Posted: Fri Mar 20, 2020 6:24 pm
by wjstarck
Not sure if this is a bug or not, maybe I'm just doing it wrong.

When I invalidate a signature because something has changed on the form, I call SignatureBoxWrapper.ClearSignature(). If I then try to call SignatureBoxWrapper.SetInvalid(),so the invalid signature label will show, nothing happens. If I instead call only SignatureBoxWrapper.SetInvalid(), that label will show but the signature will show underneath which is pretty ugly.

If I modify SignatureBoxWrapper.SetInvalid() like so the signature is cleared and the label shows nicely in its place.

Code: Select all

		public void SetInvalid(){
			if(sigBoxTopaz!=null && sigBoxTopaz.Visible){
				if(TopazWrapper.GetTopazNumberOfTabletPoints(sigBoxTopaz)==0){
					return;//no need to do anything because no signature
				}
			}
			else{
				if(sigBox.NumberOfTabletPoints()==0) {
					return;//no need to do anything because no signature
				}
			}
			ClearSignature(); <--------------------------------Add 
			labelInvalidSig.Visible=true;
			labelInvalidSig.BringToFront();
		}
So, is this a feature request, or a bug? OD 20.1.2 beta.

Thanks.

Re: Bug in SignatureBoxWrapper

Posted: Fri Mar 20, 2020 6:39 pm
by wjstarck
And, for the sake of completeness,

Code: Select all

		protected void OnSignatureChanged() {
			SigChanged=true;
			if(SignatureChanged!=null){
				labelInvalidSig.Visible = false; <--------------------ADD
				SignatureChanged(this,new EventArgs());
			}
		}
This does the reverse and clears the label when the form is resigned, so that they don't overlap :o

SignatureBoxWrapper.OnSignatureChanged();

Re: Bug in SignatureBoxWrapper

Posted: Mon Mar 23, 2020 9:08 am
by cmcgehee
Our approach to signatures is that when the user changes something in the form, we simply clear the signature but don't display "Invalid signature". So from our perspective, the behavior you're describing is not a bug. If you would like to clear it and display "Invalid signature", I would recommend calling ClearSignature() and then using reflection to set labelInvalidSig to Visible.