FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Xbrowse , Total and SetProgBar
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Xbrowse , Total and SetProgBar
Posted: Fri Jul 22, 2011 01:26 PM

Hello ,
Is it possible to have SetProgBar in Total row ?

Regards MAurizio

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Xbrowse , Total and SetProgBar
Posted: Fri Jul 22, 2011 06:05 PM

I could not understand your exact requirement.

SetProgBar: What kind of progress bar do you want to show? Progress of what action?

Total Row: Do you mean footer ?

Regards



G. N. Rao.

Hyderabad, India
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: Xbrowse , Total and SetProgBar
Posted: Mon Jul 25, 2011 07:21 AM
Hello Rao

[IMG=http://img19.imageshack.us/img19/7157/immaginesz.jpg][/IMG]

To have :setProgBAr in footer row.

MAurizio
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Xbrowse , Total and SetProgBar
Posted: Mon Jul 25, 2011 07:33 AM

The link appears to be broken. Could not see the image please.

SetProgBar is not implemented for the total in the footer row.
If we need to paint any dynamic graphics on the footer we need to modify the method paintfooter. The best way of implementation is to have a derived class and use the same for browse(s) that need to use this feature.

Regards



G. N. Rao.

Hyderabad, India
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: Xbrowse , Total and SetProgBar
Posted: Mon Jul 25, 2011 08:02 AM

Thank

Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
Re: Xbrowse , Total and SetProgBar
Posted: Mon Jul 25, 2011 11:03 AM
RAO

THI IS THE IMAGE


FWH .. BC582.. xharbour
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: Xbrowse , Total and SetProgBar
Posted: Mon Jul 25, 2011 04:18 PM
Hello Rao

Code (fw): Select all Collapse
/ Class TXBrwColumn
   // FOOTBAR    
   DATA lFootBar AS LOGICAL INIT .f.
   DATA bFootClrProg INIT { || { RGB(200,200,255), CLR_YELLOW } }
   DATA nFootProgTot INIT 1  // can be codeblock also
   
   METHOD SetFootBar(nFootProgTotal, nFootWidth, bFootClrProg )
   
      
   METHOD SetFootBar( nFootProgTotal, nFootWidth, bFootClrProg ) CLASS TXBrwColumn

   ::lFootBar        := .t.
   
   if nFootProgTotal != nil
      ::nFootProgTot     := nFootProgTotal
   endif
   
   if  ValType( bFootClrProg )  == 'B'
    
      ::bFootClrProg     := bFootClrProg
   endif

   ::nFootStyle  := DT_CENTER
   if nFootWidth != nil
      ::nWidth       := nFootWidth
   endif

   return nil
   
   
   In  METHOD PaintFooter( nRow, nCol, nHeight, lInvert ) CLASS TXBrwColumn

   local oBrush1, oBrush2, hBrush1, hBrush2, aColor2, nWidth1
         
   
   Line 90494 of FW 1106
   
   After 
   
   nHeight -=  ROW_EXTRAHEIGHT


   Before 
   if !Empty( aBitmap := ::aBitmap( nBmpNo ) )
   
   
   //---------------------------------------------------------
   if ::lFootBar
      aColor2  := Eval( ::bFootClrProg )
      hBrush1  := CreateColorBrush( aColor2[ 1 ] )
      hBrush2  := CreateColorBrush( aColor2[ 2 ] )
      nWidth1  := Min( val(cFooter) * nWidth / ;
         Max( 1, If( ValType( ::nFootProgTot ) == 'B', Eval( ::nFootProgTot, Self ), ::nFootProgTot ) ), ;
         nWidth )
         

      FillRect( hDC, { nRow, nCol, nRow + nHeight, Min( nCol + nWidth1, ::oBrw:BrwWidth() - 4 ) }, hBrush1 )

      if nCol + nWidth1 < ::oBrw:BrwWidth() - 4
         FillRect( hDC, { nRow, nCol + nWidth1 + 1, nRow + nHeight, ;
             Min( nCol + nWidth, ::oBrw:BrwWidth() - 4 ) }, hBrush2 )
      endif
      DeleteObject( hBrush1 )
      DeleteObject( hBrush2 )

   endif

Continue the discussion