Bug in SignatureBoxWrapper

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
wjstarck
Posts: 935
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Bug in SignatureBoxWrapper

Post by wjstarck » Fri Mar 20, 2020 6:24 pm

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.
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

User avatar
wjstarck
Posts: 935
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Re: Bug in SignatureBoxWrapper

Post by wjstarck » Fri Mar 20, 2020 6:39 pm

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();
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

User avatar
cmcgehee
Posts: 711
Joined: Tue Aug 25, 2015 5:06 pm
Location: Salem, Oregon

Re: Bug in SignatureBoxWrapper

Post by cmcgehee » Mon Mar 23, 2020 9:08 am

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.
Chris McGehee
Open Dental Software
http://www.opendental.com

Post Reply