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> 7itk::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> 40See 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> 48Name: <B>filename</B> 49Class: <B>FileName</B> 50Command-Line Switch: <B>-filename</B> 51</pre> 52<UL> 53The file to write the postscript output to (Only when output 54is set to "file"). If posterizing is turned on and <B>hpagecnt</B> 55and/or <B>vpagecnt</B> is more than 1, x.y is appended to the filename 56where x is the horizontal page number and y the vertical page number. 57</UL> 58<P> 59<pre> 60Name: <B>hpagecnt</B> 61Class: <B>PageCnt</B> 62Command-Line Switch: <B>-hpagecnt</B> 63</pre> 64<UL> 65Is used in combination with <B>posterize</B> to determine over 66how many pages the output should be distributed. This 67attribute specifies how many pages should be used horizontaly. 68Any change to this attribute will automatically update the "stamp". 69Defaults to 1. 70</UL> 71<P> 72<pre> 73Name: <B>orient</B> 74Class: <B>Orient</B> 75Command-Line Switch: <B>-orient</B> 76</pre> 77<UL> 78Determines the orientation of the output to the printer (or file). 79It can take the value "portrait" or "landscape" (default). Changes 80to this attribute will be reflected immediately in the "stamp". 81Defaults to "landscape" but will be changed automaticaly to the value 82deemed appropiate for the current canvas. Setting this attribute 83when 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> 88Name: <B>output</B> 89Class: <B>Output</B> 90Command-Line Switch: <B>-output</B> 91</pre> 92<UL> 93Specifies where the postscript output should go: to the printer 94or to a file. Can take on the values "printer" or "file". 95The corresponding entry-widget will reflect the contents of 96either the <B>printcmd</B> attribute or the <B>filename</B> attribute. 97Defaults to "printer". 98</UL> 99<P> 100<pre> 101Name: <B>pageSize</B> 102Class: <B>PageSize</B> 103Command-Line Switch: <B>-pagesize</B> 104</pre> 105<UL> 106The pagesize the printer supports. Changes to this attribute 107will be reflected immediately in the "stamp". 108Defaults to "a4". 109</UL> 110<P> 111<pre> 112Name: <B>posterize</B> 113Class: <B>Posterize</B> 114Command-Line Switch: <B>-posterize</B> 115</pre> 116<UL> 117Indicates if posterizing is turned on or not. Posterizing 118the output means that it is possible to distribute the 119output over more than one page. This way it is possible to 120print a canvas/region which is larger than the specified 121pagesize without stretching. If used in combination with 122stretching it can be used to "blow up" the contents of a 123canvas to as large as size as you want (See attributes: 124hpagecnt and vpagecnt). Any change to this attribute will 125automatically update the "stamp". 126Defaults to 0. 127</UL> 128<P> 129<pre> 130Name: <B>printCmd</B> 131Class: <B>PrintCmd</B> 132Command-Line Switch: <B>-printcmd</B> 133</pre> 134<UL> 135The command to execute when printing the postscript output. 136The command will get the postscript directed to its standard 137input (Only when output is set to "printer"). 138Defaults to "lpr". 139</UL> 140<P> 141<pre> 142Name: <B>printRegion</B> 143Class: <B>PrintRegion</B> 144Command-Line Switch: <B>-printregion</B> 145</pre> 146<UL> 147A list of four coordinates specifying which part of the canvas to print. 148An empty list means that the canvas' entire <B>scrollregion</B> should be 149printed. Any change to this attribute will automatically update the "stamp". 150Defaults to an empty list. 151</UL> 152<P> 153<pre> 154Name: <B>stretch</B> 155Class: <B>Stretch</B> 156Command-Line Switch: <B>-stretch</B> 157</pre> 158<UL> 159Determines if the output should be stretched to fill the 160page (as defined by the attribute pagesize) as large as 161possible. The aspect-ratio of the output will be retained 162and the output will never fall outside of the boundaries 163of the page. 164Defaults to 0 but will be changed automaticaly to the value 165deemed appropiate for the current canvas. Setting this attribute 166when 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> 171Name: <B>vPageCnt</B> 172Class: <B>PageCnt</B> 173Command-Line Switch: <B>-vpagecnt</B> 174</pre> 175<UL> 176Is used in combination with "posterize" to determine over 177how many pages the output should be distributed. This 178attribute specifies how many pages should be used verticaly. 179Any change to this attribute will automatically update the "stamp". 180Defaults to 1. 181</UL> 182<P> 183</pre><HR> 184 185</pre><H2>DESCRIPTION</H2> 186<P> 187Implements a print box for printing the contents of a canvas widget 188to a printer or a file. It is possible to specify page orientation, the 189number of pages to print the image on and if the output should be 190stretched to fit the page. Options exist to control the appearance and 191actions of the widget. 192 193</pre><H2>METHODS</H2> 194<P> 195The <B>canvasprintbox</B> command creates a new Tcl command whose 196name is <I>pathName</I>. This 197command may be used to invoke various 198operations 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 203determine the exact behavior of the command. The following 204commands 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 211by <I>option</I>. 212<I>Option</I> may have any of the values accepted by the <B>canvasprintbox</B> 213command. 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. 219If no <I>option</I> is specified, returns a list describing all of 220the available options for <I>pathName</I> (see <B>Tk_ConfigureInfo</B> for 221information on the format of this list). If <I>option</I> is specified 222with no <I>value</I>, then the command returns a list describing the 223one named option (this list will be identical to the corresponding 224sublist of the value returned if no <I>option</I> is specified). If 225one or more <I>option-value</I> pairs are specified, then the command 226modifies the given widget option(s) to have the given value(s); in 227this case the command returns an empty string. 228<I>Option</I> may have any of the values accepted by the <B>canvasprintbox</B> 229command. 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 235depending 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 241all the attributes. Returns a boolean indicating wether the printing was 242successful 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 248the 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. 254A stamp-sized copy will automatically be drawn to show how the 255output 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 261when a Canvasprintbox gets destroyed or withdrawn. It's therefore 262advised that you perform a stop before you do something like that. 263</DL> 264</pre><H2>COMPONENTS</H2> 265<P> 266<pre> 267Name: <B>prtflentry</B> 268Class: <B>Entry</B> 269</pre> 270<UL> 271The 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> 277Name: <B>hpcnt</B> 278Class: <B>Entry</B> 279</pre> 280<UL> 281The hpcnt component is the entry field for user input of the number of 282pages to use horizontaly when <B>posterize</B> is turned on. 283</UL> 284</table> 285<pre> 286Name: <B>vpcnt</B> 287Class: <B>Entry</B> 288</pre> 289<UL> 290The vpcnt component is the entry field for user input of the number of 291pages to use verticaly when <B>posterize</B> is turned on. 292</UL> 293</table> 294 295</pre><H2>EXAMPLE</H2> 296<pre> 297canvasprintbox .fsb -orient landscape -stretch 1 298pack .fsb -padx 10 -pady 10 -fill both -expand yes 299</pre> 300</pre><H2>AUTHOR</H2> 301Tako Schotanus 302</pre><H2>KEYWORDS</H2> 303canvasprintbox, widget 304