| |
|
|
Julian Schmidt | Vlt kann sowas ja wer gebrauchen.
class wuerfel = hdl&, auge&, bgfarbe&, farbe&, Init@, Setzen@, Zaehlen@, Farbe@
Declare wuerfel1#, hintergrund&
CLS
Dim wuerfel1#, wuerfel
wuerfel1#.Farbe(RGB(255,100,100),RGB(230,230,230))
wuerfel1#.Init(%hwnd,10,10,50,50)
WhileNot iskey(27)
Waitinput
case getfocus(wuerfel1#.hdl&) : wuerfel1#.Zaehlen()
Setfocus(%hwnd)
EndWhile
Dispose wuerfel1#
Proc wuerfel.Init
Parameters Dlg&, X1&, Y1&, X2&, Y2&
.hdl& = Create("PicButton",Dlg&,hintergrund&, X1&, Y1&, X2&, Y2&)
.auge& = 1
.Setzen(.auge&)
EndProc
Proc wuerfel.Farbe
Parameters bgfarbe&,farbe&
.bgfarbe& = bgfarbe&
.farbe& = farbe&
EndProc
Proc wuerfel.Setzen
Parameters auge&
Declare HPic&, SizeX&, SizeY&
HPic& = Create("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&)
Return 1
Proc Circle
whileloop %PCount
Ellipse (%BMPX-SizeX&)*Val(SubStr$(@$(&loop),1,"|")),(%BMPY-SizeY&)*Val(SubStr$(@$(&loop),2,"|")) - (%BMPX-SizeX&)*Val(SubStr$(@$(&loop),1,"|"))+SizeX&, (%BMPY-SizeY&)*Val(SubStr$(@$(&loop),2,"|"))+SizeY&
Endwhile
EndProc
EndProc
Proc wuerfel.Zaehlen
.auge& = .auge&+1
Case .auge&>6 : .auge& = 1
.Setzen(.auge&)
EndProc
|
|
|
| |
|
|