Hello friends,
I have expanded the TBtnBmp.
Now, when I insert a PopupMenu, I can select the width of the clickable area and use a bitmap instead of the PolyPolygon.
Best regards,
Otto
- Code: Select all Expand view
METHOD PaintPopupSection() CLASS TBtnBmp
local nWidth, nHeight, hDC
local hBlackBrush, hOldBrush
local hDarkPen, hLightPen, hOldPen
if ::oPopup != nil
nHeight = ::nHeight
nWidth = ::nWidth
hDC = ::hDC
hBlackBrush = GetStockObject( 4 ) //4
hOldBrush = SelectObject( hDC, hBlackBrush )
FW_DrawImage( hDC, "c:\fwh\bitmaps\alphabmp\ichat.bmp", {::nHeight-30, ::nWidth-25, ::nHeight - 10, ::nWidth-5}, .t. )
/*
PolyPolygon( hDC, { { nWidth - ::nWPop + If( ::lPressed, 1, 0 ),;
nHeight / 2 - 1 + If( ::lPressed, 1, 0 ) },;
{ nWidth - 7 + If( ::lPressed, 1, 0 ), nHeight / 2 + 1 + ;
If( ::lPressed, 1, 0 ) },;
{ nWidth - 5 + If( ::lPressed, 1, 0 ), nHeight / 2 - 1 + ;
If( ::lPressed, 1, 0 ) },;
{ nWidth - ::nWPop + If( ::lPressed, 1, 0 ), nHeight / 2 - 1 + ;
If( ::lPressed, 1, 0 ) } } )
*/
if ::lBorder .or. ::lPressed .or. ::lMOver
hDarkPen = CreatePen( PS_SOLID, 1, GetSysColor( COLOR_BTNSHADOW ) )
hLightPen = CreatePen( PS_SOLID, 1, GetSysColor( COLOR_BTNHIGHLIGHT ) )
hOldPen = SelectObject( hDC, hLightPen )
MoveTo( hDC, nWidth - ( ::nWPop + 3 ) + If( ::lPressed, 1, 0 ), 1 )
LineTo( hDC, nWidth - ( ::nWPop + 3 ) + If( ::lPressed, 1, 0 ), nHeight - 1 )
SelectObject( hDC, hDarkPen )
MoveTo( hDC, nWidth - ( ::nWPop + 4 ) + If( ::lPressed, 1, 0 ), 1 )
LineTo( hDC, nWidth - ( ::nWPop + 4 ) + If( ::lPressed, 1, 0 ), nHeight - 1 )
SelectObject( hDC, hOldPen )
DeleteObject( hDarkPen )
DeleteObject( hLightPen )
endif
SelectObject( hDC, hOldBrush )
DeleteObject( hBlackBrush )
endif
return nil
//----------------------------------------------------------------------------//