Original planning is that this version will focusing on the system messaging function. However when I just started working on it, I found that a scroll bar is essential for this component to work. Although there are a lot of scroll bar components in the market already, I prefer to write my own. (Kind of stupid… ya?) First, just to challenge myself and knowing the working mechanism. Second, allowing me to change the style and skin of the scroll bar in my own will.
So half way of this version is dedicated to the scroll bar component. Actually you will never know that the scroll bar is extremely complex unless you self written one.
Say for an example.
- How to calculate the size of the scroll box?
- How to calculate the distance that the scroll box travel for each scrolling line?
- How to make the scroll box “chasing” the mouse?
- How to make the scroll move once when the arrow is pressed, wait for a little moment and continuously scrolling until mouse up?
This little scroll bar takes me two working days… but is worth. At least I learned much within.
The next step will continue the message box~
By the way, Happy 2006~!!