Colors, Fonts and Dialogs (Feb 25)

This week, our staff worked on the Layouts interface in our new estimating & accounting software.

Choose Custom Layouts from the Options menu in Goldenseal, and you’ll see the older version. It opens a drawing environment where you can move fields around, add new ones, and fiddle with sizes, colors and other properties. Custom Layouts is how you change the appearance of data entry screens, reports or printed forms.

Click the icon next to the paint bucket or pen, and you’ll see a pop-up palette with 256 colors. It’s how you set the fill and border color for any field. Our staff wrote that interface entirely from scratch in 1997. There’s about 150 lines of code that lays out a grid, fetches colors from a color look-up table (clut), fills them into the squares, pops a window and responds to clicks.

For text colors, you click on a text field, then choose Color from the Text menu. It shows the same color palette.

Having 256 color choices was common when we first released Goldenseal. The results fit into 1 byte. Most apps used the System palette, with evenly spaced colors (most of them very bright). We replaced it with a custom palette that has extra pastels (for backgrounds) and dark colors (for field borders and text). It’s more business-friendly. Still plenty of bright colors if you want them.

Choose Background Color from the Options menu, and you’ll see a System color picker. That’s for the newer style of colors, with millions of choices. Those take 4 bytes of storage (one byte each for red, green, blue and transparency).

We added new color pickers to TurtleSoft Pro this week. It only took a few lines of code. They show a QColorDialog, which can be either the System color picker, or Qt’s own version (similar to the one in Microsoft Excel). We’ll add a checkbox in Preferences so you can use either.

I don’t think any of the modern color pickers are quite as good as the original Goldenseal palette. For business forms, 256 colors is plenty. It’s hard to see the differences as it is. Having more choices just makes it more complicated.

However, modern systems don’t provide 1-byte palettes. It’s too much work to write another 256-color chooser from scratch. Setting colors is only a minor part of our software. So we will go with the flow and use QColorDialog and 4-byte colors.

For text formats, Goldenseal currently has a bunch of Text menu commands. It often takes several trips to the menu, and the list of fonts has grown absurdly long. We just added a Text Format button in TurtleSoft Pro that is much better. It uses QFontDialog, which also can show either a System or Qt font picker. Both have their advantages, so we’ll add a checkbox in Preferences for that, too.

The new Layouts panel is already looking pretty decent. We definitely will include it in the first release. Our staff can tweak stock layouts with it, and users can modify their own. Version 1.0 probably will skip some of the more complex features. Almost nobody uses them, and it’s not worth the delay to finish them now. If you want to modify report tables, it’s something to look forward to in a later update.

At this point, most of the unfinished work is dialogs. Goldenseal includes 119 different windows and dialogs, originally set up in CodeWarrior. Some are already replaced, and some are obsolete. But, at least half still need to be redone. Some are in Layouts: we sure could use them now to help with debugging. The rest are mostly for estimating and accounting tasks.

Like every platform, Qt has a drawing window to set up windows and dialogs. It looks a lot like our Custom Layouts. Like every platform, Qt also has a coding style to make dialogs function. Like every platform, the whole system has its oddities, gotchas and quirks. It ends up being a lot of steps.

I think it will be most efficient if we replace all the remaining dialogs and windows at the same time. Our staff will be in dialog setup mode for a while.

Dennis Kolva
Programming Director
TurtleSoft.com

Author: Dennis Kolva

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