Add missing color function documentation.

Fix Fl_Tabs document WRT coloring of the tabs and pane.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2549 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2002-07-25 12:46:12 +00:00
parent 749ebab917
commit d240b98ff6
3 changed files with 180 additions and 47 deletions

View File

@ -1,5 +1,6 @@
CHANGES IN FLTK 1.1.0 CHANGES IN FLTK 1.1.0
- Documentation updates.
- Tweeked the look of the check button with a patch from - Tweeked the look of the check button with a patch from
Albrecht Schlosser. Albrecht Schlosser.

View File

@ -1,64 +1,88 @@
<HTML><BODY> <HTML>
<BODY>
<!-- NEW PAGE --> <!-- NEW PAGE -->
<H2><A name=Fl_Tabs>class Fl_Tabs</A></H2> <H2><A name=Fl_Tabs>class Fl_Tabs</A></H2>
<HR> <HR>
<H3>Class Hierarchy</H3> <H3>Class Hierarchy</H3>
<UL>
<PRE> <UL><PRE>
<A href=Fl_Group.html#Fl_Group>Fl_Group</A> <A href=Fl_Group.html#Fl_Group>Fl_Group</A>
| |
+----<B>Fl_Tabs</B> +----<B>Fl_Tabs</B>
</PRE> </PRE></UL>
</UL>
<H3>Include Files</H3> <H3>Include Files</H3>
<UL>
<PRE> <UL><PRE>
#include &lt;FL/Fl_Tabs.H&gt; #include &lt;FL/Fl_Tabs.H&gt;
</PRE> </PRE></UL>
</UL>
<H3>Description</H3> <H3>Description</H3>
The <TT>Fl_Tabs</TT> widget is the &quot;file card tabs&quot; interface that
allows you to put lots and lots of buttons and switches in a panel, as <P>The <TT>Fl_Tabs</TT> widget is the &quot;file card tabs&quot;
popularized by many toolkits. interface that allows you to put lots and lots of buttons and
switches in a panel, as popularized by many toolkits.
<P ALIGN=CENTER><IMG src="tabs.gif" ALT="Fl_Tabs widget."></P> <P ALIGN=CENTER><IMG src="tabs.gif" ALT="Fl_Tabs widget."></P>
<P>Clicking the tab makes a child <TT>visible()</TT> (by calling <TT>
show()</TT> on it) and all other children are invisible (by calling <TT> <P>Clicking the tab makes a child <TT>visible()</TT> by calling
hide()</TT> on them). Usually the children are <A href=Fl_Group.html#Fl_Group> <TT>show()</TT> on it, and all other children are made invisible
<TT>Fl_Group</TT></A> widgets containing several widgets by calling <TT>hide()</TT> on them. Usually the children are <A
themselves. </P> href="Fl_Group.html#Fl_Group"><TT>Fl_Group</TT></A> widgets
<P>Each child makes a card, and it's <TT>label()</TT> is printed on the containing several widgets themselves.
card tab (including the label font and style). The color of that child
is used to color the card as well. Currently this only draws nicely if <P>Each child makes a card, and it's <TT>label()</TT> is printed
you set <A href=Fl_Widget.html#Fl_Widget.box><TT>box()</TT></A> to the on the card tab, including the label font and style. The
default <TT>FL_THIN_UP_BOX</TT> or to <TT>FL_FLAT_BOX</TT>, which gets selection color of that child is used to color the tab, while
rid of the edges drawn on the sides and bottom. </P> the color of the child determines the background color of the
pane.
<P>The size of the tabs is controlled by the bounding box of the <P>The size of the tabs is controlled by the bounding box of the
children (there should be some space between the children and the edge children (there should be some space between the children and
of the <TT>Fl_Tabs</TT>), and the tabs may be placed &quot;inverted&quot; on the the edge of the <TT>Fl_Tabs</TT>), and the tabs may be placed
bottom, this is determined by which gap is larger. It is easiest to &quot;inverted&quot; on the bottom, this is determined by which
lay this out in fluid, using the fluid browser to select each child gap is larger. It is easiest to lay this out in fluid, using the
group and resize them until the tabs look the way you want them to. </P> fluid browser to select each child group and resize them until
the tabs look the way you want them to.
<H3>Methods</H3> <H3>Methods</H3>
<UL> <UL>
<LI><A href=#Fl_Tabs.Fl_Tabs>Fl_Tabs</A></LI> <LI><A href="#Fl_Tabs.Fl_Tabs">Fl_Tabs</A></LI>
<LI><A href=#Fl_Tabs.~Fl_Tabs>~Fl_Tabs</A></LI> <LI><A href="#Fl_Tabs.~Fl_Tabs">~Fl_Tabs</A></LI>
<LI><A href=#Fl_Tabs.value>value</A></LI> <LI><A href="#Fl_Tabs.value">value</A></LI>
</UL> </UL>
<H4><A name=Fl_Tabs.Fl_Tabs>Fl_Tabs::Fl_Tabs(int x, int y, int w, int h,
<H4><A name="Fl_Tabs.Fl_Tabs">Fl_Tabs::Fl_Tabs(int x, int y, int w, int h,
const char *label = 0)</A></H4> const char *label = 0)</A></H4>
Creates a new <TT>Fl_Tabs</TT> widget using the given position, size,
<P>Creates a new <TT>Fl_Tabs</TT> widget using the given position, size,
and label string. The default boxtype is <TT>FL_THIN_UP_BOX</TT>. and label string. The default boxtype is <TT>FL_THIN_UP_BOX</TT>.
<P>Use <A href=Fl_Group.html#Fl_Group.add><TT>add(Fl_Widget *)</TT></A>
to add each child (which is probably itself a <TT>Fl_Group</TT>). The <P>Use <A href="Fl_Group.html#Fl_Group.add"><TT>add(Fl_Widget
children should be sized to stay away from the top or bottom edge of *)</TT></A> to add each child, which are usually
the <TT>Fl_Tabs</TT>, which is where the tabs are drawn. </P> <TT>Fl_Group</TT> widgets. The children should be sized to stay
<H4><A name=Fl_Tabs.~Fl_Tabs>virtual Fl_Tabs::~Fl_Tabs()</A></H4> away from the top or bottom edge of the <TT>Fl_Tabs</TT> widget,
The destructor <I>also deletes all the children</I>. This allows a which is where the tabs will be drawn.
whole tree to be deleted at once, without having to keep a pointer to
all the children in the user code. A kludge has been done so the <TT> <H4><A name="Fl_Tabs.~Fl_Tabs">virtual Fl_Tabs::~Fl_Tabs()</A></H4>
Fl_Tabs</TT> and all of it's children can be automatic (local)
variables, but you must declare the <TT>Fl_Tabs</TT><I>first</I>, so <P>The destructor <I>also deletes all the children</I>. This
that it is destroyed last. allows a whole tree to be deleted at once, without having to
<H4><A name=Fl_Tabs.value>Fl_Widget* Fl_Tabs::value() const keep a pointer to all the children in the user code. A kludge
<BR> int Fl_Tabs::value(Fl_Widget*)</A></H4> has been done so the <TT>Fl_Tabs</TT> and all of it's children
Gets or sets the currently visible widget/tab. </BODY></HTML> can be automatic (local) variables, but you must declare the
<TT>Fl_Tabs</TT> widget <I>first</I> so that it is destroyed
last.
<H4><A name="Fl_Tabs.value">Fl_Widget* Fl_Tabs::value() const
<BR>int Fl_Tabs::value(Fl_Widget*)</A></H4>
<P>Gets or sets the currently visible widget/tab.
</BODY>
</HTML>

