Victor Feinman

December 20, 2006

Work life

Filed under: Journal — Victor @ 4:34 pm

For the last month I have been working on a desktop application in C#. I have been making custom controls and using GDI+ pretty heavily. The controls that I made are a custom image drop down box, a zoom control and a play speed control.

The image drop down box has the ability to toggle the state of the object in the drop down. Having images drawn in a combobox is no feat, it is widely available online. However, whay I did, was a little bit different. I started with the custom image drop down combo box, then created an object to put into the combo box. I then paired the combo box contents with an arraylist of the same objects. I used this second list of objects to give the combo box the ability to remove the selected item from the drop down list. When an item is selected from the drop down, it is automatically activated and the previously selected item is reinserted into the drop down list (and turned off). The user may also click on the selected image to toggle off and on. This control is pretty cool in that it has two states: List mode and panel mode. What I just described is the list mode. The panel mode is when there are a small amount of objects in the list and could be displayed one after the other in less space the the custom combo box.

The zoom control mimics the capabilities as your browsers back button. each time you click on the zoom in another item is listed in the zoom out drop down. The interesting thing about this control is that I made the drop down list quite different then the image drop down. Because I couldn’t find out how to control the combobox drop down component (couldn’t capture the event that triggers the displaying of the drop down part), I created a list of custom labels surrounded by a user drawn border (each lable was added to a panel control which I drew the border on). Each label was created in an array list and every time a user hits the zoom in button it inserts a label in the array list. Each time the arraylist times change, the items location and tag properties within are updated as well. When the drop down is enabled I bring the control to the front and change the size of it to reflect the drop down. Prety darn cool. There are more functions, but not too important now. Like a few validation controls and image toggles, etc.

The playspeed control is a ball on a track. The user can press and hold down on the ball and drag it along the trac. The user can not drag the ball past each end of the track and the ball automatically snaps to the closeest point on the trac when the mouse is lifted. The different speeds are 1/4, 1/2, normal (1x), 2x, and 4x. Wht the user selects a play speed it fires a callback delegate for the parent to handle the user’s action.

That’s enough for now.


No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.

Powered by WordPress

Close
E-mail It