/***** Get the page size ********************************************/
retstr = PrtGRxGetPageSize( prt);
if retstr = ',' then do
rcy = VRMessage( VRWindow(), 'Failed to get pagesize', 'ERROR', 'E');
return;
end
parse var retstr wide ',' high
/***** Calculate the number of tabs *********************************/
numtabs = trunc( wide / 10) - 1;
/***** Print '|' at each tab position *******************************/
rcy = PrtGrxWriteln( prt, facename, 10, 'Tab positions are shown on the next line');
rcy = PrtGrxWriteln( prt, , , '');
rcy = PrtGrxWrite( prt, , , '|');
do i = 1 to numtabs
rcy = PrtGRxTab( prt);
rcy = PrtGrxWrite( prt, , , '|');
end
/***** Go to the bottom of the page *********************************/
rcy = PrtGrxWriteln( prt, , , '');
rcy = PrtGRxGoto( prt, 0, 10);
rcy = PrtGRxWrite( prt, , , 'On the next page we show 20 random moves in an area within 200mm of the top margin and right margin');
rcy = PrtGRxNewPage( prt);
vinc = high - 20;
hinc = wide - 20;
/***** Do 20 random jumps around the page ***************************/
do i = 1 to 20
x = random( 5, hinc)
y = random( 5, vinc)
rcy = PrtGRxGoto( prt, x, y);
rcy = PrtGRxWrite( prt,,,'Jump' i x','y);
end
return
/*:VRX PrtDialog_Close
*/
PrtDialog_Close:
call PrtDialog_Fini
return
/*:VRX PrtDialog_Create
*/
PrtDialog_Create:
call PrtDialog_Init
rcy = PrtGRxPrinterList( prt, "printers.");
ok = VRMethod( "LB_1", "Clear" )
ok = VRMethod( "LB_1", "AddStringList", "printers." )
position = VRMethod( "LB_1", "FindString", pName, 1, "Exact", "Case" )
call VRSet "LB_1", "Selected", position
return
/*:VRX PrtDialog_Fini
*/
PrtDialog_Fini:
window = VRInfo( "Window" )
call VRDestroy window
drop window
return
/*:VRX PrtDialog_Init
*/
PrtDialog_Init:
window = VRInfo( "Object" )
if( \VRIsChildOf( window, "Notebook" ) ) then do
call VRMethod window, "CenterWindow"
call VRSet window, "Visible", 1
call VRMethod window, "Activate"
end
drop window
return
/*:VRX Quit
*/
Quit:
/*
call TstRxStop
*/
window = VRWindow()
call VRSet window, "Shutdown", 1
drop window
return
/*:VRX Window1_Close
*/
Window1_Close:
call Quit
return
/*:VRX WriteTable
*/
WriteTable:
/***** Initialise a table *******************************************/
rcy = PrtGRxStartTable( prt, 0, 24, 3,,
30,45,,
75,50,,
125,40);
if rcy then do
/***** Start printing a row *************************************/
rcy = PrtGRxStartRow( prt);
/***** write to col 1 *******************************************/
rcy = PrtGRxStartCol( prt, 1);
rcy = PrtGRxJustRight( prt, 'Helvetica', 10, 'This is some text in the first column. It is not very long,');
/***** write to col 2 *******************************************/
rcy = PrtGRxStartCol( prt, 2);
rcy = PrtGRxJustified( prt, 'Helvetica Bold', 10, 'This is some text in the second column. It is not very long,');
rcy = PrtGRxJustified( prt,,,'This text has several lines and with a bit of luck should force a new page.');
rcy = PrtGRxJustified( prt,,,'If it does then we have a test of a cell rolling over from one page to the next and we will not have to write any more.');
/***** write to col 3 *******************************************/
rcy = PrtGRxStartCol( prt, 3);
rcy = PrtGRxCentre( prt, 'Helvetica Bold', 14, 'This is some text in the third column. It is not very long,');
/***** print out the row ****************************************/
rcy = PrtGRxEndRow( prt);
/***** start the next row ***************************************/
rcy = PrtGRxStartRow( prt);
/***** write to col 1 *******************************************/
rcy = PrtGRxStartCol( prt, 1);
rcy = PrtGRxJustRight( prt, 'Times New Roman', 10, 'This is some text in the first column. It is not very long,');
/***** write to col 2 *******************************************/
rcy = PrtGRxStartCol( prt, 2);
rcy = PrtGRxWrite( prt, 'Helvetica Bold', 10, 'This is some text in the second column. It is not very long and should be left justified.');
rcy = PrtGRxCentre( prt,,,'This text has several lines and with a bit of luck should be centred.');
rcy = PrtGRxJustified( prt,,,'This text here was designed to be justified and should roll over several lines, of course the last line will be left aligned.');
rcy = PrtGRxJustRight( prt,,,'This last bit of text should finally show all the styles in one cell as it is right aligned.');
/***** write to col 3 *******************************************/
rcy = PrtGRxStartCol( prt, 3);
rcy = PrtGRxJustified( prt, 'Times New Roman', 8, 'This is some text in the third column. It is not very long,');
/***** print out the row ****************************************/
rcy = PrtGRxEndRow( prt);
/***** Terminate the table **************************************/
rcy = PrtGRxEndTable( prt);
end
else
rcy = PrtGRxWrite( prt, 'Helvetica Bold', 14, 'ERROR - Failed to create the table...');
return
/*:VRX WriteTable2
*/
WriteTable2:
/***** Define the table ********************************/
table.0 = 8
table.1 = 0
table.2 = 14
table.3 = 1
table.4 = 0
table.5 = 28
table.6 = 1
table.7 = 12
table.8 = 'Helvetica Bold'
/***** Make 3 columns ***********************************/
Cols.0.0 = 3
Cols.1.1 = 30
Cols.1.2 = 45
Cols.1.3 = 'Column 1'
Cols.2.1 = 75
Cols.2.2 = 50
Cols.2.3 = 'Column 2'
Cols.3.1 = 125
Cols.3.2 = 40
Cols.3.3 = 'Column 3'
rcy = PrtGRxDefineTable( prt, "table.", "Cols.");
/**** Start printing in the table **********************************/