xBrowse cell overlaps
xBrowse cell overlaps
Dear Rao,
is it possible to overlap (free) cells in xBrowse, like it is in Excel?
Little screen shot, showing overlapped cells in Excel:
http://depositfiles.com/files/3bb77rcog
is it possible to overlap (free) cells in xBrowse, like it is in Excel?
Little screen shot, showing overlapped cells in Excel:
http://depositfiles.com/files/3bb77rcog
Windows 11 Pro 22H2 22621.1848
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
-
- Posts: 1077
- Joined: Fri Oct 07, 2005 3:33 pm
- Location: Cochabamba - Bolivia
- Has thanked: 1 time
Re: xBrowse cell overlaps
Hello,
I think this id not possible with the native xBrowse, you need to change the code, maybe can be possible to add a data (object attribute) to change the paint behavior
In the PaintData Method of TXBrwColumn Class change the follow lines
this is a simple test, I am using very old version of xBrowse ( I don't update my FW yet
), please test and comment
saludos
Marcelo
I think this id not possible with the native xBrowse, you need to change the code, maybe can be possible to add a data (object attribute) to change the paint behavior
In the PaintData Method of TXBrwColumn Class change the follow lines
Code: Select all | Expand
//DrawTextEx( hDC, cData,;
// {nRow, nCol, nRow + nHeight, Min( nCol + nWidth, ::oBrw:BrwWidth() - 5 ) },;
// ::nDataStyle )
Draw TextEx( hDC, cData,;
{ nRow, nCol, nRow + nHeight, nCol + GetTextWidth( hDC, cData ) },;
::nDataStyle )
this is a simple test, I am using very old version of xBrowse ( I don't update my FW yet

saludos
Marcelo
Re: xBrowse cell overlaps
Hi Marcelo,
thank you very much for your code snippet.
It works for the last column, see screen shot:

But it doesn't work for (empty) cells, as shown here:

Do you have an idea to change the code for overlapping (empty) cells?
Even better: switch (property) for each column with the following values:
- Do not overlap cells
- Overlap only empty cells
- Overlap cells even if they are not empty
thank you very much for your code snippet.
It works for the last column, see screen shot:

But it doesn't work for (empty) cells, as shown here:

Do you have an idea to change the code for overlapping (empty) cells?
Even better: switch (property) for each column with the following values:
- Do not overlap cells
- Overlap only empty cells
- Overlap cells even if they are not empty
Windows 11 Pro 22H2 22621.1848
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: xBrowse cell overlaps
>>
I think this id not possible with the native xBrowse, you need to change the code, maybe can be possible to add a data (object attribute) to change the paint behavior
>>
This observation is not correct.
If oCol:bPaintText is assigned with our codeblock, xbrowse does NOT paint cell text on its own and instead calls our codeblock with the parameters ( oCol, hDC, cData, aRect, aColors, lHighLite ). It is for the programmer to use this facility,
I think this id not possible with the native xBrowse, you need to change the code, maybe can be possible to add a data (object attribute) to change the paint behavior
>>
This observation is not correct.
If oCol:bPaintText is assigned with our codeblock, xbrowse does NOT paint cell text on its own and instead calls our codeblock with the parameters ( oCol, hDC, cData, aRect, aColors, lHighLite ). It is for the programmer to use this facility,
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: xBrowse cell overlaps
Rao,
So, we can achieve the above described behaviour with the actual version of xBrowse!?
If so, please give me some more advices, what I have to do. Here is my sample code:
If oCol:bPaintText is assigned with our codeblock, xbrowse does NOT paint cell text on its own and instead calls our codeblock with the parameters ( oCol, hDC, cData, aRect, aColors, lHighLite ). It is for the programmer to use this facility,
So, we can achieve the above described behaviour with the actual version of xBrowse!?
If so, please give me some more advices, what I have to do. Here is my sample code:
Code: Select all | Expand
FUNCTION Main()
LOCAL oDlg, oBrw, oCol, aRecord, nAt := 1
USE Customer
aRecord = Array( Customer->( FCount() ) )
DEFINE DIALOG oDlg SIZE 300, 300
@ 0, 0 XBROWSE oBrw OF oDlg ARRAY aRecord // AUTOSORT
oCol := oBrw:AddCol()
oCol:bStrData = { || Customer->( FieldName( oBrw:nArrayAt ) ) }
oCol:cHeader = "FieldName"
oCol := oBrw:AddCol()
oCol:bStrData = { || Customer->( FieldGet( oBrw:nArrayAt ) ) }
oCol:cHeader = "Value"
oCol := oBrw:AddCol()
oCol:bStrData = { || "" }
oCol:cHeader = "Empty"
oCol:bPaintText = { || NIL }
oBrw:nMarqueeStyle = MARQSTYLE_HIGHLROW
oBrw:CreateFromCode()
oBrw:bKeyCount = { || Customer->( FCount() ) }
oDlg:oClient = oBrw
ACTIVATE DIALOG oDlg CENTERED ON INIT oDlg:Resize()
RETURN NIL
Windows 11 Pro 22H2 22621.1848
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
-
- Posts: 1077
- Joined: Fri Oct 07, 2005 3:33 pm
- Location: Cochabamba - Bolivia
- Has thanked: 1 time
Re: xBrowse cell overlaps
Hello,
I think Mr. Rao is right, what happend is I worked with very old xBrowse source
The xbrowse's source has only 4561 lines
I am sorry, I will try to see it with other xBrowse version
regards
Marcelo
I think Mr. Rao is right, what happend is I worked with very old xBrowse source

Code: Select all | Expand
...
if !Empty( cData )
oFont:Activate( hDC )
SetTextColor( hDC, aColors[ 1 ] )
SetBkColor( hDC, aColors[ 2 ] )
//DrawTextEx( hDC, cData,;
// {nRow, nCol, nRow + nHeight, Min( nCol + nWidth, ::oBrw:BrwWidth() - 5 ) },;
// ::nDataStyle )
DrawTextEx( hDC, cData,;
{ nRow, nCol, nRow + nHeight, nCol + GetTextWidth( hDC, cData ) },;
::nDataStyle )
//-------------------------
oFont:Deactivate( hDC )
endif
...
The xbrowse's source has only 4561 lines
I am sorry, I will try to see it with other xBrowse version
regards
Marcelo
Re: xBrowse cell overlaps
Dear Marcelo, dear Rao,
I've adopted your proposals and now my sample code looks as follows:
Even though the third column draw nothing, it still overwrites the content of the second column!
Any ideas?
I've adopted your proposals and now my sample code looks as follows:
Code: Select all | Expand
FUNCTION Main()
LOCAL oDlg, oBrw, oCol, aRecord, nAt := 1
USE Customer
aRecord = Array( Customer->( FCount() ) )
DEFINE DIALOG oDlg SIZE 300, 300
@ 0, 0 XBROWSE oBrw OF oDlg ARRAY aRecord // AUTOSORT
// 1. column
oCol := oBrw:AddCol()
oCol:bStrData = { || Customer->( FieldName( oBrw:nArrayAt ) ) }
oCol:cHeader = "FieldName"
// 2. column
oCol := oBrw:AddCol()
oCol:bStrData = { || Customer->( FieldGet( oBrw:nArrayAt ) ) }
oCol:cHeader = "Value"
// Overlapping this column
oCol:bPaintText = { | oCol, hDC, cData, aRect | DrawTextEx( hDC, cData, { aRect[ 1 ], aRect[ 2 ], aRect[ 3 ], aRect[ 2 ] + GetTextWidth( hDC, cData ) }, oCol:nDataStyle ) }
// 3. column
oCol := oBrw:AddCol()
oCol:bStrData = { || "abc" }
oCol:cHeader = "Empty"
// Don't draw this column
oCol:bPaintText = { || NIL }
oBrw:nMarqueeStyle = MARQSTYLE_HIGHLROW
oBrw:CreateFromCode()
oBrw:bKeyCount = { || Customer->( FCount() ) }
oDlg:oClient = oBrw
ACTIVATE DIALOG oDlg CENTERED ON INIT oDlg:Resize()
RETURN NIL
Even though the third column draw nothing, it still overwrites the content of the second column!
Any ideas?
Windows 11 Pro 22H2 22621.1848
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
Re: xBrowse cell overlaps
Hi to all,
one possible solution is, setting
but the content of the selected row disappears:

And color settings has no effect for transparent cells
Code for the column 'Empty':
the cell doesn't change the color:

Any ideas?
one possible solution is, setting
Code: Select all | Expand
oCol:lColTransparent := .T.
but the content of the selected row disappears:

And color settings has no effect for transparent cells

Code for the column 'Empty':
Code: Select all | Expand
oCol:bClrStd := { || { CLR_BLACK, CLR_CYAN } }
oCol:lColTransparent := .T.
the cell doesn't change the color:

Any ideas?
Windows 11 Pro 22H2 22621.1848
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
Re: xBrowse cell overlaps acc. merge columns
Another much more better solution:
Merge columns similar to merge rows, see testmerg.prg
Unfortunately this feature is not (yet) implemented in xBrowse.
Merge columns similar to merge rows, see testmerg.prg
Unfortunately this feature is not (yet) implemented in xBrowse.
Windows 11 Pro 22H2 22621.1848
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86