FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xbrowse record display
Posts: 310
Joined: Mon Oct 10, 2005 05:10 AM
xbrowse record display
Posted: Fri May 14, 2010 02:11 AM

Hi All

I have a xbrowse that has more records that can be displayed but the bottom line
of the view looks like a blank record even though there are records below - is there a way
overcome this - so the browse is full of records.

cheers

Colin

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xbrowse record display
Posted: Fri May 14, 2010 07:00 AM
When the vertical size of the browse data area is not integral multiple of number of rows that can be displayed and the row height, there is a small gap at the bottom that can not be filled with data.

If we want the displayed rows to snugly cover the total area, there are two alternative approaches.

Alternative-1: While defining the browse, manually assign nHeaderHeight, nFooterHeight and nRowHeight. Define the height of the browse as nHeaderHeight + nFooterHeight + numrows * nRowHeight + ( exact space if needed depending on whether the style of Browse has WS_BORDER or not ).

Alternative-2: Define the browse as usual. Immediately after the browse is initiated, calculate the gap at the bottom and (a) add the gap to header and footer equally or (b) reduced the height of the browse.

You can use this code:
Code (fw): Select all Collapse
   oDlg:bStart := { || AdjustBrwHeoght( oBrw ) }

function:
Code (fw): Select all Collapse
static function AdjustBrwHeoght( oBrw )

   local nGap  := oBrw:BrwHeight - ( oBrw:nRowHeight * (oBrw:RowCount()) ) - ;
                  If( oBrw:lHeader, oBrw:nHeaderHeight, 0 ) - ;
                  If( oBrw:lFooter, oBrw:nFooterHeight, 0 )

   if oBrw:lFooter
      oBrw:nFooterHeight   += Int( nGap / 2 )
      nGap                 -= Int( nGap / 2 )
   endif
   if oBrw:lHeader
      oBrw:nHeaderHeight   += nGap
      nGap                 := 0
   endif

   if nGap > 0
      oBrw:nHeight         -= nGap
   endif

   obrw:refresh()

return nil

You can modify the logic to your aesthetic taste.
Regards



G. N. Rao.

Hyderabad, India
Posts: 310
Joined: Mon Oct 10, 2005 05:10 AM
Re: xbrowse record display
Posted: Sun May 16, 2010 11:32 PM

Mr Rao

Thanks for your reply - this fixed the issue - now looks a lot better.

Cheers

Colin

Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: xbrowse record display
Posted: Mon May 17, 2010 12:56 AM

Dear RAO,

I think it's better if we determine if elements/records are greater than xbrowse can display then use AdjustBrwHeight( oBrw ) otherwise no adjustment since all elements/records are displayed.

Regards,
Frances

Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xbrowse record display
Posted: Mon May 17, 2010 07:15 AM
fraxzi wrote:Dear RAO,

I think it's better if we determine if elements/records are greater than xbrowse can display then use AdjustBrwHeight( oBrw ) otherwise no adjustment since all elements/records are displayed.


Regards,
Frances

Yes.
My answer was specific to Mr. Haig's requirement. He said in his case rows were more than the display
Regards



G. N. Rao.

Hyderabad, India
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: xbrowse record display
Posted: Mon May 17, 2010 10:05 AM
nageswaragunupudi wrote:
fraxzi wrote:Dear RAO,

I think it's better if we determine if elements/records are greater than xbrowse can display then use AdjustBrwHeight( oBrw ) otherwise no adjustment since all elements/records are displayed.


Regards,
Frances

Yes.
My answer was specific to Mr. Haig's requirement. He said in his case rows were more than the display


Dear RAO,

I was affected.. LOL!

This is also my case but did not bother until I read this topic.


Regards,
Frances
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15

Continue the discussion