View File

@ -13,10 +13,13 @@ A</A>.
<LI><A HREF="#fl_alert"><TT>fl_alert</TT></A></LI> <LI><A HREF="#fl_alert"><TT>fl_alert</TT></A></LI>
<LI><A HREF="#fl_ask"><TT>fl_ask</TT></A></LI> <LI><A HREF="#fl_ask"><TT>fl_ask</TT></A></LI>
<LI><A HREF="#fl_average_color"><TT>fl_average_color</TT></A></LI>
<LI><A HREF="#fl_beep"><TT>fl_beep</TT></A></LI> <LI><A HREF="#fl_beep"><TT>fl_beep</TT></A></LI>
<LI><A HREF="#fl_choice2"><TT>fl_choice</TT></A></LI> <LI><A HREF="#fl_choice2"><TT>fl_choice</TT></A></LI>
<LI><A HREF="#fl_color_chooser_func"><TT>fl_color_chooser</TT></A></LI> <LI><A HREF="#fl_color_chooser_func"><TT>fl_color_chooser</TT></A></LI>
<LI><A HREF="#fl_color_cube"><TT>fl_color_cube</TT></A></LI> <LI><A HREF="#fl_color_cube"><TT>fl_color_cube</TT></A></LI>
<LI><A HREF="#fl_contrast"><TT>fl_contrast</TT></A></LI>
<LI><A HREF="#fl_darker"><TT>fl_darker</TT></A></LI>
<LI><A HREF="#fl_dir_chooser"><TT>fl_dir_chooser</TT></A></LI> <LI><A HREF="#fl_dir_chooser"><TT>fl_dir_chooser</TT></A></LI>
<LI><A HREF="#fl_file_chooser2"><TT>fl_file_chooser</TT></A></LI> <LI><A HREF="#fl_file_chooser2"><TT>fl_file_chooser</TT></A></LI>
<LI><A HREF="#fl_file_chooser_callback"><TT>fl_file_chooser_callback</TT></A></LI> <LI><A HREF="#fl_file_chooser_callback"><TT>fl_file_chooser_callback</TT></A></LI>
@ -31,6 +34,7 @@ A</A>.
<LI><A HREF="#fl_filename_setext"><TT>fl_filename_setext</TT></A></LI> <LI><A HREF="#fl_filename_setext"><TT>fl_filename_setext</TT></A></LI>
<LI><A HREF="#fl_gray_ramp"><TT>fl_gray_ramp</TT></A></LI> <LI><A HREF="#fl_gray_ramp"><TT>fl_gray_ramp</TT></A></LI>
<LI><A HREF="#fl_input2"><TT>fl_input</TT></A></LI> <LI><A HREF="#fl_input2"><TT>fl_input</TT></A></LI>
<LI><A HREF="#fl_lighter"><TT>fl_lighter</TT></A></LI>
<LI><A HREF="#fl_message"><TT>fl_message</TT></A></LI> <LI><A HREF="#fl_message"><TT>fl_message</TT></A></LI>
<LI><A HREF="#fl_message_font"><TT>fl_message_font</TT></A></LI> <LI><A HREF="#fl_message_font"><TT>fl_message_font</TT></A></LI>
<LI><A HREF="#fl_message_icon"><TT>fl_message_icon</TT></A></LI> <LI><A HREF="#fl_message_icon"><TT>fl_message_icon</TT></A></LI>
@ -67,8 +71,12 @@ A</A>.
<LI>Drawing Functions <LI>Drawing Functions
<UL> <UL>
<LI><A HREF="#fl_average_color"><TT>fl_average_color</TT></A></LI>
<LI><A HREF="#fl_color_cube"><TT>fl_color_cube</TT></A></LI> <LI><A HREF="#fl_color_cube"><TT>fl_color_cube</TT></A></LI>
<LI><A HREF="#fl_contrast"><TT>fl_contrast</TT></A></LI>
<LI><A HREF="#fl_darker"><TT>fl_darker</TT></A></LI>
<LI><A HREF="#fl_gray_ramp"><TT>fl_gray_ramp</TT></A></LI> <LI><A HREF="#fl_gray_ramp"><TT>fl_gray_ramp</TT></A></LI>
<LI><A HREF="#fl_lighter"><TT>fl_lighter</TT></A></LI>
<LI><A HREF="#fl_rgb_color"><TT>fl_rgb_color</TT></A></LI> <LI><A HREF="#fl_rgb_color"><TT>fl_rgb_color</TT></A></LI>
</UL> </UL>
@ -148,6 +156,37 @@ a shortcut for No.
<P ALIGN="CENTER"><IMG SRC="fl_ask.gif" ALT="The fl_ask window."> <P ALIGN="CENTER"><IMG SRC="fl_ask.gif" ALT="The fl_ask window.">
<!-- NEED 4in -->
<H2><A NAME="fl_average_color">fl_average_color</A></H2>
<HR>
<H3>Include Files</H3>
<UL><PRE>
#include &lt;FL/Enumerations.H&gt;
</PRE></UL>
<H3>Prototype</H3>
<UL><PRE>
Fl_Color fl_average_color(Fl_Color c1, Fl_Color c2, float weight);
</PRE></UL>
<H3>Description</H3>
<P>Returns the weighted average color between the two colors.
The red, green, and blue values are averaged using the following
formula:
<UL><PRE>
color = c1 * weight + c2 * (1 - weight)
</PRE></UL>
<P>Thus, a <CODE>weight</CODE> value of 1.0 will return the
first color, while a value of 0.0 will return the second color.
<!-- NEED 4in --> <!-- NEED 4in -->
<H2><A name="fl_beep">fl_beep</A></H2> <H2><A name="fl_beep">fl_beep</A></H2>
@ -303,6 +342,53 @@ fl_color_cube(R * (FL_NUM_RED - 1) / 255,
</PRE></UL> </PRE></UL>
<!-- NEED 4in -->
<H2><A NAME="fl_contrast">fl_contrast</A></H2>
<HR>
<H3>Include Files</H3>
<UL><PRE>
#include &lt;FL/Enumerations.H&gt;
</PRE></UL>
<H3>Prototype</H3>
<UL><PRE>
Fl_Color fl_contrast(Fl_Color fg, Fl_Color bg);
</PRE></UL>
<H3>Description</H3>
<P>Returns the foreground color if it contrasts sufficiently
with the background color. Otherwise, returns
<CODE>FL_WHITE</CODE> or <CODE>FL_BLACK</CODE> depending on
which color provides the best contrast.
<!-- NEED 4in -->
<H2><A NAME="fl_darker">fl_darker</A></H2>
<HR>
<H3>Include Files</H3>
<UL><PRE>
#include &lt;FL/Enumerations.H&gt;
</PRE></UL>
<H3>Prototype</H3>
<UL><PRE>
Fl_Color fl_darker(Fl_Color c);
</PRE></UL>
<H3>Description</H3>
<P>Returns a darker version of the specified color.
<!-- NEED 4in --> <!-- NEED 4in -->
<H2><A NAME="fl_dir_chooser">fl_dir_chooser</A></H2> <H2><A NAME="fl_dir_chooser">fl_dir_chooser</A></H2>
@ -806,6 +892,28 @@ label are after the default value.
<P ALIGN=CENTER><IMG SRC="fl_input.gif" ALT="The fl_input window."> <P ALIGN=CENTER><IMG SRC="fl_input.gif" ALT="The fl_input window.">
<!-- NEED 4in -->
<H2><A NAME="fl_lighter">fl_lighter</A></H2>
<HR>
<H3>Include Files</H3>
<UL><PRE>
#include &lt;FL/Enumerations.H&gt;
</PRE></UL>
<H3>Prototype</H3>
<UL><PRE>
Fl_Color fl_lighter(Fl_Color c);
</PRE></UL>
<H3>Description</H3>
<P>Returns a lighter version of the specified color.
<!-- NEED 4in --> <!-- NEED 4in -->
<H2><A name="fl_message">fl_message</A></H2> <H2><A name="fl_message">fl_message</A></H2>