Paint Xbrowse

Paint Xbrowse

Postby cnavarro » Fri Jun 28, 2013 8:48 am

good afternoon
I try to make a xBrowse with a couple of columns in an array that occupies the entire width defined in the control, because more columns will be added later

How I can get the area that DATA is not well with the Brush paint is defined in the control or with another color that you define.

If I define TRANSPARENT xBrowse yes I get the background color but they miss the colors defined columns and cells.
Deputy Xbrstru.Prg example image as an example of what I mean

Buenas tardes
Intento realizar un XBrowse con un par de columnas en un array que no ocupa todo el ancho definido en el control, ya que posteriormente se añadiran mas columnas

Cómo puedo conseguir que el area que no tiene DATOS se pinte bien con el Brush que se defina en el control o con otro color que se defina.

Si el XBrowse lo defino TRANSPARENTE sí me aparece el color de fondo pero se pierden los colores definidos de columnas y celdas.
Adjunto imagen del ejemplo Xbrstru.Prg como ejemplo de lo que quiero decir.

Image

Uploaded with ImageShack.us

Code: Select all  Expand view

STATIC FUNCTION MakeStruBrowse( oDlg )

   LOCAL oBrw, nMaxWidth   := 0, oBrus

   DEFINE BRUSH oBrus COLOR CLR_BLUE

   oBrw           := TXBrowse():new( oDlg )

   WITH OBJECT oBrw

      :nTop      := INT(HGT/2)+5
      :nLeft     := 10
      :nBottom   := HGT-10
      :nRight    := WID-10

      :oBrush    := oBrus

      :SetArray( CUST->( dbStruct() ), .f. )

   :bClrSel           := { || { CLR_WHITE, CLR_BLUE } }
   :bClrStd           := { || { CLR_WHITE, CLR_BLUE } }
   :bClrStds          := { || { CLR_WHITE, CLR_BLUE } }
   END


Gracias
Last edited by cnavarro on Sun Jun 30, 2013 8:59 am, edited 1 time in total.
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
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Paint Xbrowse

Postby cnavarro » Sun Jun 30, 2013 12:07 am

The problem was due to a proper class inherited that contained the lRegistered CLASSDATA.
I realized to get a test message: "Object Window not found".
Only Fixed issue with TRANSPARENT and color attributes of cells and columns
Keep getting a white background when the columns do not take up all control
thanks

El problema era debido a una clase propia heredada que no contenia la CLASSDATA lRegistered.
Me di cuenta al obtener en una de las pruebas un mensaje de: "Objeto Ventana no encontrado".
Solo se ha solucionado el problema con el TRANSPARENT y los atributos de color de las celdas y columnas
Sigue apareciendo un fondo blanco cuando las columnas no ocupan todo el control.
Gracias
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
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Paint Xbrowse

Postby Adolfo » Thu Aug 08, 2013 3:59 pm

Cristobal..
Pudiste resolver ese problema. yo tengo el mismo drama y no consigo llenar el espacio "vacio"

Avisame por aqui.. Gracias
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 1 TB NVME M.2, 1 TB SSD, GTX 1650
User avatar
Adolfo
 
Posts: 846
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: Paint Xbrowse

Postby Armando » Thu Aug 08, 2013 4:05 pm

Friends:

Please, view the next topic

viewtopic.php?f=6&t=26935

Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3061
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Paint Xbrowse

Postby cnavarro » Thu Aug 08, 2013 4:37 pm

Adolfo wrote:Cristobal..
Pudiste resolver ese problema. yo tengo el mismo drama y no consigo llenar el espacio "vacio"

Avisame por aqui.. Gracias


Adolfo
Look at my post

Mira mi post

http://forums.fivetechsupport.com/viewtopic.php?f=3&t=26334&p=144872#p145052

Regards

Saludos
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
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Paint Xbrowse

Postby nageswaragunupudi » Sat Aug 10, 2013 3:16 am

Is this what you are looking for?

Image

oBrw:bClrStd is used to paint the entire browse area
oCol:bClrStd is used to paint the columns

Code: Select all  Expand view

#include "fivewin.ch"
#include "xbrowse.ch"

function main()

  local oDlg, oBrw
  local aData    := { { "One", "Two" }, { "Three", "Four" }, { "Five", "Six" }  }

  DEFINE DIALOG oDlg SIZE 300,200 PIXEL TITLE FWVERSION

   @ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
         DATASOURCE aData AUTOCOLS ;
         CELL LINES NOBORDER

   WITH OBJECT oBrw
      :bClrStd    := { || { CLR_BLACK, CLR_WHITE } }
      :aCols[ 1 ]:bClrStd  := { || { CLR_BLACK, CLR_HGREEN } }
      :aCols[ 2 ]:bClrStd  := { || { CLR_BLACK, CLR_HGREEN } }

      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED

return nil
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Paint Xbrowse

Postby cnavarro » Sat Aug 10, 2013 9:20 am

