Re: [fltk.development] [RFE] STR #2951: DoubleSlider for selectinglow and high values within min/max range

2013-04-21 Thread Duncan Gibson

 Coming to this party late, but I just remembered that Jason Bryan's
 FLU widgets have a double-slider widget.

 His pages at OSC.edu appear to be gone but the mirror here still
 seems to be working:

 http://src.gnu-darwin.org/ports/x11-toolkits/flu/work/FLU_2.14/=20

 His FLU_Dual_Slider might be relevant, to see how what he did
 compares.

 He derived a pile of new fltk based widgets, so there may be
 clues in that work for a template for future derivations?


I was going to say that the above link didn't work for me either
until I remembered to remove the =20 at the end. This will work:
http://src.gnu-darwin.org/ports/x11-toolkits/flu/work/FLU_2.14/

It also reminded me that I had trawled through all of the Links
pages a while ago, and weeded out the dead links to come up with:

  Article #884: What third party widgets are available for FLTK?
  http://fltk.org/articles.php?L884

So why I hadn't remembered and checked there first I don't know :-(

If you go to the Flu_Dual_Slider doxygen page from the link above,
the list of public methods is quite limited, so the interface looks
to be quite simple. He does allow overlap where low == high.
He has derived it from Fl_Valuator, which is interesting, because
that only supports a single value so I would be curious how he
has implemented it.

However, although he appears to be using the FLTK licence, I don't
think we should just base our code on hiswithout understanding our
own vision / requirements.

Cheers
D.

PS. I shall update the article to include the link above [Done]

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2951: DoubleSlider for selectinglow and high values within min/max range

2013-04-16 Thread Duncan Gibson
Adding to the fltk.development thread rather than the STR/RFE itself.

I just wanted to make a few comments relating to Greg's insights in
http://www.fltk.org/newsgroups.php?gfltk.development+v:14629

My vision, for want of a better word, but it's more like looking
through a window with rain on the outside and condensation inside,
went as follows. It may change as other people chip in their ideas.

I wasn't planning on deriving from Fl_Valuator as such because I
thought that some of the concepts don't fit cleanly with having
two sliders (eg. how does 'step()' work, which slider moves when
you click in the trough, does value() return high or low, etc).

I had wondered about a similar Fl_Double_Valuator type base class
which provide a smaller interface. Some methods would obviously be
similar, such as handle_push(), handle_drag() and handle_release()
taking care of when() handling, etc. However, the two classes would
be separate, and would not follow the Liskov Substitution Principle.
See also http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod

The first real on-screen widget would be the basic trough and sliders,
as shown in the DoubleSlider example code.

The next level(s) up would then add boxes, labels or fields for the
display/edit of the min/low/high/max values.

Then Greg hit me straight between the eyes with a whole load of things
I had never even considered. [I still don't understand what the moving
gif is actually doing].

- keyboard/arrow key activation: yes, but needs some consensus on
  whether to move the low or high slider, or both. Does focus select
  the widget as a whole, or the last active slider(s)?

- clicking in the trough locks the sliders and they move together
  (with or without an additional graticule)

- having a Date slider. That's a good one. I think that there should
  be hooks in the lower levels that allow the programmer to provide
  conversion between their Date or Foo format and the internal double.
  A DateSlider could use a Julian Date representation for example.

- representing this as a group containing two Fl_Valuator sliders.
  That's something I haven't got my head around. Are they stalactites
  and stalagmites, with one growing down representing max to high, and
  the other growing up representing min to low, with the group drawing
  between them? Isn't this going to require the group to intervene in
  the event handling and dynamic widget resizing as the sliders move?

- round button sliders on a central rail, or rectangle/triangle combos,
  or user supplied shapes. Are these not just [extensions to] themes?

The need for an Fl_Double_Valuator base class isn't clear to me yet.
At the moment I can't see how you would use an Fl_Double_Valuator for
anything other than a linear min/low/high/max linear double slider,
but maybe someone else has something esoteric in mind.

Anyway, that's enough rambling for the moment. I won't have time to
actually do anything about this for a while, so there's plenty of
scope for discussing ideas.

Cheers
D.

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev