DEFINE TBMENU OF oBar ;
ACTION If( ValType( ::bPrint ) == 'B', Eval( ::bPrint, Self ), ::PrintPage() ) ;
TOOLTIP Strtran( TXT_PRINT, "&", "" ) ;
MESSAGE TXT_PRINT_CURRENT_PAGE ;
MENU ::PrintersMenu()
/*
DEFINE TBBUTTON OF oBar ;
ACTION If( ValType( ::bPrint ) == 'B', Eval( ::bPrint, Self ), ::PrintPage() ) ;
TOOLTIP Strtran( TXT_PRINT, "&", "" ) ;
MESSAGE TXT_PRINT_CURRENT_PAGE ;
MENU ::PrintersMenu()
*/
DEFINE BUTTON RESOURCE "Printer2" OF oBar GROUP ;
MENU ::PrintersMenu() ;
MESSAGE TXT_PRINT_CURRENT_PAGE ;
ACTION If( ValType( ::bPrint ) == 'B', Eval( ::bPrint, Self ), ::PrintPage() ) ;
TOOLTIP Strtran( TXT_PRINT, "&", "" )
METHOD SelPrinter( cPrinter ) CLASS TPreview
local cOldPrinter := GetProfString( "windows", "device" , "" )
WriteProfString( "windows", "device", cPrinter )
SysRefresh()
PrinterInit()
DeleteDC( ::oDevice:hDC )
::oDevice:hDC = GetPrintDefault( GetActiveWindow() )
::oDevice:cModel = cPrinter
SysRefresh()
WriteProfString( "windows", "device", cPrinter )
RETURN nil
METHOD PrintersMenu() CLASS TPreview
local oPop, aPrinters := aGetPrinters()
MENU oPop POPUP
oPop:l2007 = ( nStyle == 2007 )
oPop:l2010 = ( nStyle == 2010 )
AEval( aPrinters, { | cPrinter | MenuAddItem( cPrinter,,;
cPrinter $ ::oDevice:cModel,,;
{ | oMenuItem | ::SelPrinter( oMenuItem:cPrompt ) } ) } )
ENDMENU
return oPop
@ 7, nCol SAY ::oPage PROMPT TXT_PAGENUM + ": "+;
LTrim( Str( ::nPage, 4, 0 ) ) + " / " + ; // " de "
LTrim( Str( Len( ::oDevice:aMeta ) ) ) ;
SIZE 180, 15 PIXEL OF ::oBar FONT ::oFont
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 35 guests