Wednesday, March 17, 2010
While tinkering around at home I produce a lot of small snippets of code that aren't complete projects but come in handy in the future. A lot of times these end up in my programming notes for later (every developer should keep a TiddlyWiki). Recently I've decided that my blog is just as good as any place for some of these pieces of code. My first post will be a vertical button:
I found several examples online, but didn't like the implementation. One overrode paint() and drew everything from scratch. Another kept a delegate component to do all the painting (which means you have to delegate all the button's properties to the delegate if you want them to apply to the button).
My implementation just rotates the graphics object before painting. The only other trick is to invert the height and width. The source is available on github.
Pros
| Cons
|
0 Comments:
Subscribe to Post Comments [Atom]
<< Home