MacArthur, Ian (SELEX GALILEO, UK) schrieb:
>
>> the interface name is bad.
No problem, when to find in color doc - my STR will come today.
> Albrecht's post had a few suggestions that might be clearer. Since the
> method already exists, it would be pretty cheap (i.e. a few line in a
> header file) to add the inline wrappers, to wrap Fl::get_color(...) in a
> more explicit name... Thoughts?
My way would be, to make Fl_Color a real class and assigning all color
functions and enums to this class. Something like this:
class Fl_Color
{
public:
enum color_value {
FL_BLACK = 56,
FL_RED = 88,
FL_GREEN = 63,
};
int Value;
Fl_Color(int Col= 0): Value(Col) {}
Fl_Color(color_value Col): Value(Col) {}
uchar R() const;
uchar G() const;
uchar B() const;
Fl_Color inactive() const;
static Fl_Color fl_contrast(Fl_Color fg, Fl_Color bg);
};
Fl_Color Col(Fl_Color::FL_RED);
int S= sizeof(Col); // 4! Class must be without virtual methods!
int B= Fl_Color::FL_BLACK;
A minor approach would be to use a namespace, because there would be
better downward compatibilitiy by using-directive.
But in general I don't mind these changes to be important right now,
maybe only to consider for future releases.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk