count := 10 // !!!
I := 1
FOR I := 1 TO count // 10
IF nPos = 1 // paints LEFT
@ nRow, nCol IMAGE Image[I] SIZE 6, 12 OF oDlg ;
FILENAME Empty_L PIXEL NOBORDER ADJUST CURSOR oCursorBtn ;
ON CLICK ( pressed := I, ONSELECTRATE( pressed, count, oSay1))
image[I]:LoadBmp( Empty_L )
nPos := 2
ELSE // paints RIGHT
@ nRow, nCol IMAGE Image[I] SIZE 6, 12 OF oDlg ;
FILENAME Empty_R PIXEL NOBORDER ADJUST CURSOR oCursorBtn ;
ON CLICK ( pressed := I, ONSELECTRATE( pressed, count, oSay1))
image[I]:LoadBmp( Empty_R )
nPos := 1
ENDIF
Image[I]:lTransparent := .T.
nCol += 6 // one image = half star-size
Image[I]:bMMoved:= { || ( pressed := I, ONHOVERRATE( pressed, count)) }
Image[I]:bMLeave :={ || ( pressed := I, ONLEAVERATE( pressed, count, oSay1)) }
NEXT
I := 1
FOR I := 1 TO nCount
IF nPos = 1
@ nRow, nCol IMAGE oImage[I] SIZE 6, 12 OF oDlg ;
FILENAME Empty_L PIXEL NOBORDER ADJUST CURSOR oCursorBtn ;
oImage[I]:LoadBmp( Empty_L )
nPos := 2
ELSE
@ nRow, nCol IMAGE oImage[I] SIZE 6, 12 OF oDlg ;
FILENAME Empty_R PIXEL NOBORDER ADJUST CURSOR oCursorBtn ;
oImage[I]:LoadBmp( Empty_R )
nPos := 1
ENDIF
oImage[I]:lTransparent := .T.
nCol += 6
// NOT WORKING !!!
// oImage[I]:bMMoved := { || ONHOVERRATE( I, nCount ) }
// oImage[I]:bMLeave :={ || ONLEAVERATE( I, nCount, oSay1 ) }
NEXT
oImage[1]:bMMoved := { || ONHOVERRATE( 1, nCount ) }
oImage[1]:bMLeave :={ || ONLEAVERATE( 1, nCount, oSay1 ) }
oImage[2]:bMMoved := { || ONHOVERRATE( 2, nCount ) }
oImage[2]:bMLeave :={ || ONLEAVERATE( 2, nCount, oSay1 ) }
...
...
I := 1
nTop := 5
nStar := 1
FOR I := 1 TO 6
cStar := LTRIM(STR(nStar))
@ nTop, 160 IMAGE oStar[I] SIZE 10, 20 OF oDlg ;
FILENAME c_path1 + "Full" + cStar + "_L.bmp" PIXEL NOBORDER ADJUST
oStar[I]:LoadBmp( c_path1 + "Full" + cStar + "_L.bmp" )
oStar[I]:lTransparent := .T.
nTop += 20
cStar := LTRIM(STR(nStar))
nStar++
NEXT
FUNCTION PolyForms(nX,nY,nWidth,nHeight,nLados,nGiro,nPorC, lHalf) // MODIFIED
LOCAL aVert
LOCAL nRadV := nHeight/2
LOCAL nRadH := nWidth/2
LOCAL nAngl := (2*PI)/nLados
LOCAL nAngu,nOAng
LOCAL nCount,nStep
LOCAL nSides := IF(lHalf,Int(nLados/2),nLados) // NEW
DEFAULT nGiro := 0 , ;
nPorC := 100
*
nPorc := Max(0,Min(100,nPorC))
nAngu := (nGiro*PI)/180
IF nPorC = 100
aVert := Array(nLados+1,2)
nStep := 1
ELSE
aVert := Array((nLados*2)+1,2)
nStep := 2
nOAng := nAngl/2
nLados:= nLados*2
nPorC := 9.9+(nPorC*0.9)
ENDIF
*
FOR nCount = 1 TO nSides STEP nStep // MODIFIED
aVert[nCount] := { nY+nRadH+(nRadH*Cos(nAngu)), nX+nRadV+(nRadV*Sin(nAngu)) }
IF nPorC < 100
aVert[nCount+1] := { nY+nRadH+(nRadH*(nPorC/100)*Cos(nAngu+nOAng)), ;
nX+nRadV+(nRadV*(nPorC/100)*Sin(nAngu+nOAng)) }
ENDIF
nAngu += nAngl
NEXT
aVert[nLados+1] := aVert[1]
RETURN aVert
OR
FUNCTION PolyForms(nX,nY,nWidth,nHeight,nLados,nGiro,nPorC, lHalf) // MODIFIED
LOCAL aVert
LOCAL nRadV := nHeight/2
LOCAL nRadH := nWidth/2
LOCAL nAngl := (2*PI)/nLados
LOCAL nAngu,nOAng
LOCAL nCount,nStep
LOCAL nSatrt := IF(lHalf,Int(nLados/2),1) // NEW
DEFAULT nGiro := 0 , ;
nPorC := 100
*
nPorc := Max(0,Min(100,nPorC))
nAngu := (nGiro*PI)/180
IF nPorC = 100
aVert := Array(nLados+1,2)
nStep := 1
ELSE
aVert := Array((nLados*2)+1,2)
nStep := 2
nOAng := nAngl/2
nLados:= nLados*2
nPorC := 9.9+(nPorC*0.9)
ENDIF
*
FOR nCount = nStart TO nLados STEP nStep // MODIFIED
aVert[nCount] := { nY+nRadH+(nRadH*Cos(nAngu)), nX+nRadV+(nRadV*Sin(nAngu)) }
IF nPorC < 100
aVert[nCount+1] := { nY+nRadH+(nRadH*(nPorC/100)*Cos(nAngu+nOAng)), ;
nX+nRadV+(nRadV*(nPorC/100)*Sin(nAngu+nOAng)) }
ENDIF
nAngu += nAngl
NEXT
aVert[nLados+1] := aVert[1]
RETURN aVert
FUNCTION PolyForms(nX,nY,nWidth,nHeight,nLados,nGiro,nPorC, lHalf) // MODIFIED
LOCAL aVert
LOCAL nRadV := nHeight/2
LOCAL nRadH := nWidth/2
LOCAL nAngl := (2*PI)/nLados
LOCAL nAngu,nOAng
LOCAL nCount,nStep
LOCAL nSides := IF(lHalf,Int(nLados/2),nLados) // NEW
DEFAULT nGiro := 0 , ;
nPorC := 100
*
nPorc := Max(0,Min(100,nPorC))
nAngu := (nGiro*PI)/180
IF nPorC = 100
aVert := Array(nSides+1,2) // MODIFIED
nStep := 1
ELSE
aVert := Array((nSides*2)+1,2) // MODIFIED
nStep := 2
nOAng := nAngl/2
nSide := nSide*2 // MODIFIED
nPorC := 9.9+(nPorC*0.9)
ENDIF
*
FOR nCount = 1 TO nSides STEP nStep // MODIFIED
aVert[nCount] := { nY+nRadH+(nRadH*Cos(nAngu)), nX+nRadV+(nRadV*Sin(nAngu)) }
IF nPorC < 100
aVert[nCount+1] := { nY+nRadH+(nRadH*(nPorC/100)*Cos(nAngu+nOAng)), ;
nX+nRadV+(nRadV*(nPorC/100)*Sin(nAngu+nOAng)) }
ENDIF
nAngu += nAngl
NEXT
ATail(aVert) := aVert[1]
RETURN aVert
OR
FUNCTION PolyForms(nX,nY,nWidth,nHeight,nLados,nGiro,nPorC, lHalf) // MODIFIED
LOCAL aVert
LOCAL nRadV := nHeight/2
LOCAL nRadH := nWidth/2
LOCAL nAngl := (2*PI)/nLados
LOCAL nAngu,nOAng
LOCAL nCount,nStep
LOCAL nSides := IF(lHalf,Int(nLados/2),nLados) // NEW
LOCAL nStart := IF(lHalf,Int(nLados/2)+1,1) // NEW MODIFIED
LOCAL nQ := 1 // NEW
DEFAULT nGiro := 0 , ;
nPorC := 100
*
nPorc := Max(0,Min(100,nPorC))
nAngu := (nGiro*PI)/180
IF nPorC = 100
aVert := Array(nSides+1,2) // MODIFIED
nStep := 1
ELSE
aVert := Array((nSides*2)+1,2) // MODIFIED
nStep := 2
nOAng := nAngl/2
nLados:= nLados*2
nPorC := 9.9+(nPorC*0.9)
ENDIF
*
FOR nCount = nStart TO nLados STEP nStep // MODIFIED
aVert[nQ] := { nY+nRadH+(nRadH*Cos(nAngu)), nX+nRadV+(nRadV*Sin(nAngu)) } // MODIFIED
IF nPorC < 100
aVert[nQ+1] := { nY+nRadH+(nRadH*(nPorC/100)*Cos(nAngu+nOAng)), ; // MODIFIED
nX+nRadV+(nRadV*(nPorC/100)*Sin(nAngu+nOAng)) }
ENDIF
nAngu += nAngl
++nQ // ADDED
NEXT
ATail(aVert) := aVert[1]
RETURN aVert
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 84 guests