i_font_size - updating of user defined widgets
The class Fl_Widget is ment as basic class for user defined classes.
But it doesn't provide methods for text settings and often derived
widgets will use text output. For adding such widgets to font and
size system, they can be derive from i_font_size:
struct i_font_size
{ // Interface for adjustment
of fonts and sizes for self defined widgets
virtual unsigned char
textsize() const= 0;
virtual Fl_Font textfont()
const= 0;
virtual void textsize(unsigned
char Size)= 0;
virtual void textfont(Fl_Font
Font)= 0;
};
It's a pure interface and you need to overwrite the methods to make
the widget accessable by general setting of font and font size.
class Fl_My_Widget: public Fl_Widget, public i_font_size
{
public:
virtual unsigned char
textsize() const { return m_Size; }
virtual Fl_Font textfont()
const { return m_Font; }
virtual void textsize(unsigned
char Size) { m_Size= Size; }
virtual void textfont(Fl_Font
Font) { m_Font= Font; }
private:
Fl_Font
m_Font;
unsigned char m_Size;
};
It is not necessary to use this interface, when the new widget was
derived from a class, that provides methods textsize(), textfont().
[ index ] [ i_basic_font_size ] [ i_local_font_size ]