xbrowse record display

xbrowse record display

Postby Colin Haig » Fri May 14, 2010 2: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
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: xbrowse record display

Postby nageswaragunupudi » Fri May 14, 2010 7: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: Select all  Expand view
  oDlg:bStart := { || AdjustBrwHeoght( oBrw ) }
 

function:
Code: Select all  Expand view
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
User avatar
nageswaragunupudi
 
Posts: 10628
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xbrowse record display

Postby Colin Haig » Sun May 16, 2010 11:32 pm

Mr Rao

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


Cheers

Colin
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: xbrowse record display

Postby fraxzi » 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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: xbrowse record display

Postby nageswaragunupudi » Mon May 17, 2010 7: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
User avatar
nageswaragunupudi
 
Posts: 10628
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xbrowse record display

Postby fraxzi » 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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 71 guests