Page 1 of 2

ASSISTANCE NEEDED - Dual xbrowse header

PostPosted: Thu Dec 10, 2009 11:56 pm
by TimStone
Using xBrowse, I'm trying to use a type of Gannt chart for a calendar. Please look at the sample and you will see the problem with the display. :(

I want the day on the top header, and the hours below. The top header should cover the range of hours ( 8 - 5 ) for the day. So hour 8 is header type 2, 9 to 4 are header type 1, and 5 is header type 3. This repeats. Of course the setup is done with the appropriate columns. Note that the 5 is using a characteristic of type 0, not 3, and the header stops before the end of the 4.

This is the result I get:

Image

Here is the code:

oCalW:nHeader := 1
oCalW:aHeaderTop := {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday"}
oCalW:aCols[ 1 ]:nHeaderType := 0
oCalW:aCols[ 2 ]:nHeaderType := 2
FOR mbx := 3 TO 10
oCalW:aCols[ mbx]:nHeaderType := 1
NEXT
oCalW:aCols[ 11]:nHeaderType := 3
oCalW:aCols[ 12]:nHeaderType := 2
FOR mbx := 13 TO 20
oCalW:aCols[ mbx]:nHeaderType := 1
NEXT
oCalW:aCols[ 21]:nHeaderType := 3
oCalW:aCols[ 22]:nHeaderType := 2
FOR mbx := 23 TO 30
oCalW:aCols[ mbx]:nHeaderType := 1
NEXT
oCalW:aCols[ 31]:nHeaderType := 3
oCalW:aCols[ 32]:nHeaderType := 2
FOR mbx := 33 TO 40
oCalW:aCols[ mbx]:nHeaderType := 1
NEXT
oCalW:aCols[ 41]:nHeaderType := 3
oCalW:aCols[ 42]:nHeaderType := 2
FOR mbx := 43 TO 50
oCalW:aCols[ mbx]:nHeaderType := 1
NEXT
oCalW:aCols[ 51]:nHeaderType := 3


Any ideas ?

Re: xBrowse Top Header DISPLAY ERROR - Ideas ?

PostPosted: Wed Dec 16, 2009 10:00 am
by Antonio Linares
Tim,

Could you please "paint" (mspaint) the result that you would like to get and post it here ? thanks :-)

Re: xBrowse Top Header DISPLAY ERROR - Ideas ?

PostPosted: Wed Dec 16, 2009 3:58 pm
by James Bott
Antonio,

I think it is supposed to look like this:

Image


Regards,
James

Re: xBrowse Top Header DISPLAY ERROR - Ideas ?

PostPosted: Wed Dec 16, 2009 4:36 pm
by TimStone
Antonio,

James did it ( looking at the adjustment for Monday display ). The numbers are the hours of the day, from 8 to 5, and so the top header Monday should cover all of those hours. I believe I implemented the code correctly, but the display is off. Of course it needs to display correctly for all 5 days, Monday through Friday.

Thanks ...

Re: ASSISTANCE NEEDED - Dual xbrowse header

PostPosted: Sun Dec 20, 2009 10:26 pm
by TimStone
I showed a current display of the top header, and James showed a visual of how it should look, but after a week, doesn't anyone have an idea what is wrong here ?

I would sure love to fix this ... it looks pretty bad.

Thanks.

Re: ASSISTANCE NEEDED - Dual xbrowse header

PostPosted: Mon Dec 21, 2009 12:16 pm
by Silvio
Tim
If you send me a sample of it I can see what Multiheader make and where is the error

Re: ASSISTANCE NEEDED - Dual xbrowse header

PostPosted: Mon Dec 21, 2009 4:33 pm
by TimStone
The code is in the original message at the top of this thread.

Re: ASSISTANCE NEEDED - Dual xbrowse header

PostPosted: Mon Dec 21, 2009 5:01 pm
by Silvio
i CANNOT COMPILED IT

Re: ASSISTANCE NEEDED - Dual xbrowse header

PostPosted: Mon Dec 21, 2009 5:31 pm
by TimStone
Silvio,

