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