Text & Tabs (Oct 30)

Recently I set up online accounts for a new dentist, Covid/flu booster shots, and a couple other things. Most of the interfaces were terrible. For example, one date field kept saying “incorrect format”. It took several tries to find the only acceptable way to enter dates (03/09/2021). Phone numbers and passwords also were much too fussy about punctuation. Likewise, when we ship via PayPal, it complains if you enter the ounces but leave pounds blank.

Guys, it’s not that hard to program data entry fields to be tolerant. The approach we use in Goldenseal is to accept any text, then fix it into the correct format. Usually the conversion is pretty obvious. Blank pounds are zero pounds, duh.

Sometimes the code has to guess. Enter a number with two decimal points and we skip the second one. Half the time that will be wrong, but it’s still better than nagging you about it every time. Dates are the hardest. They have many ways to go wrong, but we try hard to make sense of anything that users type in. Worst case, we guess it’s today.

For TurtleSoft Pro, it didn’t take much to get the same behavior. Every field in TurtleSoft Pro is linked to an old-style Goldenseal field, which already knows how to fix text. Just one line of code, and it worked fine for the new data entry screens.

It wasn’t as easy for breakdown tables. They don’t have a link to an old-style field. This week we moved the text-fixing code so it works for table cells also.

Another convenience: if you are good at typing, then you probably like the Tab key. It’s a quick jump to the next field, with your hands still on the keyboard. The Qt framework that we use for TurtleSoft Pro “just works” for tabbing, based on the order you add fields. Sadly, it starts with the first field and goes down the list. Our code loads fields back-to-front, so their automatic tabbing goes backwards.

It was easier to rewrite tabbing from scratch, rather than reversing the order. It meant adding event filters to every type of field. They grab all mouse, keyboard and scroll wheel inputs. Eventually the event filters will do more than just listen for the tab key. For example, it’s how we can enter today’s date automatically with command-hyphen.

We also just installed a second machine that can run the current Goldenseal in the debugger. Thank you Carbon Copy Cloner for making it easy.

Dennis Kolva
Programming Director
TurtleSoft.com

Author: Dennis Kolva

Programming Director for Turtle Creek Software. Design & planning of accounting and estimating software.