| |
|
|
Jörg Sellmeyer | Hi,
i will Controls of/ one designed Size on of/ one pretended way steady distribute. the works too but it shining me yet something unelegant To his. gives it a better Solution as these whole Rechnerei?
Proc RClickedMultiItem
Parameters b&[],wparam&
Declare I%
I% = IndexOf(b&[],wparam&)
If (%childMessage = 516) And (I% > -1)
Return wparam&
Endif
ENDPROC
Proc ClickedMultiItem
Parameters b&[],getfocus%
Declare I%
I% = IndexOf(b&[],getfocus%)
If (I%) > -1
Return Clicked(getfocus%)
EndIf
ENDPROC
Class Raster = count%,\
Raster@
Proc Raster.Raster
Parameters parent&,grp&[],wide%,hoehe%,top%,rasterweite%,rasterhoehe%,minRand%,minAbstand%
Declare number%,factor!,stood off%,remainder%,edge%
Case wide% = 0:wide% = Width(parent&)
Case hoehe% = 0:hoehe% = Width(parent&)
Case rasterhoehe% = 0:rasterhoehe% = rasterweite%
Dec wide%,minRand%
number% = wide% \ rasterweite%
remainder% = wide% - rasterweite% * number%
stood off% = remainder% \ (number% + 1)
If stood off% < minAbstand%
Dec wide%,minAbstand%
number% = wide% \ rasterweite%
remainder% = wide% - rasterweite% * number%
stood off% = remainder% \ (number% + 1)
EndIf
factor! = NachKomma(remainder% / (number% + 1)) * number%
edge% = factor! \ 2 + minRand%
WhileLoop 0,number%-1
grp&[&Loop] = Create("Button",%hwnd,Str $(&Loop + 1),edge% + stood off% + &Loop * (rasterweite% + stood off%),top%,rasterweite%,rasterhoehe%)
Wend
.count% = SizeOf(grp&[])
Return .count%
ENDPROC
Proc NachKomma
Parameters f!
Return f! - Int(f!)
ENDPROC
Declare btn&[]
Declare grp#
Window Style $1F
Window 400 + Rnd(600),600
Cls
grp# = New(Raster,%hwnd,btn&[],0,0,120,96,96,4)
Print grp#.count%,SizeOf(btn&[])
Randomize
While 1
WaitInput
If ClickedMultiItem(btn&[],%getfocus)
Window Title GetText$(%getfocus)
ElseIf GetFocus(%hwnd)
DestroyWindow(btn&[])
Dispose grp#
Window 400 + Rnd(600),600
Cls
Clear btn&[]
grp# = New(Raster,%hwnd,btn&[],0,0,120,96,96,4,8)
Print grp#.count%,SizeOf(btn&[])
EndIf
Wend
|
|
|
| |
|
|
|
| If not by HTML his "darf", with which it one "Klax" would, then comes one circa CreateWindow or. SetWindowPos imho not around. |
|
|
| |
|
|