2010-01-18 15:30 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* contrib/hbwin/tests/testprn.prg
    + Brings up printer setup dialog if run with 'ask' cmdline parameter.
This commit is contained in:
Viktor Szakats
2010-01-18 14:31:20 +00:00
parent 8f9973afd5
commit f2d2214ef5
2 changed files with 12 additions and 4 deletions

View File

@@ -17,6 +17,10 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-01-18 15:30 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbwin/tests/testprn.prg
+ Brings up printer setup dialog if run with 'ask' cmdline parameter.
2010-01-18 14:56 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
* harbour/src/common/hbver.c
@@ -29,7 +33,7 @@
% simplified the code using hb_iswin9x() function
TODO: Check if WinCE support WinNT file IO functions and if yes then
replace in src/rtl/filesys.c 'if( hb_iswinnt() )' with
replace in src/rtl/filesys.c 'if( hb_iswinnt() )' with
'if( !hb_iswin9x() )'
* harbour/contrib/hbwin/win_tprn.prg

View File

@@ -2,9 +2,10 @@
* $Id$
*/
#include "common.ch"
#include "hbwin.ch"
PROCEDURE Main()
PROCEDURE Main( cPar1 )
LOCAL nPrn := 1
LOCAL cBMPFile := Space( 40 )
LOCAL aPrn := WIN_PRINTERLIST()
@@ -25,13 +26,13 @@ PROCEDURE Main()
@ 2, 0 TO MaxRow(), MaxCol()
nPrn := AChoice( 3, 1, MaxRow() - 1, MaxCol() - 1, aPrn, .T.,, nPrn )
IF nPrn != 0
PrnTest( aPrn[ nPrn ], cBMPFile )
PrnTest( aPrn[ nPrn ], cBMPFile, iif( ISCHARACTER( cPar1 ) .AND. Lower( cPar1 ) == "ask", .T., NIL ) )
ENDIF
ENDDO
RETURN
STATIC PROCEDURE PrnTest( cPrinter, cBMPFile )
STATIC PROCEDURE PrnTest( cPrinter, cBMPFile, lAsk )
LOCAL oPrinter := Win_Prn():New( cPrinter )
LOCAL aFonts
LOCAL x
@@ -42,6 +43,9 @@ STATIC PROCEDURE PrnTest( cPrinter, cBMPFile )
oPrinter:Landscape := .F.
oPrinter:FormType := WIN_DMPAPER_A4
oPrinter:Copies := 1
IF ISLOGICAL( lAsk )
oPrinter:AskProperties := lAsk
ENDIF
IF ! oPrinter:Create()
Alert( "Cannot Create Printer" )