METHOD MouseMove( nRow, nCol, nKeyFlags ) CLASS TBtnBmp
if ! ::lMOver
::lMOver = .T.
// ::Refresh()
endif
METHOD PaintBorder() CLASS TBtnBmp
local nAdjustBorder := 0
if ::l2007 .or. ::l2010
nAdjustBorder = If( ::lBorder, If( ::lBarBtn, 0, 3 ), 0 )
endif
if ::lMOver .and. ::lBoxSelect
if ! ::lRound .and. ! ::lEllipse
if ::l2007 .or. ::l2010
WndBox2007( ::hDC, nAdjustBorder, nAdjustBorder,;
::nHeight - nAdjustBorder - 1, ::nWidth - nAdjustBorder - 1,;
nRGB( 221, 207, 155 ) )
else
if ! ::lPressed
WndRaised( ::hWnd, ::hDC )
else
WndInset( ::hWnd, ::hDC )
endif
endif
else
if ::lEllipse
::DrawEllipse( ::hDC, nRGB( 221, 207, 155 ), 2 )
else
if ::lRound
RoundBox( ::hDC, 2, 2, ::nWidth - 3, ::nHeight - 3, 6, 6,;
nRGB( 221, 207, 155 ) )
else
if ! ::lPressed
WndRaised( ::hWnd, ::hDC )
else
WndInset( ::hWnd, ::hDC )
endif
endif
METHOD PaintBorder() CLASS TBtnBmp
local nAdjustBorder := 0
if ::l2007 .or. ::l2010
nAdjustBorder = If( ::lBorder, If( ::lBarBtn, 0, 3 ), 0 )
endif
if ::lMOver .and. ::lBoxSelect
if ! ::lRound .and. ! ::lEllipse
if ::l2007 .or. ::l2010
WndBox2007( ::hDC, nAdjustBorder, nAdjustBorder,;
::nHeight - nAdjustBorder - 1, ::nWidth - nAdjustBorder - 1,;
nRGB( 221, 207, 155 ) )
else
MsgBeep()
if ! ::lPressed
WndRaised( ::hWnd, ::hDC )
else
WndInset( ::hWnd, ::hDC )
endif
endif
else
if ::lEllipse
::DrawEllipse( ::hDC, nRGB( 221, 207, 155 ), 2 )
else
if ::lRound
RoundBox( ::hDC, 2, 2, ::nWidth - 3, ::nHeight - 3, 6, 6,;
nRGB( 221, 207, 155 ) )
else
if ! ::lPressed
WndRaised( ::hWnd, ::hDC )
else
WndInset( ::hWnd, ::hDC )
endif
endif
endif
endif
else
if ::lBorder
MsgBeep()
if ! ::lPressed
if ! ( ::l2007 .or. ::l2010 )
WndRaised( ::hWnd, ::hDC )
endif
else
WndInset( ::hWnd, ::hDC )
endif
endif
endif
return nil
Antonio Linares wrote:Enrico,
ok, thats what I told you: thst only using NOROUND was working fine.
Now the question is: why lRound is set to .T. by default ?
Try to set it .F. by default and then it should work fine.
METHOD PaintBorder() CLASS TBtnBmp
local nAdjustBorder := 0
if ::l2007 .or. ::l2010
nAdjustBorder = If( ::lBorder, If( ::lBarBtn, 0, 3 ), 0 )
endif
if ::lMOver .and. ::lBoxSelect
? ::lRound
if ! ::lRound .and. ! ::lEllipse
Antonio Linares wrote:Enrico,
Please help me to locate the error, I am very busy with EasyReport, sorry, thanks
METHOD PaintCaption() CLASS TBtnBmp
local nStyle, nClr
local hOldFont, aRect, lMultiline, cWord, cWord2
local nOffset, nMaxWidth, nLine
local nTxtTop := 0, nTxtLeft := 6, nTxtRight := ::nWidth - 6
local nTxtHeight, nAdjust := 0
local nLayOut := ::nLayOut
if ::oPopup != nil
nTxtRight -= 12
endif
if ! Empty( ::cCaption )
if ::oFont == nil
::GetFont()
endif
lMultiLine = ! Empty( ::cCaption ) .and. CRLF $ ::cCaption
if lMultiLine
cWord = cStrWord( ::cCaption, nOffset, CRLF )
while nOffset < Len( ::cCaption )
nMaxWidth = Max( nMaxWidth,;
Len( cWord2 := cStrWord( ::cCaption, @nOffset, CRLF ) ) )
if Len( cWord ) < nMaxWidth
cWord = cWord2
endif
end
nLine = MLCount( ::cCaption )
else
cWord = ::cCaption
endif
nStyle = nOr( If( ::nLayOut == 0, DT_CENTER, nLayOut ), DT_WORDBREAK ,;
If( ::nLayOut % 2 == 0, DT_VCENTER, DT_TOP ) )
nClr = If( IsWindowEnabled( ::hWnd ), ::nClrText,;
If( ::lDisColor, CLR_HGRAY, ::nClrTextDis ) )
SetTextColor( ::hDC, If( ValType( nClr ) == "B", Eval( nClr, ::lMOver ), nClr ) )
SetBkMode( ::hDC, 1 )
if ::oWnd:oFont != nil .or. ::oFont != nil
hOldFont = SelectObject( ::hDC, ::oFont:hFont )
endif
aRect = { nTxtTop + nAdjust, nTxtLeft + nAdjust, ::nHeight + nAdjust - 4,;
nTxtRight + nAdjust }
lMultiLine = ( nTxtHeight := DrawText( ::hDC, ::cCaption, aRect,;
nOr( DT_WORDBREAK, DT_CALCRECT ) ) ) > ;
DrawText( ::hDC, ::cCaption, aRect, nOr( DT_SINGLELINE, DT_CALCRECT ) )
if ::nLayOut == 1
nStyle = nOr( DT_CENTER, DT_WORDBREAK )
aRect[ 1 ] = aRect[ 3 ] - nTxtHeight
endif
if ::nLayOut == 3
aRect[ 1 ] = 2
endif
if ::lPressed
aRect[ 1 ]++
aRect[ 2 ]++
aRect[ 3 ]++
aRect[ 4 ]++
endif
DrawText( ::hDC, ::cCaption, aRect, nStyle )
SelectObject( ::hDC, hOldFont )
endif
return nil
Return to Bugs report & fixes / Informe de errores y arreglos
Users browsing this forum: No registered users and 6 guests