OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [itcl/] [iwidgets3.0.0/] [demos/] [html/] [canvasprintbox.n.html] - Blame information for rev 1770

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
<HTML>
2
<HEAD>
3
<TITLE>iwidgets2.2.0 User Commands - canvasprintbox</TITLE>
4
</HEAD>
5
<BODY BGCOLOR="#FFFFFF">
6
<H1>iwidgets2.2.0 User Commands - canvasprintbox</H1>
7
<HR>
8
<PRE>
9
 
10
</PRE>
11
<H2><HR ALIGN=LEFT WIDTH=70% SIZE=3></H2><PRE>
12
 
13
 
14
</PRE>
15
<H2>NAME</H2><PRE>
16
     canvasprintbox - Create and manipulate a  canvas  print  box
17
     widget
18
 
19
 
20
</PRE>
21
<H2>SYNOPSIS</H2><PRE>
22
     <STRONG>canvasprintbox</STRONG> <EM>pathName</EM> ?<EM>options</EM>?
23
 
24
 
25
</PRE>
26
<H2>INHERITANCE</H2><PRE>
27
     itk::Widget &lt;- Canvasprintbox
28
 
29
 
30
</PRE>
31
<H2>STANDARD OPTIONS</H2><PRE>
32
     <STRONG>activeBackground</STRONG>               <STRONG>background</STRONG>      <STRONG>borderWidthcursor</STRONG>
33
     <STRONG>foreground</STRONG>      <STRONG>highlightBackground</STRONG>            <STRONG>highlightColorhighlightThickness</STRONG>
34
     <STRONG>insertBackground</STRONG>               <STRONG>insertBorderWidthinsertOffTimeinsertOnTime</STRONG>
35
     <STRONG>insertWidth</STRONG>     <STRONG>relief</STRONG>         <STRONG>repeatDelay</STRONG>     <STRONG>repeatInterval</STRONG>
36
     <STRONG>selectBackground</STRONG>               <STRONG>selectBorderWidthselectForeground</STRONG>
37
 
38
     See the "options" manual entry for details on  the  standard
39
     options.
40
 
41
 
42
</PRE>
43
<H2>ASSOCIATED OPTIONS</H2><PRE>
44
 
45
 
46
 
47
</PRE>
48
<H2>WIDGET-SPECIFIC OPTIONS</H2><PRE>
49
     Name:           <STRONG>filename</STRONG>
50
     Class:          <STRONG>FileName</STRONG>
51
     Command-Line Switch:           <STRONG>-filename</STRONG>
52
 
53
          The file to write the postscript output to  (Only  when
54
          output  is  set to "file"). If posterizing is turned on
55
          and <STRONG>hpagecnt</STRONG> and/or <STRONG>vpagecnt</STRONG> is more  than  1,  x.y  is
56
          appended to the filename where x is the horizontal page
57
          number and y the vertical page number.
58
 
59
     Name:           <STRONG>hpagecnt</STRONG>
60
     Class:          <STRONG>PageCnt</STRONG>
61
     Command-Line Switch:           <STRONG>-hpagecnt</STRONG>
62
 
63
          Is used in combination with <STRONG>posterize</STRONG> to determine over
64
          how  many  pages the output should be distributed. This
65
          attribute specifies how many pages should be used  hor-
66
          izontaly.   Any change to this attribute will automati-
67
          cally update the "stamp".  Defaults to 1.
68
 
69
     Name:           <STRONG>orient</STRONG>
70
     Class:          <STRONG>Orient</STRONG>
71
     Command-Line Switch:           <STRONG>-orient</STRONG>
72
 
73
          Determines the orientation of the output to the printer
74
          (or  file).   It  can  take  the  value  "portrait"  or
75
          "landscape" (default). Changes to this  attribute  will
76
          be  reflected  immediately in the "stamp".  Defaults to
77
          "landscape" but will be  changed  automaticaly  to  the
78
          value deemed appropiate for the current canvas. Setting
79
          this attribute when the canvasprintbox  is  first  con-
80
          structed (instead of using the "configure" method) will
81
          turn off the auto adjustment of this attribute.
82
 
83
     Name:           <STRONG>output</STRONG>
84
     Class:          <STRONG>Output</STRONG>
85
     Command-Line Switch:           <STRONG>-output</STRONG>
86
 
87
          Specifies where the postscript output should go: to the
88
          printer  or to a file. Can take on the values "printer"
89
          or "file".  The corresponding entry-widget will reflect
90
          the  contents  of  either the <STRONG>printcmd</STRONG> attribute or the
91
          <STRONG>filename</STRONG> attribute.  Defaults to "printer".
92
 
93
     Name:           <STRONG>pageSize</STRONG>
94
     Class:          <STRONG>PageSize</STRONG>
95
     Command-Line Switch:           <STRONG>-pagesize</STRONG>
96
 
97
          The pagesize the  printer  supports.  Changes  to  this
98
          attribute will be reflected immediately in the "stamp".
99
          Defaults to "a4".
100
 
101
     Name:           <STRONG>posterize</STRONG>
102
     Class:          <STRONG>Posterize</STRONG>
103
     Command-Line Switch:           <STRONG>-posterize</STRONG>
104
 
105
          Indicates if posterizing is turned on or not. Posteriz-
106
          ing  the output means that it is possible to distribute
107
          the output over more than one page. This way it is pos-
108
          sible to print a canvas/region which is larger than the
109
          specified pagesize without stretching. If used in  com-
110
          bination  with  stretching  it can be used to "blow up"
111
          the contents of a canvas to as large  as  size  as  you
112
          want  (See  attributes:   hpagecnt  and  vpagecnt). Any
113
          change to this attribute will automatically update  the
114
          "stamp".  Defaults to 0.
115
 
116
     Name:           <STRONG>printCmd</STRONG>
117
     Class:          <STRONG>PrintCmd</STRONG>
118
     Command-Line Switch:           <STRONG>-printcmd</STRONG>
119
 
120
          The command to execute  when  printing  the  postscript
121
          output.   The  command will get the postscript directed
122
          to its standard input  (Only  when  output  is  set  to
123
          "printer").  Defaults to "lpr".
124
 
125
     Name:           <STRONG>printRegion</STRONG>
126
     Class:          <STRONG>PrintRegion</STRONG>
127
     Command-Line Switch:           <STRONG>-printregion</STRONG>
128
 
129
          A list of four coordinates specifying which part of the
130
          canvas  to print.  An empty list means that the canvas'
131
          entire <STRONG>scrollregion</STRONG> should be printed.  Any  change  to
132
          this  attribute  will automatically update the "stamp".
133
          Defaults to an empty list.
134
 
135
     Name:           <STRONG>stretch</STRONG>
136
     Class:          <STRONG>Stretch</STRONG>
137
     Command-Line Switch:           <STRONG>-stretch</STRONG>
138
 
139
          Determines if the output should be  stretched  to  fill
140
          the  page  (as  defined  by  the attribute pagesize) as
141
          large as possible. The aspect-ratio of the output  will
142
          be  retained  and the output will never fall outside of
143
          the boundaries of the page.  Defaults to 0 but will  be
144
          changed automaticaly to the value deemed appropiate for
145
          the current canvas. Setting  this  attribute  when  the
146
          canvasprintbox  is  first constructed (instead of using
147
          the "configure" method) will turn off the auto  adjust-
148
          ment of this attribute.
149
 
150
     Name:           <STRONG>vPageCnt</STRONG>
151
     Class:          <STRONG>PageCnt</STRONG>
152
     Command-Line Switch:           <STRONG>-vpagecnt</STRONG>
153
 
154
          Is used in combination with  "posterize"  to  determine
155
          over  how  many pages the output should be distributed.
156
          This attribute specifies how many pages should be  used
157
          verticaly.  Any change to this attribute will automati-
158
          cally update the "stamp".  Defaults to 1.
159
 
160
 
161
</PRE>
162
<H2><HR ALIGN=LEFT WIDTH=70% SIZE=3></H2><PRE>
163
 
164
 
165
 
166
</PRE>
167
<H2>DESCRIPTION</H2><PRE>
168
     Implements a print box for printing the contents of a canvas
169
     widget  to  a  printer  or a file. It is possible to specify
170
     page orientation, the number of pages to print the image  on
171
     and  if  the  output  should  be  stretched to fit the page.
172
     Options exist to control the appearance and actions  of  the
173
     widget.
174
 
175
 
176
 
177
</PRE>
178
<H2>METHODS</H2><PRE>
179
     The <STRONG>canvasprintbox</STRONG> command creates a new Tcl  command  whose
180
     name  is <EM>pathName</EM>.  This command may be used to invoke vari-
181
     ous operations on the widget.  It has the following  general
182
     form:
183
 
184
          <EM>pathName</EM> <EM>option</EM> ?<EM>arg</EM> <EM>arg</EM> ...?
185
 
186
     <EM>Option</EM> and the <EM>arg</EM>s determine the exact behavior of the com-
187
     mand.    The   following  commands  are  possible  for  can-
188
     vasprintbox widgets:
189
 
190
 
191
 
192
</PRE>
193
<H2>WIDGET-SPECIFIC METHODS</H2><PRE>
194
     <EM>pathName</EM> <STRONG>cget</STRONG> <EM>option</EM>
