Correcion...xBrowse...Fwh 907.....909

Post Reply
User avatar
Ale SB
Posts: 248
Joined: Wed Jan 11, 2006 11:30 am
Location: Campo Grande-MS / Brasil

Correcion...xBrowse...Fwh 907.....909

Post by Ale SB »

Ola Antonio,
por favor revise el method DataRect() del xBrowse (Vrs. Fwh907...909..)

Code: Select all | Expand


METHOD DataRect() CLASS TXBrowse

   local aRect    := GetClientRect( ::hWnd )

   if ::lRecordSelector
      //aRect[ 2 ]  += RECORDSELECTOR_WIDTH
      aRect[ 2 ]  -= RECORDSELECTOR_WIDTH  //--> Ale SB
   endif
   if ::lHeader
      aRect[ 1 ]  += ::HeaderHeight()
   endif
   if ::lFooter
      //aRect[ 3 ]  -= ::FooterHeight()
      aRect[ 3 ]  += ::FooterHeight()  //--> Ale SB
   endif

return aRect
 


Esta alteraçao corrigi este Bug :
viewtopic.php?f=6&t=17134

Saluds, Ale
aleseribeli@hotmail.com

FwH, Hb Svn, ADS 8.1, ADS 10, Pelles C, FwPPC, MsVc 2008, MsVc 2010
"Conhecimento, você não subtrai quando divide; mas soma e multiplica."
**---Mário Persona---**
User avatar
Antonio Linares
Site Admin
Posts: 42511
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Re: Correcion...xBrowse...Fwh 907.....909

Post by Antonio Linares »

Ale,

Incluido para el próximo FWH 9.11, muchas gracias! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 42511
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Re: Correcion...xBrowse...Fwh 907.....909

Post by Antonio Linares »

Ale,

Podrias proporcionarnos un ejemplo de PRG y RC que reproduzcan el error de pintado que tenias, antes de implementar tus cambios ? gracias
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Ale SB
Posts: 248
Joined: Wed Jan 11, 2006 11:30 am
Location: Campo Grande-MS / Brasil

Re: Correcion...xBrowse...Fwh 907.....909

Post by Ale SB »

Antonio;

Encontrado el verdadero problema.

Pruebas se basan en Fwh909 ==>
Image

El defecto Footer:
Image

El defecto header:
Image

Solución, a los cambios en xBrowse :

Code: Select all | Expand


METHOD Paint() CLASS TXBrowse
.
.
   // Paint Background
   aRect       := ::DataRect()
   SetBrushOrgEx( ::hDC, aRect[ 2 ], aRect[ 1 ] )
   //FillRect( ::hDC, aRect, ::oBrush:hBrush )
   //--> El aRect[1] := 0 y aRect[2] := 0,  tenes q ser 0.
   //    Correcion del Header.
    FillRect( ::hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )  //--> Ale SB
   // Paint Background end
.
.
.
   /*
   Paint Footer
   */


   if ::lFooter
      if !lOnlyData
         //nHeight  := ::nFooterHeight - 3
         //--> Correcion del Footer.
         nHeight  := ::nFooterHeight - 1  //--> Ale SB
 


Después de las correcciones:
Image

El footer, no defeito :
Image

Prueba:

Code: Select all | Expand


/*
* testxbr.prg
*/


#include "FiveWin.Ch"
#include "XBrowse.Ch"

REQUEST DBFCDX

//----------------------------------------------------------------------------//

function Main()

  local oDlg, oBrw
   
  rddsetdefault( "DBFCDX" )
  CheckCustCdx()

  DEFINE DIALOG oDlg RESOURCE "DIALOG_1" TITLE "Test xBrwose"

*****--- Browse ---*************************************************************
    oBrw := TXBrowse():New( oDlg )    
             oBrw:CreateFromResource( 101 )
            oBrw:nMarqueeStyle       := MARQSTYLE_HIGHLROW
            oBrw:nColDividerStyle := LINESTYLE_BLACK
            oBrw:cAlias           := ("CUSTOMER")      
            oBrw:lFooter          := .T.
            oBrw:lHScroll         := .F.
           
  ACTIVATE DIALOG oDlg CENTERED
 
return

//----------------------------------------------------------------------------//
static function CheckCustCdx()

   local n

   if File( "customer.cdx" )
      FErase( "customer.cdx" )
   endif

   if !File( "customer.cdx" )
      USE CUSTOMER EXCLUSIVE VIA "DBFCDX"
      for n := 1 to FCount()
         CreateTag( FieldName( n ), FieldType( n ) )
      next
    endif

return nil

//----------------------------------------------------------------------------//

static function CreateTag( ctag, cType )

   PRIVATE cExpr

   if cType == 'C'
      cExpr    := "UPPER(" + Trim( cTag ) + ")"
      INDEX ON &cExpr TAG &cTag
   else
      INDEX ON &ctag TAG &ctag
   endif

return nil
 


Testxbr.Rc

Code: Select all | Expand


DIALOG_1 DIALOG 6, 15, 349, 190
STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX
CAPTION "DIALOG_1"
FONT 8, "MS Sans Serif"
{
 CONTROL "", 101, "Txbrowse", 0 | WS_CHILD | WS_VISIBLE, 12, 8, 325, 171
}
 


Saluds, Ale
aleseribeli@hotmail.com

FwH, Hb Svn, ADS 8.1, ADS 10, Pelles C, FwPPC, MsVc 2008, MsVc 2010
"Conhecimento, você não subtrai quando divide; mas soma e multiplica."
**---Mário Persona---**
Post Reply