Enrico,
I sent you several modified Class TBtnBmp, maybe you are still linking one of them ?
Enrico,
I sent you several modified Class TBtnBmp, maybe you are still linking one of them ?
Antonio,
no, I'm using clean latest FWH. Can you try using the downloaded FWH package? Maybe you have changed something in the last minute?
EMG
Enrico,
I just downloaded FWH 14.07, went to samples folder, did a buildh btn, and the EXE is working fine.
Really strange. Could you test it on another computer ?
METHOD MouseMove( nRow, nCol, nKeyFlags ) CLASS TBtnBmp
if ! ::lMOver
::lMOver = .T.
// ::Refresh()
endifEnrico,
Thats no a solution, as you are avoiding the repainting of the control.
Do you have virtualbox ? if you don't have another PC at hand, you may use one virtual and try it there.
Antonio,
your EXE works fine here too so what's the point to test mine on another PC? Anyway, I just tried on my old XP machine: no change. ![]()
EMG
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
endifEnrico,
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
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 nilAntonio 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. ! ::lEllipseEnrico,
Please help me to locate the error, I am very busy with EasyReport, sorry, thanks ![]()
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 nilAntonio,
great! Now btnbmp seems to work like the old version.
Thank you! ![]()
EMG