Box question

Post Reply
User avatar
Silvio.Falconi
Posts: 7133
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Box question

Post by Silvio.Falconi »

I made a Box with
nRiga := 5.5
nColonna := 1
nAltezza := 0.8
nlarghezza := 4.5
....


oPrn:Box(nRiga,nColonna,nAltezza+nRiga,nlarghezza, { cColorbordo, nTipoBordo }, cBackbordo, ;
{ cTesto, oFnt, nColorFont, cAlign }, ;
"CM" )


as you can see here

Image

How I can make to move only the text for some mm ?

the "T" of the text is close to the line of the box, how do I move the content of the text so that the whole box does not move?

If I insert nColonna+0.3 it move also the box
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
karinha
Posts: 7935
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: Box question

Post by karinha »

Example for tests? >-< cBackbordo ???
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Silvio.Falconi
Posts: 7133
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: Box question

Post by Silvio.Falconi »

karinha wrote:Example for tests? >-< cBackbordo ???


it is color back
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
Posts: 7133
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: Box question

Post by Silvio.Falconi »

there is an error on build of the Box

Image

the boxes are identical changes only the coordinates of the row

FIRST
nRiga := 5.5
nColonna := 1
nAltezza := 0.8
nlarghezza := 4.5
cTesto := "Tipo documento"
cColorbordo := CLR_BLACK
nTipoBordo := 0.01
nAngleBordo := 0
cBackbordo := CLR_HGRAY
cCarattere := "Arial"
nSizefont := 6
cAlign := "TL"
nColorFont := CLR_BLACK



SECOND
nRiga := 6.3
nColonna := 1
nAltezza := 0.8
nlarghezza := 4.5
cTesto := "Cod Cliente"
cColorbordo := CLR_BLACK
nTipoBordo := 0.01
nAngleBordo := 0
cBackbordo := CLR_WHITE
cCarattere := "Arial"
nSizefont := 6
cAlign := "TL"
nColorFont := CLR_BLACK

oPrn:Box(nRiga,nColonna,nAltezza+nRiga,nlarghezza, { cColorbordo, nTipoBordo }, cBackbordo, ;
{ cTesto, oFnt, nColorFont, cAlign }, ;
"CM" )

I saw when there is not the background color the line of the box is too big
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
karinha
Posts: 7935
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: Box question

Post by karinha »

Show in this example what is wrong.

Muestre en este ejemplo lo que está mal.

Code: Select all | Expand


// \samples\boxbordo.prg

#include "FiveWin.ch"

FUNCTION PrnBox()

   LOCAL oPrn, oFont, cTexto2, oBrush
   LOCAL NRIGA, NCOLONNA, NALTEZZA, NLARGHEZZA, CTESTO, CCOLORBORDO, CALIGN, ;
         NTIPOBORDO, NANGLEBORDO, CBACKBORDO, CCARATTERE, NCOLORFONT, NSIZEFONT
   LOCAL nlarghezz2

   // FIRST
   nRiga       := 3.0               // Linha
   nColonna    := 1.00              // Coluna
   nAltezza    := 1.50              // altura
   nlarghezza  := 12.00             // largura
   cTesto      := "Tipo documento"  // Texto
   cColorbordo := RGB(227, 200, 0)  // cor das bordas
   nTipoBordo  := 1.50
   nAngleBordo := 0
   cBackbordo  := RGB(27, 161, 226) // cor do fundo.
   cCarattere  := "Arial"
   nSizefont   := 6
   cAlign      := "TL"
   nColorFont  := RGB(0, 80, 239)
   cTexto2     := "Silvio Printer"
   nlarghezz2  := 18.00

   DEFINE BRUSH oBrush FILE "c:\fwh1905\bitmaps\backgrnd\pebbles.bmp"

   PRINT oPrn NAME "Silvio Falconi in Box" PREVIEW MODAL

      DEFINE FONT oFont NAME "VERDANA" SIZE 0, - 30 OF oPrn BOLD

      oPrn:SetPage(9)     //->A4
      oPrn:SetPortrait()  //->Vertical

      PAGE

      oPrn:RoundBox( 1, 1, 5, 5, .5, .5, { CLR_HRED, 3 }, oBrush, ;
         { "FIRST" + CRLF + "SECOND", oFont, CLR_WHITE, "B" },    ;
           "INCHES" )

      oPrn:Box( nRiga, nColonna, nAltezza + nRiga, nlarghezza, ;
         { cColorbordo, nTipoBordo }, cBackbordo,              ;
         { cTesto, oFont, nColorFont, cAlign }, "CM" )

      nRiga    := nRiga + 2.00
      nColonna := nColonna + 2.00

      oPrn:Box( nRiga, nColonna, nAltezza + nRiga, nlarghezza, ;
         { cColorbordo, nTipoBordo }, cBackbordo,              ;
         { cTexto2, oFont, nColorFont, cAlign }, "CM" )

      nRiga    := nRiga + 2.00
      nColonna := nColonna + 2.00

      oPrn:Box( nRiga, nColonna, nAltezza + nRiga, nlarghezz2, ;
         { cColorbordo, nTipoBordo }, cBackbordo,              ;
         { "TIPO DOCUMENTO", oFont, nColorFont, cAlign }, "CM" )

      nRiga    := nRiga + 2.00
      nColonna := nColonna - 2.00

      oPrn:Box( nRiga, nColonna, nAltezza + nRiga, nlarghezz2, ;
         { cColorbordo, nTipoBordo }, cBackbordo,              ;
         { "F I V E W I N", oFont, nColorFont, cAlign }, "CM" )

      ENDPAGE

   ENDPRINT

   RELEASE BRUSH oBrush
   RELEASE FONT oFont  

