FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Poner color de fondo oPrn:Box()
Posts: 418
Joined: Wed Nov 26, 2008 06:33 PM
Poner color de fondo oPrn:Box()
Posted: Thu Apr 25, 2019 09:04 PM

Saludos.

Tengo la necesidad de poner cuadros con texto y titulos usando el metodo Box() de tprinter, pero que los titulos tomen un color de fondo determinado

oPrn:Box(...)

La otra es como crear cuadros con las esquinas redondeadas con la misma clase?

Ayuda porfa.

Noé Aburto Sánchez
Tec. Prog. de Sistemas. -Morelia, Mich. México.
fwh 20.06, Harbour 3.2.0, bcc 7.4
TsBrowse 9.0, TsButton 7.0, xEdit 6.1
naburtos@gmail.com, noeaburto67@hotmail.com
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Poner color de fondo oPrn:Box()
Posted: Fri Apr 26, 2019 01:13 PM
Algo Asi?

Code (fw): Select all Collapse
#include "fivewin.ch"

#define PAD_LEFT            0
#define PAD_RIGHT           1
#define PAD_CENTER          2

FUNCTION Main()

   LOCAL oPrn, oFont, oPen, oPen1, oPen2, oPen3
   LOCAL nLinI, nColI, nLinF, nColF

   nLinI :=  0.90

   nColI :=  0.90

   nLinF := 28.60

   nColF := 20.00

   SetDefaultPrinter( PrnGetName() )

   PRINT oPrn NAME "Impresión en Vertical.." PREVIEW MODAL

      DEFINE FONT oFont NAME "Arial" SIZE 0, - 12 BOLD OF oPrn

      DEFINE PEN oPen  WIDTH 2                         OF oPrn
      DEFINE PEN oPen1 WIDTH 4 COLOR CLR_BROWN         OF oPrn
      DEFINE PEN oPen2 WIDTH 2 COLOR CLR_BROWN         OF oPrn
      DEFINE PEN oPen3 WIDTH 5 COLOR CLR_HRED          OF oPrn

      oPrn:SetPage( 9 )  // A4

      oPrn:SetPortrait() // Vertical

      PAGE

         oPrn:Cmtr2Pix( @nLinI, @nColI )

         oPrn:cmtr2Pix( @nLinF, @nColF )

         oPrn:Box( nLinI, nColI, nLinF, nColF, oPen3 )

         oPrn:cmSay( 1.0,  1.0,  "Superior Izquierda", oFont, , CLR_BLACK, , PAD_LEFT  )

         oPrn:cmSay( 1.0, 10.5,  "Superior Centro",    oFont, , CLR_BLACK, , PAD_CENTER )

         oPrn:cmSay( 1.0, 20.0,  "Superior Derecha",   oFont, , CLR_BLACK, , PAD_RIGHT )

         oPrn:cmSay( 28.0,  1.0, "Inferior Izquierda", oFont, , CLR_BLACK, , PAD_LEFT  )

         oPrn:cmSay( 28.0, 10.5, "Inferior Centro",    oFont, , CLR_BLACK, , PAD_CENTER )

         oPrn:cmSay( 28.0, 20.0, "Inferior Derecha",   oFont, , CLR_BLACK, , PAD_RIGHT )

      ENDPAGE

   ENDPRINT

RETURN NIL


Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341

Continue the discussion