Code: Select all
#include "FiveWin.ch"
Function Main()
Local obtn,oWnd
Local oGrayBrush := CreateSolidBrush( GetSysColor(15) )
local hDC := GetDC()
DEFINE WINDOW oWnd TITLE "Testing button" ;
FROM 3, 3 TO 20, 80 ;
COLOR CLR_BLACK, GetSysColor( COLOR_BTNFACE )
obtn:=Arrow_SX(hDC,11, oWnd:nWidth - 25 + 2 , oGrayBrush)
ACTIVATE WINDOW oWnd
Return nil
static Function DrawPolygon( hDC, aPoints, nColor )
local n
local nLen := len( aPoints )
local hPen, hOldPen
if nColor != nil
hPen := CreatePen( PS_SOLID,1,nColor)
hOldPen := SelectObject( hDC, hPen )
endif
Moveto( hDC, aPoints[1,1], aPoints[1,2])
for n := 2 to nLen
Lineto( hDC, aPoints[n,1], aPoints[n,2])
next
Lineto( hDC, aPoints[1,1], aPoints[1,2])
if nColor != nil
SelectObject(hDC,hOldPen)
DeleteObject( hPen )
endif
return 0
Function Arrow_SX ( hDC,nTop,nLeft, nColor )
DrawPolygon( hDC, { {nLeft+4,nTop } ,;
{nLeft ,nTop+4 } ,;
{nLeft+4,nTop+8 } ,;
{nLeft+4,nTop } }, nColor )
return 0