A notebook on Vid Extension Kit Wiki and Source - GiuseppeChillemi/VID-Extension-Kit GitHub Wiki
- Questions & Aswers:
-
Elements list:
- [Elements of: vid.r](#elements-of---vidr--https---githubcom-giuseppechillemi-vid-extension-kit-blob-master-source-vidr-)
- [Elements of: face-tree.r](#elements-of---face-treer--https---githubcom-giuseppechillemi-vid-extension-kit-blob-master-source-face-treer-)
- [elements of: feel.r](#elements-of---feelr--https---githubcom-giuseppechillemi-vid-extension-kit-blob-master-source-feelr-)
- [elements of: extras.r](#elements-of---extrasr--https---githubcom-giuseppechillemi-vid-extension-kit-blob-master-source-extrasr-)
- [elements of: windows.r](#elements-of---windowsr--https---githubcom-giuseppechillemi-vid-extension-kit-blob-master-source-windowr-)
- [elements of: main.r](#elements-of---mainr--https---githubcom-giuseppechillemi-vid-extension-kit-blob-master-source-mainr-) + Elements of: system/view/vid
- Todo:
-
Contexts in:
- [elements of: ctx-colors.r](#elements-of---ctx-colorsr--https---githubcom-giuseppechillemi-vid-extension-kit-blob-master-source-ctx-ctx-colorsr-)
- [elements of: ctx-content.r](#elements-of---ctx-contentr--https---githubcom-giuseppechillemi-vid-extension-kit-blob-master-source-ctx-ctx-contentr-)
- [elements of: ctx-dialog.r](#elements-of---ctx-dialogr--https---githubcom-giuseppechillemi-vid-extension-kit-blob-master-source-ctx-ctx-dialogr-)
- [elements of: ctx-draw.r](#elements-of---ctx-drawr--https---githubcom-giuseppechillemi-vid-extension-kit-blob-master-source-ctx-ctx-drawr-)
- [elements of: ctx-focus-ring.r](#elements-of---ctx-focus-ringr--https---githubcom-giuseppechillemi-vid-extension-kit-blob-master-source-ctx-ctx-focus-ringr-)
- [elements of: ctx-key-nav.r](#elements-of---ctx-key-navr--https---githubcom-giuseppechillemi-vid-extension-kit-blob-master-source-ctx-ctx-key-navr-)
- [elements of: ctx-menu-face.r](#elements-of---ctx-menu-facer--https---githubcom-giuseppechillemi-vid-extension-kit-blob-master-source-ctx-ctx-menu-facer-)
- [elements of: ctx-list.r](#elements-of---ctx-listr--https---githubcom-giuseppechillemi-vid-extension-kit-blob-master-source-ctx-ctx-listr-)
- [elements of: ctx-resize.r](#elements-of---ctx-resizer--https---githubcom-giuseppechillemi-vid-extension-kit-blob-master-source-ctx-ctx-resizer-)
- [elements of: ctx-sheet.r](#elements-of---ctx-sheetr--https---githubcom-giuseppechillemi-vid-extension-kit-blob-master-source-ctx-ctx-sheetr-)
- [elements of: ctx-skin.r](#elements-of---ctx-skinr--https---githubcom-giuseppechillemi-vid-extension-kit-blob-master-source-ctx-ctx-skinr-)
- [elements of: ctx-surface.r](#elements-of---ctx-surfacer--https---githubcom-giuseppechillemi-vid-extension-kit-blob-master-source-ctx-ctx-surfacer-)
- [elements of: ctx-text.r](#elements-of---ctx-textr--https---githubcom-giuseppechillemi-vid-extension-kit-blob-master-source-ctx-ctx-textr-)
- [elements of: ctx-tool-tip.r](#elements-of---ctx-tool-tipr--https---githubcom-giuseppechillemi-vid-extension-kit-blob-master-source-ctx-ctx-tool-tipr-)
- [elements of: ctx-vid-debug.r](#elements-of---ctx-vid-debugr--https---githubcom-giuseppechillemi-vid-extension-kit-blob-master-source-ctx-ctx-vid-debugr-)
- Styles in:
Table of contents generated with markdown-toc
- How is the VIEW tree ?
- Which basic knowledge you need ?
- Which is the bigger structure ?
- Which are the tecniques used ?
- Why there are 3 or for fixed arguments in certain functions ?
- Which are all the elements that could be estracted ?
- How a feel event became an on-* actor ?
- Which are all the styles ?
- How to style ad super stile words ?
- Which is the building and including model ?
- How header words ?
- Which are all de context ?
- How a function is attached to a... (Try to undestand the structure)
- How are extra DOC stored ?
- Which are all the objects ?
- Which are the native ones and added ones ?
- How does Henrik extends the VID/VIEW ? Has some native functions been revrittend and extnded and how ?
- Which are all original vid functions and extended ?
- Could we replace the encoded styles and how ? Are they size depened fro the PNG ?
- Which is the resizing model ? How is it calculated ? Which tecnniques and functions ?
- Which are the managed events ?
- Which are all the functions ?
- Could we divide it per area ?
- Could we uncomment parts of commented code and have new functions ?
- Where are the commented parts ?
- Could we mark the sources ?
- How do we extract info like in the VEK browser ?
- Are complex panels being used ?
- Do stylize works here ?
- which are all the extended parts ?
- How is the on-* attached to each face ?
- How is the function added and extectued ?
- Why Henrick uses
SET 'functioname
andname: func [] format ?
- How functions are propagated ? Which is the root one ?
- How pane and parents works ? And display ?
- How is the original VID tree compared to the new one ?
- Which are the incomplete areas and stubs?
-
All Areas
-
All functions
-
All Styles
-
All super styles
-
All events
-
All actors
-
All events
-
All patched functions
-
All files
-
All GFX Elements
-
All comound styles
-
All features
-
All requesters
-
All VID Original Objects
VID-FACE (cloned from FACE) (Don't know if it is the original or extended, it is marked as ROOT)
Facet-words: (Block!) (note, order is important)
-
All VID Extended Objects
-
The view tree system/view/vid
-
All functions per area
- all face management
- all actors management
- View the USR Actors and enlist all available functions
- Create new more modern style, even weblike
- Add the Baby Steps
- Add the "Kind of windows"
- Make snapshot of all the panels
- Create a public panels/styles repository
- Extract Basic set-get-reset functions and variants
- Describe how are they are extended and the contexts found in the source
- Extract and descrive View, unview, make-windows, etc.
- Comment code
- Extract all styles
- Extract Dialogs (Ongoing) (Done)
- Analyze the on-init-window and make a graph of the dependencies
- Find a way to extract actors from source and find a way to link them to wiki page, so to keep track to what I have documented
- List VID object and tree
- Vid-rules: In layout function https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/0d0dfecf94215aa331c36043a1838f97d5d53873/source/vid.r#L702
- Layout function https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/0d0dfecf94215aa331c36043a1838f97d5d53873/source/vid.r#L646
Elements of: vid.r
(Extracted from ultra EDIT. Extract them via parser or while running if possible)
Objects
- text-body
- set-font
- set-para
- set-edge
- set-valid
- set-tool-tip-face
- get-style
- set-style
- make-face
- stylize
- layout
Functions
- find-key-face
- do-face
- do-face-alt
- track
- error
- warning
- expand-specs
- grow-facets
- do-facets
- next-tab
- set-edge
- set-actor
Elements of: face-tree.r
(Extracted from ultra EDIT. Extract them via parser or while running if possible)
Objects
- ctx-validate
- validate-init-face
- validate-face
- init-enablers
Functions
- set-parent-faces
- click-face
- root-face
- find-face
- next-pane-face
- next-face
- get-tip-face
- back-face
- traverse-face
- ascend-face
- over-face
- within-face?
- find-relative-face
- find-style
- iterated-face?
- compound-face?
- visible-face?
- iterated-pane
- get-pane
- focus-default-input
- focus-first-input
- focus-first-false
- flag-face
- flag-face?
- find-flag
- save-flags
- restore-flags
- save-face
- validate?
- show-indicator
- validate-init-face-func
- validate-face-func
- save-feel
- restore-feel
- save-font
- restore-font
- set-face-path
- get-face-path
- freeze-face
- thaw-face
- get-default-face
- set-default-face
- dirty-face?
- dirty-face
- clean-face
- adjust-face-scrollers
- edge-size
- face-size
- face-span
elements of: feel.r
(Extracted from ultra EDIT. Extract them via parser or while running if possible)
Objects
-
enable-face
-
ctx-access
-
Sub-objects
- data
- Methods
- set-face*
- get-face*
- reset-face*
-
Sub-objects
Functions
- setup-face
- set-face
- get-face
- clear-face
- reset-face
- search-face
- edit-face
- query-face
- select-face
- unselect-face
- get-select-face
- attach-face
- scroll-face
- resize-face
- move-face
- refresh-face
- enable-face
- disable-face
- insert-actor-func
- remove-actor-func
- pass-actor
- act-face
elements of: extras.r
(Extracted from ultra EDIT. Extract them via parser or while running if possible)
Functions
- format
- face-size-text
- face-size-from-text
- set-image
- hinge
elements of: windows.r
(Extracted from ultra EDIT. Extract them via parser or while running if possible)
Objects
- compressed-events
- show-popup Functions
- make-window
- vid-window?
- window-open?
- do-window
- activate-window
- maximize-window
- display-window
- get-parent
- make-pane
- set-pane
- clear-pane
- popup?
- key-sense
- detect-func
- init-window
- view
- unview
- hide-popup
- inform
elements of: main.r
(Extracted from ultra EDIT. Extract them via parser or while running if possible)
Static Includes
- %vid.r
- %ctx/ctx-vid-debug.r
- %feel.r
- %ctx/ctx-text.r
- %face-tree.r
- %image-stock.r
- %ctx/ctx-content.r
- %ctx/ctx-list.r
- %ctx/ctx-scroll.r
- %ctx/ctx-focus-ring.r
- %ctx/ctx-tool-tip.r
- %ctx/ctx-key-nav.r
- %ctx/ctx-resize.r
- %window.r
- %ctx/ctx-dialog.r
- %extras.r
- %styles/face
- %styles/image
- %styles/sensor
- %styles/text
- %styles/box
- %styles/button
- %styles/toggle
- %styles/scroller
- %styles/panel
- %styles/dialog-buttons
- %styles/field
- %styles/label
- %styles/construct
- %styles/selector
- %styles/icon
- %styles/balance
- %styles/date
- %styles/indicator
- %styles/pop-face
- %styles/form
- %styles/list
- %styles/search
- %styles/super-styles
- %styles/windows
- %styles/styles
(Extracted vie probe)
[verbose warn resizing? word-limits image-stock vid-feel icon-image radio.bmp radio-on.bmp text-body vid-face state-flags vid-words vid-styles track error warning facet-words fw-with fw-feel spot expand-specs grow-facets do-facets next-tab vid-origin vid-space choice-face set-edge set-actor]
elements of: ctx-colors.r
elements of: ctx-content.r
elements of: ctx-dialog.r
elements of: ctx-draw.r
elements of: ctx-focus-ring.r
elements of: ctx-key-nav.r
elements of: ctx-menu-face.r
elements of: ctx-list.r
elements of: ctx-resize.r
elements of: ctx-sheet.r
elements of: ctx-skin.r
elements of: ctx-surface.r
elements of: ctx-text.r
elements of: ctx-tool-tip.r
elements of: ctx-vid-debug.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/balance.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/box.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/button.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/console.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/construct.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/date.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/dialog-buttons.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/doc.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/face.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/field.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/file.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/flags.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/form.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/icon.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/image.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/indicator.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/label.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/list.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/menu.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/panel.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/pop-face.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/scroller.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/search.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/selector.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/sensor.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/styles.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/super-styles.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/tags.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/text.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/toggle.r
https://github.com/GiuseppeChillemi/VID-Extension-Kit/blob/master/source/styles/windows.r
## Dialogs:
-
request-dir
func [/file where /title ttl] [request any [ttl "Get Directory"] 'layout-dir where 'use-cancel] -
request-color
func [value /title ttl] [request any [ttl "Get Color"] 'layout-color value 'use-cancel] -
request-user
func [user pass /title ttl] [request any [ttl "Enter User & Pass"] 'layout-user reduce [user pass] 'use-cancel] -
request-pass
func [value /title ttl] [request any [ttl "Enter Password"] 'layout-pass value 'use-cancel] -
request-date
func [/date value /title ttl] [request any [ttl "Enter Date"] 'layout-date any [value now/date] 'use-cancel] -
request-download
func [urls /title ttl] [request any [ttl "Downloading..."] either block? urls ['layout-downloads] ['layout-download] urls 'cancel] -
request-value
func [value /title ttl] [request any [ttl "Enter Value"] 'layout-value value 'use-cancel] -
request-text
func [value /title ttl] [request any [ttl "Enter Text"] 'layout-text value 'use-cancel] -
request-rename
func [value /title ttl] [request any [ttl "Enter New Name"] 'layout-rename value 'use-cancel] -
request-email
func [target subject text /title ttl] [request any [ttl "Send Email"] 'layout-email reduce [target subject text] 'send-cancel] -
request-message
func [target text /title ttl] [request any [ttl "Send Message"] 'layout-message reduce [target text] 'send-cancel] -
request-item
func [data /title ttl] [request any [ttl "Select One Item"] 'layout-list data 'use-cancel] -
request-items
func [data /title ttl] [request any [ttl "Select Item(s)"] 'layout-lists data 'use-cancel] -
request-find
func [src /title ttl] [request any [ttl "Search for Text"] 'layout-find data 'use-cancel] -
request-replace
func [src repl /title ttl] [request any [ttl "Search and Replace Text"] 'layout-replace reduce [src repl] 'use-cancel] -
question
func [str /buttons btns /title ttl] [request any [ttl "Question"] 'layout-question str any [btns 'yes-no]] -
important-question
func [str /buttons btns /title ttl] [request any [ttl "Question"] 'layout-warning str any [btns 'yes-no]] -
notify
func [str /title ttl] [request any [ttl "Notification"] 'layout-notify str 'close] -
alert
func [str /title ttl] [request any [ttl "Alert"] 'layout-alert str 'close] -
warn
func [str /title ttl] [request any [ttl "Warning"] 'layout-warning str 'close] -
about-program
func [/title ttl] [request any [ttl "About Program"] 'layout-about none 'close]
dir-path: %.
_filter-list_
[["*"] ["*.r" "*.reb" "*.rip"] ["*.txt"] ["*.jpg" "*.gif" "*.bmp" "*.png"]]
request-file
func [
{Requests a file using a popup list of files and directories.}
/title "Change heading on request."
title-text "Title text of request"
button-text "Button text for selection"
/file name "Default file name or block of file names"
/filter filt "Filter or block of filters"
/keep "Keep previous settings and results"
/only "Return only a single file, not a block."
/path "Return absolute path followed by relative files."
/save "Request file for saving, otherwise loading."
/local where data filt-names filt-values
view
: func [
"Displays a window face."
view-face [object!]
/new "Creates a new window and returns immediately"
/offset xy [pair!] "Offset of window on screen"
/options opts [block! word!] "Window options [no-title no-border resize]"
/title text [string!] "Window bar title"
/local scr-face
;Show differencies from regular view
unview
: func [
"Closes window views, except main view."
/all "Close all views, including main view"
/only face [object!] "Close a single view"
/local pane
(Put example code)
hide-popup
: func [/timeout /local focal-win-face win-face]
inform
: func [
{Display an exclusive focus panel for alerts, dialogs, and requestors.}
panel [object!]
/offset where [pair!] "Offset of panel"
/title ttl [string!] "Dialog window title"
/options opts "Window display options"
/timeout time
/event evt-func "Event Function"
/local sv old-focus
format
: func [
"Format a string according to the format dialect."
rules {A block in the format dialect. E.g. [10 -10 #"-" 4]}
values
/pad p
/local out val rule
find-key-face: func [ "Search faces to determine if keycode applies." face [object!] keycode [char! word!] /local w f result ] [ either all [ w: in face 'keycode w: get w any [keycode = w all [block? w find w keycode]] ] [face] [ w: in face 'pane either block? w: get w [ result: none foreach f w [if all [object? f f: find-key-face f keycode] [result: f break]] result ] [ if object? :w [find-key-face w keycode] ] ] ] do-face: func [face value] [ do get in face 'action face either value [value] [get-face face] ] do-face-alt: func [face value] [ do get in face 'alt-action face either value [value] [get-face face] ]
Vid face actors
on-setup:
on-key:
on-tab:
on-return:
on-click:
on-alt-click:
on-double-click:
on-drag:
on-set:
on-clear:
on-reset:
on-escape:
on-focus:
on-unfocus:
on-scroll:
on-resize:
on-align:
on-time:
on-search:
on-query:
on-edit:
on-select:
on-unselect:
on-highlight:
on-validate:
on-init-validate:
on-init-window:
on-resize-window:
on-move-window:
on-close-window:
on-change:
on-enable:
on-disable:
on-freeze:
on-thaw:
on-redraw:
on-activate:
on-deactivate:
on-maximize:
on-minimize:
on-restore:
on-text:
on-refresh:
on-offset:
vid-face/doc: make object! [
info: "base face style"
string:
image:
logic:
integer:
pair:
tuple:
file:
url:
decimal:
time:
block:
keywords:
`facet-words`: [
edge font para doc feel
align fill spring setup default
effect effects keycode rate colors texts help user-data
with [args: next args]
bold italic underline [set-font new style first args args]
left center right [set-font new align first args args]
top middle bottom [set-font new valign first args args]
plain [set-font new style none args]
of [new/related: second args next args]
font-size [set-font new size second args next args]
font-name [set-font new name second args next args]
font-color [set-font new color second args next args]
wrap [set-para new wrap? on args]
no-wrap [set-para new wrap? off args]
required [set-valid new required true args]
validate [set-valid new action second args next args]
tool-tip [set-tool-tip-face new action second args next args]
disabled [disable-face new args]
as-is [flag-face new as-is args]
shadow [set-font new shadow second args next args]
frame [set-edge new none args]
bevel [set-edge new 'bevel args]
ibevel [set-edge new 'ibevel args]
on-setup [set-actor new 'on-setup second args next args]
on-key [set-actor new 'on-key second args next args]
on-tab [set-actor new 'on-tab second args next args]
on-return [set-actor new 'on-return second args next args]
on-click [set-actor new 'on-click second args next args]
on-alt-click [set-actor new 'on-alt-click second args next args]
on-double-click [set-actor new 'on-double-click second args next args]
on-drag [set-actor new 'on-drag second args next args]
on-set [set-actor new 'on-set second args next args]
on-clear [set-actor new 'on-clear second args next args]
on-reset [set-actor new 'on-reset second args next args]
on-escape [set-actor new 'on-escape second args next args]
on-focus [set-actor new 'on-focus second args next args]
on-unfocus [set-actor new 'on-unfocus second args next args]
on-scroll [set-actor new 'on-scroll second args next args]
on-resize [set-actor new 'on-resize second args next args]
on-align [set-actor new 'on-align second args next args]
on-time [set-actor new 'on-time second args next args]
on-search [set-actor new 'on-search second args next args]
on-query [set-actor new 'on-query second args next args]
on-edit [set-actor new 'on-edit second args next args]
on-select [set-actor new 'on-select second args next args]
on-unselect [set-actor new 'on-unselect second args next args]
on-highlight [set-actor new 'on-highlight second args next args]
on-validate [set-actor new 'on-validate second args next args]
on-init-validate [set-actor new 'on-init-validate second args next args]
on-init-window [set-actor new 'on-init-window second args next args]
on-resize-window [set-actor new 'on-resize-window second args next args]
on-move-window [set-actor new 'on-move-window second args next args]
on-close-window [set-actor new 'on-close-window second args next args]
on-change [set-actor new 'on-change second args next args]
on-enable [set-actor new 'on-enable second args next args]
on-disable [set-actor new 'on-disable second args next args]
on-freeze [set-actor new 'on-freeze second args next args]
on-thaw [set-actor new 'on-thaw second args next args]
on-redraw [set-actor new 'on-redraw second args next args]
on-activate [set-actor new 'on-activate second args next args]
on-deactivate [set-actor new 'on-deactivate second args next args]
on-maximize [set-actor new 'on-maximize second args next args]
on-minimize [set-actor new 'on-minimize second args next args]
on-restore [set-actor new 'on-restore second args next args]
on-text [set-actor new 'on-text second args next args]
on-refresh [set-actor new 'on-refresh second args next args]
on-offset [set-actor new 'on-offset second args next args]
]
dump-face
: func [
"Print face info for entire pane. (for debugging)"
face [object!]
/parent p
/local depth pane style
describe-face
: func [
{Small dump of face characteristics for error messages.}
face
] [
setup-face: func [ "Sets up a face construct" face value /no-show "Do not show change yet" /local access show? ] [ if all [ access: get in face 'access in access 'setup-face* ] [ access/setup-face* face :value if all [ any [none? face/init empty? face/init] flag-face? face layout ] [ ctx-resize/align/no-show face ] act-face face none 'on-setup ] any [no-show show face] face ] set-face: func [ {Sets the primary value of a face. Returns face object (for show).} face value /no-show "Do not show change yet" /local access ] [ if all [ access: get in face 'access in access 'set-face* ] [ access/set-face* face :value act-face face none 'on-set ] any [no-show show face] face ] get-face: func [ "Returns the primary value of a face." face [object!] /local access ] [ if all [ access: get in face 'access in access 'get-face* ] [ access/get-face* face ] ] clear-face: func [ "Clears the primary value of a face." face /no-show "Do not show change yet" /local access ] [ if all [ access: get in face 'access in access 'clear-face* ] [ access/clear-face* face act-face face none 'on-clear ] any [no-show show face] face ] reset-face: func [ "Resets the primary value of a face." face /no-show "Do not show change yet" /local access ] [ if all [ access: get in face 'access in access 'reset-face* ] [ access/reset-face* face act-face face none 'on-reset ] any [no-show show face] face ] search-face: func [ "Searches the contents of a face for a value." face value /no-show "Do not show change yet" /local access ] [ if all [ access: get in face 'access in access 'search-face* ] [ access/search-face* face :value act-face face none 'on-search ] any [no-show show face] face ] edit-face: func [ "Manipulate the content of the face." face op value /at pos "Positions" /field word "Field" /no-show "Do not show change yet" /local access ] [ if all [ access: get in face 'access in access 'edit-face* ] [ access/edit-face* face :op :value :pos :word act-face face none 'on-edit ] any [no-show show face] face ] query-face: func [ {Performs a query on a face to return a reduced result set.} face value /no-show "Do not show change yet" /local access ] [ if all [ access: get in face 'access in access 'query-face* ] [ access/query-face* face :value act-face face none 'on-query ] any [no-show show face] face ] select-face: func [ {Selects a range of data in a face that supports it.} face range /no-show "Do not show change yet" /local access ] [ if all [ access: get in face 'access in access 'select-face* ] [ access/select-face* face :range act-face face none either :range ['on-select] ['on-unselect] ] any [no-show show face] face ] unselect-face: func [ {Unselects a range of data in a face that supports it.} face range /no-show "Do not show change yet" /local access ] [ if all [ access: get in face 'access in access 'unselect-face* ] [ access/unselect-face* face :range act-face face none 'on-unselect ] any [no-show show face] face ] get-select-face: func [ {Return the face selection index in a face that supports it.} face /local access ] [ if all [ access: get in face 'access in access 'get-select-face* ] [ access/get-select-face* face ] ] attach-face: func [ {Attaches the first face to the second, specifying what to do and when.} from-face "Face to act with" to-face "Face to act on" what [word!] "What to act with" when [word! block!] "When to act" ] [ what when from-face to-face get in from-face what ] scroll-face: func [ "Scrolls a face according to scroll values." face x-value [number! none!] "Value between 0 and 1" y-value [number! none!] "Value between 0 and 1" /step {x and y values are multiples of face step size instead of absolutes} /no-show "Do not show changes yet." /local access show? scroll ] [ if all [ access: get in face 'access in access 'scroll-face* ] [ if all [ step in access 'get-offset* ] [ if all [x-value not zero? x-value] [ x-value: max 0 min 1 (face/scroll/step-unit face) * x-value + access/get-offset* face 'x ] if all [y-value not zero? y-value] [ y-value: max 0 min 1 (face/scroll/step-unit face) * y-value + access/get-offset* face 'y ] ] set/any 'show? access/scroll-face* face x-value y-value if value? 'show? [no-show: not show?] if show? [act-face face none 'on-scroll] ] any [no-show show face] face ] resize-face: func [ "Resize a face." face size [number! pair!] /x "Resize only width" /y "Resize only height" /no-show "Do not show change yet" /local access ] [ if all [ access: get in face 'access in access 'resize-face* ] [ access/resize-face* face size x y either all [ in face 'style 'window = get in face 'style ] [ traverse-face face [ act-face face none 'on-resize-window ] ] [ act-face face none 'on-resize ] ] any [no-show show face] face ] move-face: func [ "Move a face." face offset [number! pair!] size /scale {Keeps the lower right corner at the original position} /no-show "Do not show change yet" ] [ face/offset: face/offset + offset if scale [ resize/no-show face face/size face/size - offset ] any [no-show show face] face ] refresh-face: func [ "Refresh a face with a data source." face /no-show "Do not show change yet" /local access ] [ if all [ access: get in face 'access in access 'refresh-face* ] [ access/refresh-face* face act-face face none 'on-refresh ] any [no-show show face] face ] set 'enable-face func [ {Enables a face or a panel of faces with TABBED flag.} face /no-show "Do not show change yet." /local flags ] [ either any [ flag-face? face panel flag-face? face compound ] [ deflag-face face disabled if flag-face? face detabbed [ deflag-face face detabbed flag-face face tabbed ] traverse-face face [enable-face/no-show face] ] [ if flag-face? face disabled [ deflag-face face disabled if flag-face? face detabbed [ deflag-face face detabbed flag-face face tabbed ] restore-feel face restore-font face either all [ in face 'access in face/access 'enable-face* ] [ face/access/enable-face* face ] [ remove/part find/reverse tail face/effect first disabled-effect length? disabled-effect ] ] ] any [no-show show face] ] enable-face: func [ {Enables a face or a panel of faces with DISABLED flag.} face /no-show "Do not show change yet." /local flags ] [ if flag-face? face disabled [ deflag-face face disabled if flag-face? face detabbed [ deflag-face face detabbed flag-face face tabbed ] restore-feel face act-face face none 'on-enable ] if any [ flag-face? face panel flag-face? face compound ] [ traverse-face face [enable-face/no-show face] ] svvf/set-face-state face none any [no-show show face] ] disable-face: func [ {Disables a face or a panel of faces with ACTION flag.} face [object!] /no-show "Do not show change yet." ] [ if same? face get-tab-face face [ validate-face face unfocus face ] if all [ not flag-face? face disabled flag-face? face action ] [ if flag-face? face tabbed [ deflag-face face tabbed flag-face face detabbed ] flag-face face disabled save-feel face make face/feel [over: engage: detect: none] act-face face none 'on-disable ] if any [ flag-face? face panel flag-face? face compound ] [ traverse-face face [disable-face/no-show face] ] svvf/set-face-state face none any [no-show show face] ] insert-actor-func: func [fc actor fn /from fac] [ if in fc 'actors [ if none? get in fc/actors actor [ fc/actors/:actor: make block! [] ] unless find fc/actors/:actor :fn [ insert/only insert fc/actors/:actor if from [fac] :fn ] ] ] remove-actor-func: func [face actor fn /local act] [ if in face 'actors [ any [ none? act: get in face/actors actor act: find act :fn act: back act remove/part act 2 ] ] ] pass-actor: func [src-face target-face actor] [ if all [in src-face 'actors in target-face 'actors] [ foreach [fc act] any [get in src-face/actors actor []] [ insert-actor-func/from target-face actor :act any [fc src-face] ] ] ] act-face: func [[catch] face event actor] [ unless in face 'actors [ throw make error! join "Actors do not exist for " describe-face face ] unless find first face/actors actor [ throw make error! reform ["Actor" actor "not found"] ] if find ctx-vid-debug/debug 'actor [ print ["Face:" describe-face face] print ["Actor:" actor] ] if block? get in face/actors actor [ foreach [fc act] get in face/actors actor [ act any [fc face] get-face any [fc face] event actor ] ] ]
text edit core
...
keymap: [
#"^H" back-char
#"^-" tab-char
#"^" del-char
#"^M" enter
#"^A" all-text
#"^C" copy-text
#"^X" cut-text
#"^V" paste-text
#"^T" clear-tail
#"^[" escape
...
base-keys: make bitset! 64#{AQAAAP//////////////f/////////////////////8=}
nav-keys: make bitset! ["^-"]
ctrl-keys: union nav-keys make bitset! [#"^H" #"^M" #"^" #" "]
integer-keys: make bitset! [#"0" - #"9"]
sign-key: make bitset! [#"-" #"+"]
decimal-keys: make bitset! [#"0" - #"9" #"." #","]
tuple-keys: make bitset! [#"0" - #"9" #"."]
keys-to-insert: func [face /local base] [
base: case [
flag-face? face integer [integer-keys]
flag-face? face decimal [decimal-keys]
true [base-keys]
]
if flag-face? face sign [base: union base sign-key]
base
]
...
COMPOUNDS
LEFT-PANEL: PANEL spring [right] align [left] fill 0x1
LEFT-TOP-PANEL: PANEL spring [right bottom] align [left top]
LEFT-BOTTOM-PANEL: PANEL spring [right top] align [left bottom]
RIGHT-PANEL: PANEL spring [left] align [right] fill 0x1
RIGHT-TOP-PANEL: PANEL spring [left bottom] align [right top]
RIGHT-BOTTOM-PANEL: PANEL spring [left top] align [right bottom]
BOTTOM-PANEL: PANEL spring [top] align [bottom] fill 1x0
TOP-PANEL: PANEL spring [bottom] align [top] fill 1x0
CENTER-PANEL: PANEL spring [left right bottom top] align [center]
CENTER-TOP-PANEL: PANEL spring [left right bottom] align [left right top]
CENTER-BOTTOM-PANEL: PANEL spring [left right top] align [left right bottom]
CENTER-LEFT-PANEL: PANEL spring [right bottom top] align [left top bottom]
CENTER-RIGHT-PANEL: PANEL spring [left bottom top] align [right top bottom]
SCROLL-PANEL: COMPOUND with [
FRAME: PANEL
LEFT-FRAME: FRAME spring [right] align [left] fill 0x1
LEFT-TOP-FRAME: FRAME spring [right bottom] align [left top]
LEFT-BOTTOM-FRAME: FRAME spring [right top] align [left bottom]
RIGHT-FRAME: FRAME spring [left] align [right] fill 0x1
RIGHT-TOP-FRAME: FRAME spring [left bottom] align [right top]
RIGHT-BOTTOM-FRAME: FRAME spring [left top] align [right bottom]
BOTTOM-FRAME: FRAME spring [top] align [bottom] fill 1x0
TOP-FRAME: FRAME spring [bottom] align [top] fill 1x0
CENTER-FRAME: FRAME spring [left right bottom top] align [center]
CENTER-TOP-FRAME: FRAME spring [left right bottom] align [left right top]
CENTER-BOTTOM-FRAME: FRAME spring [left right top] align [left right bottom]
CENTER-LEFT-FRAME: FRAME spring [right bottom top] align [left top bottom]
CENTER-RIGHT-FRAME: FRAME spring [left bottom top] align [right top bottom]
SCROLL-FRAME: SCROLL-PANEL
V-SCROLL-FRAME: V-SCROLL-PANEL
H-SCROLL-FRAME: H-SCROLL-PANEL
COLUMN: BOX EDGE NONE with [
TRANSPARENT-PANEL: PANEL
TAB-PANEL-FRAME: PANEL
TAB-PANEL: PANEL fill 1x1 with [
....
LEFT-BUTTON: BUTTON ctx-colors/colors/true-color
RIGHT-BUTTON: BUTTON align [right] spring [left bottom]
CENTER-BUTTON: BUTTON align [left right] spring [left right]
TRUE-BUTTON: LEFT-BUTTON "True" ctx-colors/colors/true-color [ctx-dialog/set-dialog-value face true]
FALSE-BUTTON: RIGHT-BUTTON "False" ctx-colors/colors/false-color [ctx-dialog/set-dialog-value face false]
VALIDATE-BUTTON: TRUE-BUTTON "Validate" ctx-colors/colors/true-color [ctx-dialog/dialog-use face]
OK-BUTTON: TRUE-BUTTON "OK" ctx-colors/colors/true-color
YES-BUTTON: TRUE-BUTTON "Yes" ctx-colors/colors/true-color
RETRY-BUTTON: TRUE-BUTTON "Retry" ctx-colors/colors/true-color
SAVE-BUTTON: VALIDATE-BUTTON "Save" ctx-colors/colors/true-color
USE-BUTTON: VALIDATE-BUTTON "Use" ctx-colors/colors/true-color
SEND-BUTTON: VALIDATE-BUTTON "Send" ctx-colors/colors/true-color
CANCEL-BUTTON: FALSE-BUTTON "Cancel" ctx-colors/colors/false-color
CLOSE-BUTTON: CENTER-BUTTON "Close" [ctx-dialog/set-dialog-value face false]
NO-BUTTON: FALSE-BUTTON "No" ctx-colors/colors/false-color
BTN-GROUP: COMPOUND fill 1x0 spring [top]
CLOSE: BTN-GROUP [bar close-button]
CANCEL: BTN-GROUP [bar cancel-button align [left right] spring [left right]]
OK-CANCEL: BTN-GROUP [across bar return ok-button cancel-button]
SAVE-CANCEL: BTN-GROUP [across bar return save-button cancel-button]
USE-CANCEL: BTN-GROUP [across bar return use-button cancel-button]
SEND-CANCEL: BTN-GROUP [across bar return send-button cancel-button]
YES-NO: BTN-GROUP [across bar return yes-button no-button]
YES-NO-CANCEL: BTN-GROUP [across bar return yes-button cancel-button align none no-button align none]
RETRY-CANCEL: BTN-GROUP [across bar return retry-button no-button cancel-button]
DATE-TIME-FIELD: DATE-FIELD