2008-01-18

Scrollbar Changes

The trickle of changes continues. First up, a non-scrollbar related change - the EventHandler is now an abstract class. It makes no sense to be able to create an instance of the EventHandler and, since it only contains one method to be overridden, there’s no hardship for the developer if that method is implemented in the base class as a pure virtual function.

Next on the list, more scrollbar changes. I’ve renamed the scrollbar classes to “SliderVertical” and “SliderVerticalGrip”. The old “ScrollbarVerticalComplex” is now just “ScrollbarVertical”. This reflects the fact that the scrollbar gadget can be reused as a slider gadget.

I’ve stripped out the “raiseScrollEvent()” from the SliderVertical class, and made it raise a value change event instead. “Scroll” was obviously the wrong event here, as the scrollbar/slider does not actually scroll. I’ve added in maximum, minimum and current value getters and setters. The setters will automatically resize the grip within a sensible range.