In Fl_Slider.H there are definitions that are used for "subclasses":

<pre>
    // values for type(), lowest bit indicate horizontal:
    #define FL_VERT_SLIDER      0
    #define FL_HOR_SLIDER       1
    #define FL_VERT_FILL_SLIDER 2
    #define FL_HOR_FILL_SLIDER  3
    #define FL_VERT_NICE_SLIDER 4
    #define FL_HOR_NICE_SLIDER  5
</pre>

although the class documentation doesn't mention the first two, it
uses the values defined in Fl_Valuator.H instead:

<pre>
    // shared type() values for classes that work in both directions:
    #define FL_VERTICAL   0 ///< The valuator can work vertically
    #define FL_HORIZONTAL 1 ///< The valuator can work horizontally
</pre>

and indeed Fl_Slider makes use of Fl_Valuator::horizontal() which tests
type() against FL_HORIZONTAL.

In "Adding and Extending Widgets" it says that type() "is an arbitrary
8-bit identifier" and "you can use it for any purpose you want".

It seems to me that if I subclass some existing widgets, such as
Fl_Slider, then I am not completely free to overwrite type() with
my own arbitrary values.

Therefore, are there general guidelines on type(), or do they only
apply on widget-by-widget basis?

D.
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to