| |
|
|
Julian Schmidt | Vlt kann algo como sí wer gebrauchen.
class wuerfel = hdl&, auge&, bgfarbe&, farbe&, Init@, Setzen@, Zaehlen@, Farbe@
Declarar wuerfel1#, hintergrund&
CLS
Dim wuerfel1#, wuerfel
wuerfel1#.Farbe(RGB(255,100,100),RGB(230,230,230))
wuerfel1#.Init(%hwnd,10,10,50,50)
Sinestar encargado iskey(27)
Waitinput
caso getfocus(wuerfel1#.hdl&) : wuerfel1#.Zaehlen()
Setfocus(%hwnd)
EndWhile
Disponer wuerfel1#
Proc wuerfel.Init
Parámetros Dlg&, X1&, Y1&, X2&, Y2&
.hdl& = Crear("PicButton",Dlg&,hintergrund&, X1&, Y1&, X2&, Y2&)
.auge& = 1
.Setzen(.auge&)
ENDPROC
Proc wuerfel.Farbe
Parámetros bgfarbe&,farbe&
.bgfarbe& = bgfarbe&
.farbe& = farbe&
ENDPROC
Proc wuerfel.Setzen
Parámetros auge&
Declarar HPic&, SizeX&, SizeY&
HPic& = Crear("hNewPic", width(.hdl&), height(.hdl&), RGB(255,255,255))
SizeX& = width(.hdl&)*0.2
SizeY& = height(.hdl&)*0.2
StartPaint HPic&
UseBrush 1,.bgfarbe&
RoundRect 0,0 - %BMPX,%BMPY; 10,10
UseBrush 1,.farbe&
Case auge&=1 : Circle("0.5|0.5")
Case auge&=2 : Circle("0.33|0.5","0.66|0.5")
Case auge&=3 : Circle("0.25|0.25","0.5|0.5","0.75|0.75")
Case auge&=4 : Circle("0.25|0.25","0.75|0.25","0.25|0.75","0.75|0.75")
Case auge&=5 : Circle("0.5|0.5","0.25|0.25","0.75|0.25","0.25|0.75","0.75|0.75")
Case auge&=6 : Circle("0.25|0.2","0.75|0.2","0.25|0.8","0.75|0.8","0.25|0.5","0.75|0.5")
EndPaint
SendMessage(.hdl&,$F7 | 247,0,HPic&)
Volver 1
Proc Circle
whileloop %PCount
Ellipse (%BMPX-SizeX&)*Val(Substr$(@$(&bucle),1,"|")),(%BMPY-SizeY&)*Val(Substr$(@$(&bucle),2,"|")) - (%BMPX-SizeX&)*Val(Substr$(@$(&bucle),1,"|"))+SizeX&, (%BMPY-SizeY&)*Val(Substr$(@$(&bucle),2,"|"))+SizeY&
Endwhile
ENDPROC
ENDPROC
Proc wuerfel.Zaehlen
.auge& = .auge&+1
Case .auge&>6 : .auge& = 1
.Setzen(.auge&)
ENDPROC
|
|
|
| |
|
|