195
          Returns the current value of the  configuration  option
196
          given  by  <EM>option</EM>.   <EM>Option</EM>  may have any of the values
197
          accepted by the <STRONG>canvasprintbox</STRONG> command.
198
 
199
     <EM>pathName</EM> <STRONG>configure</STRONG> ?<EM>option</EM>? ?<EM>value</EM> <EM>option</EM> <EM>value</EM> ...?
200
          Query  or  modify  the  configuration  options  of  the
201
          widget.   If  no  <EM>option</EM>  is  specified, returns a list
202
          describing all of the available  options  for  <EM>pathName</EM>
203
          (see  <STRONG>Tk_ConfigureInfo</STRONG> for information on the format of
204
          this list).  If <EM>option</EM> is specified with no <EM>value</EM>, then
205
          the  command  returns  a  list describing the one named
206
          option (this list will be identical to the  correspond-
207
          ing  sublist  of  the  value  returned  if no <EM>option</EM> is
208
          specified).  If one or more  <EM>option</EM> - <EM>value</EM>  pairs  are
209
          specified,  then  the command modifies the given widget
210
          option(s) to have the given value(s);  in this case the
211
          command  returns  an empty string.  <EM>Option</EM> may have any
212
          of the values accepted by the <STRONG>canvasprintbox</STRONG> command.
213
 
214
     <EM>pathName</EM> <STRONG>getoutput</STRONG>
215
          Returns the value of the <STRONG>printercmd</STRONG> or <STRONG>filename</STRONG>  option
216
          depending on the current setting of <STRONG>output</STRONG>.
217
 
218
     <EM>pathName</EM> <STRONG>print</STRONG>
219
          Perfrom the actual printing of  the  canvas  using  the
220
          current  settings  of  all  the  attributes.  Returns a
221
          boolean indicating wether the printing  was  successful
222
          or not.
223
 
224
     <EM>pathName</EM> <STRONG>refresh</STRONG>
225
          Retrieves the current value for  all  edit  fields  and
226
          updates  the  stamp  accordingly.  Is useful for Apply-
227
          buttons.
228
 
229
     <EM>pathName</EM> <STRONG>setcanvas</STRONG> <EM>canvas</EM>
230
          This is used to set the <EM>canvas</EM> that has to be  printed.
231
          A  stamp-sized copy will automatically be drawn to show
232
          how the output would look with the current settings.
233
 
234
     <EM>pathName</EM> <STRONG>stop</STRONG>
235
          Stops the drawing of the "stamp". I'm currently  unable
236
          to detect when a Canvasprintbox gets destroyed or with-
237
          drawn. It's therefore advised that you perform  a  stop
238
          before you do something like that.
239
 
240
 
241
</PRE>
242
<H2>COMPONENTS</H2><PRE>
243
     Name:           <STRONG>prtflentry</STRONG>
244
     Class:          <STRONG>Entry</STRONG>
245
 
246
          The prtflentry component is the entry  field  for  user
247
          input  of the <STRONG>filename</STRONG> or <STRONG>printer</STRONG> command (depending on
248
          the value of <STRONG>output</STRONG>).
249
 
250
     Name:           <STRONG>hpcnt</STRONG>
251
     Class:          <STRONG>Entry</STRONG>
252
 
253
          The hpcnt component is the entry field for  user  input
254
          of  the number of pages to use horizontaly when <STRONG>poster-</STRONG>
255
          <STRONG>ize</STRONG> is turned on.
256
          Name:           <STRONG>vpcnt</STRONG>
257
          Class:          <STRONG>Entry</STRONG>
258
 
259
          The vpcnt component is the entry field for  user  input
260
          of  the number of pages to use verticaly when <STRONG>posterize</STRONG>
261
          is turned on.
262
 
263
 
264
 
265
</PRE>
266
<H2>EXAMPLE</H2><PRE>
267
          option add *textBackground GhostWhite
268
 
269
          canvasprintbox .fsb -orient landscape -stretch 1
270
          pack .fsb -padx 10 -pady 10 -fill both -expand yes
271
 
272
 
273
 
274
</PRE>
275
<H2>AUTHOR</H2><PRE>
276
     Tako Schotanus
277
 
278
     Tako.Schotanus@bouw.tno.nl
279
 
280
 
281
</PRE>
282
<H2>KEYWORDS</H2><PRE>
283
     canvasprintbox, widget
284
 
285
 
286
 
287
 
288
 
289
 
290
 
291
 
292
 
293
 
294
 
295
 
296
 
297
 
298
 
299
 
300
</PRE>
301
</BODY>
302
</HTML>

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.