| |
|
|
Julian Schmidt | Vlt peux quelque chose comme oui qui gebrauchen.
class wuerfel = hdl&, auge&, bgfarbe&, farbe&, Init@, mettons@, Zaehlen@, la couleur@
Déclarer wuerfel1#, hintergrund&
CLS
Faible wuerfel1#, wuerfel
wuerfel1#.la couleur(RGB(255,100,100),RGB(230,230,230))
wuerfel1#.Init(%hwnd,10,10,50,50)
WhileNot iskey(27)
Waitinput
cas getfocus(wuerfel1#.hdl&) : wuerfel1#.Zaehlen()
SetFocus(%hwnd)
Endwhile
Dispose wuerfel1#
Proc wuerfel.Init
Paramètres Dlg&, X1&, Y1&, X2&, Y2&
.hdl& = Créer("PicButton",Dlg&,hintergrund&, X1&, Y1&, X2&, Y2&)
.auge& = 1
.mettons(.auge&)
ENDPROC
Proc wuerfel.la couleur
Paramètres bgfarbe&,farbe&
.bgfarbe& = bgfarbe&
.farbe& = farbe&
ENDPROC
Proc wuerfel.mettons
Paramètres auge&
Déclarer HPic&, SizeX&, SizeY&
HPic& = Créer("hNewPic", width(.hdl&), height(.hdl&), RGB(255,255,255))
SizeX& = width(.hdl&)*0.2
SizeY& = height(.hdl&)*0.2
Début de peinture HPic&
UseBrush 1,.bgfarbe&
RoundRect 0,0 - %BMPX,%BMPY; 10,10
UseBrush 1,.farbe&
Cas auge&=1 : Circle("0.5|0.5")
Cas auge&=2 : Circle("0.33|0.5","0.66|0.5")
Cas auge&=3 : Circle("0.25|0.25","0.5|0.5","0.75|0.75")
Cas auge&=4 : Circle("0.25|0.25","0.75|0.25","0.25|0.75","0.75|0.75")
Cas auge&=5 : Circle("0.5|0.5","0.25|0.25","0.75|0.25","0.25|0.75","0.75|0.75")
Cas 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&)
Retour 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
Cas .auge&>6 : .auge& = 1
.mettons(.auge&)
ENDPROC
|
|
|
| |
|
|