| 1 | REBOL [
|
|---|
| 2 | Title: "RebGUI Documentation"
|
|---|
| 3 | Owner: "Ashley G. Trüter"
|
|---|
| 4 | Purpose: "Documents & demonstrates RebGUI widgets, requestors and functions."
|
|---|
| 5 | History: {
|
|---|
| 6 | 110 Initial release
|
|---|
| 7 | 111 References new requestors object
|
|---|
| 8 | 112 Added color panel
|
|---|
| 9 | 117 Added space after drop-list, edit-list and menu widgets
|
|---|
| 10 | }
|
|---|
| 11 | ]
|
|---|
| 12 |
|
|---|
| 13 | do %rebgui.r
|
|---|
| 14 |
|
|---|
| 15 | make object! [
|
|---|
| 16 |
|
|---|
| 17 | widgets: sort find first ctx-rebgui/widgets 'anim
|
|---|
| 18 | requestors: find first ctx-rebgui/requestors 'alert
|
|---|
| 19 | functions: find first ctx-rebgui/functions 'append-widget
|
|---|
| 20 | objects: copy [rebface ctx-rebgui/behaviors ctx-rebgui/colors ctx-rebgui/edit ctx-rebgui/effects ctx-rebgui/locale* ctx-rebgui/on-fkey ctx-rebgui/sizes ctx-rebgui/subface]
|
|---|
| 21 |
|
|---|
| 22 | sizes: make object! [
|
|---|
| 23 | view: to integer! (length? mold/only get ctx-rebgui/view*) / 1024
|
|---|
| 24 | locale: to integer! (length? mold/only get ctx-rebgui/locale*) / 1024
|
|---|
| 25 | rebgui: to integer! (length? mold/only get ctx-rebgui) / 1024 - view - locale
|
|---|
| 26 | widgets: to integer! (length? mold/only get ctx-rebgui/widgets) / 1024
|
|---|
| 27 | requestors: to integer! (length? mold/only get ctx-rebgui/requestors) / 1024
|
|---|
| 28 | functions: to integer! (length? mold/only get ctx-rebgui/functions) / 1024
|
|---|
| 29 | objects: rebgui - widgets - requestors - functions
|
|---|
| 30 | ]
|
|---|
| 31 |
|
|---|
| 32 | func-help: make function! ['word /local s p1 p2] [
|
|---|
| 33 | p1: :print
|
|---|
| 34 | p2: :prin
|
|---|
| 35 | s: make string! 4096
|
|---|
| 36 | print: make function! [data] [insert tail s form reduce data insert tail s "^/"]
|
|---|
| 37 | prin: make function! [data] [insert tail s form reduce data]
|
|---|
| 38 | help :word
|
|---|
| 39 | print: :p1
|
|---|
| 40 | prin: :p2
|
|---|
| 41 | trim/tail s
|
|---|
| 42 | ]
|
|---|
| 43 |
|
|---|
| 44 | show-ref: make function! [word face /widget /requestor /object /local txt lnk lay arg] [
|
|---|
| 45 | all [word? word word: to word! word]
|
|---|
| 46 | txt: either widget [examine/no-print :word] [func-help :word]
|
|---|
| 47 | lnk: case [
|
|---|
| 48 | widget [http://trac.geekisp.com/rebgui/browser/widgets/]
|
|---|
| 49 | requestor [http://trac.geekisp.com/rebgui/browser/requestors/]
|
|---|
| 50 | object [http://trac.geekisp.com/rebgui/browser/]
|
|---|
| 51 | true [http://trac.geekisp.com/rebgui/browser/functions/]
|
|---|
| 52 | ]
|
|---|
| 53 | if requestor [
|
|---|
| 54 | arg: switch/default word [
|
|---|
| 55 | request-menu [[ face ["A" [] "B" [] "C" []] ]]
|
|---|
| 56 | request-progress [[ 10 [loop 10 [wait .5 step]] ]]
|
|---|
| 57 | request-spellcheck [[ make rebface [text: "wordz"] ]]
|
|---|
| 58 | splash [[ %images/logo.png unview ]]
|
|---|
| 59 | ][
|
|---|
| 60 | copy "Text."
|
|---|
| 61 | ]
|
|---|
| 62 | ]
|
|---|
| 63 | lay: compose/deep [
|
|---|
| 64 | after 1
|
|---|
| 65 | heading (either object [form word] [uppercase/part form word 1])
|
|---|
| 66 | panel 150 data [
|
|---|
| 67 | after 2
|
|---|
| 68 | label 20 "Source" link (rejoin [lnk either object [%rebgui-ctx] [word] %.r])
|
|---|
| 69 | label 20 "Size" text (remove reform [to money! (length? mold/only get either widget [ctx-rebgui/widgets/:word] [either word? word [word] [do word]]) / 1024 "Kb"])
|
|---|
| 70 | ]
|
|---|
| 71 | ]
|
|---|
| 72 | all [
|
|---|
| 73 | widget
|
|---|
| 74 | insert tail lay compose/deep [panel 150 data [(load trim second parse/all txt "^/")]]
|
|---|
| 75 | all [
|
|---|
| 76 | find [drop-list edit-list menu] word
|
|---|
| 77 | insert tail last lay 'return
|
|---|
| 78 | insert tail last lay 'text
|
|---|
| 79 | ]
|
|---|
| 80 | ]
|
|---|
| 81 | all [
|
|---|
| 82 | requestor
|
|---|
| 83 | insert tail lay compose/deep [panel 150 data [button 45x15 (form word) [(word) (arg)]]]
|
|---|
| 84 | ]
|
|---|
| 85 | insert tail lay [panel 150 data [text txt font [name: font-fixed]]]
|
|---|
| 86 | lay: ctx-rebgui/layout/only lay
|
|---|
| 87 | face/pane/1/pane: lay
|
|---|
| 88 | face/pane/1/size: lay/size
|
|---|
| 89 | face/action/on-resize face
|
|---|
| 90 | if scroll/picked = 2 [face/pane/2/data: 0]
|
|---|
| 91 | show face
|
|---|
| 92 | ]
|
|---|
| 93 |
|
|---|
| 94 | scroll: none
|
|---|
| 95 |
|
|---|
| 96 | do show-tour: make function! [] [
|
|---|
| 97 | display "RebGUI Documentation" [
|
|---|
| 98 | image %images/logo.png tip "RebGUI logo"
|
|---|
| 99 | return
|
|---|
| 100 | tab-panel data [
|
|---|
| 101 | "Widgets" [
|
|---|
| 102 | text-list 40x112 data widgets [
|
|---|
| 103 | show-ref/widget face/selected page1
|
|---|
| 104 | ]
|
|---|
| 105 | page1: scroll-panel 162x112 options [offset] data [
|
|---|
| 106 | after 1
|
|---|
| 107 | heading "Widgets"
|
|---|
| 108 | panel 150 data [
|
|---|
| 109 | after 2
|
|---|
| 110 | label 20 "Source" link http://trac.geekisp.com/rebgui/browser/rebgui-widgets.r
|
|---|
| 111 | label 20 "Size" text (reform [sizes/widgets "Kb"])
|
|---|
| 112 | label 20 "Number" text (form length? widgets)
|
|---|
| 113 | ]
|
|---|
| 114 | panel 150 data [
|
|---|
| 115 | text (func-help ctx-rebgui/widgets) font [name: font-fixed]
|
|---|
| 116 | ]
|
|---|
| 117 | ]
|
|---|
| 118 | ]
|
|---|
| 119 | "Requestors" [
|
|---|
| 120 | text-list 40x112 data requestors [
|
|---|
| 121 | show-ref/requestor face/selected page2
|
|---|
| 122 | ]
|
|---|
| 123 | page2: scroll-panel 162x112 options [offset] data [
|
|---|
| 124 | after 1
|
|---|
| 125 | heading "Requestors"
|
|---|
| 126 | panel 150 data [
|
|---|
| 127 | after 2
|
|---|
| 128 | label 20 "Source" link http://trac.geekisp.com/rebgui/browser/rebgui-requestors.r
|
|---|
| 129 | label 20 "Size" text (reform [sizes/requestors "Kb"])
|
|---|
| 130 | label 20 "Number" text (form length? requestors)
|
|---|
| 131 | ]
|
|---|
| 132 | panel 150 data [
|
|---|
| 133 | text (func-help ctx-rebgui/requestors) font [name: font-fixed]
|
|---|
| 134 | ]
|
|---|
| 135 | ]
|
|---|
| 136 | ]
|
|---|
| 137 | "Functions" [
|
|---|
| 138 | text-list 40x112 data functions [
|
|---|
| 139 | show-ref face/selected page3
|
|---|
| 140 | ]
|
|---|
| 141 | page3: scroll-panel 162x112 options [offset] data [
|
|---|
| 142 | after 1
|
|---|
| 143 | heading "Functions"
|
|---|
| 144 | panel 150 data [
|
|---|
| 145 | after 2
|
|---|
| 146 | label 20 "Source" link http://trac.geekisp.com/rebgui/browser/rebgui-functions.r
|
|---|
| 147 | label 20 "Size" text (reform [sizes/functions "Kb"])
|
|---|
| 148 | label 20 "Number" text (form length? functions)
|
|---|
| 149 | ]
|
|---|
| 150 | panel 150 data [
|
|---|
| 151 | text (func-help ctx-rebgui/functions) font [name: font-fixed]
|
|---|
| 152 | ]
|
|---|
| 153 | ]
|
|---|
| 154 | ]
|
|---|
| 155 | "Objects" [
|
|---|
| 156 | text-list 40x112 data objects [
|
|---|
| 157 | show-ref/object face/selected page4
|
|---|
| 158 | ]
|
|---|
| 159 | page4: scroll-panel 162x112 options [offset] data [
|
|---|
| 160 | after 1
|
|---|
| 161 | heading "Objects"
|
|---|
| 162 | panel 150 data [
|
|---|
| 163 | after 2
|
|---|
| 164 | label 20 "Source" link http://trac.geekisp.com/rebgui/browser/rebgui-ctx.r
|
|---|
| 165 | label 20 "Size" text (reform [sizes/objects "Kb"])
|
|---|
| 166 | label 20 "Number" text (form length? objects)
|
|---|
| 167 | ]
|
|---|
| 168 | panel 150 data [
|
|---|
| 169 | text (func-help ctx-rebgui) font [name: font-fixed]
|
|---|
| 170 | ]
|
|---|
| 171 | ]
|
|---|
| 172 | ]
|
|---|
| 173 | "Colors" [
|
|---|
| 174 | group-box "Theme" data [
|
|---|
| 175 | label-size 25x10
|
|---|
| 176 | text-size -1x10
|
|---|
| 177 | after 3
|
|---|
| 178 | label "page" pill ctx-rebgui/colors/page text "Main background^/Reversed text"
|
|---|
| 179 | label "text" pill ctx-rebgui/colors/text text "Normal text"
|
|---|
| 180 | label "theme-light" pill ctx-rebgui/colors/theme-light text "Over / selection background"
|
|---|
| 181 | label "theme-dark" pill ctx-rebgui/colors/theme-dark text "Heading background^/Edit edge"
|
|---|
| 182 | label "state-light" pill ctx-rebgui/colors/state-light text "Temporary state (e.g. button down)"
|
|---|
| 183 | label "state-dark" pill ctx-rebgui/colors/state-dark text "Permanent state (e.g. radio selection)"
|
|---|
| 184 | label "outline-light" pill ctx-rebgui/colors/outline-light text "Info background^/Non-edit edge^/Slider background"
|
|---|
| 185 | label "outline-dark" pill ctx-rebgui/colors/outline-dark text "Informational text"
|
|---|
| 186 | ]
|
|---|
| 187 | ]
|
|---|
| 188 | ]
|
|---|
| 189 | return
|
|---|
| 190 | bar
|
|---|
| 191 | reverse
|
|---|
| 192 | button "Close" [quit]
|
|---|
| 193 | button "UI" [if request-ui [unview/all show-tour]]
|
|---|
| 194 | button "Stats" [
|
|---|
| 195 | display "Stats" [
|
|---|
| 196 | label-size 20
|
|---|
| 197 | after 2
|
|---|
| 198 | label "Memory" text (reform [to integer! system/stats / 1024 / 1024 "Mb"])
|
|---|
| 199 | label "Source" text (reform [sizes/rebgui "Kb"])
|
|---|
| 200 | pie-chart 40x40 data [
|
|---|
| 201 | "Widgets" red sizes/widgets
|
|---|
| 202 | "Requestors" green sizes/requestors
|
|---|
| 203 | "Functions" blue sizes/functions
|
|---|
| 204 | "Objects" yellow sizes/objects
|
|---|
| 205 | ]
|
|---|
| 206 | return
|
|---|
| 207 | bar
|
|---|
| 208 | reverse
|
|---|
| 209 | button "Close" [unview/only face/parent-face]
|
|---|
| 210 | ]
|
|---|
| 211 | ]
|
|---|
| 212 | scroll: radio-group 30x5 data [1 "Sticky" "Reset"]
|
|---|
| 213 | label "Scroll:"
|
|---|
| 214 | ]
|
|---|
| 215 | ]
|
|---|
| 216 | ]
|
|---|
| 217 |
|
|---|
| 218 | do-events |
|---|