source: rtems-graphics-toolkit/fltk-1.1.10/documentation/Fl_Button.html @ 513eea1

Last change on this file since 513eea1 was 513eea1, checked in by Joel Sherrill <joel.sherrill@…>, on 01/09/10 at 22:43:24

2010-01-08 Joel Sherrill <joel.sherrill@…>

fltk 1.1.10. imported

  • ORIGIN: Updated.
  • Property mode set to 100644
File size: 5.7 KB
Line 
1<HTML>
2<HEAD>
3        <TITLE>Fl_Button</TITLE>
4</HEAD>
5<BODY>
6<!-- NEW PAGE -->
7<H2><A name=Fl_Button>class Fl_Button</A></H2>
8<HR>
9<H3>Class Hierarchy</H3>
10<UL>
11<PRE>
12<A href=Fl_Widget.html#Fl_Widget>Fl_Widget</A>
13   |
14   +----<B>Fl_Button</B>
15           |
16           +----<A href=Fl_Check_Button.html#Fl_Check_Button>Fl_Check_Button</A>, <A href=Fl_Light_Button.html#Fl_Light_Button>Fl_Light_Button</A>, <A href=Fl_Repeat_Button.html#Fl_Repeat_Button>Fl_Repeat_Button</A>,
17                <A href=Fl_Return_Button.html#Fl_Return_Button>Fl_Return_Button</A>, <A href=Fl_Round_Button.html#Fl_Round_Button>Fl_Round_Button</A>, <A href=Fl_Toggle_Button.html#Fl_Toggle_Button>Fl_Toggle_Button</A>
18</PRE>
19</UL>
20<H3>Include Files</H3>
21<UL>
22<PRE>
23#include &lt;FL/Fl_Button.H&gt;
24</PRE>
25</UL>
26<H3>Description</H3>
27<P>Buttons generate callbacks when they are clicked by the user.  You
28control exactly when and how by changing the values for <TT>type()</TT>
29 and <TT>when()</TT>. </P>
30<P>Buttons can also generate callbacks in response to <TT>FL_SHORTCUT</TT>
31 events.  The button can either have an explicit <A href=#Fl_Button.shortcut>
32<TT>shortcut()</TT></A> value or a letter shortcut can be indicated in
33the <TT>label()</TT> with an '&amp;' character before it.  For the label
34shortcut it does not matter if <I>Alt</I> is held down, but if you have
35an input field in the same window, the user will have to hold down the <I>
36Alt</I> key so that the input field does not eat the event first as an <TT>
37FL_KEYBOARD</TT> event. </P>
38<H3>Methods</H3>
39<CENTER>
40<TABLE width=90% summary="Fl_Button methods">
41<TR><TD align=left valign=top>
42<UL>
43<LI><A href=#Fl_Button.Fl_Button>Fl_Button</A></LI>
44<LI><A href=#Fl_Button.~Fl_Button>~Fl_Button</A></LI>
45</UL>
46</TD><TD align=left valign=top>
47<UL>
48<LI><A href=#Fl_Button.clear>clear</A></LI>
49<LI><A href=#Fl_Button.down_box>down_box</A></LI>
50</UL>
51</TD><TD align=left valign=top>
52<UL>
53<LI><A href=#Fl_Button.set>set</A></LI>
54<LI><A href=#Fl_Button.setonly>setonly</A></LI>
55</UL>
56</TD><TD align=left valign=top>
57<UL>
58<LI><A href=#Fl_Button.shortcut>shortcut</A></LI>
59<LI><A href=#Fl_Button.type>type</A></LI>
60</UL>
61</TD><TD align=left valign=top>
62<UL>
63<LI><A href=#Fl_Button.value>value</A></LI>
64<LI><A href=#Fl_Button.when>when</A></LI>
65</UL>
66</TD></TR>
67</TABLE>
68</CENTER>
69<H4><A name=Fl_Button.Fl_Button>Fl_Button::Fl_Button(int x, int y, int
70w, int h, const char *label = 0)</A></H4>
71 The constructor creates the button using the position, size, and
72label.
73<H4><A name=Fl_Button.~Fl_Button>Fl_Button::~Fl_Button(void)</A></H4>
74 The destructor removes the button.
75<H4><A name=Fl_Button.clear>int Fl_Button::clear()</A></H4>
76 Same as <TT>value(0)</TT>.
77<H4><A name=Fl_Button.down_box>Fl_Boxtype Fl_Button::down_box() const
78<BR> void Fl_Button::down_box(Fl_Boxtype bt)</A></H4>
79 The first form returns the current down box type, which is drawn when <TT>
80value()</TT> is non-zero.
81<P>The second form sets the down box type. The default value of 0
82causes FLTK to figure out the correct matching down version of <TT>box()</TT>
83. </P>
84<H4><A name=Fl_Button.set>int Fl_Button::set()</A></H4>
85 Same as <TT>value(1)</TT>.
86<H4><A name=Fl_Button.setonly>void Fl_Button::setonly()</A></H4>
87 Turns on this button and turns off all other radio buttons in the
88group (calling <TT>value(1)</TT> or <TT>set()</TT> does not do this).
89<H4><A name=Fl_Button.shortcut>ulong Fl_Button::shortcut() const
90<BR> void Fl_Button::shortcut(ulong key)</A></H4>
91 The first form returns the current shortcut key for the button.
92<P>The second form sets the shortcut key to <TT>key</TT>. Setting this
93overrides the use of '&amp;' in the <TT>label()</TT>.  The value is a bitwise
94OR of a key and a set of shift flags, for example <CODE>FL_ALT | 'a'</CODE>
95, <CODE>FL_ALT | (FL_F + 10)</CODE>, or just <CODE>'a'</CODE>.  A value
96of 0 disables the shortcut. </P>
97<P>The key can be any value returned by <A href="Fl.html#Fl.event_key">
98<TT>Fl::event_key()</TT></A>, but will usually be an ASCII letter.  Use
99a lower-case letter unless you require the shift key to be held down. </P>
100<P>The shift flags can be any set of values accepted by <A href="Fl.html#Fl.event_state">
101<TT>Fl::event_state()</TT></A>.  If the bit is on that shift key must
102be pushed.  Meta, Alt, Ctrl, and Shift must be off if they are not in
103the shift flags (zero for the other bits indicates a &quot;don't care&quot;
104setting). </P>
105<H4><A name=Fl_Button.type>uchar Fl_Button::type() const
106<BR> void Fl_Button::type(uchar t)</A></H4>
107 The first form of <TT>type()</TT> returns the current button type,
108which can be one of:
109<UL>
110<LI><CODE>0</CODE>: The value is unchanged. </LI>
111<LI><CODE>FL_TOGGLE_BUTTON</CODE>: The value is inverted. </LI>
112<LI><CODE>FL_RADIO_BUTTON</CODE>: The value is set to 1, and all  other
113buttons in the current group with <CODE>type() == FL_RADIO_BUTTON</CODE>
114 are set to zero. </LI>
115</UL>
116 The second form sets the button type to <TT>t</TT>.
117<H4><A name=Fl_Button.value>char Fl_Button::value() const
118<BR> int Fl_Button::value(int)</A></H4>
119 The first form returns the current value (0 or 1).  The second form
120sets the current value.
121<H4><A name=Fl_Button.when>Fl_When Fl_Widget::when() const
122<BR> void Fl_Widget::when(Fl_When w)</A></H4>
123 Controls when callbacks are done.  The following values are useful,
124the default value is <CODE>FL_WHEN_RELEASE</CODE>:
125<UL>
126<LI><CODE>0</CODE>: The callback is not done, instead changed() is
127 turned on. </LI>
128<LI><CODE>FL_WHEN_RELEASE</CODE>: The callback is done after the user
129 successfully clicks the button, or when a shortcut is typed. </LI>
130<LI><CODE>FL_WHEN_CHANGED </CODE>: The callback is done each time the
131 value() changes (when the user pushes and releases the button, and as
132 the mouse is dragged around in and out of the button). </LI>
133</UL>
134</BODY></HTML>
Note: See TracBrowser for help on using the repository browser.