| 1 | REBOL [
|
|---|
| 2 | Title: "RebGUI requestors"
|
|---|
| 3 | Owner: "Ashley G. Trüter"
|
|---|
| 4 | Purpose: "Requestor functions."
|
|---|
| 5 | Acknowledgements: {
|
|---|
| 6 | request-date based on the work of Carl Sassenrath's VID function of the same name
|
|---|
| 7 | request-file based on the work of Carl Sassenrath's VID function of the same name
|
|---|
| 8 | }
|
|---|
| 9 | History: {
|
|---|
| 10 | 111 Initial version
|
|---|
| 11 | }
|
|---|
| 12 | ]
|
|---|
| 13 |
|
|---|
| 14 | requestors: make object! [
|
|---|
| 15 |
|
|---|
| 16 | color-spec: copy [text-size 15 margin 2x2 space 1x1]
|
|---|
| 17 |
|
|---|
| 18 | do make function! [/local bx r g b i] [
|
|---|
| 19 | bx: 4 + length? locale*/colors
|
|---|
| 20 | r: bx - 1
|
|---|
| 21 | g: bx + 2
|
|---|
| 22 | b: bx + 4
|
|---|
| 23 | i: 1
|
|---|
| 24 | foreach color locale*/colors [
|
|---|
| 25 | insert tail color-spec compose/deep [
|
|---|
| 26 | box 5x5 (color) [face/parent-face/pane/(bx)/action/on-click face] edge [] feel [
|
|---|
| 27 | over: make function! [face act pos /local p][
|
|---|
| 28 | all [
|
|---|
| 29 | act
|
|---|
| 30 | p: face/parent-face/pane
|
|---|
| 31 | p/(bx)/color: face/color
|
|---|
| 32 | p/(r)/text: form face/color/1
|
|---|
| 33 | p/(g)/text: form face/color/2
|
|---|
| 34 | p/(b)/text: form face/color/3
|
|---|
| 35 | set-title face/parent-face (uppercase/part form color 1)
|
|---|
| 36 | ]
|
|---|
| 37 | ]
|
|---|
| 38 | ]
|
|---|
| 39 | ]
|
|---|
| 40 | all [zero? i // 8 insert tail color-spec 'return]
|
|---|
| 41 | i: i + 1
|
|---|
| 42 | ]
|
|---|
| 43 | all ['return <> last color-spec insert tail color-spec 'return]
|
|---|
| 44 | ]
|
|---|
| 45 |
|
|---|
| 46 | read-dir: make function! [path /local blk dirs] [
|
|---|
| 47 | blk: copy []
|
|---|
| 48 | if dirs: attempt [read path] [
|
|---|
| 49 | foreach dir remove-each file sort dirs [any [#"/" <> last file #"." = first file]] [
|
|---|
| 50 | insert tail blk head remove back tail dir
|
|---|
| 51 | insert/only tail blk read-dir dirize path/:dir
|
|---|
| 52 | if empty? last blk [remove back tail blk]
|
|---|
| 53 | ]
|
|---|
| 54 | ]
|
|---|
| 55 | blk
|
|---|
| 56 | ]
|
|---|
| 57 |
|
|---|
| 58 | #include %requestors/alert.r
|
|---|
| 59 | #include %requestors/question.r
|
|---|
| 60 | #include %requestors/request-char.r
|
|---|
| 61 | #include %requestors/request-color.r
|
|---|
| 62 | #include %requestors/request-date.r
|
|---|
| 63 | #include %requestors/request-dir.r
|
|---|
| 64 | #include %requestors/request-file.r
|
|---|
| 65 | #include %requestors/request-font.r
|
|---|
| 66 | #include %requestors/request-menu.r
|
|---|
| 67 | #include %requestors/request-password.r
|
|---|
| 68 | #include %requestors/request-progress.r
|
|---|
| 69 | #include %requestors/request-spellcheck.r
|
|---|
| 70 | #include %requestors/request-ui.r
|
|---|
| 71 | #include %requestors/request-value.r
|
|---|
| 72 | #include %requestors/splash.r
|
|---|
| 73 | ]
|
|---|
| 74 |
|
|---|
| 75 | foreach word find first requestors 'alert [
|
|---|
| 76 | either word = 'request-file [
|
|---|
| 77 | all [
|
|---|
| 78 | find [2 3] fourth system/version
|
|---|
| 79 | value? 'local-request-file
|
|---|
| 80 | set to word! word get in requestors word
|
|---|
| 81 | ]
|
|---|
| 82 | ][
|
|---|
| 83 | set to word! word get in requestors word
|
|---|
| 84 | ]
|
|---|
| 85 | ] |
|---|