Something not in the original design spec (what there was of a spec, heh) was progress bars. I was pondering them today, then realised that most of the work was already done - they re-use the same algorithm that the sliders use to calculate the size of their grips. A few minutes later and I’ve got a ProgressBar class done. It’s little more than 30 lines of code.
In extracting the bits of the slider that I needed, I spotted the error that’s been throwing out the grip positioning and resizing routines - they should be rounding up before bitshifting away the fractional part of the calculation. I’ve now fixed that, and the grip moves correctly.
Double-clicking is now optional. It is enabled in a gadget by setting the new “doubleClickable” flag to true or, if you’re subclassing, you can send “GADGET_DOUBLE_CLICKABLE” in the flag bitmask. If this is not set, all clicks are processed as single clicks.
Something that’s been bugging me for a while (since Jeff picked it up) is the “Woopsi::play()” function. This is now called “Woopsi::run()“. I’ve also made some of the methods within the Woopsi class protected that were previously public, since they shouldn’t really be called outside of the Woopsi class.
There are a few other changes. Gadget::unregisterChildrenFromVBL() is now recursive, and unregisters all children and their children (etc) from the VBL system. Previously, only the top level of child gadgets was getting unregistered.
The Gadget destructor is now more intelligent, and will clean up gadgets that are deleted without going through the deletion queue. This is not intended to allow gadgets to be placed on the stack or deleted manually; instead, it is to ensure that the children of gadgets that are being deleted are also deleted correctly. Related to this, the context menu gets shelved if the gadget that opened it is itself closed.