This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red [ | |
author: ["Gregg Irwin"] | |
notes: { | |
Experimental requesters, for design discussion. Not just about the | |
implementation, but about modal vs modeless dialogs. I think there's | |
value in the simple, modal approach, but we probably want to provide | |
more advanced options. e.g. document/sheet modal, and mobile standard | |
approaches. | |
TBD: Determine if we want to build everything on inner funcs that are |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red [ | |
title: "Edward de Jong's Chess Challenge" | |
author: ["Gregg Irwin"] | |
] | |
; This may prove useful as more logic is added. Right now it's not a big win. | |
array: function [ | |
"Makes and initializes a block of of values (NONE by default)" | |
size [integer! block!] "Size or block of sizes for each dimension" | |
/initial "Specify an initial value for elements" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red [needs: view] | |
detail-tab: first layout/only [panel [text "hello"]] | |
toggle-detail: function [state [logic!]][ | |
either state [ | |
insert at tabs/data 2 "Detail" | |
insert at tabs/pane 2 detail-tab | |
][ | |
remove at tabs/data 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red [] | |
linear-interpolate: func [ | |
src-min [number!] | |
src-max [number!] | |
dest-min [number!] | |
dest-max [number!] | |
value [number!] | |
][ | |
add dest-min ((value - src-min) / (src-max - src-min) * (dest-max - dest-min)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; The original is at https://gist.github.com/toomasv/19e45ce2cbd7dc213548400fcdec1f8b | |
context [ | |
colors: exclude sort extract load help-string tuple! 2 [glass] | |
lay: copy [ | |
style color: base 70x70 font [size: 8] wrap top on-down [ | |
write-clipboard form face/extra | |
tx/data: rejoin [ | |
"Color '" face/extra "' (" get face/extra ") copied to clipboard!" | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red [ | |
Title: "Red set-related functions" | |
Author: "Gregg Irwin" | |
File: %sets.red | |
Tabs: 4 | |
Rights: "Copyright (C) 2013 All Mankind. All rights reserved." | |
License: { | |
Distributed under the Boost Software License, Version 1.0. | |
See https://github.com/dockimbel/Red/blob/master/BSL-License.txt | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red [] | |
#include %include-me.red | |
print incl-int | |
print mold incl-str | |
img: load/as incl-img 'png | |
view [image img] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red [] | |
collect-values: func [ | |
"Collect values in a block, by datatype or custom parse rule" | |
block [block!] | |
rule "Datatype, prototype value, or parse rule" | |
/deep "Include nested blocks" | |
][ | |
rule: switch/default type?/word rule [ | |
datatype! block! typeset! [rule] ; Blocks and typesets (e.g. any-word!) work directly as rules. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red [] | |
view [ | |
base 200x336 white draw [ | |
pen #eeac29 | |
fill-pen #eeac29 polygon 100x2 100x65 72x49 | |
fill-pen #bc822d polygon 100x2 100x65 128x49 | |
pen #d41c18 | |
fill-pen #d41c18 polygon 100x84 100x146 37x109 64x63 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red [ | |
Purpose: "Show how to drop faces to make a GUI and save it." | |
] | |
spec: copy [] | |
btn-pos: 700x10 | |
n: 0 |