(include "sci.sh")
(use "Main")
(use "Class_255_0")
(script 940)



(procedure public (proc940_0 param1)
    (var temp0, newDialog, newDText, newDTextNsRight, theNewDTextNsBottom_2, newDTextNsBottom, theNewDTextNsBottom, temp7, temp8, temp9, temp10, temp11, temp12, temp13, temp14)
    = temp11 -1
    = temp10 temp11
    = theNewDTextNsBottom 0
    = newDTextNsBottom theNewDTextNsBottom
    = theNewDTextNsBottom_2 newDTextNsBottom
    = newDTextNsRight theNewDTextNsBottom_2
    = temp12 0
    = temp14 0
    = newDialog (Dialog:new())
    (send newDialog:window(gSq4Win))
    = temp0 0
    (while (< temp0 paramTotal)
        (switch (= temp8 param1[temp0])
            (case 101
                = newDTextNsBottom (send newDText:nsBottom)
                = newDTextNsRight 0
            )
            (case 67
                = temp10 param1[++temp0]
                = temp11 param1[++temp0]
            )
            (case 80
                = temp12 param1[++temp0]
            )
            (case 116
                = temp14 param1[++temp0]
            )
            (default 
                ++temp0
                (switch (temp8)
                    (case 26
                        = newDText (DText:new())
                        (send newDText:text(param1[temp0]))
                    )
                    (case 81
                        = newDText (DButton:new())
                        (send newDText:
                            text(param1[temp0])
                            value(param1[++temp0])
                        )
                    )
                    (case 41
                        = newDText (DEdit:new())
                        (send newDText:
                            text(param1[temp0])
                            max(param1[++temp0])
                        )
                    )
                    (default 
                        = newDText (DText:new())
                        (send newDText:text(param1[--temp0]))
                    )
                )
                (if ((< (+ temp0 1) paramTotal) and (== param1[(+ temp0 1)] 4))
                    ++temp0
                    = newDTextNsRight (+ newDTextNsRight param1[++temp0])
                )
                (if ((< (+ temp0 1) paramTotal) and (== param1[(+ temp0 1)] 3))
                    ++temp0
                    = newDTextNsBottom (+ newDTextNsBottom param1[++temp0])
                )
                (send newDText:
                    setSize()
                    moveTo(+ newDTextNsRight 4 + newDTextNsBottom 4)
                )
                (send newDialog:add(newDText))
                = newDTextNsRight (send newDText:nsRight)
            )
        )
        ++temp0
    )
    (send newDialog:
        setSize()
        center()
    )
    (send newDialog:moveTo(
        (if (== -1 temp10)
            (send newDialog:nsLeft)
        )(else
            temp10
        )
 
        (if (== -1 temp11)
            (send newDialog:nsTop)
        )(else
            temp11
        )
))
    (if (temp12)
        (send newDialog:text(temp12))
    )
    = temp13 (send newDialog:at(temp14))
    (if (not & $0001 (send temp13:state))
        = temp13 0
    )
    = temp7 (send newDialog:
            open(
                (if (temp12)
                    4
                )(else
                    0
                )
 -1)
            doit(temp13)
        )
    (if (IsObject(temp7))
        (if ((send temp7:isKindOf(DButton)))
            = temp7 (send temp7:value)
        )(else
            = temp7 1
        )
    )
    (send newDialog:dispose())
    return temp7
)


