I have several questions concerning the controls like a button, if You could answer i would be very much pleased.
Questions:
- Is there any way to create a control like a button, but开发者_JAVA技巧 not-standard, i mean, not that strict-rectangled button
- How do I handle mouse hover events within the control
Regards, Galymzhan Sh
It's relatively easy. If you want the same behaviour as a button (click, hover etc etc), then the best bet is to subclass the button control.
Have a read of the following MSDN articles:
http://msdn.microsoft.com/en-us/library/bb773183.aspx
http://msdn.microsoft.com/en-us/library/ms997565.aspx
http://msdn.microsoft.com/en-us/library/ms633569.aspx
This one is tricky one.
I developed my own GUI, it is advance topic.
Here is how i developed mine.
Create class called button
In button class, create all variables needed like the width and Height of the button
Have a render function
If you gonna let users load their own texture for the button, you should include a load function
Create class for wrapper
- Have a Add button function and use ids for buttons
- Have a EventProc that checks for hovers, clicks...
- Have a Render controls function to render all buttons
This is just simple way to write buttons
精彩评论