Last modified on 13 November 2012, at 10:51

REBOL Programming/request-pass

USAGE:Edit

REQUEST-PASS /offset xy /user username /only /title title-text 

DESCRIPTION:Edit

Requests a username and password.

REQUEST-PASS is a function value.

REFINEMENTSEdit

  • /offset
    • xy -- (Type: any)
  • /user
    • username -- (Type: any)
  • /only -- Password only.
  • /title
    • title-text -- (Type: any)

SOURCE CODEEdit

request-pass: func [
    "Requests a username and password." 
    /offset xy 
    /user username 
    /only "Password only." 
    /title title-text
][
    if none? user [username: copy ""] 
    pass-lay: layout compose [
        style tx text 40x24 middle right 
        across origin 10x10 space 2x4 
        h3 (either title [title-text] [either only ["Enter password:"] ["Enter username and password:"]]) 
        return 
        (either only [[]] [[tx "User:" userf: field username return]]) 
        tx "Pass:" pass: field hide [ok: yes hide-popup] with [flags: [return tabbed]] return 
        pad 140 
        btn-enter 50 [ok: yes hide-popup] 
        btn-cancel 50 #"^[" [hide-popup]
    ] 
    ok: no 
    focus either only [pass] [userf] 
    either offset [inform/offset pass-lay xy] [inform pass-lay] 
    all [ok either only [pass/data] [reduce [userf/data pass/data]]]
]