RETURN NIL
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Silvio.Falconi
Posts: 7133
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: Box question

Post by Silvio.Falconi »

karinha wrote:Show in this example what is wrong.

Muestre en este ejemplo lo que está mal.

[

   RELEASE BRUSH oBrush
   RELEASE FONT oFont  

RETURN NIL
 [/code]



querido señor me parece que está exagerando,
es la segunda vez que me escribe e inserta ejemplos (fuente) que nada tiene que ver con lo que estoy haciendo
si miras atentamente mis cajas te darás cuenta de que todas son diferentes a la que hiciste
Estoy haciendo una estructura de una factura, por supuesto, no he publicado toda mi fuente, solo los datos esenciales para comprender el problema.
hay dos cajas, una arriba y otra debajo, las cajas están adjuntas

1) el primer cuadro,el primer cuadro está en la fila 5.5 y la columna 1, de 4,5 cm de largo,y 0,8 de altura
tiene el color de fondo en gris claro, tiene un texto "Tipo de documento" en el color negro de la fuente Aial tamaño 6 y está colocado arriba (T) y a la izquierda (L)

2) el segundo recuadro de la fila 6.3 en la columna 1, 2.5 de ancho y 0.8 de alto, color de fondo blanco y el texto en color negro siempre con Arial y dimensión 6 y siempre en posición TL

ahora tenemos que insertar otros escritos en el cuadro de caracteres 12
pero no puedo usar el comando simple cmsay o decir imprimir porque estas escrituras pueden tener colores o cajas
entonces tengo que usar el mismo sistema

3)el tercer cuadro está en la línea 6.3 en la columna 1, 2.5 de ancho y 0.8 de alto, con el texto "001" con la fuente Arial pero el tamaño de fuente 12, el fondo es blanco

como puedes ver en esta figura

Image

ahora creado la matriz aHeader intentemos imprimir las cajas

Image

pero al mirar las casillas me doy cuenta de que la segunda casilla de abajo a pesar de estar colocada en la columna 1 está más atrás que la casilla de arriba además de tener un contorno mucho más grueso, ¿lo ves tú también?
Last edited by Silvio.Falconi on Sun Apr 09, 2023 12:19 am, edited 1 time in total.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
Posts: 7133
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: Box question

Post by Silvio.Falconi »

HE ENCONTRADO EL PROBLEMA

si no hay border lo hice

oPrn:Box(nRiga,nColonna,nAltezza+nRiga,nlarghezza, nil, nil, ;
{ cTesto, oFnt, nColorFont, cAlign }, ;
"CM" )

pero el "nil" tiene problemas para mover el cuadro y poner un contorno más grande

tal vez funcione así
oPrn:Box(nRiga,nColonna,nAltezza+nRiga,nlarghezza, { "", 0 }, "", ;
{ cTesto, oFnt, nColorFont, cAlign }, ;
"CM" )

Image
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Box question

Post by nageswaragunupudi »

How I can make to move only the text for some mm ?

the "T" of the text is close to the line of the box, how do I move the content of the text so that the whole box does not move?

You have to print the text separately.
Regards

G. N. Rao.
Hyderabad, India
Post Reply