bug en xBrowse o tBtnbmp

bug en xBrowse o tBtnbmp

Postby mastintin » Wed Oct 22, 2014 3:29 pm

el error se produce con esta pequeña modificación en el sample xbrowgrad.prg :
Code: Select all  Expand view


#include 'fivewin.ch'
#include 'xbrowse.ch'

function Main()

   local oDlg, oBrw, oFont
   local aRowGrad, aSelGrad, aStdGrad
   local oCol
   
   local n := RGB( 157, 248, 255 )

   XbrNumFormat( 'E', .t. )

   aRowGrad := { { .5, RGB( 232, 241, 252 ), RGB(  232, 241, 252 ) }, ;
                 { .5, RGB( 210, 225, 244 ), RGB(  235, 243, 253 ) } }

   aSelGrad := { { .5, RGB( 255, 255, 251 ), RGB( 255, 237, 178 ) }, ;
                 { .5, RGB( 255, 218, 103 ), RGB( 255, 233, 162 ) } }

   USE CUSTOMER ALIAS CUST

   DEFINE FONT oFont NAME 'Tahoma' SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 640,440 PIXEL ;
      FONT oFont TITLE 'XBrowse Gradient Rows FWH 9.12'

   @ 10,10 XBROWSE oBrw OF oDlg ;
      SIZE -10,-10 PIXEL ;
      COLUMNS 'FIRST', 'HIREDATE', 'MARRIED', 'SALARY' ;
      ALIAS 'CUST' LINES NOBORDER

   oBrw:Married:SetCheck()  // Default FWH Bitmap is Alpha

   WITH OBJECT oBrw:First
      :AddBitmap( '\fwh\bitmaps\open2.bmp' ) // non-alpha bitmap
      :bBmpData   := { || 1 }
   END

   WITH OBJECT oBrw:HireDate
      :AddBitmap( '\fwh\bitmaps\Alphabmp\task.bmp' )  // alpha
      :bBmpData   := { || 1 }
   END

   WITH OBJECT oBrw
      :nStretchCol   := 1
      :nMarqueeStyle := 4
      :bClrSelFocus  := { || { CLR_BLACK, aSelGrad } }
      :bClrRowFocus  := { || { CLR_BLACK, aRowGrad } }
   END
    // añadido un boton ....
    oCol := oBrw:AddCol()
       WITH OBJECT oCol
          :cHeader  := ""
          :bStrData  := { || " " }
          :nEditType := EDIT_BUTTON
          :AddBitmap( '\fwh\bitmaps\Alphabmp\task.bmp' )
          :lBtnTransparent := .t.
          :nBtnBmp := 1
          :bEditBlock := { ||  msginfo(1)  }
          :bOnPostEdit := {|| .t. }
          :bLDClickData:={ || .t. }
          :nBtnWidth:= 24
       END

   oBrw:CreateFromCode()


   ACTIVATE DIALOG oDlg CENTERED

   CLOSE CUST
   RELEASE FONT oFont

return nil


 


Una posible solucion :

Code: Select all  Expand view


CLASS MyXbrCol FROM TXBrwColumn
  .......
  DATA bClrBtn
  ......
  ::bClrBtn := ::bClrHeader

  .....

METHOD PaintCell( )
.....

  ::oBtnElip:Move( nButtonRow, nButtonCol, nBtnWidth + 1, nHeight, .f.) // ButtonGet
            ::oBtnElip:Show()
            ::oBtnElip:GetDC()
            if ::lBtnTransparent
                aColors:= Eval( ::bClrBtn ,.f. )   // nuevo ....
                ::oBtnElip:SetColor( aColors[ 1 ],aColors[ 2 ] )

            else
              FillRect( hDC, {nButtonRow, nButtonCol, nButtonRow + nHeight , nButtonCol + nBtnWidth + 1 },; // ButtonGet
                        ::oBtnElip:oBrush:hBrush )
           endif




 
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: bug en xBrowse o tBtnbmp

Postby mastintin » Thu Oct 23, 2014 9:42 am

otro ejemplo con el bug .... xbrbtn.prg colocandole MARQSTYLE_HIGHLWIN7
Code: Select all  Expand view


function TestMain()

   local oWnd
   local oBrw
   local nI

   local aArray := {}

   DEFINE WINDOW oWnd TITLE "Testing Transparent Button-Cell"


   if empty( aArray )
      aArray := {{"one","two","three","four"},;
         {"one","two","three","four"},;
         {"one","two","three","four"},;
         {"one","two","three","four"}}
   endif


   @ 0,0 XBROWSE oBrw OF oWnd ;
      COLUMNS {1,2,3,4} ;
      HEADERS {"Btn Trans - 1","Btn Trans - 2","Header - 3","Header - 4"} ;
      array aArray LINES CELL fastedit
      oBrw:nRowHeight := 25

      oBrw:bClrStd := {|| {CLR_BLACK, CLR_CYAN } }

      oBrw:aCols[ 1 ]:addbmpfile( "..\bitmaps\16x16\adddbf.bmp" )
      oBrw:aCols[ 1 ]:lBtnTransparent := .t.
      oBrw:aCols[ 1 ]:nBtnBmp := 1

      oBrw:aCols[ 2 ]:addbmpfile( "..\bitmaps\16x16\zoom2.bmp" )
      oBrw:aCols[ 2 ]:lBtnTransparent := .t.
      oBrw:aCols[ 2 ]:nBtnBmp := 1

      oBrw:aCols[ 3 ]:addbmpfile( "..\bitmaps\16x16\adddbf.bmp" )
      oBrw:aCols[ 3 ]:nBtnBmp := 1

      oBrw:aCols[ 4 ]:addbmpfile( "..\bitmaps\16x16\zoom2.bmp" )
      oBrw:aCols[ 4 ]:nBtnBmp := 1

   aeval( oBrw:aCols, { |oCols| oCols:nEditType := EDIT_BUTTON } )
   
    oBrw:nMarqueeStyle :=MARQSTYLE_HIGHLWIN7 // a¤adido

   oWnd:oClient := oBrw

   oBrw:createfromcode()

   activate window oWnd

return nil
 
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 35 guests