Introduction
Having had loads of fun working with OpenGL, I decided to try my hand at DirectX. I thought what better way to start than to take my OpenGL projects and see how they work in DirectX. I ran into a barrier when the original project used various GLUI objects which are not available in .NET. This is my first GLUI-style control.
Using the code
As this is a beginner control, there is not much difference between this and a Microsoft control. The control is derived from a System.Windows.Forms.Panel
as I needed something to contain the System.Windows.Forms.TextBox
and two System.Windows.Forms.Button
objects. This has allowed me to keep the usability of a single control (i.e., you cannot tab to each button, instead to each spinner as a while).
Each Spinner
has the following properties for setting the behavior to the user's liking:
- The '
Minimum
' and 'Maximum
' properties to set the range of the Spinner
.
- A '
Value
' property to set the original value of the Spinner
.
- A '
Theta
' property to set the step value for the Spinner
.
Using this control should be as simple as using any other Panel
; just drop it on a form and set the listed properties to your desire.
Points of Interest
This is not exactly a final release. I am still relatively new to .NET development, so there are a few features I plan to add just as soon as I learn how. As it stands, you can change the Spinner
value in three ways:
- Input the value by using the numeric keypad found on your keyboard.
- Use the buttons on the right side of the control.
- Use the Up and Down arrow keys on your keyboard while the control has focus.
Currently, there is no code in place to stop the user from inputting a value outside the range, but the next click of the button or press of the arrow keys will set the value to the range minimum or maximum, whichever applies.
History
As this is the first draft, there aren't any updates.