English
Forum

Control gleichmässig distribute Raster

 

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

 
XProfan X3
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
05/16/18  
 



If not by HTML his "darf", with which it one "Klax" would, then comes one circa CreateWindow or. SetWindowPos imho not around.
 
05/29/18  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.794 Views

Untitledvor 0 min.
Stringray01/05/22
iF10/31/20
Jörg Sellmeyer06/23/20
RudiB.04/04/20
More...

Themeninformationen

this Topic has 2 subscriber:

iF (1x)
Jörg Sellmeyer (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie