Pictures & Links (Aug 28)

Custom Layouts is almost complete in our new accounting software. The biggest item still on the to-do list is pictures.

Goldenseal stores pix as binary data inside the company file. It uses Apple’s PICT format: once the most popular way to store bitmaps and vector images, but now obsolete.

Qt supports BMP, JPEG, PNG and a few less common graphic formats. But it can’t read PICT. We also couldn’t find any C++ code to do that. Sadly, when you convert your company file from Goldenseal to the new accounting app, any pictures will be left behind. Screen shots are the easiest way to salvage them.

The new business software stores all pictures as external files. You can put them in the TurtleSoft folder inside Pictures, or anywhere else that you choose. The database just has some text: a path to the folder location and file name.

There are trade-offs to the new system. On the plus side, it makes the company file smaller: no huge chunks of binary amongst the accounting and estimate data. Editing pictures is easier. There’s no need to export/import, just open them with any graphics app.

On the minus side: backups are more complicated. Switching to a new computer means moving more than just the app and company file.

File paths are good for more than just graphic images. They also can link to PDF documents, Excel spreadsheets, or anything else. Those files won’t display inside the accounting software window. Instead, they’ll launch the app that created them, and open in a separate window. Links also can use an Internet URL: those will open a browser page.

Goldenseal didn’t start out storing pictures inside records. We added them piecemeal to a few classes: first Cost Items, then Estimates, then a few more. In the new accounting app, any record class can store a picture, file link or website URL. The coding is easier that way.

I think pictures and links will be useful in many new places.

Dennis Kolva
Programming Director
TurtleSoft.com

 

 

 

Drawing Lines (Aug 20)

Our staff spent far too much time on line drawing this past week. We need them for printing and data forms in the new accounting software. Here’s a microscope view of one small bit of programmer sweat.

To print a line on screen or paper, it takes four numbers: x and y values for the start point, then x and y for the end. The same four numbers can also make a rectangle: one point for upper left, one for lower right. Qt specs it another way: upper left point, width, height. Both end up the same.

Every GUI uses lots of rectangles. Fields have visible boxes. Text has an invisible one. Ovals and rounded rectangles draw curves inside a box. Many apps have a drawing interface to modify shapes: it’s in all CAD software, MS Excel or Word, OpenOffice, Goldenseal’s Custom Layouts, and many others.

The standard used to be four handle boxes at the corners: drag on them to change size and shape. Drag the middle to move the whole thing. Goldenseal has code to do that in Custom Layouts. Newer software adds handles at the midpoints so you can pull in just one dimension. We now do that too.

Handle-dragging has a possible problem: what happens when you shrink to zero and keep going? Dealing with it is a programmer decision.

Goldenseal flips the numbers, turns the rectangle into a positive, and keeps going. That needed lots of complex code that isn’t easy to duplicate. The new accounting software simply stops before the edge. In fact, it won’t even go to zero, avoiding an itsy rectangle that’s hard to work with. After testing, the new approach seems fine.

Lines are less common, and totally different. In Goldenseal, you click on the handle at either end, and drag that point anywhere. A click in the middle drags the whole line. That code is buggy: some drags leave screen garbage. Getting pure verticals and horizontals isn’t easy.

Our staff tried to make end-dragging work the same way for lines in the new accounting software, but it was just too hard. Every attempt went bonkers. We finally decided to have separate commands for three types of lines: horizontal, vertical, diagonal. They’re now just rectangles that draw a line inside.

That still left one issue: diagonals can go up or down. Goldenseal stores the line slope to figure that: another design flaw. The easy answer was two commands for diagonal lines. Not like you see a lot of diagonals on business forms, anyhow.

Something trivial needed many attempts and much quandary. Multiply that by a few thousand, and it’s the history of TurtleSoft.

Dennis Kolva
Programming Director
TurtleSoft.com

Versions (Aug 13)

TurtleSoft released Goldenseal accounting/estimating software in 2000. It wasn’t long before we wanted to change it. New apps are never perfect in version 1.0. Heck, automobiles have been around for 138 years and they’re still getting big rewrites.

There’s a problem when we add new data fields. Users may already have records with the old setup, so the new code must accept two different arrangements. The solution is to use a file version number. When you read from disk, the code branches, depending on the version. Some data classes have changed many times: the current maximum is 9.

Layouts for data entry screens, reports and printed forms also need a version system. For example, we added help text to data fields in late 2000, then to buttons in 2001, then to breakdown tables in 2002. Each change added more data to read, so layouts also need different versions. The current max is 14.

For users, versions are invisible. For programmers, they are a PITA. Branches are easy to screw up. They clutter up the code base, and cause hard-to-find bugs.

Our new accounting software is a chance to start fresh. Once you convert your Goldenseal accounting file into the new app format, it bypasses all the old version branches. Some day we can delete them.

Likewise, new layouts are stored as text, not binary. Some day we can clear out the complicated code that reads Goldenseal layouts. In fact we won’t need many versions from now on, since text is less fussy than binary. We can add stuff at the end of a line and just continue if it’s not there.

Versions are one reason our staff has taken so long for the 64-bit replacement. We want to make all the big changes before the first release. Getting it right at the start avoids headaches later.

Meanwhile, our staff is still working on Custom Layouts. It’s now possible to add new fields and graphics. Colors can be partly transparent. Circles and ovals finally draw right, after much frustration. Lines are still a challenge. You’d think they’d be simpler than rectangles, but they’re not.

Dennis Kolva
Programming Director
TurtleSoft.com

Layouts & Screens (Aug 6)

Goldenseal accounting/estimating software is 24 years old. It was designed for the smaller screens of the 90s and early 00s, with pixels at 72 dots per inch. Since then, screens grew bigger and pixels shrank. Expectations of what an app should look like also changed to suit the bigger space.

Our new accounting software needs to fudge Goldenseal’s layouts to make them look OK on modern hardware. It has code for most problems: text expands from 9 points to 12, fields get bigger. The approach is similar to the Magnify feature in Goldenseal, added in version 4.3 to solve the same issue.

Even with adjustments, layouts still looked cluttered. So we added code to shift the right column over by 10 pixels. Plus a few other tweaks. Sometimes Mac and Windows need different treatments.

The code hacks makes most screens look better, but some are still ugly. We’ll need to adjust those individually, using Custom Layouts. Our staff spent the past couple weeks improving it: the work is nearly complete. You now can export layouts to a text file or import them back. Most of the nifty tools are working.

Editing a text file looks like a decent way to tweak layouts. Every value has a label, and most make sense. We also made a few changes to improve the new text-based system.

About the only thing left unfinished is pictures and logos. We did most of the work for those last year, but it’s time to make a final version. I’ll talk more about that in a future post.

Dennis Kolva
Programming Director
TurtleSoft.com