It is not possible to post all of the code that leads to this. I assumed others use the top header option in Xbrowse and would look at the implementation above and see what is wrong, or have experienced something similar. Apparently either no one is using Top Header, or there is something unique here. From the documentation and sample, what I posted should be correct ...but it doesn't display correctly.

Tim

Re: ASSISTANCE NEEDED - Dual xbrowse header

PostPosted: Mon Dec 21, 2009 6:02 pm
by Silvio
you can post a small sample test to see the problem

Re: ASSISTANCE NEEDED - Dual xbrowse header

PostPosted: Tue Dec 22, 2009 4:11 am
by nageswaragunupudi
Please search for this code in the METHOD Paint() in XBrowse.Prg
Code: Select all  Expand view
              ElseIf oCol:nHeaderType==3
                  MoveTo( hDC, nCol - 2, nRow + 0 )
                  LineTo( hDC, nCol - 2, nRow + nHeight - 0, hHeaderPen )
                  oCol:PaintHeader( nRow , nCol-1, nHeight,,,oCol:nWidth+1, oCol:cHeader )
                  MoveTo( hDC, nColIni - 2, nRow + nHeight/2 )
                  LineTo( hDC, nCol - 2, nRow + nHeight/2, hHeaderPen )
                  nHeaderTop++
                  oCol:PaintHeader( nRow - 0, nColIni-1, nHeight/2,,,nWidthHeaderTop+1, ::aHeaderTop[nHeaderTop] )
                  nWidthHeaderTop:=0
 

Please replace the entire block above with the code given below
Code: Select all  Expand view
              ElseIf oCol:nHeaderType==3
                  MoveTo( hDC, nCol - 2, nRow + 0 )
                  LineTo( hDC, nCol - 2, nRow + nHeight - 0, hHeaderPen )
                  oCol:PaintHeader( nRow + nHeight/2, nCol-1, nHeight/2,,,oCol:nWidth+1, oCol:cHeader )
                  nWidthHeaderTop += oCol:nWidth+1
                  MoveTo( hDC, nColIni - 2, nRow + nHeight/2 )
                  LineTo( hDC, nColIni - 2 + nWidthHeaderTop, nRow + nHeight/2, hHeaderPen )
                  nHeaderTop++
                  oCol:PaintHeader( nRow - 0, nColIni-1, nHeight/2,,,nWidthHeaderTop+1, ::aHeaderTop[nHeaderTop] )
                  nWidthHeaderTop:=0
 

Now the headers should work as expected.

Re: ASSISTANCE NEEDED - Dual xbrowse header

PostPosted: Tue Dec 22, 2009 5:17 am
by nageswaragunupudi
Mr Silvio

Can you please clarify what for is nHeaderType == 4 ?
Documentation describes nHeaderType 1, 2 and 3 only but not 4.

Re: ASSISTANCE NEEDED - Dual xbrowse header

PostPosted: Tue Dec 22, 2009 7:18 am
by Antonio Linares
Tim,

Sorry for the delay but I was for a few days out of the office.

Fortunatly our dear friend and master, Rao, managed to provide you a solution :-)

Re: ASSISTANCE NEEDED - Dual xbrowse header

PostPosted: Tue Dec 22, 2009 2:17 pm
by Silvio
Nas,
4 is to close ( sum 3+1 =4)
see the testhead.prg

xColBrw[03] := { "Street", AL_CENTER, .T., 70, AL_LEFT, "@30", 1, { |o| (oBrw:cAlias)->STREET }, { || (oBrw:cAlias)->STREET }, 4, AL_RIGHT }

Re: ASSISTANCE NEEDED - Dual xbrowse header

PostPosted: Tue Dec 22, 2009 3:37 pm
by TimStone
Thank you. That takes care of the 5 displaying as a status 1 ( full height ), but the top bar still does not extend fully to the right of the last column it covers. It appears to be about 1/3 of the way across the column. You can see this in the sample above where it covers only part of the column with the number 4.

At least this looks better. Thanks for the edit.