1 QPenPrinter : QObject {
2 var printFunc, cancelFunc, okFunc;
4 *qtClass { ^'QcPenPrinter' }
10 *print { |printFunc, cancelFunc|
11 this.new.showDialog( { |p| p.print(printFunc) }, cancelFunc);
16 this.connectFunction('printFunc()', synchronous:true) {
17 printFunc.value(this);
21 this.connectFunction('dialogDone(int)', synchronous:false) { |me, ok|
25 cancelFunc.value(this);
33 showDialog { |aOkFunc, aCancelFunc|
34 if(okFunc.notNil or: cancelFunc.notNil) {
35 "QPenPrinter: dialog already open".warn;
39 cancelFunc = aCancelFunc;
40 heap = heap.add(this);
41 this.invokeMethod(\show, synchronous:false);
45 if(printFunc.notNil) {
46 "QPenPrinter: printing already in progress".warn;
49 printFunc = aPrintFunc;
50 heap = heap.add(this);
51 this.invokeMethod(\print, synchronous:false);
55 this.invokeMethod(\newPage, synchronous:true);
58 pageRect { ^this.getProperty(\pageRect) }
59 paperRect { ^this.getProperty(\paperRect) }
60 fromPage { ^this.getProperty(\fromPage) }
61 toPage { ^this.getProperty(\toPage) }
62 pageSize { ^this.pageRect.size }