Cambios en buttonb.prg

Cambios en buttonb.prg

Postby mastintin » Tue Dec 15, 2015 8:13 am

para poder usar png,jpg con esta clase ...

Code: Select all  Expand view

......

METHOD New( nRow, nCol, cCaption, oWnd, bAction, nWidth, nHeight,;
               nHelpId, oFont, lDefault, lPixel, lDesign, cMsg,;
               lUpdate, bWhen, bValid, lCancel, cBitmap, cPosText, cToolTip ) CLASS TButtonBmp

   DEFAULT cCaption := "", cPosText := ""

   ::LoadBitmap( cBitmap )

   ::cPosText  = Upper( cPosText )
   ::cToolTip  = cToolTip

   DEFAULT nWidth := nBmpWidth( ::hBitmap ) + 9, nHeight := nBmpHeight( ::hBitmap ) + 9

return ::Super:New( nRow, nCol, cCaption, oWnd, bAction, nWidth, nHeight,;
                  nHelpId, oFont, lDefault, lPixel, lDesign, cMsg,;
                  lUpdate, bWhen, bValid, lCancel, cBitmap )

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

METHOD ReDefine( nId, bAction, oWnd, nHelpId, cMsg,;
                 lUpdate, bWhen, bValid, cPrompt, lCancel, cBitmap, cPosText, cToolTip ) CLASS TButtonBmp

   DEFAULT cPrompt := "", cPosText := ""

    ::LoadBitmap( cBitmap )

   ::cPosText  = Upper( cPosText )
   ::cToolTip  = cToolTip

return ::Super:Redefine( nId, bAction, oWnd, nHelpId, cMsg, lUpdate, bWhen,;
                       bValid, cPrompt, lCancel )

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

METHOD LoadBitmap( cBmpName ) CLASS TButtonBmp

   local aBmp

   if ! Empty( ::hBitmap )
      DeleteObject( ::hBitmap )
      ::hBitmap = nil
   endif

   ::cBitmap = cBmpName

   if ValType( cBmpName ) == 'N'
      if IsGdiObject( cBmpName )
         ::hBitmap   := cBmpName
      endif
      ::cBitmap   := cValToChar( cBmpName )
   ELSE

         aBmp    := ::ReadPalBmpEx( cBmpName )
         ::hBitmap := aBmp[1]
         If !Empty(  aBmp[2] )
            DeleteObject(  aBmp[2] )
         endif
   // old code
  // elseif File( cBmpName )
  //    ::hBitmap = ReadBitmap( 0, cBmpName )
  // else
   //   ::hBitmap = LoadBitmap( GetResources(), cBmpName )

   endif
  ::HasAlpha()

return nil

........

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

Re: Cambios en buttonb.prg

Postby Antonio Linares » Tue Dec 15, 2015 8:34 am

Manuel,

gracias! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42077
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 68 guests