File: stringbox.xml

package info (click to toggle)
scilab 5.2.2-9
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 334,832 kB
  • ctags: 52,586
  • sloc: xml: 526,945; ansic: 223,590; fortran: 163,080; java: 56,934; cpp: 33,840; tcl: 27,936; sh: 20,397; makefile: 9,908; ml: 9,451; perl: 1,323; cs: 614; lisp: 30
file content (176 lines) | stat: -rw-r--r-- 4,655 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) INRIA - Jean-Baptiste Silvy
 * 
 * This file must be used under the terms of the CeCILL.
 * This source file is licensed as described in the file COPYING, which
 * you should have received as part of this distribution.  The terms
 * are also available at    
 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 *
 -->
<refentry version="5.0-subset Scilab" xml:id="stringbox" xml:lang="en"
          xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg"
          xmlns:ns4="http://www.w3.org/1999/xhtml"
          xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:db="http://docbook.org/ns/docbook">
  <info>
    <pubdate>$LastChangedDate$</pubdate>
  </info>

  <refnamediv>
    <refname>stringbox</refname>

    <refpurpose>Computa o retngulo de fronteira de um texto ou
    rtulo.</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <title>Seqncia de Chamamento</title>

    <synopsis>rect = stringbox( string, x, y, [angle, [fontStyle, [fontSize]]] )
rect = stringbox( Handle )</synopsis>
  </refsynopsisdiv>

  <refsection>
    <title>Parmetros</title>

    <variablelist>
      <varlistentry>
        <term>rect</term>

        <listitem>
          <para>uma matriz 2x4 contendo as quatro coordenadas dos vrtices do
          retngulo de fronteira. </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>string</term>

        <listitem>
          <para>matriz de strings a ser encerrada </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>x,y</term>

        <listitem>
          <para>escalares reais, coordenadas do ponto inferior esquerdo dos
          strings. </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>angle</term>

        <listitem>
          <para>ngulo de rotao dos strings em sentido horrio e em graus ao
          redor do ponto <literal>(x,y)</literal>.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>fonStyle</term>

        <listitem>
          <para>inteiro especificando o tipo da fonte. </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>fontSize</term>

        <listitem>
          <para>inteiro especificando o tamanho da fonte. </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>Handle</term>

        <listitem>
          <para>um manipulador grfico do tipo Text ou Label.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsection>

  <refsection>
    <title>Descrio</title>

    <para><literal>stringbox</literal> retorna os vrtices de um retngulo de
    fronteira de um texto ou rtulo ou um string que ser exibido de certo
    modo. As coordenadas so dadas com a escala grfica corrente. O primeiro
    vrtice corresponde s coordenadas do texto <literal>(x,y)</literal>,
    ponto superior esquerdo sem rotao, os vrtices seguintes so dados em
    sentido horrio na matriz resultante.</para>

    <para>O resultado pode ser impreciso com um driver Postscript.</para>
  </refsection>

  <refsection>
    <title>Exemplos</title>

    <programlisting role="example"><![CDATA[ 
// exibindo eixos
axes = gca() ;
axes.axes_visible = 'on' ;
axes.data_bounds = [ 1, 1 ; 10, 10 ] ;

// exibindo rtulos para eixos
xtitle( 'stringbox', 'X', 'Y' )  ;

// obtendo a caixa de fronteixa do rtulo X
stringbox( axes.x_label )

// imprimindo um string
str = [ "Scilab", "no" , "", "Skylab" ] ;
xstring( 4, 9, str ) ;

//modificando o texto
e = gce() ;
e.font_angle = 90 ;
e.font_size    = 6  ;
e.font_style   = 7 ;
e.box = 'on' ;

// obtendo sua caixa de fronteira
stringbox( e )
// ou
rect = stringbox( str, 4, 9, 90, 7, 6 )

// clicando e descobrindo se o texto foi acertado
hit = xclick()  ;
hit = hit( 2 : 3 ) ;

if hit(1) >= rect(1,1)  & hit(1) <=  rect(1,2) & hit(2) <= rect(2,2) & hit(2) >= rect(2,3) then
  disp('Voc acertou o texto.') ;
else
  disp('Voc errou.')
end;
 ]]></programlisting>
  </refsection>

  <refsection>
    <title>Ver Tambm</title>

    <simplelist type="inline">
      <member><link linkend="xstring">xstring</link></member>

      <member><link linkend="xstringl">xstringl</link></member>

      <member><link linkend="xstringb">xstringb</link></member>
    </simplelist>
  </refsection>

  <refsection>
    <title>Autor</title>

    <para>Jean-Baptiste Silvy</para>
  </refsection>
</refentry>