| 1 | |
| 2 | <refentry id="FLbox"> |
| 3 | <indexterm id="IndexFLbox"><primary>FLbox</primary></indexterm> |
| 4 | <refentryinfo><title>FLTK:Other</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>FLbox</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>FLbox</refname> |
| 11 | <refpurpose> |
| 12 | A FLTK widget that displays text inside of a box. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | 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. |
| 20 | The plugin repository can be found here: <ulink url="https://github.com/csound/plugins"><citetitle>https://github.com/csound/plugins</citetitle></ulink></para> |
| 21 | <para> |
| 22 | A FLTK widget that displays text inside of a box. |
| 23 | </para> |
| 24 | </refsect1> |
| 25 | |
| 26 | <refsect1> |
| 27 | <title>Syntax</title> |
| 28 | <synopsis>ihandle <command>FLbox</command> "label", itype, ifont, isize, iwidth, iheight, ix, iy [, image]</synopsis> |
| 29 | <synopsis>ihandle <command>FLbox</command> istr, itype, ifont, isize, iwidth, iheight, ix, iy [, image]</synopsis> |
| 30 | </refsect1> |
| 31 | |
| 32 | <refsect1> |
| 33 | <title>Initialization</title> |
| 34 | <para> |
| 35 | <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>FLbox</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.) |
| 36 | </para> |
| 37 | <para> |
| 38 | <emphasis><quote>label</quote></emphasis> -- a double-quoted string containing some user-provided text, placed near corresponding widget. |
| 39 | </para> |
| 40 | <para> |
| 41 | <emphasis>istr</emphasis> -- an i-value that is used to get a string via strset, placed near corresponding widget. |
| 42 | </para> |
| 43 | |
| 44 | <para> |
| 45 | Notice that with <emphasis>FLbox</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>itype</emphasis> -- an integer number denoting the appearance of the widget. |
| 78 | </para> |
| 79 | |
| 80 | <para> |
| 81 | The following values are legal for <emphasis>itype</emphasis>: |
| 82 | <itemizedlist> |
| 83 | <listitem><para>1 - flat box</para></listitem> |
| 84 | <listitem><para>2 - up box</para></listitem> |
| 85 | <listitem><para>3 - down box</para></listitem> |
| 86 | <listitem><para>4 - thin up box</para></listitem> |
| 87 | <listitem><para>5 - thin down box</para></listitem> |
| 88 | <listitem><para>6 - engraved box</para></listitem> |
| 89 | <listitem><para>7 - embossed box</para></listitem> |
| 90 | <listitem><para>8 - border box</para></listitem> |
| 91 | <listitem><para>9 - shadow box</para></listitem> |
| 92 | <listitem><para>10 - rounded box</para></listitem> |
| 93 | <listitem><para>11 - rounded box with shadow</para></listitem> |
| 94 | <listitem><para>12 - rounded flat box</para></listitem> |
| 95 | <listitem><para>13 - rounded up box</para></listitem> |
| 96 | <listitem><para>14 - rounded down box</para></listitem> |
| 97 | <listitem><para>15 - diamond up box</para></listitem> |
| 98 | <listitem><para>16 - diamond down box</para></listitem> |
| 99 | <listitem><para>17 - oval box</para></listitem> |
| 100 | <listitem><para>18 - oval shadow box</para></listitem> |
| 101 | <listitem><para>19 - oval flat box</para></listitem> |
| 102 | </itemizedlist> |
| 103 | </para> |
| 104 | |
| 105 | <para> |
| 106 | <emphasis>ifont</emphasis> -- an integer number denoting the font of <emphasis>FLbox</emphasis>. |
| 107 | </para> |
| 108 | |
| 109 | <para> |
| 110 | <emphasis>ifont</emphasis> argument to set the font type. The following values are legal for <emphasis>ifont</emphasis>: |
| 111 | <itemizedlist> |
| 112 | <listitem><para>1 - helvetica (same as "Arial" under Windows)</para></listitem> |
| 113 | <listitem><para>2 - helvetica bold</para></listitem> |
| 114 | <listitem><para>3 - helvetica italic</para></listitem> |
| 115 | <listitem><para>4 - helvetica bold italic</para></listitem> |
| 116 | <listitem><para>5 - courier</para></listitem> |
| 117 | <listitem><para>6 - courier bold</para></listitem> |
| 118 | <listitem><para>7 - courier italic</para></listitem> |
| 119 | <listitem><para>8 - courier bold italic</para></listitem> |
| 120 | <listitem><para>9 - times</para></listitem> |
| 121 | <listitem><para>10 - times bold</para></listitem> |
| 122 | <listitem><para>11 - times italic</para></listitem> |
| 123 | <listitem><para>12 - times bold italic</para></listitem> |
| 124 | <listitem><para>13 - symbol</para></listitem> |
| 125 | <listitem><para>14 - screen</para></listitem> |
| 126 | <listitem><para>15 - screen bold</para></listitem> |
| 127 | <listitem><para>16 - dingbats</para></listitem> |
| 128 | </itemizedlist> |
| 129 | </para> |
| 130 | |
| 131 | <para> |
| 132 | <emphasis>isize</emphasis> -- size of the font. |
| 133 | </para> |
| 134 | |
| 135 | <para> |
| 136 | <emphasis>iwidth</emphasis> -- width of widget. |
| 137 | </para> |
| 138 | |
| 139 | <para> |
| 140 | <emphasis>iheight</emphasis> -- height of widget. |
| 141 | </para> |
| 142 | |
| 143 | <para> |
| 144 | <emphasis>ix</emphasis> -- horizontal position of the upper left corner of the valuator, relative to the upper left corner of corresponding window. (Expressed in pixels.) |
| 145 | </para> |
| 146 | |
| 147 | <para> |
| 148 | <emphasis>iy</emphasis> -- vertical position of the upper left corner of the valuator, relative to the upper left corner of corresponding window. (Expressed in pixels.) |
| 149 | </para> |
| 150 | |
| 151 | <para> |
| 152 | <emphasis>image</emphasis> -- a handle referring to an eventual image opened with <emphasis>bmopen</emphasis> opcode. If it is set, it allows a skin for that widget. |
| 153 | </para> |
| 154 | |
| 155 | <note> |
| 156 | <title>Note about the bmopen opcode</title> |
| 157 | <para> |
| 158 | Although the documentation mentions the <emphasis>bmopen</emphasis> opcode, it has not been implemented in Csound 4.22. |
| 159 | </para> |
| 160 | </note> |
| 161 | </refsect1> |
| 162 | |
| 163 | <refsect1> |
| 164 | <title>Performance</title> |
| 165 | <para> |
| 166 | <emphasis>FLbox</emphasis> is useful to show some text in a window. The text is bounded by a box, whose aspect depends on <emphasis>itype</emphasis> argument. |
| 167 | </para> |
| 168 | |
| 169 | <para> |
| 170 | Note that <emphasis>FLbox</emphasis> is not a valuator and its value is fixed. Its value cannot be modified. |
| 171 | </para> |
| 172 | </refsect1> |
| 173 | |
| 174 | <refsect1> |
| 175 | <title>Examples</title> |
| 176 | <para> |
| 177 | Here is an example of the FLbox opcode. It uses the file <ulink url="examples/FLbox.csd"><citetitle>FLbox.csd</citetitle></ulink>. |
| 178 | |
| 179 | <example> |
| 180 | <title>Example of the FLbox opcode.</title> |
| 181 | |
| 182 | <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> |
| 183 | <xi:include href="examples-xml/FLbox.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 184 | </example> |
| 185 | </para> |
| 186 | </refsect1> |
| 187 | |
| 188 | <refsect1> |
| 189 | <title>See Also</title> |
| 190 | <para> |
| 191 | <link linkend="FLbutBank"><citetitle>FLbutBank</citetitle></link>, |
| 192 | <link linkend="FLbutton"><citetitle>FLbutton</citetitle></link>, |
| 193 | <link linkend="FLprintk"><citetitle>FLprintk</citetitle></link>, |
| 194 | <link linkend="FLprintk2"><citetitle>FLprintk2</citetitle></link>, |
| 195 | <link linkend="FLvalue"><citetitle>FLvalue</citetitle></link> |
| 196 | </para> |
| 197 | </refsect1> |
| 198 | |
| 199 | <refsect1> |
| 200 | <title>Credits</title> |
| 201 | <para>Author: &namegabriel;</para> |
| 202 | <para>New in version 4.22</para> |
| 203 | <para>Example written by Iain McCurdy, edited by &namekevin;.</para> |
| 204 | </refsect1> |
| 205 | </refentry> |