Debian Codegraph @

opcodes/flbutton.xml

raw symbols SCIP
1
2 <refentry id="FLbutton">
3 <indexterm id="IndexFlbutton"><primary>FLbutton</primary></indexterm>
4 <refentryinfo><title>FLTK:Other</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>FLbutton</refentrytitle>
7 </refmeta>
8
9
10
11 <refnamediv>
12 <refname>FLbutton</refname>
13 <refpurpose>
14 A FLTK widget opcode that creates a button.
15 </refpurpose>
16 </refnamediv>
17
18 <refsect1>
19 <title>Description</title>
20 <para>
21 Plugin opcode in widgets. This opcode is part of the plugin repository and has to be installed separately. These FLTK widgets do not work on the Mac.
22 The plugin repository can be found here: <ulink url="https://github.com/csound/plugins"><citetitle>https://github.com/csound/plugins</citetitle></ulink></para>
23 <para>
24 A FLTK widget opcode that creates a button.
25 </para>
26 </refsect1>
27
28 <refsect1>
29 <title>Syntax</title>
30 <synopsis>kout, ihandle <command>FLbutton</command> &quot;label&quot;, ion, ioff, itype, iwidth, iheight, ix, \
31 iy, iopcode [, kp1] [, kp2] [, kp3] [, kp4] [, kp5] [....] [, kpN]</synopsis>
32 </refsect1>
33
34 <refsect1>
35 <title>Initialization</title>
36 <para>
37 <emphasis>ihandle</emphasis> -- a handle value (an integer number) that unequivocally references a corresponding widget. This is used by other opcodes that modify a widget's properties (see <link linkend="ControlFltkAppearance"><citetitle>Modifying FLTK Widget Appearance</citetitle></link>). It is automatically output by <emphasis>FLbutton</emphasis> and must not be set by the user label. (The user label is a double-quoted string containing some user-provided text placed near the widget.)
38 </para>
39
40 <para>
41 <emphasis><quote>label</quote></emphasis> -- a double-quoted string containing some user-provided text, placed near the corresponding widget.
42 </para>
43
44 <para>
45 Notice that with <emphasis>FLbutton</emphasis>, it is not necessary to call the <link linkend="FLsetTextType"><citetitle>FLsetTextType</citetitle></link> opcode at all in order to use a symbol. In this case, it is sufficient to set a label starting with <quote>@</quote> followed by the proper formatting string.
46 </para>
47
48 <para>
49 The following symbols are supported:
50
51 <mediaobject>
52 <imageobject>
53 <imagedata fileref="images/symbols.png" format="PNG"/>
54 </imageobject>
55
56 <textobject>
57 <phrase>FLTK label supported symbols.</phrase>
58 </textobject>
59
60 <caption>
61 <para>FLTK label supported symbols.</para>
62 </caption>
63 </mediaobject>
64 </para>
65
66 <para>
67 The @ sign may be followed by the following optional <quote>formatting</quote> characters, in this order:
68
69 <orderedlist>
70 <listitem><para><quote>#</quote> forces square scaling rather than distortion to the widget's shape.</para></listitem>
71 <listitem><para>+[1-9] or -[1-9] tweaks the scaling a little bigger or smaller.</para></listitem>
72 <listitem><para>[1-9] rotates by a multiple of 45 degrees. <quote>6</quote> does nothing, the others point in the direction of that key on a numeric keypad.</para></listitem>
73 </orderedlist>
74 </para>
75
76 <para>
77 <emphasis>ion</emphasis> -- value output when the button is checked.
78 </para>
79
80 <para>
81 <emphasis>ioff</emphasis> -- value output when the button is unchecked.
82 </para>
83
84 <para>
85 <emphasis>itype</emphasis> -- an integer number denoting the appearance of the widget.
86 </para>
87
88 <para>
89 Several kind of buttons are possible, according to the value of <emphasis>itype</emphasis> argument:
90
91 <itemizedlist>
92 <listitem><para>1 - normal button</para></listitem>
93 <listitem><para>2 - light button</para></listitem>
94 <listitem><para>3 - check button</para></listitem>
95 <listitem><para>4 - round button</para></listitem>
96 </itemizedlist>
97 You can add 20 to the value to create a "plastic" type button. (Note that there is no Platic Round button. i.e. if you set type to 24 it will look exactly like type 23).
98 </para>
99
100 <para>
101 This is the appearance of the buttons:
102
103 <mediaobject>
104 <imageobject>
105 <imagedata fileref="images/flbutton.png" format="PNG"/>
106 </imageobject>
107
108 <textobject>
109 <phrase>FLbutton.</phrase>
110 </textobject>
111
112 <caption>
113 <para>FLbutton.</para>
114 </caption>
115 </mediaobject>
116 </para>
117
118 <para>
119 <emphasis>iwidth</emphasis> -- width of widget.
120 </para>
121
122 <para>
123 <emphasis>iheight</emphasis> -- height of widget.
124 </para>
125
126 <para>
127 <emphasis>ix</emphasis> -- horizontal position of upper left corner of the valuator, relative to the upper left corner of corresponding window (expressed in pixels).
128 </para>
129
130 <para>
131 <emphasis>iy</emphasis> -- vertical position of upper left corner of the valuator, relative to the upper left corner of corresponding window (expressed in pixels).
132 </para>
133
134 <para>
135 <emphasis>iopcode</emphasis> -- score opcode type. You have to provide the ascii code of the letter corresponding to the score opcode. At present time only <quote>i</quote> (ascii code 105) score statements are supported. A zero value refers to a default value of <quote>i</quote>. So both 0 and 105 activates the <link linkend="i"><citetitle>i</citetitle></link> opcode. A value of -1 disables this opcode feature.
136 </para>
137 </refsect1>
138
139 <refsect1>
140 <title>Performance</title>
141 <para>
142 <emphasis>kout</emphasis> -- output value
143 </para>
144
145 <para>
146 <emphasis>kp1</emphasis>, <emphasis>kp2</emphasis>, ..., <emphasis>kpN</emphasis> -- arguments of the activated instruments.
147 </para>
148
149 <para>
150 Buttons of type 2, 3, and 4 also output (<emphasis>kout</emphasis> argument) the value contained in the <emphasis>ion</emphasis> argument when checked, and that contained in <emphasis>ioff</emphasis> argument when unchecked.
151 </para>
152
153 <para>
154 By adding 10 to <emphasis>itype</emphasis> argument (i.e. by setting 11 for type 1, 12 for type 2, 13 for type 3 and 14 for type 4) it is possible to skip the button value when getting/setting snapshots (see later section). <emphasis>FLbutton</emphasis> not only outputs a value, but can also activate (or schedule) an instrument provided by the user each time a button is pressed. You can also add 10 to "plastic" button types (31 for type 1, 32 for type 2, etc.)
155 </para>
156
157 <para>
158 If the <emphasis>iopcode</emphasis> argument is set to a negative number, no instrument is activated. So this feature is optional. In order to activate an instrument, <emphasis>iopcode</emphasis> must be set to 0 or to 105 (the ascii code of character <quote>i</quote>, referring to the <link linkend="i"><citetitle>i</citetitle></link> score opcode).
159 </para>
160
161 <para>
162 P-fields of the activated instrument are <emphasis>kp1</emphasis> (instrument number), <emphasis>kp2</emphasis> (action time), <emphasis>kp3</emphasis> (duration) and so on with user p-fields. Notice that in dual state buttons (light button, check button and round button), the instrument is activated only when button state changes from unchecked to checked (not when passing from checked to unchecked).
163 </para>
164 </refsect1>
165
166 <refsect1>
167 <title>Examples</title>
168 <para>
169 Here is an example of the FLbutton opcode. It uses the file <ulink url="examples/FLbutton.csd"><citetitle>FLbutton.csd</citetitle></ulink>, and <ulink url="examples/drumsMlp.wav"><citetitle>drumsMlp.wav</citetitle></ulink>.
170 <example>
171 <title>Example of the FLbutton opcode.</title>
172 <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para>
173 <xi:include href="examples-xml/FLbutton.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
174 </example>
175 </para>
176 </refsect1>
177
178 <refsect1>
179 <title>See Also</title>
180 <para>
181 <link linkend="FLbox"><citetitle>FLbox</citetitle></link>,
182 <link linkend="FLbutBank"><citetitle>FLbutBank</citetitle></link>,
183 <link linkend="FLprintk"><citetitle>FLprintk</citetitle></link>,
184 <link linkend="FLprintk2"><citetitle>FLprintk2</citetitle></link>,
185 <link linkend="FLvalue"><citetitle>FLvalue</citetitle></link>
186 </para>
187 </refsect1>
188
189 <refsect1>
190 <title>Credits</title>
191 <para>Author: &namegabriel;</para>
192 <para>New in version 4.22</para>
193 <para>Example written by Iain McCurdy, edited by &namekevin;.</para>
194 </refsect1>
195 </refentry>