FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Paint Xbrowse
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Paint Xbrowse
Posted: Fri Jun 28, 2013 08: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.



Uploaded with ImageShack.us

Code (fw): Select all Collapse
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
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: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Paint Xbrowse
Posted: 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
Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
Re: Paint Xbrowse
Posted: Thu Aug 08, 2013 03: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, 2 * 1 TB NVME M.2, GTX 1650
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Paint Xbrowse
Posted: Thu Aug 08, 2013 04:05 PM

Friends:

Please, view the next topic

viewtopic.php?f=6t=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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Paint Xbrowse
Posted: Thu Aug 08, 2013 04: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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Paint Xbrowse
Posted: Sat Aug 10, 2013 03:16 AM
Is this what you are looking for?



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

Code (fw): Select all Collapse
#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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Paint Xbrowse
Posted: Sat Aug 10, 2013 09: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.



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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Paint Xbrowse
Posted: 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



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 (fw): Select all Collapse
 聽 聽 聽 聽 nTemp2 := ::nDataRows

Substitute this line with :
Code (fw): Select all Collapse
 聽 聽 聽 聽 nTemp2 := If( ::lFullGrid, nMaxRows, ::nDataRows )


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

Substitute this line with the new code:
Code (fw): Select all Collapse
 聽 聽 聽 聽 聽 聽 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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Paint Xbrowse
Posted: Sun Aug 11, 2013 08: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
Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
Re: Paint Xbrowse
Posted: Mon Aug 12, 2013 01: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, 2 * 1 TB NVME M.2, GTX 1650
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Paint Xbrowse
Posted: Mon Aug 12, 2013 02: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

Continue the discussion