OpenDCL Forums

OpenDCL => Show and Tell => Topic started by: Fred Tomke on October 27, 2009, 06:38:40 AM

Title: CustomSlider
Post by: Fred Tomke on October 27, 2009, 06:38:40 AM
Hello,

now it's on me to publish something. Maybe it could help others, too. I'm looking forward to append another sample for a range selector next week.

Short sample description
Custom slider, custom scrollbar.

Requirements
OpenDCL Runtime 6.0.0.10

Used OpenDCL functionalities

Long sample description, genesis
I have a form with a standard windows scroll bar (screenshot (http://opendcl.com/wordpress/wp-content/gallery/samples/signothek_1.gif)). Many users asked me why mouse wheel is not supported for this control. They are familiar with scrolling in listviews but they want to do it with the previews, too. Thatââ,¬â,,¢s why I decided to create my own scrollbar control based on a picture control. The disadvantage of the control is that the current windows style cannot be applied very easy. But there are millions of further possibilities for individual styles.

Features of the test dialog

Features of the scrollbar/slider

Notes for implementation:
If you're interested in doing something like that in a case AutoCAD is going to hard work after each scroll (especially searching for drawings and showing them in a DWGPreview like in the screenshot above) you should decrease the number of scrolling events. So, for example, do only update the previews after OnMouseUp and not while OnMouseMove. The number of calling events is too much for doing that.

Enjoy it!

Fred

[EDIT] Due to some type mismatches I've uploaded a new release of the slider.lsp. Changes only in the documentations.
Title: Re: CustomSlider
Post by: owenwengerd on October 27, 2009, 07:53:36 AM
Well done, Fred. Do you mind if I include this as a standard sample?
Title: Re: CustomSlider
Post by: BazzaCAD on October 27, 2009, 08:38:58 AM
Wow looks cool, thx Fred.
Title: Re: CustomSlider
Post by: Fred Tomke on October 27, 2009, 09:18:56 AM
Quote from: owenwengerd on October 27, 2009, 07:53:36 AM
Well done, Fred. Do you mind if I include this as a standard sample?

Yes, if you do it, it would be a honor for me.

Fred