Making a slider drag bar

Walter,

We have a requirement for a unique slider bar (sort of like a control) that users can directly manipulate. I'd like to use GoDiagram to do this because my experience with it has been excellent so far. My question is, given the below properties, would it be easier to try to hijack an existing GoInstrument object, or build this thing from scratch?
The first important tidbit about this bar is that it is used to view a range. So, there is a slider that is either fixed or variable width that moves along a bar. The slider is limited by the bar extents. The user can of course drag this slider using the mouse.
The slider may be resized by dragging little teeth that sit on the edges (like arrows pointing down). This changes the width of the slider and thus the range the slider represents. When the slider is dragged again this new fixed width is used.
The teeth may be double-clicked to anchor the slider to the left or the right (depending on which of the teeth are clicked). When this happens, drag actions on the slider cause the width itself to change such that the unanchored side moves to the mouse. When a tooth is anchored, it "pushes in" to the slider, changes color.
We'd also like to be able to write dynamically updating text above the teeth, and at the extents of the bar the slider slides on. And, it would be great if the slider was a transparent gradient of some sort.
So, with these things in mind, should we just start hammering away at building our own widget?
Thanks -
Tyler

I can’t say if inheriting your slider from Instruments.IndicatorSlider is the best choice for your application.

But if you do choose to pursue this course, you can override several methods to get the effect(s) you want.
Override Paint to call DrawPath with a gradient brush, and then to draw those teeth where you want them.
Override ValidValue to make sure the Value stays within a range such that the ends of the IndicatorSlider don't go beyond the Minimum or Maximum values of the GraduatedScale.
Override OnActionAdjusted to see if the mouse point is on those teeth. If so, modify the Dimensions (and perhaps the Value) accordingly. Otherwise do the regular behavior, which will let the user drag the slider.
Override ComputePath so that the Value point is not at the middle of the slider, but at one end or the other. Since the slider now represents a range rather than a single Value, it might be easiest to assume the Value is at one end of the range, such as at the low end.
The only problem I see is how to handle double-clicking. The IGoActionObject interface, in conjunction with the GoToolAction tool, is what allows individual GoObjects to usurp the regular mouse behavior implemented by all of the other tools that the GoView uses, such as selecting or dragging. But IGoActionObject/GoToolAction don't currently handle double-click. (Maybe it should; no one has brought this up before.)
I believe you could extend the standard GoToolAction tool to pass a double-click on to your Indicator class. But there might be a problem with the ambiguity that at the time of the first mouse up, you don't know if it might be the first part of a double-click. I suppose you could make the simplifying assumption that if the mouse hasn't moved much (GoTool.IsBeyondDragSize) you shouldn't do anything unless (until) GoInputEventArgs.DoubleClick is true.