< Rebol Programming
USAGE:
REQUEST-PASS /offset xy /user username /only /title title-text
DESCRIPTION:
Requests a username and password.
REQUEST-PASS is a function value.
REFINEMENTS
- /offset
- xy -- (Type: any)
- /user
- username -- (Type: any)
- /only -- Password only.
- /title
- title-text -- (Type: any)
SOURCE CODE
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]]]
]
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.