......
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
........