class Flv_Style
Class Hierarchy
Flv_Style
Include Files
#include <FL/Flv_Style.H>;
Description
The Flv_Style class was designed to track bits of information about how
an item looks and/or feels. The Flv_Style class is not a visible
widget. Instead it is used to affect how a widget will appear.
Conventions
The default value listed for each property, is the value that global_style
will obtain when initialized. All other styles will have no defaults and
all properties will be undefined.
The lists of values, such as FL_RED, are not nesasarily inclusive of the
available values. You should consult the appropriate FLTK documentation
for a complete list of values.
Each "property" consists of a section of four (4) functions.
The four functions always adhere to the following convention:
type Flv_Style::property(void)
This function will retrieve the value of the property. The returned value is
always read-only and reflects the current value of the property. The value
returned will be undefined if the property is not defined.
type Flv_Style::property(type v)
This function will set the value of the property to the value of v if possible.
Either way, the returned value is also always read-only and reflects the current
value of the property. The returned value will always be valid because the property
will always be defined after calling this function.
void clear_property(void)
This function will make the value of the property undefined. Undefined properties
should not be read.
bool property_defined(void)
This function return true if the property has a defined value and
false if the property has an undefined value. Use this function to
determine if the contents of the property are valid to read.
Methods
The constructor initializes an Flv_Style with no style information defined
and with a value of value or 0.
The all_clear function returns true if no style information is defined and
false if any style information is defined.
const Fl_Align &Flv_Style::align(void) const
const Fl_Align &Flv_Style::align(const Fl_Align &n)
void Flv_Style::clear_align(void)
bool Flv_Style::align_defined(void) const
The align property may be used to determine in what alignment a row or cell
should be drawn. This property is not directly used by any of the existing
code. The default value is FL_ALIGN_CLIP (This will center
horizontally and vertically). Other valid values are: FL_ALIGN_CENTER, FL_ALIGN_TOP, FL_ALIGN_BOTTOM, FL_ALIGN_LEFT, FL_ALIGN_RIGHT, FL_ALIGN_INSIDE, FL_ALIGN_CLIP, FL_ALIGN_WRAP, FL_ALIGN_TOP_LEFT, FL_ALIGN_TOP_RIGHT, FL_ALIGN_BOTTOM_LEFT, FL_ALIGN_BOTTOM_RIGHT, FL_ALIGN_LEFT_TOP, FL_ALIGN_RIGHT_TOP, FL_ALIGN_LEFT_BOTTOM, FL_ALIGN_RIGHT_BOTTOM,
FL_ALIGN_NOWRAP
The all_defined method may be used to determine if all style elements are defined.
It will return true if they are all defined and false if they are not.
Fl_Color Flv_Style::background(void) const
Fl_Color Flv_Style::background(Fl_Color n)
void Flv_Style::clear_background(void)
bool Flv_Style::background_defined(void) const
The background property is used to determine what color the background will
be drawn in. It is used by the default row and cell drawing code to fill
in this color. The default color is style dependant but is equivalent to color().
The colors common to both version are: FL_BLACK, FL_RED, FL_GREEN, FL_YELLOW, FL_BLUE, FL_MAGENTA, FL_CYAN, FL_WHITE, FL_GRAY_RAMP, FL_GRAY, FL_COLOR_CUBE, FL_INACTIVE_COLOR
The additional 1.x version colors are: FL_SELECTION_COLOR, FL_FREE_COLOR, FL_NUM_FREE_COLOR, FL_GRAY0, FL_DARK3, FL_DARK2, FL_DARK1, FL_LIGHT1, FL_LIGHT2, FL_LIGHT3
The additional 2.x version colors are: FL_NO_COLOR, FL_INACTIVE_COLOR, FL_BLUE_SELECTION_COLOR
The clear_all method, makes all style information undefined. This is
equivalent to callin clear_n() where n is the name of each each
property in the style.
const Fl_Font &Flv_Style::font(void) const
const Fl_Font &Flv_Style::font(const Fl_Font &n)
void Flv_Style::clear_font(void)
bool Flv_Style::font_defined(void) const
The font property is used to determine in what font face text will be
drawn. It is used by the default row and cell drawing code to set this
value for you. The default font is style dependant but is equivalent
to text_font(). The FLTK fonts are FL_COURIER, FL_HELVETICA,
FL_TIMES, FL_SYMBOL, FL_SCREEN, FL_ZAPF_DINGBATS. Some of these
include bold and/or italics versions.
int Flv_Style::font_size(void)const
int Flv_Style::font_size(int n)
void Flv_Style::clear_font_size(void)
bool Flv_Style::font_size_defined(void) const
The font_size property is used to determine what size text should be drawn
in. It is used by the default row and cell drawing code to set the value
for you. Font sizes are in points. A point is 1/72 of an inch.
The default value is style dependant but is equivalent to text_size().
Fl_Color Flv_Style::foreground(void) const
Fl_Color Flv_Style::foreground(Fl_Color n)
void Flv_Style::clear_foreground(void)
bool Flv_Style::foreground_defined(void) const
The foreground property is used to determine what color foreground
information should be drawn in. It is used by the default row and cell
drawing code to set this value for you. The default color is style
dependant but is equivalent to text_color(). (See background for a
list of colors)
const Fl_Boxtype &Flv_Style::frame(void) const
const Fl_Boxtype &Flv_Style::frame(const Fl_Boxtype &n)
void Flv_Style::clear_frame(void)
bool Flv_Style::frame_defined(void) const
The frame property is used to determine what style of frame should be
drawn around a row or cell. The default frame style is: FL_FLAT_BOX.
Some other common frame styles are: FL_UP_BOX, FL_DOWN_BOX, FL_THIN_UP_BOX,
FL_THIN_DOWN_BOX, FL_NO_BOX
int Flv_Style::height(void) const
int Flv_Style::height(int n )
void Flv_Style::clear_height(void)
bool Flv_Style::height_defined(void) const
The height property is used to determine the height of a row or cell.
It is only meaningful as a row property or as a cell property of a complex
table. The value is ignored for all other contexts (col_style). The
default height is the height of text drawn at text_size() point
size.
bool Flv_Style::locked(void) const
bool Flv_Style::locked(bool n)
void Flv_Style::clear_locked(void)
bool Flv_Style::locked_defined(void) const
The locked property is used to determine whether editing is allowed in a row
or cell. The default value of this property is true. (There is no
current implementation that uses this)
bool Flv_Style::resizable(void) const
bool Flv_Style::resizable(bool n)
void Flv_Style::clear_resizable(void)
bool Flv_Style::resizable_defined(void) const
The resizable property is used to determine if resizing is allowed for a
column or row. The default value for this property is true.
(There is no current implementation that uses this)
int Flv_Style::width(void) const
int Flv_Style::width(int n)
void Flv_Style::clear_width(void)
bool Flv_Style::width_defined(void) const
The width property is used to determine the width a column should drawn or
for a complex table the width of a cell. The property is ignored in all
other contexts (row_style) The default value of this property is 40.
The assignment operator is used to perform a "defined"
assignment. That is, the value of the style after assignment will be any
currently defined styles plus any styles defined in n. The styles in n
take precedence if defined. For the example a=b; if a has align and background
defined and b as background and foreground defined, after the assignment a will
have a's original align and b's background and foreground colors. No other
information will be defined for a.
The cell_style variable is only meaningful, in the current implementations,
for rows. Each row style is able to maintain a list of cell styles for
that row.