• 9
• 10
• 9
• 11
• 14
• entries
63
56
• views
44150

# Love programming

153 views

The last two days have been good to me programming wise. A few bits of my GUI framework have come together very nicely.

And a hint for anyone trying to program a scrollbar: It's actually built up of five buttons:
|1|             2             | 3 |    4     |5|

1,5: the end buttons, scroll by small amount
2,4: the gutter, scroll by large amount
3: scoller, this buttons needs to be draggable

Actually, you can get away with only four by making the gutter/track a single "button", but the position in which it is clicked as related to the thumb/scroller becomes important.

But in any case, no, a scrollbar(especially a draggable scrollbar) is not an easy control to implement, especially if you are trying to get the same sort of behavior that a standard windows scrollbar will give you. And also a confusing control to use, as a scrollbar positioned at the bottom is best represented by a negative value, which is the number of pixels to scroll the top of the view by.

I know exactly what you mean ;)