View discussion [27 posts] | View script | License |
Download script | History | Other scripts by: crazyaxe |
30-Apr 13:16 UTC
[0.12] 148.112k
[0.12] 148.112k
Archive version of: rebolide.r ... version: 3 ... crazyaxe 4-Jan-2011Amendment note: Quite perfect... || Publicly available? Yes Rebol [ Title: "Rebolide" File: %rebolide.r Author: "Massimiliano Vessi" Date: 2010-12-31 Version: 1.0.1 email: maxint@tiscali.it Purpose: {A Rebol IDE for beginners that helps learning Rebol} Library: [ level: 'beginner platform: 'all type: [ide] domain: [all] tested-under: [view 2.7.7.3.1 Windos Linux ] support: none license: 'public-domain see-also: none ] ] ;functio to insert text in the source area inni: func [testo2 ] [ set-text/caret a testo2 ] saveas: func [] [ filen: request-value "File name?" filed: to-file request-dir filep: to-file rejoin [ filed filen] salva ] salva: func [] [ if filep = none [ saveas ] write filep a/text set-text testo reform ["Saved as " filep ] ] filep: none if not (exists? %rebgui.r) [ Alert "Rebgui not found, I'll try to download it" read-thru/expand/update/to http://www.dobeash.com/RebGUI/rebgui.r %rebgui.r ] do %rebgui.r display "Rebolide" [ menu data [ "File" [ "Open" [filep: to-file request-file temp: read filep set-text a temp set-text testo reform ["Opened " filep ] ] "Save (CTRL+D)" [ salva ;it save the source text ] "Save as... (CTRL+SHIFT+D)" [ saveas write filep a/text ] ] "Modify" [ "Try" [lancia a/text ] "Modify colors" [ request-ui] ] "Help" [ "About" [display "about" aboutpage] "Shotcuts" [display "Shortcuts" shortcuts] "VID" [ attempt [ temp: read/binary http://www.rebol.com/view/nyc.jpg write/binary %nyc.jpg temp ] display "VID Guide" guida_vid ] ] ] button -1 "Try it!" [ lancia a/text] return a: area 90x113 on-key [ if event/key = #"^D" [ salva] if (event/key = #"^D") and event/shift [ saveas] true] tab-panel data [ "Core" [ scroll-panel 80x100 data [ button -1 "Example" [ inni {Rebol [] print "Hello word!"} ] tip "Example" return group-box "Comparison" data [ button -1 "<" [ inni "< " ] tip "Returns TRUE if the first value is less than the second value" button -1 "<=" [ inni "<= " ] tip "Returns TRUE if the first value is less than or equal to the second value" button -1 "<>" [ inni "<> " ] tip "Returns TRUE if the values are not equal" button -1 "=" [ inni "= " ] tip "Returns TRUE if the values are equal" button -1 "==" [ inni "== " ] tip "Returns TRUE if the values are equal and of the same datatype" return button -1 "=?" [ inni "=? " ] tip "Returns TRUE if the values are identical.(same memory)" button -1 ">" [ inni "> " ] tip "Returns TRUE if the first value is greater than the second value" button -1 ">=" [ inni ">= " ] tip "Returns TRUE if the first value is greater than or equal to the second value" ] return group-box "Context" data [ button -1 "alias" [ inni "alias " ] tip "Creates an alternate alias for a word" button -1 "bind" [ inni "bind /copy " ] tip "Binds words to a specified context" button -1 "context" [ inni "context " ] tip "Defines a unique (underived) object" button -1 "get" [ inni "get /any " ] tip "Gets the value of a word" button -1 "in" [ inni "in " ] tip "Returns the word in the object's context" return button -1 "set" [ inni "set /any /pad " ] tip "Sets a word or block of words to specified value(s)" button -1 "unset" [ inni "unset " ] tip "Unsets the value of a word" button -1 "use" [ inni "use " ] tip "Defines words local to a block" button -1 "value?" [ inni "value? " ] tip "Returns TRUE if the word has been set" ] return group-box "Control" data [ button -1 "break" [ inni "break /return " ] tip "Breaks out of a loop, while, until, repeat, foreach, etc" button -1 "catch" [ inni "catch [ throw ] " ] tip "Catches a THROW from a block and returns its value" return button -1 "compose" [ inni "compose /deep /only [ ( ) ] " ] tip "Evaluates a block of expressions, only evaluating parens, and returns a block" button -1 "disarm" [ inni "disarm " ] tip "Returns the error value as an object" button -1 "do" [ inni "do /args /next [] " ] tip "Evaluates a block, file, URL, function, word, or any other value" return button -1 "does" [ inni "does [] " ] tip "A shortcut to define a function that has no arguments or locals" button -1 "either" [ inni "either [] [] " ] tip "If condition is TRUE, evaluates the first block, else evaluates the second" button -1 "exit" [ inni "exit " ] tip "Exits a function, returning no value" button -1 "for" [ inni "for word start end bump [] " ] tip "Repeats a block over a range of values" return button -1 "foreach" [inni "foreach word series [] " ] tip "Evaluates a block for each value(s) in a series" button -1 "forever" [ inni "forever [] " ] tip "Evaluates a block endlessly" button -1 "forskip" [ inni "forskip word skip-num series [] " ] tip "Evaluates a block for periodic values in a series" return button -1 "func" [ inni {func [ /local "usage" /refinemet "refinemet usage"] []} ] tip "Creates a function" button -1 "halt" [ inni "halt " ] tip "Stops evaluation and returns to the input prompt" button -1 "if" [ inni "if cond [] " ] tip "If condition is TRUE, evaluates the block" return button -1 "launch" [ inni "launch " ] tip "Launches a new REBOL interpreter process" button -1 "loop" [ inni "loop n [] " ] tip "Evaluates a block a specified number of times" button -1 "protect" [ inni "protect " ] tip "Protect a word or block to prevent from being modified" return button -1 "protect-system" [ inni "protect-system " ] tip "Protects all system functions and the system object from redefinition" button -1 "quit" [ inni "quit " ] tip "Stops evaluation and exits the interpreter" button -1 "reduce" [ inni "reduce " ] tip "Evaluates an expression or block expressions and returns the result" return button -1 "rejoin" [ inni "rejoin " ] tip "Reduces and joins a block of values" button -1 "return" [ inni "return " ] tip "Returns a value from a function" button -1 "secure" [ inni "secure [] " ] tip "Specifies security policies (access levels and directories)" button -1 "switch" [ inni "switch /default [] " ] tip "Selects a choice and evaluates what follows it" return button -1 "throw" [ inni "catch [ throw ] " ] tip "Throws control back to a previous catch" button -1 "try" [ inni "try [] " ] tip "Tries to DO a block and returns its value or an error" button -1 "unprotect" [ inni "unprotect " ] tip "Unprotects a word or block of words" button -1 "until" [ inni "until [] " ] tip "Evaluates a block until its last command is TRUE" return button -1 "wait" [ inni "wait /all " ] tip "Waits for a duration, port, or both" button -1 "while" [ inni "while [] [] " ] tip "While the first block is TRUE, evaluates the second block" ] return group-box "Datatype" data [ button -1 "to-local-file" [ inni "to-local-file " ] tip "Converts a REBOL file path to the local system file path" button -1 "to-rebol-file" [ inni "to-rebol-file " ] tip "Converts a local system file path to a REBOL file path" return button -1 "any-block" [ inni "any-block " ] tip "Returns TRUE for any-block values" button -1 "any-function?" [ inni "any-function? " ] tip "Returns TRUE for any-function values" return button -1 "any-string?" [ inni "any-string? " ] tip "Returns TRUE for any-string values" button -1 "any-type?" [ inni "any-type? " ] tip "Returns TRUE for any-type values" return button -1 "any-word?" [ inni "any-word? " ] tip "Returns TRUE for any-word values" button -1 "as-pair" [ inni "as-pair " ] tip "Combine X and Y values into a pair" button -1 "binary?" [ inni "binary? " ] tip "Returns TRUE for binary values" return button -1 "bitset?" [ inni "bitset? " ] tip "Returns TRUE for bitset values" button -1 "block?" [ inni "block? " ] tip " Returns TRUE for block values" button -1 "char?" [ inni "char? " ] tip " Returns TRUE for char values" button -1 "datatype?" [ inni "datatype? " ] tip "Returns TRUE for datatype values" return button -1 "date?" [ inni "date? " ] tip "Returns TRUE for date values" button -1 "decimal?" [ inni "decimal? " ] tip "Returns TRUE for decimal values" button -1 "email?" [ inni "email? " ] tip " Returns TRUE for email values" return button -1 "error?" [ inni "error? " ] tip "Returns TRUE for error values" button -1 "function?" [ inni "function? " ] tip "Returns TRUE for function values" button -1 "get-word?" [ inni "get-word? " ] tip " Returns TRUE for get-word values" return button -1 "hash?" [ inni "hash? " ] tip "Returns TRUE for hash values" button -1 "image?" [ inni "image? " ] tip "Returns TRUE for image values" button -1 "integer?" [ inni "integer? " ] tip " Returns TRUE for integer values" button -1 "issue?" [ inni "issue? " ] tip "Returns TRUE for issue values" return button -1 "library?" [ inni "library? " ] tip "Returns TRUE for library values" button -1 "list?" [ inni "list? " ] tip "Returns TRUE for list values" button -1 "lit-path?" [ inni "lit-path? " ] tip " Returns TRUE for lit-path values" return button -1 "lit-word?" [ inni "lit-word? " ] tip " Returns TRUE for lit-word values" button -1 "logic?" [ inni "logic? " ] tip " Returns TRUE for logic values" button -1 "make" [ inni "make " ] tip " Constructs and returns a new value" return button -1 "money?" [ inni "money? " ] tip " Returns TRUE for money values" button -1 "native?" [ inni "native? " ] tip "Returns TRUE for native values" button -1 "none?" [ inni "none? " ] tip "Returns TRUE for none values" return button -1 "number?" [ inni "number? " ] tip "Returns TRUE for number values" button -1 "object?" [ inni "object? " ] tip "Returns TRUE for object values" button -1 "op?" [ inni "op? " ] tip " Returns TRUE for op values" return button -1 "pair?" [ inni "pair? " ] tip " Returns TRUE for pair values" button -1 "paren?" [ inni "paren? " ] tip " Returns TRUE for paren values" button -1 "path?" [ inni "path? " ] tip "Returns TRUE for path values" button -1 "port?" [ inni "port? " ] tip " Returns TRUE for port values" return button -1 "refinement?" [ inni "refinement? " ] tip "Returns TRUE for refinement values" button -1 "routine?" [ inni "routine? " ] tip "Returns TRUE for routine values" return button -1 "series?" [ inni "series? " ] tip "Returns TRUE for series values" button -1 "set-path?" [ inni "set-path? " ] tip "Returns TRUE for set-path values" button -1 "set-word?" [ inni "set-word? " ] tip "Returns TRUE for set-word values" return button -1 "string?" [ inni "string? " ] tip " Returns TRUE for string values" button -1 "struct?" [ inni "struct? " ] tip "Returns TRUE for struct values" button -1 "tag?" [ inni "tag? " ] tip "Returns TRUE for tag values" return button -1 "time?" [ inni "as-pair " ] tip "Returns TRUE for time values" button -1 "to" [ inni "to binary!/bitset!/block!/char!/date!/decimal!/email!/file!/get-word!/hash!/hex!/idate!/image!/integer!/issue!/list!/lit-path!/lit-word!/logic!/money!/pair!/paren!/path!/refinement!/set-path!/set-word!/string!/tag!/time!/tuple!/url!/word!" ] tip "Constructs and returns a new value after conversion" button -1 "tuple?" [ inni "tuple? " ] tip "Returns TRUE for tuple values" button -1 "type?" [ inni "type? " ] tip "Returns a value's datatype" return button -1 "unset?" [ inni "unset? " ] tip "Returns TRUE for unset values" button -1 "url?" [ inni "url? " ] tip " Returns TRUE for url values" button -1 "word?" [ inni "word? " ] tip " Returns TRUE for word values" ] return group-box "Debug" data [ button -1 "attempt" [ inni "attempt [] " ] tip "Tries to evaluate and returns result or NONE on error" button -1 "comment" [ inni "comment [] " ] tip "Ignores the argument value and returns nothing" button -1 "dump-obj" [ inni "dump-obj /match " ] tip "Returns a block of information about an object" return button -1 "probe" [ inni "probe " ] tip "Prints a molded, unevaluated value and returns the same value" return button -1 "source" [ inni "source " ] tip "Prints the source code for a word" button -1 "trace" [ inni "trace /net /function " ] tip "Enables and disables evaluation tracing" ] return group-box "Logic" data [ button -1 "all" [ inni "all [] " ] tip "Shortcut for AND. Evaluates and returns at the first FALSE or NONE" button -1 "and" [ inni "and " ] tip "Returns the first value ANDed with the second" button -1 "any" [ inni "any [] " ] tip "Shortcut OR. Evaluates and returns the first value that is not FALSE or NONE" button -1 "complement" [ inni "complement " ] tip "Returns the one's complement value" return button -1 "not" [ inni "not " ] tip "Returns the logic complement" button -1 "or" [ inni "or " ] tip "Returns the first value ORed with the second" button -1 "xor" [ inni "xor " ] tip "Returns the first value exclusive ORed with the second" ] return group-box "I/O" data [ button -1 "ask" [ inni "ask /hide " ] tip "Ask the user for input" button -1 "checksum" [ inni "checksum /tcp /secure /hash /mehod /key " ] tip "Returns a CRC or other type of checksum" button -1 "close" [ inni "close " ] tip "Closes an open port connection" button -1 "compress" [ inni "compress " ] tip "Compresses a string series and returns it" return button -1 "debase" [ inni {debase /base "" } ] tip "Converts a string from a different base representation to binary" button -1 "decode-cgi" [ inni {decode-cgi } ] tip "Converts CGI argument string to a block of set-words and value strings" button -1 "decompress" [ inni "decompress " ] tip "Decompresses a binary series back to a string" return button -1 "dispatch" [ inni "dispatch [] " ] tip "Wait for a block of ports. As events happen, dispatch port handler blocks" button -1 "enbase" [ inni "enbase " ] tip "Converts a string to a different base representation" button -1 "get-modes" [ inni "get-modes " ] tip "Returns mode settings for a port" return button -1 "input" [ inni "input /hide " ] tip "Inputs a string from the console. New-line character is removed" button -1 "import-email" [ inni "import-email /multiple " ] tip "Constructs an email object from an email message" button -1 "load" [ inni "load /header /next /library /markup /all " ] tip "Loads a file, URL, or string. Binds words to global context" button -1 "open" [ inni "open /binary /string /direct /new /write /no-wait /lines /with /allow /mode / custom /skip " ] tip "Opens a new port connection" return button -1 "parse-xml" [ inni "parse-xml " ] tip "Parses XML code and returns a tree of blocks" button -1 "prin" [ inni "prin " ] tip "Outputs a value with no line break" button -1 "print" [ inni "print " ] tip "Outputs a value followed by a line break" button -1 "query" [ inni "query " ] tip "Returns information about a file, port or URL" return button -1 "read" [ inni "read /binary /string /direct /new /write /no-wait /lines /with /allow /mode / custom /skip " ] tip "Reads from a file, url, or port-spec" button -1 "read-io" [ inni "read-io " ] tip "Low level read from a port" button -1 "script?" [ inni "script? " ] tip "Checks file, url, or string for a valid script header" button -1 "set-modes" [ inni "set-modes " ] tip "Changes mode settings for a port" return button -1 "set-net" [ inni "set-net " ] tip "Network setup" button -1 "send" [ inni "send /only /header /attach /subject /show address message " ] tip "Send a message to an address(es)" button -1 "update" [ inni "update " ] tip "Updates the data related to a port" ] return group-box "File & Directory" data [ button -1 "change-dir" [ inni "change-dir " ] tip "Changes the active directory path" button -1 "clean-path" [ inni "clean-path " ] tip "Cleans-up '.' and '..' in path; returns the cleaned path" button -1 "delete" [ inni "delete " ] tip "Deletes the specified file(s) or empty directory(s)" return button -1 "dir?" [ inni "dir? " ] tip "Returns TRUE if a file or URL is a directory" button -1 "dirize" [ inni "dirize " ] tip "Returns a copy of the path turned into a directory" button -1 "echo" [ inni "echo %file ^/ echo none " ] tip "Copies console output to a file" button -1 "exists?" [ inni "exists? " ] tip "Determines if a file or URL exists" return button -1 "file?" [ inni "file? " ] tip " Returns TRUE for file values" button -1 "info?" [ inni "info? " ] tip "The information is returned within an object that has SIZE, DATE, and TYPE words" button -1 "list-dir" [ inni "list-dir " ] tip "Prints a multi-column sorted listing of a directory" button -1 "make-dir" [ inni "make-dir " ] tip "Creates the specified directory. No error if already exists" return button -1 "modified?" [ inni "modified? " ] tip "Returns the last modified date of a file or URL" button -1 "rename" [ inni "rename " ] tip "Renames a file to a new name" button -1 "save" [ inni "save /header /bmp /png /all " ] tip "Saves a value or a block to a file or url" button -1 "size?" [ inni "size? " ] tip "Returns the size of a file or URL's contents" return button -1 "split-path" [ inni "split-path " ] tip "Returns a block containing path and target" button -1 "suffix?" [ inni "suffix? " ] tip "Return the suffix (ext) of a filename or url, else NONE" button -1 "what-dir " [ inni "what-dir " ] tip "Prints the active directory path" return button -1 "write" [ inni "write /binary /string /append /no-wait /lines /with /allow /mode /custom destination value " ] tip "Writes to a file, url, or port-spec" button -1 "write-io" [ inni "write-io " ] tip "Low level write to a port" ] return group-box "Math" data [ button -1 "*" [ inni "( * ) " ] tip "Returns the first value multiplied by the second" button -1 "**" [ inni "( ** ) " ] tip "Returns the first number raised to the second number" button -1 "+" [ inni "( + ) " ] tip "Returns the result of adding two values" button -1 "-" [ inni "( - ) " ] tip "Returns the second value subtracted from the first" button -1 "/" [ inni "( / ) " ] tip "Returns the first value divided by the second" button -1 "//" [ inni "( // ) " ] tip "Returns the remainder of first value divided by second" button -1 "abs" [ inni "abs " ] tip "Returns the absolute value" return button -1 "arccosine" [ inni "arccosine " ] tip "Returns the trigonometric arccosine in degrees" button -1 "arcsine" [ inni "arcsine " ] tip "Returns the trigonometric arcsine in degrees" button -1 "arctangent" [ inni "arctangent " ] tip "Returns the trigonometric arctangent in degrees" return button -1 "cosine" [ inni "cosine " ] tip "Returns the trigonometric cosine in degrees" button -1 "even?" [ inni "even? " ] tip "Returns TRUE if the number is even" button -1 "exp" [ inni "exp " ] tip "Raises E (natural number) to the power specified" button -1 "log-10" [ inni "log-10 " ] tip "Returns the base-10 logarithm" return button -1 "log-2" [ inni "log-2 " ] tip "Return the base-2 logarithm" button -1 "log-e" [ inni "log-e " ] tip "Returns the base-E (natural number) logarithm" button -1 "maximum-of" [ inni "maximum-of [] " ] tip "Finds the largest value in a series" return button -1 "minimum-of" [ inni "minimum-of [] " ] tip "Finds the smallest value in a series" button -1 "negate" [ inni "negate " ] tip "Changes the sign of a number" button -1 "negative?" [ inni "negative? " ] tip "Returns TRUE if the number is negative" return button -1 "odd?" [ inni "odd? " ] tip "Returns TRUE if the number is odd" button -1 "positive?" [ inni "positive? " ] tip "Returns TRUE if the value is positive" button -1 "random" [ inni "random /seed /secure /only " ] tip "Returns a random value of the same datatype" button -1 "sign?" [ inni "sign? " ] tip "Returns sign of number as 1, 0, or -1" return button -1 "sine" [ inni "sine " ] tip "Returns the trigonometric sine in degrees" button -1 "square-root" [ inni "square-root " ] tip "Returns the square root of a number" button -1 "tangent" [ inni "tangent /radians " ] tip "Returns the trigonometric tangent in degrees" return button -1 "zero?" [ inni "zero? " ] tip "Returns TRUE if the number is zero" ] return group-box "Series" data [ button -1 "alter" [ inni "alter series value " ] tip "If a value is not found in a series, append it; otherwise, remove it" button -1 "append" [ inni "append /only series value " ] tip "Appends a value to the tail of a series and returns the series head" button -1 "array" [ inni "array /initial size " ] tip "Makes and initializes a series of a given size" button -1 "at" [ inni "at series index " ] tip "Returns the series at the specified index" button -1 "back" [ inni "back " ] tip "Returns the series at its previous position" return button -1 "change" [ inni "change /part /only /dup series value " ] tip "Changes a value in a series and returns the series after the change" button -1 "clear" [ inni "clear " ] tip "Removes all values from the current index series to the tail. Returns at tail" button -1 "copy" [ inni "copy /part /deep " ] tip "Returns a series copy" button -1 "difference" [ inni "difference /case /skip " ] tip "Return the difference of two series" return button -1 "exclude" [ inni "exclude " ] tip "Return the first series less the second" button -1 "extract" [ inni "extract series width " ] tip "Extracts a value from a series at regular intervals" button -1 "find" [ inni "find /part /only /case /any /with /skip /match /tail /last /reverse series values " ] tip "nds a value in a series and returns the series at the start of it" button -1 "found?" [ inni "found? " ] tip "Returns TRUE if value is not NONE" return button -1 "head" [ inni "head " ] tip "Returns the series at its head" button -1 "head?" [ inni "head? " ] tip "Returns TRUE if a series is at its head" button -1 "index?" [ inni "index? " ] tip "Returns the index number of the current position in the series" button -1 "insert" [ inni "insert /part /only /dup series value " ] tip "Inserts a value into a series and returns the series after the insert" return button -1 "intersect" [ inni "intersect /case /skip " ] tip "Create a new value that is the intersection of the two series" button -1 "join" [ inni "join " ] tip "Concatenates values" button -1 "last" [ inni "last " ] tip "Returns the last value of a series" return button -1 "length?" [ inni "length? " ] tip "Returns the length of the series from the current position" button -1 "offset?" [ inni "offset? " ] tip "Returns the offset between two series positions" button -1 "pick" [ inni "pick series index " ] tip "Returns the value at the specified position in a series" button -1 "poke" [ inni "poke series index newdata " ] tip "Returns value after changing its data at the given index" return button -1 "remove" [ inni "remove /part " ] tip "Removes value(s) from a series and returns after the remove" button -1 "remove-each" [ inni "remove-each word series body " ] tip "Removes a value from a series for each block that returns TRUE" button -1 "replace" [ inni "replace series search replace " ] tip "Replaces the search value with the replace value within the target series" return button -1 "repend" [ inni "repend /only series value " ] tip "Appends a reduced value to a series and returns the series head" button -1 "reverse" [ inni "reverse /part " ] tip "Reverses a series" button -1 "select" [ inni "select /part /only /case /any /with /skip series value " ] tip "Finds a value in the series and returns the value or series after it" return button -1 "skip" [ inni "skip series offset " ] tip "Returns the series forward or backward from the current position" button -1 "sort" [ inni "sort /case /skip /compare /part /all /reverse " ] tip "Sorts a series" button -1 "tail" [ inni "tail " ] tip "Returns the series at the position after the last value" return button -1 "tail?" [ inni "tail? " ] tip "Returns TRUE if a series is at its tail" button -1 "union" [ inni "union /case /skip " ] tip "Returns all elements present within two blocks or strings ignoring the duplicates" button -1 "uique" [ inni "unique /case /skip " ] tip "Returns a set with duplicate values removed" ] return group-box "String" data [ button -1 "build-tag" [ inni "build-tag [] " ] tip "Generates a tag from a composed block" button -1 "charset" [ inni {charset ""} ] tip "Makes a bitset of chars" button -1 "detab" [ inni "detab /size " ] tip "Converts tabs in a string to spaces,standard tab size is 4" button -1 "dehex" [ inni "dehex " ] tip "Converts URL-style hex encoded (%xx) strings" return button -1 "entab" [ inni "entab /size " ] tip "Converts spaces in a string to tabs,standard tab size is 4" button -1 "form" [ inni "form " ] tip "Converts a value to a string" button -1 "lowercase" [ inni "lowercase " ] tip "Converts string of characters to lowercase" button -1 "mold" [ inni "mold /only /all /flat " ] tip "Converts a value to a REBOL-readable string" return button -1 "reform" [ inni "reform " ] tip "Forms a reduced block and returns a string with spaces" button -1 "rejoin" [ inni "rejoin " ] tip "Reduces and returns a string without spaces" button -1 "remold" [ inni "remold " ] tip "Forms a reduced block and returns a string with spaces and sqare-bracket" return button -1 "trim" [ inni "trim /head /tail /auto /lines /all /with " ] tip "Removes whitespace from a string. Default removes from head and tail" button -1 "uppercase" [ inni "uppercase /part " ] tip "Converts string of characters to uppercase" ] return group-box "Time" data [ button -1 "now" [ inni "now /year /month /day /time /zone /date /weekday /precise " ] tip "Returns the current local date and time" ] ] ] "VID" [ scroll-panel 80x100 data [ button -1 "Example" [ inni {view layout [button "Hello World!!!" [alert "Hello word!!!"]]} ] tip "Typical usage of VID" return group-box "Special funticons" data [ button -1 "brightness?" [ inni "brightness? " ] tip "Returns the monochrome brightness (0.0 to 1.0) for a color value" button -1 "caret-to-offset" [ inni "caret-to-offset " ] tip " Returns the offset position relative to the face of the character position" return button -1 "center-face" [ inni "center-face " ] tip "Center a face on screen or relative to another face" button -1 "clear-fields" [ inni "clear-fields " ] tip "Clear all text fields faces of a layout" return button -1 "do" [ inni "do [] " ] tip " Evaluate a block" button -1 "do-events" [ inni "do-events " ] tip "When this function is called the program becomes event driven" return button -1 "dump-face" [ inni "dump-face " ] tip "Print face info for entire pane" button -1 "event?" [ inni "event? " ] tip "Returns TRUE for event values" button -1 "focus" [ inni "focus " ] tip "Focuses key events on a specific face" button -1 "hide" [ inni "hide " ] tip " Hides a face or block of faces" return button -1 "in-window?" [ inni "in-window? " ] tip " Return true if a window contains a given face" button -1 "layout" [ inni "layout /size /pffset /parent /origin /styles /keep /tight " ] tip "Return a face with a pane built from style description dialect" button -1 "make-face" [ inni "make-face /styles /clones /spec /offset /keep " ] tip "Make a face from a given style name or example face" return button -1 "offset-to-caret" [ inni "offset-to-caret face offset" ] tip " Returns the offset in the face's text corresponding to the offset pair" button -1 "show" [ inni "show " ] tip "Display a face or block of faces" button -1 "size-text" [ inni "size-text " ] tip " Returns the size of the text in a face" return button -1 "span?" [ inni "span? " ] tip "Returns a block of [min max] bounds for all faces" button -1 "stylize" [ inni "stylize " ] tip " Return a style sheet block" button -1 "unfocus" [ inni "unfocus " ] tip " Removes the current key event focus" button -1 "unview" [ inni "unview /all /only" ] tip " Closes window(s)" return button -1 "view" [ inni "view /new /offset /options /title " ] tip "Displays a window face" button -1 "viewed?" [ inni "viewed? " ] tip "Returns TRUE if face is displayed" button -1 "within?" [ inni "within? point offset size " ] tip " Return TRUE if the point is within the rectangle bounds" ] return group-box "Inform" data [ button -1 "alert" [ inni "alert " ] tip " Flashes an alert message to the user. Waits for a user response" button -1 "flash" [ inni "flash " ] tip "Flashes a message to the user and continues" button -1 "inform" [ inni "inform /offset /title /timeout " ] tip "Display an exclusive focus panel for alerts, dialogs, and requestors" ] return group-box "Request" data [ button -1 "choose" [ inni "choose /style /window /offset /across " ] tip "Generates a choice selector menu, vertical or horizontal" button -1 "confirm" [ inni "confirm /with " ] tip "Confirms a user choice" button -1 "request" [ inni "request /offset /ok /only /confirm /type /timeout " ] tip "Requests an answer to a simple question" return button -1 "request-color" [ inni "request-color /color /offset " ] tip " Requests a color value" button -1 "request-date" [ inni "request-date /offset " ] tip "Requests a date" return button -1 "request-download" [ inni "request-download /to " ] tip "Request a file download from the net. Show progress. Return none on error" button -1 "request-file" [ inni "request-file /title /file /filter /keep /omly /path /save " ] tip "Requests a file using a popup list of files and directories" return button -1 "request-list" [ inni "request-list title [] " ] tip "Requests a selection from a list" button -1 "request-pass" [ inni "request-pass /offset /user /only /title " ] tip "Requests a username and password" return button -1 "request-text" [ inni "request-text /offset /default " ] tip "Requests a text string be entered" ] return group-box "Position" data [ button -1 "across" [ inni "across " ] tip "Put items horizontally" button -1 "at" [ inni "at " ] tip "Put items at the specified position (pair!)" button -1 "below" [ inni "below " ] tip "Put items vertically (standard)" button -1 "guide" [ inni "guide " ] tip "Set a guide line" button -1 "indent" [ inni "indent " ] tip "Indent horizontally" return button -1 "offset" [ inni "offset " ] tip "Set the output face position" button -1 "origin" [ inni "origin " ] tip "Specify the layout starting position" button -1 "pad" [ inni "pad " ] tip "Insert extra spacing" button -1 "return" [ inni "return " ] tip "Return to the current guide position" button -1 "space" [ inni "space " ] tip "Set the auto-spacing used between faces" return button -1 "size" [ inni "size " ] tip "Set the output face size" button -1 "tabs" [ inni "tabs " ] tip "Secify tab space, even a series fo different spaces. Also pairs!" button -1 "tab" [ inni "tab " ] tip "Put tab spaces between items" ] return group-box "Text" data [ button -1 "title" [ inni "title " ] tip "Big title" button -1 "text" [ inni "text " ] tip "Normal text" button -1 "head 1" [ inni "h1 " ] tip "Heding 1" button -1 "head 2" [ inni "h2 " ] tip "Heading 2" return button -1 "head 3" [ inni "h3 " ] tip "Heading 3" button -1 "head 4" [ inni "h4 " ] tip "Heading 4" button -1 "head 5" [ inni "h5 " ] tip "Heading 5" return button -1 "code" [ inni "code " ] tip "Bold code style text" button -1 "tt" [ inni "tt " ] tip "Code style text" button -1 "banner" [ inni "banner " ] tip "Big coloured title" return button -1 "video text" [ inni "vtext " ] tip "text with shadow" button -1 "Video h1" [ inni "vh1 " ] tip "Heading 1 with shadow" button -1 "Video h2" [ inni "vh2 " ] tip "Heding 2 with shadow" return button -1 "Video h3" [ inni "vh3 " ] tip "Heding 3 with shadow" button -1 "Video h4" [ inni "vh4 " ] tip "Heding 4 with shadow" button -1 "Label" [ inni "label " ] tip "bold contrasted text" ] return group-box "Fields" data [ button -1 "field" [ inni "field " ] tip "Text entry field" button -1 "info" [ inni "info " ] tip "Same as FIELD style, but read-only" button -1 "area" [ inni "area " ] tip "Text editing area for paragraph entry" ] return group-box "Items" data [ button -1 "image" [ inni "image " ] tip "Display a JPEG, BMP, PNG, or GIF image" button -1 "box" [ inni "box " ] tip "A shortcut for drawing a rectangular box" button -1 "icon" [ inni "icon " ] tip "Display a thumbnail sized image with text caption" button -1 "led" [ inni "led " ] tip "An indicator light" button -1 "anim" [ inni "anim " ] tip "Display an animated image" button -1 "button" [ inni "button " ] tip "Button" return button -1 "toggle" [ inni "toggle " ] tip "Similar to BUTTON but has a dual state" button -1 "rotary" [ inni "rotary " ] tip "Similar to BUTTON but allows multiple states" button -1 "choice" [ inni "choice " ] tip "A pop-up button that displays multiple choices" button -1 "check" [ inni "check " ] tip "A check box" button -1 "radio" [ inni "radio " ] tip "A rounded radio button" return button -1 "arrow" [ inni "arrow " ] tip "An arrow button with a beveled edge" button -1 "progress" [ inni "progress " ] tip "A sliding progress bar" button -1 "slider" [ inni "slider " ] tip "A slider bar" button -1 "panel" [ inni "panel " ] tip "A sub-layout" button -1 "list" [ inni "list " ] tip "An iterated sub-layout" return button -1 "text-list" [ inni "text-list " ] tip "A simple form of the LIST style" ] return group-box "Style" data [ button -1 "style" [ inni "style " ] tip "Define a custom style" button -1 "styles" [ inni "styles " ] tip "Use styles from a stylesheet" button -1 "backcolor" [ inni "backcolor " ] tip "Set the color of the background" button -1 "backdrop" [ inni "backdrop " ] tip "Scale an image over the entire layout window" return button -1 "backtile" [ inni "backtile " ] tip "Tile an image over the entire layout window" ] return group-box "Events" data [ button -1 "sensor" [ inni "sensor " ] tip "An invisible face that senses mouse events" button -1 "key" [ inni "key " ] tip "A keyboard shortcut" ] ] ] "DRAW" [ scroll-panel 80x100 data [ button -1 "Example" [ inni {view layout [box 300x200 effect [draw [ pen navy fill-pen yellow box 20x20 80x80 fill-pen 0.200.0.150 pen maroon box 30x30 90x90 image logo.gif 150x100 line 2x2 2x150 150x100 2x2 ]]] } ] tip "Example" return group-box "Effects" data [ button -1 "anti-alias" [ inni "anti-alias " ] tip "Antialias on/off (on is standard)" button -1 "clip" [ inni {clip 0x0 10x10 ... ; draw commands clip none } ] tip "The drawing commands between clips will be displayedonly in the clip region" button -1 "fill-pen" [ inni "fill-pen " ] tip {fill-pen color (grad-mode grad-offset grad-start-rng grad-stop-rng grad-angle grad-scale-x grad-scale-y grad-color1 grad-color2 grad-color3 ... image)} button -1 "fill-rule" [ inni "fill-rule " ] tip "fill-rule mode" return button -1 "font" [ inni "font " ] tip "font font-object" return button -1 "gamma" [ inni "gamma " ] tip "gamma gamma-value" button -1 "invert-matrix" [ inni "invert-matrix " ] tip "Applies an algebric matrix inversion operation on the current transformation matrix" button -1 "image-filter" [ inni "image-filter " ] tip "image-filter filter-type" return button -1 "line-cap" [ inni "line-cap " ] tip "line-cap butt/square/round" button -1 "line-join" [ inni "line-join " ] tip "line-join miter/miter-bevel/round/bevel" button -1 "line-pattern" [ inni "line-pattern " ] tip "line-pattern stroke-size dash-size (stroke-size dash-size stroke-size dash-size ...)" return button -1 "line-width" [ inni "line-width " ] tip "line-width size" button -1 "matrix" [ inni "matrix " ] tip "Premultiply the current transformation matrix with the given block" button -1 "pen" [ inni "pen " ] tip "pen (stroke-color dash-color image)" button -1 "push" [ inni "push " ] tip "Stores the current matrix setup in stack" return button -1 "reset-matrix" [ inni "reset-matrix " ] tip "Resets the current transformation matrix to its default values" button -1 "rotate" [ inni "rotate " ] tip "Sets the clockwise rotation, in degrees, for drawing commands" button -1 "scale" [ inni "scale " ] tip "Sets the scale for drawing commands" return button -1 "transform" [ inni "transform " ] tip "You can apply a transformation such as translation, scaling, and rotation to any DRAW result" button -1 "translate" [ inni "translate " ] tip "translate offset" ] return group-box "Geometry" data [ button -1 "arc" [ inni "arc " ] tip "Arc center radius (angle-start angle-end angle-lenght closed)" button -1 "arrow" [ inni "arrow 0x0" ] tip "arrow mode-x-mode" button -1 "box" [ inni "box " ] tip "box up-left low-right (radius)" button -1 "circle" [ inni "circle " ] tip "circle center radiusX (radiusY)" button -1 "curve" [ inni "curve " ] tip "curve point point point (point)" return button -1 "image" [ inni "image " ] tip "image (up-left low-right/up-right low-left low-right key-color border)" return button -1 "line" [ inni "line " ] tip "line point point (point point ...)" button -1 "polygon" [ inni "polygon " ] tip "polygon point point point (point point ...)" button -1 "spline" [ inni "spline " ] tip "spline (segmentation closed) point point (point point ...)" button -1 "text" [ inni "text " ] tip "text sting offset anti-aliased/vectorial/aliased" ] return group-box "Shape commands" data [ button -1 "shape" [ inni "shape [] " ] tip "Draws shapes using the SHAPE sub-dialect, for relative positions" button -1 "arc" [ inni "arc " ] tip "arc center radiusX radiusY angle sweep true/false" button -1 "curv" [ inni "curv " ] tip "curv point point (point point ...)" button -1 "curve" [ inni "curve " ] tip "curve point point point (point ...)" button -1 "hline" [ inni "hline " ] tip "hline endX" return button -1 "line" [ inni "line " ] tip "line point (point point ...)" return button -1 "move" [ inni "move " ] tip "Set's the starting point for a new path without drawing anything" button -1 "qcurve" [ inni "qcurve " ] tip "qcurve point" button -1 "vline" [ inni "vline " ] tip "vline endY" ] ] ] ] return testo: text 140 ] ;Other windows lancia: func [ temp /local corpo ] [ corpo: copy temp insert corpo "Rebol [] " write %temp.r corpo launch %temp.r ] ;about page aboutpage: [ text 50 {Author: Massimiliano Vessi Feel free to contact me. This script should make it easier to learn Rebol.} return link "www.maxvessi.net" return field "maxint@tiscali.it" ] ;Shortcuts page shortcuts: [ table 100x50 options ["Key(s)" left 0.4 "Description" left 0.6] data [ "Ctrl+D" "Save" "Ctrl+Shift+D" "Save as..." "Ctrl+S" "Spellcheck All" "BackSpc" "Delete previous character" "Del" "Delete next character" "Ctrl+BackSpc" "Delete to start of word" "Ctrl+Del" "Delete to end of word" "Ctrl+T" "Delete to end of line" "ArwLeft" "Character left" "ArwRight" "Character right" "ArwDn" "Line down" "ArwUp" "Line up" "Home" "Start of line" "End" "End of line" "PgUp" "Page Up" "PgDn" "Page Down" "Ctrl+ArwLeft" "Word left" "Ctrl+ArwRight" "Word right" "Ctrl+ArwDn" "Page down" "Ctrl+ArwUp" "Page up" "Ctrl+Home" "Start of text" "Ctrl+End" "End of text" "Ctrl+PgUp" "Start of text" "Ctrl+PgDn" "End of text" "Shift+Arrow" "Select characters" "Double click" "Select word" "Ctrl+A" "Select All" "Ctrl+Z" "Undo" "Ctrl+Y" "Redo" "Ctrl+X" "Cut" "Ctrl+C" "Copy" "Ctrl+V" "Paste" "Shift+Del" "Cut" "Shift+Ins" "Paste" "Ins" "Toggle Insert/Overwrite mode" "Tab" "Move focus to next tabable widget" "Shift+Tab" "Move focus to previous tabable widget" ] ] ;VID guide page guida_vid: [ heading "REBOL/View VID Developer's Guide" return text italic bold "You can click on the examples to see the results" return scroll-panel 100x100 data [ text 80 {This document describes VID, the Visual Interface Dialect for creating graphical user interfaces in REBOL 2." By their nature, graphical user interfaces (GUI) are more descriptive than they are functional. In REBOL, the Visual Interface Dialect (VID) provides an efficient method of describing GUIs. VID is implemented as a layer that rides on top of the REBOL/View graphical compositing system. VID provides shortcut expressions that are automatically translated into View objects and functions. You can seamlessly combine VID and View code and data for great power and flexibility. Layout Concepts A VID layout is a block of words and values that is used to describe a GUI. It provides the names, attributes, and operations that are used to display text areas, buttons, checkboxes, input fields, slider bars, and more. The format of the VID layout block is organized according to the rules of VID. Layout Structure A layout block consists of: Keywords Layout keywords that describe face positioning and other layout attributes. Styles Face styles that are used to specify the faces that are displayed. These can be predefined styles like TITLE, BUTTON, FIELD, TEXT, or your own custom styles. Facets Attributes that describe variations in the style of a face, such as the size, color, alignment, border, or image. Variables Definitions that hold either faces or layout positions. These variables can be used later to access face objects or to affect face positions. Styledefs New style definitions that are to be used within the layout. Single styles or entire stylesheets can be provided. These elements can be mixed and matched in whatever order is necessary to create a layout. Simple Examples The easiest way to learn VID layouts is by example. The single line below creates and displays a window that contains the obligatory "Hello World!" example:} return tooltip {view layout [title "Hello World!"]} [ lancia { view layout [title "Hello World!"] }] return text 80 {The layout block contains the VID description of what to display. The block is a dialect, not normal REBOL, and it is passed to the LAYOUT function to create the faces for the layout. The result of the LAYOUT function is passed to the VIEW function to display it on your screen: The TITLE word is a predefined style and is followed by values and attributes that affect that style. In the example above, a string value provides the title text. VID provides more than 40 predefined styles. For example, you can replace the TITLE style with the video BANNER style:} return tooltip {view layout [banner "Hello World!!!"]} [ lancia {view layout [banner "Hello World!!!"]} ] return text 80 "Within a layout, multiple styles can be provided. Each style creates another element of the interface. The example below shows a video heading (vh2), followed by text, then by a button:" return tooltip {view layout [ vh2 "Layout Definition:" text "Layouts describe graphical user interfaces." button "Remember" ]} [ lancia {tooltip {view layout [ vh2 "Layout Definition:" text "Layouts describe graphical user interfaces." button "Remember" ]}} ] return text 80 "Thousands of effects and variations are possible within a layout by specifying style attributes called facets. These attributes follow the style word. Here is an example that shows how an elaborate layout can be created in a few lines of VID code:" return tooltip {view layout [ backdrop effect [gradient 1x1 180.0.0 0.0.100] vh2 "Layout Definition:" 200x22 yellow effect [gradmul 1x0 50.50.50 128.128.128] vtext bold italic "Layouts describe graphical user interfaces." button "Remember" effect [gradient 0.0.0] ]} [ lancia {view layout [ backdrop effect [gradient 1x1 180.0.0 0.0.100] vh2 "Layout Definition:" 200x22 yellow effect [gradmul 1x0 50.50.50 128.128.128] vtext bold italic "Layouts describe graphical user interfaces." button "Remember" effect [gradient 0.0.0] ]}] return text 80 {Layouts can specify as many faces as your interface requires. For example, this layout uses styles, a backdrop, a heading, text labels, text input fields, and buttons:} return tooltip {view layout [ style lab label 100 right across vh2 "Provide Your Information:" gold return lab "User Name:" field return lab "Email Address:" field return lab "Date/Time:" field form now return lab "Files:" text-list data load %. return lab button 96 "Save" button 96 "Cancel" return ]} [lancia {view layout [ style lab label 100 right across vh2 "Provide Your Information:" gold return lab "User Name:" field return lab "Email Address:" field return lab "Date/Time:" field form now return lab "Files:" text-list data load %. return lab button 96 "Save" button 96 "Cancel" return ]}] return text 80 "The example shows how multiple styles can be specified within a layout." return heading "Layout Function" return text 80 {The LAYOUT function takes a layout block as an argument and returns a layout face as a result. The block describes the layout according to the rules of the Visual Interface Dialect. The block is evaluated and a face is returned. The result of LAYOUT is can be passed directly to the VIEW function, but it can also be set to a variable or returned as the result of a function. The line:} return tooltip {view layout block} return text 80 "can also be written as:" return tooltip {window: layout block view window} return text 80 "The result of the layout function is a face and can be used in other layouts. More on this later." return heading "Layout Refinements" return text 80 {In most cases, the LAYOUT function is called without refinements; however, these refinements are available when necessary: /size A PAIR! that specifies the size of the resulting face. This forces the face to be of a fixed size before the layout is performed. The default is to size the face dynamically based on the placement of items within the layout. /offset A PAIR! that provides the offset to where the window will be displayed within its parent face (often the screen). /styles A stylesheet block that was created with the STYLIZE function. A stylesheet defines custom styles used within the layout. This is equivalent to the STYLES keyword within a layout. /origin A PAIR! that sets the pixel offset to the first face within the layout. This is equivalent to the ORIGIN keyword within a layout. /parent Specifies the style of the top-level face that is produced from the layout. The parent can be specified as a style name or as an actual instance of the style. /options Specifies the VIEW options when the face is displayed with the VIEW function. See the VIEW function for details. Keywords Here is a summary of the layout keywords that describe face positioning and other layout attributes. These are reserved words. These words cannot be used for style names or for variables within a layout. across Set auto-layout to horizontal direction. at Locate a face to an absolute position. backcolor Set the color of the background. below Set auto-layout to vertical direction. do Evaluate a block. guide Set a guide line. indent Indent horizontally. offset Set the output face position. origin Specify the layout starting position. pad Insert extra spacing. return Return to the current guide position. style Define a custom style. styles Use styles from a stylesheet. space Set the auto-spacing used between faces. size Set the output face size. tabs Set tab stops. tab Advance to next tab position. Each of these keywords is described in more detail in sections of this document.} return heading "Face Styles" return text 80 {Face styles are used to specify the faces that are displayed. These can be predefined styles, or they can be your own custom styles.} return heading {Predefined Styles} return text 80 {Predefined styles are part of VID and can be used in three ways. You can use any predefined style as-is and it will provide its default look and feel. You can specify variations on a style by providing facets such as color, size, font, effects, etc. You can use a style as the basis for defining a new custom style. The predefined styles are listed below. For more information about each of these styles, refer to the Styles chapter (a separate document). title Document title heading. h1 Top level heading used for documents. h2 Heading use for document sections. h3 Heading used for subsections. h4 Heading used below subsections. h5 Heading used below subsections. banner Title heading with video style. vh1 Section heading used for video style. vh2 Section heading used for video style. vh3 Section heading used for video style. text Document body text. txt An alias for TEXT style above. vtext Inverse video body text. tt The teletype font for fixed width text. code Same as TT except defaults to bold. label Used for specifying GUI text labels. field Text entry field. info Same as FIELD style, but read-only. area Text editing area for paragraph entry. sensor An invisible face that senses mouse events. image Display a JPEG, BMP, PNG, or GIF image. box A shortcut for drawing a rectangular box. backdrop Scale an image over the entire layout window. backtile Tile an image over the entire layout window. icon Display a thumbnail sized image with text caption. led An indicator light. anim Display an animated image. button A button that goes down on a click. toggle Similar to BUTTON but has a dual state. rotary Similar to BUTTON but allows multiple states. choice A pop-up button that displays multiple choices. check A check box. radio A rounded radio button. arrow An arrow button with a beveled edge. progress A sliding progress bar. slider A slider bar. panel A sub-layout. list An iterated sub-layout. text-list A simple form of the LIST style. key Keyboard shortcut. Here is an example that shows most of these custom styles:} return tooltip {view layout [title "Document Title" h1 "Heading 1" h2 "Heading 2" h3 "Heading 3" h4 "Heading 4" h5 "Heading 5" banner "Video Title" vh1 "Video heading 1" vh2 "Video heading 2" vh3 "Video heading 3" text "Document body text" tt "The teletype font for fixed width text" code "Same as TT except defaults to bold" vtext "Inverse video body text" txt "An alias for BODY style above" label "Used for specifying GUI text labels" lbl "The video equivalent of LABEL" field "Text entry field" info "Same as FIELD style, but read-only" area "Text editing area for paragraph entry" do [if not exists? %nyc.jpg [write/binary %nyc.jpg read/binary %../nyc.jpg]] image %nyc.jpg 100x100 box blue icon %nyc.jpg "NYC" led button "Button" toggle "Toggle" rotary "Rotary" choice "Choice" check radio arrow progress slider 200x16 text-list "A simple form of the LIST style"]} [ lancia {view layout [title "Document Title" h1 "Heading 1" h2 "Heading 2" h3 "Heading 3" h4 "Heading 4" h5 "Heading 5" banner "Video Title" vh1 "Video heading 1" vh2 "Video heading 2" vh3 "Video heading 3" text "Document body text" tt "The teletype font for fixed width text" code "Same as TT except defaults to bold" vtext "Inverse video body text" txt "An alias for BODY style above" label "Used for specifying GUI text labels" lbl "The video equivalent of LABEL" field "Text entry field" info "Same as FIELD style, but read-only" area "Text editing area for paragraph entry" do [if not exists? %nyc.jpg [write/binary %nyc.jpg read/binary %../nyc.jpg]] image %nyc.jpg 100x100 box blue icon %nyc.jpg "NYC" led button "Button" toggle "Toggle" rotary "Rotary" choice "Choice" check radio arrow progress slider 200x16 text-list "A simple form of the LIST style"]}] return heading "Facets" return text 80 "All of the styles above can be provided with additional information to vary their size, color, text, alignment, background, and more. This is described in detail in the Facets section below." return heading "Custom Styles" return text 80 "Any of the styles listed above can be used as the base style for creating your own custom style. This is covered in the Style Definition section later in this document." return heading "Style Facets" return text 80 {Within a layout, each face is specified by a style word that identifies the look and feel of the face. Each style word can be followed by optional facet attributes that further modify the face. Facets can control the text, size, color, images, actions, and most other aspects of a face. All facets are optional. For example, the example below shows how you can create a button with a variety of facets. The facets can be provided alone or in combination.} return tooltip {button button "Easy" button "Easy" 40x40 button "Easy" oldrab button "Easy" [print "Fun"] button "Easy" 40x40 maroon [print "Fun"]} [ lancia { view layout [button button "Easy" button "Easy" 40x40 button "Easy" oldrab button "Easy" [print "Fun"] button "Easy" 40x40 maroon [print "Fun"]]}] return text 80 {Facets can appear in any order. You don't need to keep track of which goes first. All of these mean the same thing:} return tooltip{ button "Easy" 40x40 navy [print "Fun"] button navy "Easy" 40x40 [print "Fun"] button 40x40 navy "Easy" [print "Fun"] button [print "Fun"] navy 40x40 "Easy"} [ lancia { view layout [ button "Easy" 40x40 navy [print "Fun"] button navy "Easy" 40x40 [print "Fun"] button 40x40 navy "Easy" [print "Fun"] button [print "Fun"] navy 40x40 "Easy"]}] return heading "Text Facets" return text 80 "Text string facets provide the text used for all faces. The text can be written as a short string in quotes, a long multiline string in braces, or provided as a variable or function that contains the string." return tooltip { text "Example string" text 80 {This is a long, multilined textsection that is put in a braced string and will be displayed on the page.} text text-doc text read %file.txt} return text 80 "For some faces styles, more than one string can be provided. For instance, a choice button accepts multiple strings:" return tooltip {choice "Steak" "Eggs" "Salad"} [lancia {view layout [ choice "Steak" "Eggs" "Salad"]}] return heading "Size Facets" return text 80 "The size of a face can be specified as a pair that provides the width and height of the face in pixels:" return tooltip{image %nyc.jpg 100x200 text "example" 200x200 button "test" 50x24}[lancia { view layout [ image %nyc.jpg 100x200 text "example" 200x200 button "test" 50x24]}] return text 80 "The width of a face can also be expressed an integer, leaving the height to be computed automatically:" return tooltip {text "example" 200 button "test" 50}[ lancia { view layout [ text "example" 200 button "test" 50]}] return heading "Color Facets" return text 80 "A color is written as a tuple that provides the red, green, and blue components of the color." return tooltip{image %nyc.jpg 250.250.0 text "example" 0.0.200 button "test" 100.0.0} [ lancia { view layout [ image %nyc.jpg 250.250.0 text "example" 0.0.200 button "test" 100.0.0]}] return text 80 "The are also about 40 predefined colors in REBOL that can be used:" return tooltip {text red "Warning" text blue "Cool down" text green / 2 "Ok"} [ lancia {view layout [ text red "Warning" text blue "Cool down" text green / 2 "Ok"]}] return text 80 {Notice in the last case how the color can be reduced by dividing it by two. Some faces accept multiple colors. For instance:} return tooltip{toggle "Test" red green rotary "Stop" red "Caution" yellow "Go" green}[ lancia {view layout [ toggle "Test" red green rotary "Stop" red "Caution" yellow "Go" green]}] return heading "Image Facets" return text 80 "An image can be provided as a filename, a URL, or as image data." return tooltip{image %nyc.jpg image http://www.rebol.com/view/nyc.jpg button "Test" %nyc.jpg}[ lancia {view layout [ image %nyc.jpg image http://www.rebol.com/view/nyc.jpg button "Test" %nyc.jpg]}] return text 80 "An image can also be loaded and used as a variable:" return tooltip {town: %nyc.jpg image town image 30x30 town icon town "NYC"}[ lancia {view layout [town: %nyc.jpg image town image 30x30 town icon town "NYC"]}] return heading "Action Facets" return text 80 {An action is specified as a block. The action makes a face "hot". When a user clicks on the face, the block will be evaluated.} return tooltip {image %nyc.jpg [print "hello"] text "example" [print "there"] button "Test" [print "user"]} [ lancia {view layout [image %nyc.jpg [print "hello"] text "example" [print "there"] button "Test" [print "user"]]}] return text 80 {Some styles accept a second block that is used as an alternate action (right-click action). For example:} return tooltip {text "Click Here" [print "left click"] [print "right click"]} [ lancia {view layout [text "Click Here" [print "left click"] [print "right click"]]}] return heading "Character Facets" return text 80 {A shortcut key is written as a character (a string with a # before it). If the user presses a shortcut key, the action block will be evaluated as if the user clicked on it.} return tooltip {image %nyc.jpg #"i" [print "hello"] text "example" #"^t" [print "there"] button "Test" #" " [print "user"] } [ lancia {view layout [image %nyc.jpg #"i" [print "hello"] text "example" #"^t" [print "there"] button "Test" #" " [print "user"] ]}] return heading "Face Facet Blocks" return text 80 {Note that facet blocks are most useful when used in conjunction with custom styles. font A font block is used to specify other details about a font, such as its font name, point size, color, shadow, alignment, spacing, and more:} return tooltip{text "black" font [color: 255.255.255 size: 16 shadow: none]} [ lancia {view layout [text "black" font [color: 255.255.255 size: 16 shadow: none]]}] return text 80 {para A para block specifies the paragraph attributes of a text face. This is where you adjust the spacing between paragraphs, margins, and other values.} return tooltip{text "test" para [origin: 10x10 margin: 10x10]} [ lancia {view layout [text "test" para [origin: 10x10 margin: 10x10]]}] return text 80 "edge An edge block gives you a way to control the edge around the outside of a face. You can set its color, size, and effect." return tooltip {image %nyc.jpg edge [size 5x5 color: 100.100.100 effect: [bevel]]}[ lancia {view layout [ image %nyc.jpg edge [size 5x5 color: 100.100.100 effect: [bevel]]]}] return text 80 "effect An effect block specifies special graphic effects for a face. Many effects are possible, such as gradients, colorize, flip, rotate, crop, multiply, contrast, tint, brighten, and various combinations." return tooltip{image %nyc.jpg effect [contrast 20] image %nyc.jpg effect [tint 120 brighten 30] button "Test" effect [gradient 0x1 200.0.0]} [lancia { view layout [image %nyc.jpg effect [contrast 20] image %nyc.jpg effect [tint 120 brighten 30] button "Test" effect [gradient 0x1 200.0.0]]}] return text 80 "with The with block allows you to specify any other type of face characteristic using standard REBOL object format." return heading "Attribute Keywords" return text 80 "These words control the layout as it is being created. They affect the placement of faces within the layout." return text bold "Size " return text 80 "SIZE sets the size of the layout face. This must be done at the beginning of a layout before any styles are used. For example, the simple layout:" return tooltip {size 200x100 h2 "Size Example"} [lancia { view layout [size 200x100 h2 "Size Example"]}] return text 80 "This is equivalent to the /size refinement in the LAYOUT function. If no size is specified, then the layout is auto-sized based on the styles used within it." return text bold "Offset" return text 80 "OFFSET specifies the position of the layout face within its parent face (often the screen). This is the same as the /offset refinement in the LAYOUT function." return tooltip {offset 10x32} return text 80 "The offset need not be specified in the layout. It can be specified in the View if necessary. The default offset is 25x25." return text bold "Origin" return text 80 {ORIGIN sets the starting X and Y position of faces in the layout. The origin is specified as the number of pixels from the upper left corner of the layout window. However, the origin also determines the amount of spacing between the last face and the bottom right of the layout. The default origin is 20x20. The example below uses an origin that is smaller than usual:} return tooltip {origin 4x2 text bold "Origin at 4x2"} [ lancia{ view layout [ origin 4x2 text bold "Origin at 4x2"]}] return text 80 "If an integer is specified for the origin, then both the X and Y positions will be set to that value, as in this example:" return tooltip {origin 50 text bold "Origin at 50x50"} [ lancia{ view layout [origin 50 text bold "Origin at 50x50"]}] return text 80 {When no pair value is provided, the origin word returns the layout to its original origin position.} return tooltip{box 34x40 beige origin text bold "Back at Origin"} [lancia { view layout [ box 34x40 beige origin text bold "Back at Origin"]}] return text 80 {As you can see from the above examples, the origin also has an affect on the size of the resulting face when no size has been provided. Setting the origin is especially important when creating panels and lists. Frequently the origin in lists is set to zero. For example:} return tooltip {vh2 "Films:" list 144x60 [ origin 0 across text 60 text 80 ] data [ ["Back to the Future" "1:45"] ["Independence Day" "1:55"] ["Contact" "2:15"] ]} [lancia { view layout [ vh2 "Films:" list 144x60 [ origin 0 across text 60 text 80 ] data [ ["Back to the Future" "1:45"] ["Independence Day" "1:55"] ["Contact" "2:15"] ]]}] return text 80 "The block provided to the LIST style is a layout with an origin of zero." return heading "Auto-Layout Direction" return text bold "Below" return text 80 {BELOW specifies a vertical layout for faces that follow it. It is used along with ACROSS for auto layout of faces. BELOW is the default layout direction when none is specified. For example:} return tooltip {button "Button 1" button "Button 2" button "Button 3"} [lancia { view layout [ button "Button 1" button "Button 2" button "Button 3"]}] return text 80 "You can switch between BELOW and ACROSS at any time during a layout. When BELOW is used, faces will be positioned below the current face. The example:" return tooltip {across button "Button 1" button "Button 2" return below button "Button 3" button "Button 4"} [lancia { view layout [ across button "Button 1" button "Button 2" return below button "Button 3" button "Button 4"]}] return text bold "Across" return text 80 {ACROSS specifies a horizontal layout for faces that follow it. It is used along with BELOW for auto layout of faces. When ACROSS is used, faces will be located to the right of the current face. The example:} return tooltip {across button "Button 1" button "Button 2" button "Button 3"} [lancia { view layout [ across button "Button 1" button "Button 2" button "Button 3"]}] return text 80 "You can switch between ACROSS and BELOW at any time during a layout." return tooltip {vh2 "Example" across button "Button 1" button "Button 2" return button "Button 3" button "Button 4" return} [lancia { view layout [ vh2 "Example" across button "Button 1" button "Button 2" return button "Button 3" button "Button 4" return]}] return text "The above example would display:" return text bold "Return" return text 80 {RETURN advances the position to the next row or column, depending on the layout direction. If the layout direction is across, return will start a new row. If the direction is below, return will start a new column. The example:} return tooltip {across text "Name:" 100x24 right field "Your name" return text "Address:" 100x24 right field "Your address" return}[lancia { view layout [ across text "Name:" 100x24 right field "Your name" return text "Address:" 100x24 right field "Your address" return]}] return text "The position of the column is relative to the origin or to a guide." return heading "Spacing" return text "Space" return text 80 {SPACE sets the auto-spacing to use between faces within the layout. The spacing can be changed at any time within your layout. Either a pair or an integer can be given. If you specify a pair, both the vertical and horizontal spacing is set. Compare these two cases. The first specifies a small space:} return tooltip {space 2x4 button "Button 1" button "Button 2" return button "Button 3" button "Button 4"} [lancia { view layout [ space 2x4 button "Button 1" button "Button 2" return button "Button 3" button "Button 4"]}] return text "The second uses a larger space:" return tooltip {space 20x16 button "Button 1" button "Button 2" return button "Button 3" button "Button 4" }[lancia { view layout [ space 20x16 button "Button 1" button "Button 2" return button "Button 3" button "Button 4"]}] return 80 "If the space you specify is an integer, only the spacing in the current direction (across or below) is set. The line would look like:" return tooltip {space 5} [lancia { view layout [ space 5]}] return text 80 { Pad Keyword PAD inserts extra spacing between the current position and the position of the next face. The distance can be specified as an integer or a pair. When it is a pair, the space will be added both horizontal and vertically. text "Bar below" pad 20x4 box 50x3 maroon When the PAD is an integer, space is either vertical or horizontal depending on the current direction of auto layout (determined by below and across words). A PAD used in a BELOW: below text "Pad" pad 40 text "Below" has a vertical effect: and a PAD used in an across: across text "Pad" pad 40 text "Across" has a horizontal effect: Note that negative pad values are also allowed. text "Bar above" pad 20x-30 box 50x3 maroon The bar is now above the text: Indent Keyword INDENT inserts spacing horizontally between the current position and the next face. It is not affected by the auto layout direction. This example indents 20 pixels for every face after the heading: vh1 "About VID" indent 20 text "This section is about VID." button "Ok" button "Cancel" The result is: Negative values can also be used: vh1 "About VID" indent 20 text "This section is about VID." indent -20 button "Ok" button "Cancel" Aligning Faces At Keyword AT sets an absolute layout position for the face that follows it. Here's a simple example that sets the next position of a layout: at 60x30 vh2 "Simple Example" that looks like: Here is an example that places multiple faces on top of each other: at 0x0 backdrop effect [gradient 0x1 gray] at 70x70 box effect [gradient 1x1] at 50x50 box effect [gradient 1x1 200.0.0 0.0.100] at 30x30 vtext bold italic 100 {This is an example of locating two faces using absolute positioning.} at 20x160 button 40 "OK" The result would be: Tabs Keyword TABS specifies the tab spacing that is used when a TAB word is encountered. The direction of the tab (horizontally or vertically) depends on the current direction of the layout as specified by BELOW and ACROSS. To set the tab spacing an integer provides regular spacing of that amount: across tabs 150 vh3 "Buttons:" tab button "Button 1" tab button "Button 2" The result is: Fixed tab positions can also be provided with a block of integers. In this example two tab-stops are defined to align the result: across tabs [80 200] h2 "Line 1" tab field 100 tab field 100 return h3 "Line 2" tab check text "Check" tab button "Ok" return h4 "Line 3" tab button "Button 1" tab button "Button 2" This produces: Note that tabs also apply vertically and tabs can be changed at any time in a layout. For example: tabs 40 field "Field 1" field "Field 2" field "Field 3" return across tabs 100 button "Button 1" button "Button 2" button "Button 3" displays: Tab Keyword TAB skips forward in the current direction (across or below) to the next tab position. Tabs positions are set with the TABS keyword. See the TABS description for more examples The example: across tabs 80 text "Name" tab field return text "Email" tab field return text "Phone" tab field return produces: Guide Keyword GUIDE sets the return margin for face layout. When the RETURN word is used, an invisible guide-line determines where the next face will be placed. Guides can be thought of as virtual borders that align the placement of faces. If the guide has not been set, it defaults to be the origin. A guide can be created by specifying a position, or if no position is provided, then the current position will be used. This example shows a heading, then creates a guide for the remaining faces: across vh2 "Guides" guide 60x100 label "Name:" 100x24 right field return label "Address:" 100x24 right field return This example creates: Here is a good example of a problem that is solved by a guide. The layout below creates an undesired effect: vh2 "Without A Guide:" button "Button 1" button "Button 2" return button "Button 3" button "Button 4" that is shown here: If a GUIDE is added after the heading: vh2 "With A Guide:" guide button "Button 1" button "Button 2" return button "Button 3" button "Button 4" the buttons will be aligned: Style Definition [rev] Custom Styles You can define your own styles. This is useful if you use a style with the same facets multiple times in your layout. Defining your own style will make it easier to write and easier to modify your script later. For instance, the code: text black 200x24 bold "This" text black 200x24 bold "is" text black 200x24 bold "an" text black 200x24 bold "example" would be easier to write if a new style called txt where defined: txt "This" txt "is" txt "an" txt "example" The new style can be created in two ways. Styles can be defined in a layout, or they can be created in a stylesheet and applied to a layout. Styles in Layouts To create a style that is defined only within a layout, use the style keyword. In this example, the txt style is created: style txt text black 200x24 bold txt "This" txt "is" txt "an" txt "example" The style word is followed by the new style name, a base style to begin with, and a set of facets that modify it. Any facets can be supplied as part of the style, including text, images, and action. The txt style is only valid within the layout block. It can be used within the block or within any subpanels or lists created by the block. However, if you attempt to use the style outside the block an error will occur. Any number of custom styles can be added to the layout block. Creating Stylesheets To create custom styles for multiple layouts, you will need to create a stylesheet with the stylize function. new-styles: stylize [ txt: text black 200x24 bold btn: button 80x24 effect [gradient 0x1 0.80.0] fld: field 100x24 ] Each new style is written as a set word followed by a base style and list of facets. To use the stylesheet within a layout, include it with a styles keyword: view layout [ styles new-styles txt "Text" btn "Button" fld "Field" ] A layout can contain any number of styles from any combination of stylesheets and styles. Style Keyword STYLE defines a new style that is local to the current layout. The format of the style begins with the new style name and is followed by a normal layout face specification. style blue-text text blue center 200 Once a style has been defined, it can be used just like any other style: blue-text "Blue Text Here" It is common to define a new button style in a layout: style btn button 80x22 leaf btn "Test" [print "Test button pressed"] btn "This" [print "This button pressed"] Predefined styles can be redefined with the STYLE word. For example, this line will redefine the BUTTON style used within a layout: style button button green 120x30 Such changes are local to the layout and do not affect the button style used in other layouts. Styles Keyword STYLES allows you to use a predefined stylesheet in one or more layouts. When a stylesheet is provided, those styles become available to the layout. A stylesheet is created with the STYLIZE function. Styles are defined similar to a layout, but with the new style name appearing as a variable definition. big-styles: stylize [ btn: button 300x40 navy maroon font-size 16 fld: field 300x40 bold font-size 16 middle center lab: text 300x32 font-size 20 center middle red black ] The new styles and their names are encapsulated within the stylesheet and can be used in any layout. styles big-styles lab "Enter CPU Serial Number:" fld "#000-0000" lab "Press to Eject CPU:" btn "Eject Now" btn "Cancel" Any number of stylesheets can be used within a layout. Other Keywords Do Keyword DO evaluates an expression during the process of making a layout. h2 "Introduction:" do [ intro: either exists? %intro.txt [read %intro.txt]["NA"] ] txt intro Note that the DO is only evaluated once; when the layout is created. It is not evaluated when the layout face is shown. Variables Position Variables When creating a layout, you will sometimes need to know the position of a face on the page. To do this, a position variable can be set before any layout keyword. For instance, a convenient way to get the current position is with the AT word. If you provide it with no new position, it will simply set a variable to the current position: here: at The variable here will hold the current position. This can be useful if you need to use a position later in your layout. You may want to lay one face on top of another. Here is an example that places text on top of a transparent box: backdrop %nyc.jpg banner "Example" here: at box 200x100 effect [multiply 60] at here + 10x10 vtext bold 200x100 - 20x20 { This text is on top of the smoked glass, regardless of how the screen may layout. That is the benefit of using a variable to set the position. } Face Variables Some of the faces that you use in a layout will need to be changed when the page is being displayed. For instance, the action of a button may trigger a change in text or images that are displayed. To obtain the face that was created with a style, set a variable just before the style word. For example, here the variable name will refer to the text face that is created: name: text "Merlot" 100x30 At another point on the page the text can be changed with a button that modifies the face's contents: button "Change" [name/text: "Cabernet" show name] When the button is pressed, the text field of the name face will be changed to "Cabernet". The show function is then used to update the face in the window so the change can be seen. Avoiding Variable Collisions For large scripts that have a lot of position and face variables, it may become difficult to manage all of the names and keep them from interfering with each other. A simple solution to this problem is to define pages within objects that have the required variables defined locally to the objects. For instance here is an address book form that keeps all of its variables local: make object! [ title-name: name: email: phone: none num: 1 page1: layout [ title-name: title "Person 1:" box 200x3 red across text "Name" tab name: field return text "Email" tab email: field return text "Phone" tab phone: field return button "Send" [ send luke@rebol.com [ "Person " num newline name email phone newline ] num: num + 1 title-name/text: reform [Person num] clear name/text clear email/text clear phone/text show [title-name name email phone] ] ] ] Be sure to add any new variables to the object definition. Layout Dialect Keywords Layout Organization As described in previous documents (soon), the layout dialect consists of: Layout keywords that describe face positioning and other layout attributes (see below). Face styles that are used to specify the faces that are displayed. These can be predefined styles (see Predefined Styles document) or custom styles. Variable definitions that hold either faces or layout positions. These variables can be used later to access face objects or to affect face positions. New style definitions that are to be used within the layout. Single styles or entire stylesheets can be provided. This document will describe the layout keywords. Note that all layout keywords are optional and most keywords can be used multiple times. Layout Attributes These words control the layout as it is being created. They affect the placement of faces within the layout. Offset OFFSET specifies the position of the layout face within its parent face (often the screen). (NA prior to Link 0.4.35) offset 10x32 The offset need not be specified in the layout. It can be specified in the View if necessary. The default offset is 25x25. Size SIZE sets the size of the layout face. This must be done at the beginning of a layout before any styles are used. size 800x600 If no size is specified, then the layout is auto-sized based on the styles used within it. Origin ORIGIN sets the starting position of faces in the layout. The origin is specified as the number of pixels from the upper left corner of the layout window. The default origin is 20x20. origin 100x100 text "Origin at 100x100" If an integer is specified, then both the X and Y positions will be set to that value: origin 100 text "Origin at 100x100" The origin can also be used within a layout to return the layout to the origin position. origin text "Back at the origin" The origin value also determines the amount of spacing between the last face and the bottom right of the layout. Setting the origin is especially important when creating panels and lists. Frequently the origin in lists is set to zero: list 400x80 [ origin 0 across txt 100 txt 200 ] data [ ["Bobbie" "Smith"] ["Barbie" "Jones"] ["Bettie" "Rebol"] ] Space SPACE sets the auto-spacing to use between faces within the layout. The spacing can be changed at any time within your layout. Either a pair or an integer can be given. If you specify a pair, both the vertical and horizontal spacing is set. space 5x8 If you specify an integer, only the spacing in the current direction (across or below) is set. space 5 Below BELOW sets the direction of the layout to be vertical for faces that follow it. That is, the next face will be positioned below the current face. This can be changed at any time during a layout. below button "Yes" button "No" button "Cancel" BELOW is the default layout direction. Across ACROSS sets the direction of the layout to be horizontal for faces that follow it. That is, the next face will be position to the right of the current face. This can be changed at any time during a layout. across button "Yes" button "No" button "Cancel" Tabs TABS specifies the tab spacing that is used when a TAB word is encountered. The direction of the tab (horizontally or vertically) depends on the current direction of the layout as specified by BELOW and ACROSS. To set the tab spacing an integer provides regular spacing of that amount: tabs 160 Fixed tab positions can also be provided with a block of integers: tabs [120 280 440 620] Tabs can be changed at any time in a layout. Guides GUIDE sets the return margin for face layout. When the RETURN word is used, the GUIDE will determine where the next face will be placed. They can be thought of as virtual borders that align the placement of faces. A guide can be created by specifying a position, or if no position is provided, then the current position will be used. across guide 100x100 txt "Name:" 100x24 right field return txt "Address:" 100x24 right field return Positioning and Spacing These words affect the positioning of faces that follow them. Both absolute and relative positioning are supported. At AT sets an absolute layout position for the face that follows it. at 100x100 image %face.jpg With AT you can change the next position of the layout or even place multiple faces on top of each other: at 100x100 box 200x200 navy at 110x110 text "This text is on top of the box face." 180 Pad PAD inserts extra spacing between the current position and the position of the next face. The distance can be specified as an integer or a pair. When it is a pair, the space will be added both horizontal and vertically. text "Image Below" pad 10x20 image %photo.jpg When the PAD is given an integer, space is either vertical or horizontal depending on the current direction of auto layout (determined by below and across words). below txt "Word" pad 40 txt "Here" across txt "Word" pad 40 txt "Here" Indent INDENT inserts spacing horizontally between the current position and the next face. It is not affected by the auto layout direction. title "About VID" indent 20 body "This section is about VID." Tab TAB skips forward in the current direction (across or below) to the next tab position. Tabs positions are set with the TABS keyword. across tabs 68 text "Name" tab field return text "Email" tab field return text "Phone" tab field return Return RETURN advances the position to the next row or column, depending on the layout direction. If the layout direction is across, return will start a new row. If the direction is below, return will start a new column. across txt "Name:" 100x24 right field "Your name" return txt "Address:" 100x24 right field "Your address" return The position of the column is relative to the origin or to a guide. Style Definition Style STYLE defines a new style that is local to the current layout. The format of the style begins with the new style name and is followed by a normal layout face specification. style blue-text text blue center 200 Once a style has been defined, it can be used just like any other style: blue-text "Blue Text Here" It is common to define a new button style in a layout: style btn button 80x22 leaf btn "Test" [print "Test button pressed"] btn "This" [print "This button pressed"] Predefined styles can be redefined with the STYLE word. For example, this line will redefine the BUTTON style used within a layout: style button button green 120x30 Such changes are local to the layout and do not affect the button style used in other layouts. Styles STYLES allows you to use a predefined stylesheet in one or more layouts. When a stylesheet is provided, those styles become available to the layout. A stylesheet is created with the STYLIZE function. Styles are defined similar to a layout, but with the new style name appearing as a variable definition. big-styles: stylize [ btn: button 300x40 navy maroon font-size 16 fld: field 300x40 bold font-size 16 middle center lab: txt 300x32 font-size 20 center middle red black ] The new styles and their names are encapsulated within the stylesheet and can be used in any layout. styles big-styles lab "Enter CPU Serial Number:" fld "#000-0000" lab "Press to Eject CPU:" btn "Eject Now" btn "Cancel" Any number of stylesheets can be used within a layout. Other Keywords Do DO evaluates an expression during the process of making a layout. h2 "Introduction:" do [ intro: either exists? %intro.txt [read %intro.txt]["NA"] ] txt intro Note that the DO is only evaluated once; when the layout is created. It is not evaluated when the layout face is shown. Facets Facets are attributes of a face. Facets include the face's location, size, color, image, font, style, paragraph format, rendering effects, behavior functions, and other details. Some facets are objects themselves, allowing the sharing of attributes several faces. View Facets These are the primary facets used by the View display system to show faces. These facets can be inherited from the SYSTEM/view/face object which is also defined globally as the FACE object. offset An X-Y PAIR that specifies the horizontal and vertical position of the face. If a face is outside it's parent face it will be clipped. Defaults to 0x0. size An X-Y PAIR that specifies the width and height of the face. Defaults to 100x100. span An optional X-Y PAIR that specify the range of a virtual coordinate system to use for the face. This can be used to create resolution independent displays. Normally this is set to NONE. pane A face or block of sub-faces that are to be displayed within the face. This allows you to create faces that contain faces to any degree. text The text contents of a face. The attributes of the text are determined by the FONT and PARA facets. Any printable value can be used. data Used by VID for storing other information about the face. Outside of VID this field can be freely used by programs. color The color of the face, specified as a TUPLE. When set to NONE the face is transparent. Default value is 128.128.128. image An IMAGE to use for the face's body. This must be an IMAGE value not a file name. A wide range of image processing effects can be performed on the image with the EFFECT field. effect A WORD or BLOCK that renders image processing effects on the face image or background. More than one effect can be used at the same time. edge An OBJECT that specifies the edge of the face. It can include the color, size, and effects used for the edge. font An OBJECT that specifies the font used for the text. This includes the font name, style, size, color, offset, space, align, and other attributes. para An OBJECT that describes the paragraph characteristics of the text. It includes the origin, margin, indent, tabs, edit, wrap, and scrolling attributes. feel An OBJECT that holds the functions that define the behavior of the face. These functions are evaluated during the rendering, selection, and hovering over a face and during events related to the face. rate An INTEGER or TIME that specifies the rate of time events for a face. This is used for animation or repetitive events (such as holding the mouse down on certain types of user interface styles). An INTEGER indicates the number of events per second. A TIME provides the period between events. options A BLOCK of optional flags for the face. These are normally used by a top-level view face. Options include NO-TITLE, RESIZE, NO-BORDER, ALL-OVER. saved-area Enables faster rendering for transparent faces. When a face is transparent on a static (unchanging) backdrop, this field can be set to TRUE to accelerate redrawing. The face can change without requiring the backdrop to be rendered each time. The pixels for the area under the face will be saved into this field, changing it from a TRUE to an IMAGE. This field defaults to NONE. line-list A BLOCK that is used to track the offsets of text lines when text is being displayed. When more than 200 characters of text are being displayed, this list should be set to NONE when large changes are made to the text. This allows REBOL to recalculate the locations of all TEXT lines. VID Extensions VID extends the face definition to include these additional facets. Faces that are created with the LAYOUT or MAKE-FACE functions will include these facets in addition to those described above. colors A BLOCK of alternate colors used for the face. For example, this field would hold the colors for a button that changes colors on being selected. texts A BLOCK of alternate text used for the face. For example, buttons that display different text on selection would store that text here. effects A BLOCK of alternate effects used for a face. For example, a BUTTON style may use a different effect when it is in the down position. action A BLOCK or FUNCTION that is evaluated when the face has been selected. The type of event that triggers this action depends on the style of the face. alt-action An alternate BLOCK or FUNCTION that is evaluated on an alternate selection of the face. keycode A CHAR or BLOCK of shortcut keys for the face. When pressed, these keys will evaluate the ACTION field. state The event state of buttons. Indicates that the button is still being pressed. dirty? A LOGIC flag that indicates that the text of the face has been modified. Whenever editing is performed upon a text face, this flag will be set to TRUE. help An optional string that can be used for displaying information about a button or other type of GUI element. For example, when the mouse pointer hovers over a face, this string can be displayed as help information. file The FILE path or URL of the image file used for the face. The image file is automatically loaded and cached by VID. style The style WORD that was used to create the face. For example: BUTTON, FIELD, IMAGE, RADIO, etc. user-data A field that is available to programs for storing data related to the face. This field is not used by the VID system. Edge Facet The EDGE facet is an object that describes a rectangular frame that borders a face. It is used for creating image frames, button edges, table cell dividers, and other border effects. An edge is specified as an sub-object within the face object. An EDGE object contains these fields: color The color of the edge specified as a TUPLE. size An X-Y PAIR that specifies the thickness of the edge. The x value refers to the thickness of the vertical edges on the left and right, and the Y value refers to the horizontal edges at the top and bottom. effect A WORD or BLOCK that describes the effect to use for the edge. Edge effects include BEVEL, IBEVEL, BEZEL, IBEZEL, and NUBS. Font Facet The FONT facet is an object that describes the attributes of the text to be used within a face. The font is specified as an sub-object within the face object. The FONT object contains these fields: name The name of the font to use for the text. There are three predefined variables for machine independent fonts that have a similar appearance: font-serif (times-like), font-sans-serif (helvetica-like), and font-fixed (courier fixed width). To create machine independent programs, avoid specifying custom fonts. The default is font-sans-serif. size An INTEGER that specifies the point size of the font. The default size is 12. style A WORD or BLOCK of words that describe the style of the text. Choices are: BOLD, ITALIC, and UNDERLINE. When set to NONE no styles are used (default). color A TUPLE that specifies the color of the text. The default color is black (0.0.0). align A WORD that provides the alignment of the text within the face. Choices are: LEFT, RIGHT, and CENTER. valign A WORD that indicates the vertical alignment of the text within the face. Choices are: TOP, BOTTOM, and MIDDLE. offset A PAIR that specifies the offset of the text from the upper left corner of the face. The PARA facet object also has an effect on this offset. Default is 2x2. space A PAIR that specifies the spacing between characters and between lines. The x value affects the spacing between characters. The y value changes the spacing between lines. Positive values expand the text, negative values condense it. The default is 0x0. shadow A PAIR that specifies the direction and offset of the drop shadow to use for the text. Positive values project a shadow toward the lower right corner. Negative values project toward the upper left. The default is NONE. Para Facet The PARA facet is an object that controls the formatting of text paragraphs within the face. A para is specified as a sub-object within a face object. The PARA object contains these fields: origin An X-Y PAIR that specifies the offset of the text from the upper left corner of a face. The default is 2x2. margin An X-Y PAIR that specifies the right-most and bottom limits of text display within the face. The position is relative to the bottom right corner of the face. The default is 2x2. indent An X-Y PAIR that specifies the offset of a the first line of a paragraph. The X value specifies the indentation used for the first line of the paragraph. Positive and negative values may be used. The Y value specifies the spacing between the end of the previous paragraph and the first line of the next paragraph. The Y value has no affect on the first paragraph. The default is 0x0. scroll An X-Y PAIR used for horizontal and vertical scrolling of text within a face. The scroll amount that modifies the offset of the text relative to the face. The origin and margin values are not affected. The default is 0x0. tabs An INTEGER or BLOCK of integers that provide the tab spacing used within a paragraph. An INTEGER value indicates a fixed tab size spaced at regular intervals across the text. A BLOCK of integers provides the precise horizontal offset positions of each TAB in order. The default is 40. wrap? A LOGIC value that indicates that automatic line wrapping should occur. When set to TRUE, text that exceeds the margin will be automatically wrapped to the origin. When set to FALSE, text will not be wrapped. Feel Facet The FEEL facet controls face's behavior in response system events like redraw, mouse input, and keyboard input. The fields of the feel object are all functions that are called by the View system on specific events. A summary of these functions is provided below. See the Face Feeling chapter for details. The FEEL object contains these fields: engage The primary function called for the majority of events that occur within a face. The ENGAGE function is called when the mouse pointer is over it's face and either mouse button is pressed. The function will also be called if a mouse button has been pressed and the mouse is moved over the face. In addition, the function is called when time events occur, such as for animation or repetitive selection events. over This function is called when the mouse pointer passes over the face and no buttons are pressed. This allows code to capture hover events and provide user feedback by changing the appearance of the face. For example, hot text may change the color of the text as the mouse passes over it. This field is separate from ENGAGE because it is not used for most faces. Over actions can occur at a high frequency, so setting the OVER field to NONE allows the system to ignore it. detect This function is called each time any event passes through a face. This function can be used to process events that are directed toward any subface of the face. For example, the function is used by VID to process keyboard shortcuts. The DETECT function is normally used at the window face or screen face level. Note that the insert-event-func function should be used to trap screen-face global events. redraw This function is called immediately before a face is displayed. Defining this function allows a face to dynamically modify any of its facets prior to being displayed. When not being used, it is critical that this function be set to NONE to speed up the display. Effect Facet The EFFECT facet can be set to a WORD or a BLOCK that describes image processing operations to be performed on the backdrop of a face. When a block is used, multiple effects can be specified, and they are applied in the order in which they appear within the block. A wide range of hundreds of effects can be produced. Scaling fit Scales an image to the size of the face, less the edge of the face if it exists. The image will be scaled both horizontally and vertically to fit within the face. aspect Similar to FIT, but preserves the perspective of the image. The image is not distorted. If the image does not span the entire face, the remaining portion will be filled with the face background color. extend Extends an image horizontally, vertically, or both. An image is stretched without affecting its scale. For instance, a button with rounded ends can be resized without affecting the dimensions of the rounded ends. This allows a single button bitmap to be reused over a wide variety of sizes. Two PAIRs are supplied as arguments. The first PAIR specifies the offset where the image should be extended. It can be horizontal, vertical, or both. The second PAIR specifies the number of pixels to extend in either or both directions. Tiling tile Repeats the image over the entire face. This allows you to apply textures that span an entire face. The tile offset will be relative to the face. tile-view Similar to TILE, but the tile offset will be relative to the window face. Subimages clip Clips an image to the size of the face. This is normally done when the image is larger than the face, and the remaining effects do not need to be performed on the entire bitmap. The CLIP can be done at anytime in the effect block. For instance a CLIP done before a FLIP will produce a different result than a CLIP done after a FLIP. crop Extracts a portion of an image. This effect takes two PAIRs: the offset into the image and the size of the area needed. This operation can be used to pick any part of an image to be displayed separately. It allows you to pan and zoom on images. Translation flip Flips an image vertically, horizontally, or both. A PAIR is provided as an argument to specify the direction of the flip. The X specifies horizontal and the Y specifies vertical. rotate Rotates an image. An INTEGER specifies the number of degrees to rotate in the clockwise direction. (Currently only 0, 90, 180, and 270 degree rotations are supported.) reflect Reflects an image vertically, horizontally, or both. A PAIR is used to indicate the direction of reflection. The X value will reflect horizontally, and the Y value will reflect vertically. Negative and positive values specify which portion of the image is reflected. Image Processing invert Inverts the RGB values of an image. (Inversion is in the RGB color space.) luma Lightens or darkens an image. An INTEGER specifies the degree of the effect. Positive values lighten the image and negative values darken the image. contrast Modifies the contrast of the image. An INTEGER specifies the degree of the effect. A positive value increases the contrast and a negative value reduces the contrast. tint Changes the tint of the image. An INTEGER specifies the color phase of the tint. grayscale Converts a color image to black and white. colorize Colors an image. A TUPLE specifies the COLOR. The image is automatically converted to grayscale before it is colorized. [???Note] in docs/view-guide.txt multiply Multiplies each RGB pixel of an image to produce interesting coloration. An INTEGER, TUPLE, or IMAGE can be specified. An INTEGER will multiply each color component of each pixel by that amount. A TUPLE will multiply each of the red, green, and blue components separately. An IMAGE will multiply the red, green, and blue components of an image, allowing you to apply textures to existing images. [???Note] in docs/view-guide.txt difference Computes a difference of RGB pixel values. This can be used to compare two images to detect differences between them. An IMAGE is provided as an argument. Each of its RGB pixel values will be subtracted from the face image. blur Blurs an image. This effect may be used multiple times to increase the effect. sharpen Sharpens an image. This effect may be used multiple times to increase the effect. emboss Applies an emboss effect to the image. Gradients gradient Generates a color gradient. A PAIR and two color TUPLEs can be supplied as arguments (optional). The PAIR is used to determine the direction of the gradient. The X value of one specifies horizontal and a Y value of one specifies vertical. Both X and Y can be specified at the same time, producing a gradient in both directions. Negative values reverse the gradient in that direction. gradcol Colorizes an image to a gradient. Arguments are identical to GRADIENT. The image is colorized according to the colors of the gradient. gradmul Multiplies an image over a gradient. Arguments are identical to GRADIENT. The image is multiplied according to the colors of the gradient. Keys key Creates a transparent image by keying. A TUPLE or INTEGER can specify a chroma or luma key effect. A TUPLE will cause all pixels of the same value to become transparent. An INTEGER will cause all pixels with lesser luma values to become transparent. shadow Creates a drop shadow on a keyed image. Accepts the same arguments as KEY, but in addition to a creating transparent image it generates a 50 percent drop shadow. Algorithmic Shapes A few shapes can be algorithmically generated to reduce the need for images in some frequently used cases. arrow Generate an arrow image. An optional TUPLE can be used to specify the color of the arrow, otherwise the edge color will be used. The arrow is proportional to the size of the face. The direction of the arrow can be altered with FLIP or ROTATE. cross Generate an X cross image. This is used for check boxes. An optional TUPLE can be used to specify the color of the cross, otherwise the edge color will be used. The cross is proportional to the size of the face. oval Generate a oval image. An optional TUPLE can be used to specify the color of outside of the oval, otherwise the edge color will be used. The oval will be proportional to the size of the face. tab Generate tab buttons with rounded corners. The optional arguments are: a PAIR that specifies the edge to round, a TUPLE that is used as an edge color, an INTEGER that indicates the radius of the curves, and an INTEGER that controls the thickness of the edge. grid Generate a two dimensional grid of lines. This is a useful backdrop for graphical layout programs. The optional arguments are: a PAIR that specifies the horizontal and vertical spacing of the grid lines, a PAIR that specifies the offset of the first lines, a PAIR that indicates the THICKNESS of the horizontal and vertical lines, and a TUPLE that provides the color of the lines. draw Draws simple lines, shapes, and fills within a face. See the Draw Dialect document for detailed information. } ] ] do-events ;[! "[value]"] ;[!= "[value1 value2]"] ;[!== "[value1 value2]"] ;[* "[value1 value2]"] [** "[number exponent]"] [+ "[value1 value2]"] [++ "['word]"] [- "[value1 value2]"] [-- "['word]"] [/ "[value1 value2]"] [// "[value1 value2]"] [< "[value1 value2]"] [<= "[value1 value2]"] [<> "[value1 value2]"] [= "[value1 value2]"] [== "[value1 value2]"] [=? "[value1 value2]"] [> "[value1 value2]"] [>= "[value1 value2]"] [? "['word]"] [?? "['name]"] [about "[]"] [abs "[value]"] [absolute "[value]"] [action? "[value]"] [add "[value1 value2]"] [ajoin "[block]"] [alert "[str]"] [alias "[word name]"] [all "[block]"] [also "[value1 value2]"] [alter "[series value /case]"] [and "[value1 value2]"] [and~ "[value1 value2]"] [any "[block]"] [any-block? "[value]"] [any-function? "[value]"] [any-object? "[value]"] [any-path? "[value]"] [any-string? "[value]"] [any-type? "[value]"] [any-word? "[value]"] [append "[series value /only]"] [apply "[func block /only]"] [arccosine "[value /radians]"] [arcsine "[value /radians]"] [arctangent "[value /radians]"] [array "[size /initial value]"] [as-binary "[string]"] [as-pair "[x y]"] [as-string "[string]"] [ascii? "[value]"] [ask "[question /hide]"] [assert "[conditions /type]"] [at "[series index]"] [attempt "[value]"] [back "[series]"] [binary? "[value]"] [bind "[words known-word /copy]"] [bind? "[words]"] [bitset? "[value]"] [block? "[value]"] [body-of "[value]"] [bound? "[words]"] [break "[/return value]"] [brightness? "[color]"] [browse "[value /only]"] [build-attach-body "[body files boundary]"] [build-markup "[content /quiet]"] [build-tag "[values]"] [call {[cmd /input in /output out /error err /wait /console /shell /info /show]}] [caret-to-offset "[face offset]"] [case "[block /all]"] [catch "[block /name word]"] [cause-error "[err-type err-id args]"] [center-face "[obj /with face]"] [change "[series value /part range /only /dup count]"] [change-dir "[dir]"] [char? "[value]"] [charset "[chars]"] [checksum {[data /tcp /secure /hash size /method word /key key-value]}] [choose {[choices function /style styl /window winf /offset xy /across]}] [clean-path "[target]"] [clear "[series]"] [clear-face "[face /no-show]"] [clear-fields "[panel]"] [close "[port]"] [closure "[spec body]"] [closure? "[value]"] [collect "[body /into output]"] [comment "[value]"] [complement "[value]"] [component? "[name]"] [compose "[value /deep /only]"] [compress "[data]"] [confine "[offset size origin margin]"] [confirm "[question /with choices]"] [connected? "[]"] [construct "[block /with object]"] [context "[blk]"] [copy "[value /part range /deep]"] [copy* "[value /part range /deep]"] [cosine "[value /radians]"] [cp "[value /part range /deep]"] [create-link "[source dest /start dir /note desc /args arg-str]"] [crypt-strength? "[]"] [cvs-date "[date]"] [cvs-version "[str]"] [datatype? "[value]"] [date? "[value]"] [dbug "[msg]"] [debase "[value /base base-value]"] [decimal? "[value]"] [decloak "[data key /with]"] [decode-cgi "[args]"] [decode-url "[url]"] [decompress "[data]"] [default "['word value]"] [deflag-face "[face 'flag]"] [dehex "[value]"] [delete "[target /any]"] [delete-dir "[dir]"] [deline "[string /lines]"] [desktop "[url /only]"] [detab "[string /size number]"] [dh-compute-key "[obj public-key]"] [dh-generate-key "[obj]"] [dh-make-key "[/generate length generator]"] [difference "[set1 set2 /case /skip size]"] [dir? "[target]"] [dirize "[path]"] [disarm "[error]"] [dispatch "[port-block]"] [divide "[value1 value2]"] [do "[value /args arg /next]"] [do-boot "[target args dependent]"] [do-browser "[code]"] [do-events "[]"] [do-face "[face value]"] [do-face-alt "[face value]"] [do-thru "[url /args arg /update /check info /boot]"] [does "[body]"] [draw "[image commands]"] [dsa-generate-key "[obj]"] [dsa-make-key "[/generate length]"] [dsa-make-signature "[/sign obj data]"] [dsa-verify-signature "[obj data signature]"] [dump-face "[face]"] [dump-obj "[obj /match pat]"] [dump-pane "[face]"] [echo "[target]"] [edge-size? "[face]"] [editor "[file /app app-word]"] [eighth "[series]"] [either "[condition true-block false-block]"] [else "[]"] [email? "[value]"] [emailer "[/to target /subject what]"] [empty? "[series]"] [enbase "[value /base base-value]"] [encloak "[data key /with]"] [enline "[series /with end-of-line]"] [entab "[string /size number]"] [equal? "[value1 value2]"] [error? "[value]"] [even? "[number]"] [event? "[value]"] [exclude "[set1 set2 /case /skip size]"] [exists-thru? "[url /check info]"] [exists? "[target]"] [exit "[]"] [exp "[power]"] [extract {[series width /index pos /default value /into output]}] [fifth "[series]"] [file? "[value]"] [find {[series value /part range /only /case /any /with wild /skip size /match /tail /last /reverse]}] [find-key-face "[face keycode]"] [find-window "[face]"] [first "[series]"] [first+ "['word]"] [flag-face "[face 'flag]"] [flag-face? "[face 'flag]"] [flash "[val /with face /offset xy]"] [focus "[face /no-show]"] [for "['word start end bump body]"] [forall "['word body]"] [foreach "['word data body]"] [forever "[body]"] [form "[value]"] [forskip "['word skip-num body]"] [found? "[value]"] [fourth "[series]"] [free "[value]"] [func "[spec body]"] [funct "[spec body /with object]"] [function "[spec vars body]"] [function? "[value]"] [get "[word /any]"] [get-env "[var]"] [get-face "[face]"] [get-modes "[target modes]"] [get-net-info "[]"] [get-path? "[value]"] [get-style "[name /styles ss]"] [get-word? "[value]"] [greater-or-equal? "[value1 value2]"] [greater? "[value1 value2]"] [halt "[]"] [has "[locals body]"] [hash? "[value]"] [head "[series]"] [head? "[series]"] [help "['word]"] [hide "[face /show]"] [hide-popup "[/timeout]"] [hilight-all "[face]"] [hilight-text "[face begin end]"] [hsv-to-rgb "[hsv]"] [if "[condition then-block /else else-block]"] [image? "[value]"] [import-email "[data /multiple parent]"] [in "[object word]"] [in-dir "[dir block]"] [in-window? "[window face]"] [index? "[series /xy]"] [info? "[target]"] [inform "[panel /offset where /title ttl /timeout time]"] [input "[/hide]"] [input? "[]"] [insert "[series value /part range /only /dup count]"] [insert-event-func "[funct]"] [inside? "[p1 p2]"] [install "[]"] [integer? "[value]"] [intersect "[ser1 ser2 /case /skip size]"] [issue? "[value]"] [join "[value rest]"] [last "[series]"] [latin1? "[value]"] [launch {[value /reboot /uninstall /link url /quit /secure-cmd /as-is /install]}] [launch-thru "[url /update /check info]"] [layout {[specs /size pane-size /offset where /parent new /origin pos /styles list /keep /tight]}] [length? "[series]"] [lesser-or-equal? "[value1 value2]"] [lesser? "[value1 value2]"] [library? "[value]"] [license "[]"] [link-app? "[]"] [link-relative-path "[file]"] [link? "[]"] [list-dir "[dir]"] [list? "[value]"] [lit-path? "[value]"] [lit-word? "[value]"] [load "[source /header /next /library /markup /all]"] [load-image "[image-file /update /clear]"] [load-stock "[name /block size]"] [load-stock-block "[block]"] [load-thru {[url /update /binary /to local-file /all /expand /check info]}] [local-request-file "[parms]"] [log-10 "[value]"] [log-2 "[value]"] [log-e "[value]"] [logic? "[value]"] [loop "[count block]"] [lowercase "[string /part range]"] [make "[type spec]"] [make-dir "[path /deep]"] [make-face {[style /styles ss /clone /size wh /spec blk /offset xy /keep]}] [map-each "['word data body /into output]"] [map? "[value]"] [max "[value1 value2]"] [maximum "[value1 value2]"] [maximum-of "[series /skip size /case]"] [min "[value1 value2]"] [minimum "[value1 value2]"] [minimum-of "[series /skip size /case]"] [mod "[a b]"] [modified? "[target]"] [modulo "[a b]"] [mold "[value /only /all /flat]"] [money? "[value]"] [move "[source offset /part length /skip size /to]"] [multiply "[value1 value2]"] [native "[spec]"] [native? "[value]"] [negate "[number]"] [negative? "[number]"] [net-error "[info]"] [new-line "[block value /all /skip size]"] [new-line? "[block]"] [next "[series]"] [ninth "[series]"] [none? "[value]"] [not "[value]"] [not-equal? "[value1 value2]"] [notify "[str]"] [now {[/year /month /day /time /zone /date /weekday /yearday /precise]}] [number? "[value]"] [object? "[value]"] [odd? "[number]"] [offset-to-caret "[face offset]"] [offset? "[series1 series2]"] [op? "[value]"] [open {[spec /binary /string /direct /seek /new /read /write /no-wait /lines /with end-of-line /allow access /mode args /custom params /skip length]}] [open-events "[]"] [or "[value1 value2]"] [or~ "[value1 value2]"] [outside? "[p1 p2]"] [overlap? "[f1 f2]"] [pair? "[value]"] [paren? "[value]"] [parse "[input rules /all /case]"] [parse-email-addrs "[data]"] [parse-header "[parent data /multiple]"] [parse-header-date "[data]"] [parse-xml "[code]"] [path "[value selector]"] [path-thru "[url]"] [path? "[value]"] [pick "[series index]"] [poke "[value index data]"] [port? "[value]"] [positive? "[number]"] [power "[number exponent]"] [prin "[value]"] [print "[value]"] [probe "[value]"] [protect "[value]"] [protect-system "[]"] [q "[/return value]"] [query "[target /clear]"] [quit "[/return value]"] [quote "[:value]"] [random "[value /seed /secure /only]"] [read {[source /binary /string /direct /no-wait /lines /part size /with end-of-line /mode args /custom params /skip length]}] [read-cgi "[/limit size]"] [read-io "[port buffer length]"] [read-net "[url /progress callback]"] [read-thru {[url /progress callback /update /expand /check info /to local-file]}] [recycle "[/off /on /torture]"] [reduce "[value /only words]"] [refinement? "[value]"] [reflect "[value field]"] [reform "[value]"] [rejoin "[block]"] [remainder "[value1 value2]"] [remold "[value]"] [remove "[series /part range]"] [remove-each "['word data body]"] [remove-event-func "[funct]"] [rename "[old new]"] [repeat "['word value body]"] [repend "[series value /only]"] [replace "[target search replace /all /case /tail]"] [request {[str /offset xy /ok /only /confirm /type icon /timeout time]}] [request-color "[/color clr /offset xy]"] [request-date "[/offset xy /date when]"] [request-dir "[/title title-line /dir where /keep /offset xy]"] [request-download "[url /to local-file]"] [request-file {[/title title-line button-text /file name /filter filt /keep /only /path /save]}] [request-list "[titl alist /offset xy]"] [request-pass {[/offset xy /user username /only /title title-text]}] [request-text "[/offset xy /title title-text /default str]"] [resend "[to from message]"] [reset-face "[face /no-show]"] [resize-face "[face size /x /y /no-show]"] [return "[value]"] [reverse "[value /part range]"] [rgb-to-hsv "[rgb]"] [round {[n /even /down /half-down /floor /ceiling /half-ceiling /to scale]}] [routine? "[value]"] [rsa-encrypt "[obj data /decrypt /private /padding padding-type]"] [rsa-generate-key "[obj length generator]"] [rsa-make-key "[]"] [run "[file /as suffix]"] [same? "[value1 value2]"] [save "[where value /header header-data /bmp /png /all]"] [save-user "[]"] [scalar? "[value]"] [screen-offset? "[face]"] [script? "[value]"] [scroll-drag "[face /back /page]"] [scroll-face "[face offset /x /y /no-show]"] [scroll-para "[tf sf]"] [second "[series]"] [secure "['level]"] [select {[series value /part range /only /case /any /with wild /skip size]}] [send {[address message /only /header header-obj /attach files /subject subj /show]}] [series? "[value]"] [set "[word value /any /pad]"] [set-face "[face value /no-show]"] [set-font "[aface 'word val]"] [set-modes "[target modes]"] [set-net "[settings]"] [set-para "[aface 'word val]"] [set-path? "[value]"] [set-style "[name new-face /styles ss]"] [set-user "[]"] [set-user-name "[str]"] [set-word? "[value]"] [seventh "[series]"] [shift "[data bits /left /logical /part length]"] [show "[face]"] [show-popup "[face /window window-face /away]"] [sign? "[number]"] [sine "[value /radians]"] [sixth "[series]"] [size-text "[face]"] [size? "[target]"] [skip "[series offset]"] [sort {[series /case /skip size /compare comparator /part length /all /reverse]}] [source "['word]"] [span? "[pane /part count]"] [spec-of "[value]"] [split-path "[target]"] [square-root "[value]"] [stats {[/pools /types /series /frames /recycle /evals /clear]}] [strict-equal? "[value1 value2]"] [strict-not-equal? "[value1 value2]"] [string? "[value]"] [struct? "[value]"] [stylize "[specs /master /styles styls]"] [subtract "[value1 value2]"] [suffix? "[path]"] [swap "[series1 series2]"] [switch "[value cases /default case /all]"] [tag? "[value]"] [tail "[series]"] [tail? "[series]"] [take "[value /part length /last]"] [tangent "[value /radians]"] [tenth "[series]"] [textinfo "[face line-info line]"] [third "[series]"] [throw "[value /name word]"] [throw-error "[err-type err-id args]"] [throw-on-error "[blk]"] [time? "[value]"] [title-of "[value]"] [to "[type spec]"] [to-binary "[value]"] [to-bitset "[value]"] [to-block "[value]"] [to-char "[value]"] [to-closure "[value]"] [to-datatype "[value]"] [to-date "[value]"] [to-decimal "[value]"] [to-email "[value]"] [to-error "[value]"] [to-file "[value]"] [to-function "[value]"] [to-get-path "[value]"] [to-get-word "[value]"] [to-hash "[value]"] [to-hex "[value]"] [to-idate "[date]"] [to-image "[value]"] [to-integer "[value]"] [to-issue "[value]"] [to-itime "[time]"] [to-library "[value]"] [to-list "[value]"] [to-lit-path "[value]"] [to-lit-word "[value]"] [to-local-file "[path]"] [to-logic "[value]"] [to-map "[value]"] [to-money "[value]"] [to-none "[value]"] [to-pair "[value]"] [to-paren "[value]"] [to-path "[value]"] [to-port "[value]"] [to-rebol-file "[path]"] [to-refinement "[value]"] [to-relative-file "[file /no-copy /as-rebol /as-local]"] [to-set-path "[value]"] [to-set-word "[value]"] [to-string "[value]"] [to-tag "[value]"] [to-time "[value]"] [to-tuple "[value]"] [to-typeset "[value]"] [to-url "[value]"] [to-word "[value]"] [trace "[mode /net /function]"] [trim "[series /head /tail /auto /lines /all /with str]"] [true? "[val]"] [try "[block]"] [tuple? "[value]"] [type? "[value /word]"] [types-of "[value]"] [typeset? "[value]"] [undirize "[path]"] [unfocus "[]"] [uninstall "[]"] [union "[set1 set2 /case /skip size]"] [unique "[set /case /skip size]"] [unless "[condition block]"] [unlight-text "[]"] [unprotect "[value]"] [unset "[word]"] [unset? "[value]"] [until "[block]"] [unview "[/all /only face]"] [update "[port]"] [upgrade "[]"] [uppercase "[string /part range]"] [url? "[value]"] [Usage "[]"] [use "[words body]"] [utf? "[data]"] [value? "[value]"] [values-of "[value]"] [vbug "[msg]"] [view {[view-face /new /offset xy /options opts /title text]}] [viewed? "[face]"] [viewtop "[url /only]"] [wait "[value /all]"] [what "[]"] [what-dir "[]"] [what-ho "[]"] [while "[cond-block body-block]"] [win-offset? "[face]"] [within? "[point offset size]"] [word? "[value]"] [words-of "[value]"] [write {[destination value /binary /string /direct /append /no-wait /lines /part size /with end-of-line /allow access /mode args /custom params]}] [write-io "[port buffer length]"] [write-user "[]"] [xor "[value1 value2]"] [xor~ "[value1 value2]"] [zero? "[number]"] Notes
|