Changeset 75
- Timestamp:
- 04/09/07 04:15:48 (20 months ago)
- Files:
-
- 44 modified
-
create-distribution.r (modified) (1 diff)
-
functions/display.r (modified) (2 diffs)
-
functions/examine.r (modified) (3 diffs)
-
rebgui-ctx.r (modified) (2 diffs)
-
rebgui-edit.r (modified) (5 diffs)
-
rebgui-layout.r (modified) (5 diffs)
-
rebgui-widgets.r (modified) (7 diffs)
-
rebgui.r (modified) (80 diffs)
-
tour.r (modified) (6 diffs)
-
widgets/anim.r (modified) (1 diff)
-
widgets/area.r (modified) (2 diffs)
-
widgets/arrow.r (modified) (2 diffs)
-
widgets/bar.r (modified) (1 diff)
-
widgets/box.r (modified) (1 diff)
-
widgets/button.r (modified) (2 diffs)
-
widgets/calendar.r (modified) (1 diff)
-
widgets/check-group.r (modified) (2 diffs)
-
widgets/check.r (modified) (2 diffs)
-
widgets/drop-list.r (modified) (4 diffs)
-
widgets/edit-list.r (modified) (1 diff)
-
widgets/field.r (modified) (2 diffs)
-
widgets/group-box.r (modified) (1 diff)
-
widgets/image.r (modified) (1 diff)
-
widgets/label.r (modified) (2 diffs)
-
widgets/led-group.r (modified) (2 diffs)
-
widgets/led.r (modified) (2 diffs)
-
widgets/link.r (modified) (2 diffs)
-
widgets/menu.r (modified) (4 diffs)
-
widgets/panel.r (modified) (1 diff)
-
widgets/password.r (modified) (2 diffs)
-
widgets/pie-chart.r (modified) (1 diff)
-
widgets/progress.r (modified) (1 diff)
-
widgets/radio-group.r (modified) (2 diffs)
-
widgets/slider.r (modified) (2 diffs)
-
widgets/spinner.r (modified) (3 diffs)
-
widgets/splitter.r (modified) (1 diff)
-
widgets/symbol.r (modified) (1 diff)
-
widgets/tab-panel.r (modified) (2 diffs)
-
widgets/table.r (modified) (4 diffs)
-
widgets/text-list.r (modified) (1 diff)
-
widgets/text.r (modified) (1 diff)
-
widgets/title-group.r (modified) (3 diffs)
-
widgets/tool-bar.r (modified) (2 diffs)
-
widgets/tooltip.r (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
create-distribution.r
r73 r75 47 47 ; remove extra newlines 48 48 replace/all code "^/^/" "^/" 49 ; tip compression 50 replace/all code "^^-^^-^^-" "" 51 replace/all code "^^-^^-" "" 52 replace/all code "tip: {^/" "tip:{" 53 replace/all code "^/^^-} " "}" 49 54 ; compact block delimiters 50 55 replace/all code "[ " "[" -
functions/display.r
r74 r75 75 75 if all [not dialog effects/tooltip-delay] [ 76 76 tooltip-time: now/time/precise 77 insert tail spec/pane tooltip: make widgets/tooltip [type: 'tooltip offset: -10000x-10000 ]77 insert tail spec/pane tooltip: make widgets/tooltip [type: 'tooltip offset: -10000x-10000 tip: none] 78 78 ] 79 79 detect: make function! [face event /local f] [ … … 98 98 f: event/face 99 99 while [f: find-face event/offset f] [ 100 if f/tip[100 if all [f/type <> 'face f/tip] [ 101 101 tooltip/text: f/tip 102 102 tooltip/init -
functions/examine.r
r74 r75 1 1 set 'examine make function! [ 2 2 "Prints information about widgets and attributes." 3 'widget [word!] 4 /indent "Indent and return output as an MD2 ready string" 5 /local string tmp tabs 3 'widget 4 /indent "Indent output as an MD2 ready string" 5 /no-print "Do not print output to console" 6 /local string tmp blk tabs 6 7 ][ 8 unless word? widget [widget: to word! widget] 7 9 unless find tmp: next find first widgets 'choose widget [ 8 10 print "Unknown widget. Supported widgets are:^/" … … 12 14 tabs: make function! [w /local l] [ 13 15 l: length? form w 14 join w case [l < 7 [ ":^-^-^-"] l < 11 [":^-^-"] true [":^-"]]16 join w case [l < 7 [rejoin [":" tab tab tab]] l < 11 [rejoin [":" tab tab]] true [join ":" tab]] 15 17 ] 16 18 widget: widgets/:widget 17 19 ; usage & description 18 string: re join [19 "^/^-USAGE:^/^-^-"20 replace/all mold/only load widget/tip "^/" "^/^-^-"21 "^/^/^/^-DESCRIPTION:^/^-^-"22 replace/all copy widget/type "^/" "^/^-^-"23 "^/"24 ]20 string: replace/all copy widget/tip "^/" "^/^-" 21 replace/all string "[" join " " "[" 22 replace/all string "]" join "]" " " 23 replace/all string "^- " "^-" 24 replace/all string " ^/" "^/" 25 replace string "^-DESCRIPTION:" "^/DESCRIPTION:" 26 replace string "^-OPTIONS:" "^/OPTIONS:" 25 27 ; standard attributes 26 insert tail string "^/^ -ATTRIBUTES:^/"28 insert tail string "^/^/^/ATTRIBUTES:" 27 29 foreach attribute first rebface [ 28 30 if all [ 29 not find [self type offset show? optionsface-flags feel action tip] attribute31 not find [self type offset show? face-flags feel action tip] attribute 30 32 get tmp: in widget attribute 31 33 ][ 32 34 tmp: either find ["function" "object" "block" "bitset"] form type? get tmp [join type? get tmp "!"] [mold get tmp] 33 insert tail string rejoin ["^ -^-" tabs attribute tmp "^/"]35 insert tail string rejoin ["^/^-" tabs attribute tmp] 34 36 ] 35 37 ] 36 38 ; feels 37 39 unless widget/feel = widgets/default-feel [ 38 insert tail string "^/^ -PREDEFINED FEELS:^/"40 insert tail string "^/^/PREDEFINED FEELS:" 39 41 foreach attribute next first widgets/default-feel [ 40 42 if get in widget/feel attribute [ 41 insert tail string rejoin ["^-^-" attribute "^/"]43 insert tail string join "^/^-" attribute 42 44 ] 43 45 ] … … 45 47 ; actions 46 48 unless widget/action = widgets/default-action [ 47 insert tail string "^/^ -PREDEFINED ACTIONS:^/"49 insert tail string "^/^/PREDEFINED ACTIONS:" 48 50 foreach attribute next first widgets/default-action [ 49 51 if get in widget/action attribute [ 50 insert tail string rejoin ["^-^-" attribute "^/"]52 insert tail string join "^/^-" attribute 51 53 ] 52 54 ] 53 55 ] 54 56 ; extended attributes 55 unless empty? tmp: difference first rebface first widget [56 insert tail string "^/^ -EXTENDED ATTRIBUTES:^/"57 foreach attribute copy tmp[58 if gettmp: in widget attribute [57 unless empty? blk: difference first rebface first widget [ 58 insert tail string "^/^/EXTENDED ATTRIBUTES:" 59 foreach attribute blk [ 60 if tmp: in widget attribute [ 59 61 tmp: either find ["function" "object" "block" "bitset"] form type? get tmp [join type? get tmp "!"] [mold get tmp] 60 insert tail string rejoin ["^ -^-" tabs attribute tmp "^/"]62 insert tail string rejoin ["^/^-" tabs attribute tmp] 61 63 ] 62 64 ] 63 65 ] 64 either indent [string] [replace/all string "^/^-" "^/" remove string remove back tail string print string] 66 if indent [ 67 replace/all string "^/" "^/^-" 68 replace/all string "^-^/" "^/" 69 insert string "^-" 70 ] 71 if no-print [ 72 replace/all string "^-" " " 73 ] 74 either any [indent no-print] [string] [print string] 65 75 ] -
rebgui-ctx.r
r74 r75 104 104 ctx-rebgui: make object! [ 105 105 106 build: 7 4106 build: 75 107 107 view*: system/view 108 108 locale*: system/locale … … 143 143 144 144 all-chars: make string! 256 145 insert all-chars to char! 0 146 repeat i 255 [insert tail all-chars to char! i] 145 repeat i 256 [insert tail all-chars to char! i - 1] 147 146 148 147 font?: make function! [ -
rebgui-edit.r
r74 r75 163 163 unfocus: make function! [/local face] [ 164 164 if face: view*/focal-face [ 165 if get in face/action 'on-unfocus[165 if all [face/type <> 'face get in face/action 'on-unfocus] [ 166 166 unless face/action/on-unfocus face [return false] 167 167 ] … … 236 236 ; Cursor movement functions 237 237 238 ; word-limits: make function! [/local cs] [ 239 ; cs: charset join " ^-^m/[](){}^"" newline ; required for merge 240 ; reduce [cs complement cs] 241 ; ] 242 word-limits: make bitset! join " ^-^m/[](){}^"" newline ; required for merge 238 word-limits: make bitset! " ^/^-^m/[](){}^"" 243 239 word-limits: reduce [word-limits complement word-limits] 244 240 … … 264 260 265 261 end-of-line: make function! [str] [ 266 any [find str newlinetail str]262 any [find str "^/" tail str] 267 263 ] 268 264 269 265 beg-of-line: make function! [str /local nstr] [ 270 either nstr: find/reverse str newline[next nstr] [head str]266 either nstr: find/reverse str "^/" [next nstr] [head str] 271 267 ] 272 268 … … 367 363 insert-char: make function! [face char] [ 368 364 delete-selected-text 369 unless any [insert? tail? view*/caret newline= first view*/caret] [remove view*/caret] ; AGT #25365 unless any [insert? tail? view*/caret "^/" = first view*/caret] [remove view*/caret] ; AGT #25 370 366 insert view*/caret char 371 367 view*/caret: next view*/caret … … 444 440 ][ 445 441 undo-add face 446 insert-char face newline442 insert-char face "^/" 447 443 ] 448 444 ] -
rebgui-layout.r
r74 r75 73 73 left-to-right?: true 74 74 after-count: 1 75 after-limit: 10000 0075 after-limit: 10000 76 76 77 77 view-face: make rebface [ … … 121 121 append-widget: make function! [] [ 122 122 if widget [ 123 if string? widgets/:widget/type [print type] 123 124 insert tail view-face/pane make widgets/:widget [ 124 ; type (set to word! to clear DESCRIPTION text) 125 type: either any [string? widgets/:widget/type widgets/:widget/type = 'face] [widget] [widgets/:widget/type] 125 type: either widgets/:widget/type = 'face [widget] [widgets/:widget/type] 126 126 offset: xy 127 127 size: sizes/cell * any [ … … 270 270 xy: as-pair margin-size/x + indent-width max-height + gap-size/y 271 271 left-to-right?: true 272 after-limit: 10000 00272 after-limit: 10000 273 273 ) 274 274 | 'reverse ( … … 276 276 xy: as-pair max-width max-height + gap-size/y 277 277 left-to-right?: false 278 after-limit: 10000 00278 after-limit: 10000 279 279 ) 280 280 | 'after set arg integer! ( … … 306 306 | 'space set arg pair! (append-widget gap-size: arg * sizes/cell) 307 307 | 'tight (append-widget margin-size: xy: gap-size: 0x0) 308 | 'at set arg pair! (append-widget xy: arg * sizes/cell + margin-size after-limit: 10000 00)308 | 'at set arg pair! (append-widget xy: arg * sizes/cell + margin-size after-limit: 10000) 309 309 | 'effect [set arg word! | set arg block!] (attribute-effect: arg) 310 310 | 'options set arg block! (attribute-options: arg) -
rebgui-widgets.r
r74 r75 137 137 138 138 default-text: make rebface [ 139 size: 10000 00x1000000139 size: 10000x10000 140 140 text: "" 141 141 font: default-font … … 332 332 clear pane 333 333 ;END fixed by Cyphre, sponsored by Robert 334 insert pane make rebface [334 insert pane make subface [ 335 335 size: p/size 336 336 span: p/span … … 354 354 ] 355 355 ;END fixed by Cyphre, sponsored by Robert 356 line/pane/:i/text: replace/all form pick p/data index - 1 * cols + i newline"¶"356 line/pane/:i/text: replace/all form pick p/data index - 1 * cols + i "^/" "¶" 357 357 line/pane/:i/font/color: either find p/options 'no-action [ 358 358 black … … 363 363 ] 364 364 ][ 365 line/text: replace/all form pick face/parent-face/data index newline"¶"365 line/text: replace/all form pick face/parent-face/data index "^/" "¶" 366 366 line/font/color: either find p/options 'no-action [ 367 367 black … … 434 434 pane/1/line/pane: copy [] 435 435 repeat i cols [ 436 insert tail pane/1/line/pane make rebface [436 insert tail pane/1/line/pane make subface [ 437 437 size: as-pair 0 sizes/line 438 438 font: make default-font [align: aligns/:i] … … 442 442 ; vertical scroller 443 443 insert tail pane make slider [ 444 tip: none 444 445 offset: as-pair p/size/x - sizes/slider 0 445 446 size: as-pair sizes/slider p/size/y … … 504 505 #include %widgets/button.r 505 506 #include %widgets/calendar.r 506 ; #include %widgets/chart.r507 507 #include %widgets/check.r 508 508 #include %widgets/check-group.r 509 509 #include %widgets/drop-list.r 510 ; #include %widgets/drop-tree.r511 510 #include %widgets/edit-list.r 512 511 #include %widgets/field.r 513 ; #include %widgets/grid.r514 512 #include %widgets/group-box.r 515 513 #include %widgets/image.r 516 ; #include %widgets/input-grid.r517 514 #include %widgets/label.r 518 515 #include %widgets/led.r -
rebgui.r
r74 r75 52 52 ] 53 53 all-chars: make string! 256 54 insert all-chars to char! 0 55 repeat i 255[insert tail all-chars to char! i] 54 repeat i 256[insert tail all-chars to char! i - 1] 56 55 font?: make function![ 57 56 font-name[string!] … … 259 258 unfocus: make function![/local face][ 260 259 if face: view*/focal-face[ 261 if get in face/action 'on-unfocus[260 if all[face/type <> 'face get in face/action 'on-unfocus][ 262 261 unless face/action/on-unfocus face[return false] 263 262 ] … … 318 317 remove face/undo 319 318 ] 320 word-limits: make bitset! join { ^-^M/[](){}"} newline 319 word-limits: make bitset! { 320 ^-^M/[](){}"} 321 321 word-limits: reduce[word-limits complement word-limits] 322 322 current-word: make function![str /local s ns][ … … 337 337 ] 338 338 end-of-line: make function![str][ 339 any[find str newlinetail str]339 any[find str "^/" tail str] 340 340 ] 341 341 beg-of-line: make function![str /local nstr][ 342 either nstr: find/reverse str newline[next nstr][head str]342 either nstr: find/reverse str "^/"[next nstr][head str] 343 343 ] 344 344 next-field: make function![face /wrap][ … … 427 427 insert-char: make function![face char][ 428 428 delete-selected-text 429 unless any[insert? tail? view*/caret newline= first view*/caret][remove view*/caret]429 unless any[insert? tail? view*/caret "^/" = first view*/caret][remove view*/caret] 430 430 insert view*/caret char 431 431 view*/caret: next view*/caret … … 501 501 ][ 502 502 undo-add face 503 insert-char face newline503 insert-char face "^/" 504 504 ] 505 505 ] … … 677 677 ] 678 678 default-text: make rebface[ 679 size: 10000 00x1000000679 size: 10000x10000 680 680 text: "" 681 681 font: default-font … … 846 846 p: self 847 847 clear pane 848 insert pane make rebface[848 insert pane make subface[ 849 849 size: p/size 850 850 span: p/span … … 866 866 line/pane/:i/size/x: line/pane/:i/size/x + (p/size/x - p/pane/2/size/x - (line/pane/:i/offset/x + line/pane/:i/size/x)) 867 867 ] 868 line/pane/:i/text: replace/all form pick p/data index - 1 * cols + i newline"¶"868 line/pane/:i/text: replace/all form pick p/data index - 1 * cols + i "^/" "¶" 869 869 line/pane/:i/font/color: either find p/options 'no-action[ 870 870 black … … 875 875 ] 876 876 ][ 877 line/text: replace/all form pick face/parent-face/data index newline"¶"877 line/text: replace/all form pick face/parent-face/data index "^/" "¶" 878 878 line/font/color: either find p/options 'no-action[ 879 879 black … … 941 941 pane/1/line/pane: copy[] 942 942 repeat i cols[ 943 insert tail pane/1/line/pane make rebface[943 insert tail pane/1/line/pane make subface[ 944 944 size: as-pair 0 sizes/line 945 945 font: make default-font[align: aligns/:i] … … 948 948 ] 949 949 insert tail pane make slider[ 950 tip: none 950 951 offset: as-pair p/size/x - sizes/slider 0 951 952 size: as-pair sizes/slider p/size/y … … 994 995 ] 995 996 anim: make rebface[ 996 type: "Cycles a set of images." 997 tip: "anim data[%img1.png img2]rate 2" 997 tip:{USAGE: 998 anim data[%img1.png %img2.png] 999 anim data[img1 img2 img3]rate 2 1000 DESCRIPTION: 1001 Cycles a set of images at a specified rate.} 998 1002 size: -1x-1 999 1003 effect: 'fit … … 1020 1024 ] 1021 1025 area: make rebface[ 1022 type: "Editable text area with wrapping and scroller." 1023 tip: "area options[info]^/area -1^/area 50x-1" 1026 tip:{USAGE: 1027 area 1028 area "Text" -1 1029 area "Text" 50x-1 1030 DESCRIPTION: 1031 Editable text area with wrapping and scroller. 1032 OPTIONS: 1033 'info specifies read-only} 1024 1034 size: 50x25 1025 1035 text: "" … … 1083 1093 p: self 1084 1094 text-y: second size-text self 1085 all[negative? size/x size/x: 10000 00size/x: 4 + first size-text self]1086 all[negative? size/y size/y: 10000 00size/y: 8 + text-y]1095 all[negative? size/x size/x: 10000 size/x: 4 + first size-text self] 1096 all[negative? size/y size/y: 10000 size/y: 8 + text-y] 1087 1097 pane: make slider[ 1098 tip: none 1088 1099 offset: as-pair p/size/x - sizes/slider 0 1089 1100 size: as-pair sizes/slider p/size/y … … 1121 1132 ] 1122 1133 arrow: make rebface[ 1123 t ype: {An arrow (default down) on a square button face.1124 Height is set to width.} 1125 tip: {arrow 101134 tip:{USAGE: 1135 arrow 1136 arrow 10 1126 1137 arrow data 'up 1127 1138 arrow data 'down 1128 1139 arrow data 'left 1129 arrow data 'right} 1140 arrow data 'right 1141 DESCRIPTION: 1142 An arrow (default down) on a square button face with height set to width.} 1130 1143 size: 5x-1 1131 1144 data: 'down … … 1149 1162 rebind: make function![][effect/2: colors/btn-text] 1150 1163 init: make function![][ 1151 all[string? type type: 'face tip: none]1152 1164 all[negative? size/y size/y: size/x] 1153 1165 effect/rotate: select[up 0 right 90 down 180 left 270]data … … 1156 1168 ] 1157 1169 bar: make rebface[ 1158 type: {A thin 3D bar used to separate widgets. 1159 Defaults to maximum width.} 1160 tip: "bar^/bar 100" 1170 tip:{USAGE: 1171 bar 1172 bar 100 1173 DESCRIPTION: 1174 A thin 3D bar used to separate widgets. 1175 Defaults to maximum display width.} 1161 1176 size: -1x1 1162 1177 color: colors/window … … 1165 1180 ] 1166 1181 box: make rebface[ 1167 type: "The most basic of widgets, a rectangular area." 1168 tip: "box^/box red" 1182 tip:{USAGE: 1183 box 1184 box red 1185 DESCRIPTION: 1186 The most basic of widgets, a rectangular area. 1187 ^-} 1169 1188 ] 1170 1189 button: make rebface[ 1171 type: "Performs action when clicked." 1172 tip: {button "Hello" <