Mr Nages
The brush (or bClrStd) control can paint all over, not just the data area
The lines of separation of rows and columns can occupy all control not only the area of data, even if the control is empty initially.

El brush (o bClrStd) del control pueda pintar todo el control, no solo el area de datos
Las lineas de separacion de filas y columnas puedan ocupar todo el control no solo el area de datos, incluso si el control inicialmente este vacio.

Image

Uploaded with ImageShack.us

Type Excel, you can configure

Please see also the following post:
http://forums.fivetechsupport.com/viewtopic.php?f=3&t=26334&p=144872#p145052
http://forums.fivetechsupport.com/viewtopic.php?f=3&t=26904&start=15#p149597
http://forums.fivetechsupport.com/viewtopic.php?f=6&t=26903#p149560

thanks
Happy day
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
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Paint Xbrowse

Postby nageswaragunupudi » Sat Aug 10, 2013 10:32 am

oBrw:bClrStd is used to paint the entire browse window. Not only the data cells.

Draw full Grid

Image

This feature is included in the next version.
This requires very minor modification in xbrowse.prg.

Add a New DATA lFullGrid AS LOGICAL INIT .f. in the class declaration section.

Make two minor modifications in the Paint() method as below:

#1. In the Paint() method, please locate this line:
Code: Select all  Expand view
        nTemp2 := ::nDataRows
 

Substitute this line with :
Code: Select all  Expand view
        nTemp2 := If( ::lFullGrid, nMaxRows, ::nDataRows )
 


#2. Again the Paint() method, locate this line:
Code: Select all  Expand view
           if nMarqStyle >= MARQSTYLE_HIGHLROWRC .and. nLast == Len( ::aDisplay )
 

Substitute this line with the new code:
Code: Select all  Expand view
            if ( ::lFullGrid .or. nMarqStyle >= MARQSTYLE_HIGHLROWRC ) .and. nLast == Len( ::aDisplay )
 


After setting the browse, if oBrw:lFullGrid is set to .T. , the full grid will be drawn as shown above.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Paint Xbrowse

Postby cnavarro » Sun Aug 11, 2013 8:42 am

Mr Nages
Thank you very much for your simple modifications

I'm looking for a DATA as
/ /: lRowDividerComplete: =. T. that no
as there
: lColDividerComplete: =. T.


I had thought about it and came to the following conclusions:
- Create a DATA lRowDividerComplete
   So we put all the lines of columns with lColDividerComplete, that already exists, or only rows lines with the new DATA lRowDividerComplete

and also now
- In the NEW
   Now with the DATA lFullGrid

if ::lFullGrid
::lColDividerComplete := .T.
::lRowDividerComplete := .T.
endif
   :: lFullGrid: = if (:: lColDividerComplete. and. :: lRowDividerComplete,. T.,. F.)

What do you think about this option?

Thanks in advance
regards


Mr Nages
Muchas gracias por sus sencillas modificaciones

Estaba buscando una DATA como
/ /: lRowDividerComplete: =. T. no existe
como la que tenemos
: lColDividerComplete: =. T.


Yo habia pensado sobre el tema y llegado a las siguientes conclusiones:
- Crear una DATA lRowDividerComplete
Asi podemos poner todas las lineas de columnas con lColDividerComplete, que ya existe, o solo las lineas de filas con la nueva DATA lRowDividerComplete

y ademas
- En el NEW
Ahora con la DATA lFullGrid
if ::lFullGrid
::lColDividerComplete := .T.
::lRowDividerComplete := .T.
endif
::lFullGrid := if ( ::lColDividerComplete .and. ::lRowDividerComplete, .T., .F.)

¿Que opina sobre esta opcion?
Gracias anticipadas
Saludos
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
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Paint Xbrowse

Postby Adolfo » Mon Aug 12, 2013 1:12 pm

Nageswaragunupudi

Your solution works, but it doesn't paint the rows with oBrw:bClrStd, I have to go thru all the elements in the browse to have them painted.

Any Idea.
Thanks.
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 1 TB NVME M.2, 1 TB SSD, GTX 1650
User avatar
Adolfo
 
Posts: 846
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: Paint Xbrowse

Postby nageswaragunupudi » Mon Aug 12, 2013 2:10 pm

It is a feature of XBrowse that full row (including non-data part ) is painted with oBrw:bClrStd's 2nd color when oBrw:nMarqStyle is set to MARQSTYLE_HIGHLROWMS

oBrw:bClrStd is basically intended to paint Data Cells, and serves as a default for all columns when the column's bClrStd is not assigned separately.

For painting the full background of the browse area, whether covered by data or not, we use SetColor() or SetBrush().
For setting color we can either use SetColor() or it is much simipler to declare while defining XBROWSE.

example: @ r,c, XBROWSE ............. COLOR CLR_BLACK,CLR_YELLOW.

By default, bClrStd's 2nd color is the same as the ColorPane of the browse.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 68 guests