FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Question about available printers in preview class (Solved)
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Question about available printers in preview class (Solved)
Posted: Tue Apr 21, 2015 03:36 PM
Hello,

This is the code which builds a list of the available printers in the preview class :
Code (fw): Select all Collapse
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 ),;
             oMenuItem:oMenu:UnCheckAll(), oMenuItem:SetCheck( .T. ) } ) } )
   ENDMENU

return oPop
Is there any possibility that these printers are sorted alphabetically?

Thanks a lot in advance.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Question about available printers in preview class
Posted: Tue Apr 21, 2015 04:31 PM
driessen wrote:Hello,

This is the code which builds a list of the available printers in the preview class :
Code (fw): Select all Collapse
METHOD PrintersMenu() CLASS TPreview

   local oPop, aPrinters := ASort( aGetPrinters() )       // Ordenar

   MENU oPop POPUP
      oPop:l2007 = ( nStyle == 2007 )
      oPop:l2010 = ( nStyle == 2010 )

      AEval( aPrinters, { | cPrinter | MenuAddItem( cPrinter,,;
             cPrinter $ ::oDevice:cModel,,;
             { | oMenuItem | ::SelPrinter( oMenuItem:cPrompt ),;
             oMenuItem:oMenu:UnCheckAll(), oMenuItem:SetCheck( .T. ) } ) } )
   ENDMENU

return oPop
Is there any possibility that these printers are sorted alphabetically?

Thanks a lot in advance.
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Question about available printers in preview class (Solved)
Posted: Tue Apr 21, 2015 05:08 PM

Christobal,

Thank you so much for your help.

Of course, the solution is quite easy. I should have thought about it myself.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Continue the discussion