Misc Updates

A collection of minor updates over the last few days. First up, drawing optimisation. Gadgets now have a “changeDimensions()” method that will move and resize a gadget with a single redraw operation. I’ve removed the “autoDrawing” bodge from the MultiLineTextBox and replaced it with calls to setVisible() instead. The Debug class uses the setVisible() method to optimise redraws.

Next, includes and dependencies. I’ve gone through most of the classes and moved all includes, where possible, out of the .h files and into the .cpp files. It should make builds quicker and make dependencies easier to manage.

John, the chap making the maths program, noticed (amongst other things) that a lot of the gadgets are missing resize() methods. I’ve added a resize method into the MultiLineTextBox, and I’ve fixed the AmigaWindow::resize() method that’s been broken since the “isPermeable” code was added in.

Another of John’s queries regarded collection classes. Why does the Gadget class include a lot of code for handling children if it doesn’t include all of the code? Why do the AmigaScreen, AmigaWindow, RadioButtonGroup, etc classes need to re-implement the same subgadget-handling code? I’ve merged all of that into the Gadget class. All gadgets can now interact with their child gadgets properly.

Some changes to windows and screens. I’ve removed all of the window/screen decoration button classes (flip, depth, etc) and replaced them with two classes that do the same thing - DecorationGlyphButton and WindowBorderButton (that inherits from the previous class). I was able to do this because I stripped the code out of the buttons that interacted with their parent gadgets and made them raise events instead. Much tidier.

Lastly, I have a quick list of things to do before the next release:

  • Textbox resize
  • Slider resize
  • Scrollbar resize
  • MultiLineTextBox alignment
  • Horizontal scrollbar
  • Slider incorrect height (rounding error?) - can it be fixed?
  • Scrollbar up/down buttons increase by different amounts
  • Fix the Alert class
  • Is it possible to refactor focus/blur/active system to make it less spaghetti-fied?

That last one might not make it into the next release, but it’s something I need to look into. In other news:

  • I upgraded my CycloDS from firmware 1.13 to 1.3. Woopsi works fine.
  • I’ve also upgraded the blog’s search facility. It will now search comments in addition to posts, and highlight any matches it finds.
  • The PALib website isn’t working. The error message suggests that the database has vanished. Given Mollusk’s lack of interest in PALib (last time I saw his name on the net, he was making iPhone applications), who knows when it will get fixed…


Jeff on 2008-03-17 at 23:40 said:

” moved all includes, where possible, out of the .cpp files and into the .h files. “

I hope you mean the other way around?

ant on 2008-03-18 at 00:03 said:

Heh, yep! I’ll fix that in the post…