FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ASSISTANCE NEEDED - Dual xbrowse header
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM

ASSISTANCE NEEDED - Dual xbrowse header

Posted: Thu Dec 10, 2009 11:56 PM
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:



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 ?
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: xBrowse Top Header DISPLAY ERROR - Ideas ?

Posted: Wed Dec 16, 2009 10:00 AM

Tim,

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM

Re: xBrowse Top Header DISPLAY ERROR - Ideas ?

Posted: Wed Dec 16, 2009 03:58 PM
Antonio,

I think it is supposed to look like this:




Regards,
James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM

Re: xBrowse Top Header DISPLAY ERROR - Ideas ?

Posted: Wed Dec 16, 2009 04:36 PM

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 ...

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM

Re: ASSISTANCE NEEDED - Dual xbrowse header

Posted: Sun Dec 20, 2009 10:26 PM

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.

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM

Re: ASSISTANCE NEEDED - Dual xbrowse header

Posted: Mon Dec 21, 2009 12:16 PM

Tim
If you send me a sample of it I can see what Multiheader make and where is the error

Best Regards, Saludos



Falconi Silvio
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM

Re: ASSISTANCE NEEDED - Dual xbrowse header

Posted: Mon Dec 21, 2009 04:33 PM

The code is in the original message at the top of this thread.

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM

Re: ASSISTANCE NEEDED - Dual xbrowse header

Posted: Mon Dec 21, 2009 05:01 PM

i CANNOT COMPILED IT

Best Regards, Saludos



Falconi Silvio
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM

Re: ASSISTANCE NEEDED - Dual xbrowse header

Posted: Mon Dec 21, 2009 05:31 PM

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

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM

Re: ASSISTANCE NEEDED - Dual xbrowse header

Posted: Mon Dec 21, 2009 06:02 PM

you can post a small sample test to see the problem

Best Regards, Saludos



Falconi Silvio
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: ASSISTANCE NEEDED - Dual xbrowse header

Posted: Tue Dec 22, 2009 04:11 AM
Please search for this code in the METHOD Paint() in XBrowse.Prg
Code (fw): Select all Collapse
               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 (fw): Select all Collapse
               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.
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: ASSISTANCE NEEDED - Dual xbrowse header

Posted: Tue Dec 22, 2009 05:17 AM

Mr Silvio

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

Regards



G. N. Rao.

Hyderabad, India
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: ASSISTANCE NEEDED - Dual xbrowse header

Posted: Tue Dec 22, 2009 07:18 AM

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 :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM

Re: ASSISTANCE NEEDED - Dual xbrowse header

Posted: Tue Dec 22, 2009 02:17 PM
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 }
Best Regards, Saludos



Falconi Silvio
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM

Re: ASSISTANCE NEEDED - Dual xbrowse header

Posted: Tue Dec 22, 2009 03:37 PM

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.

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit