SlideShare ist ein Scribd-Unternehmen logo
1 von 30
VID STYLE CREATION AND DESIGN
                 By
      Richard 'Cyphre' Smolak

            2005
WHAT IS VID?

●   Rebol Visual Interface Dialect
●   Layer over View composition engine
●   Powerful method of describing user interface
●   Simple to learn
Simple VID example
view layout [
    text "Hello world!"
    field "enter any string"
    text-list 200x100 data ["item 1" "item 2"
                                   "item 3"]
    button "Ok"
 ]
VID styles
●   text,field, text-list, button are styles
●   style describes face(s) structure
●   REBOL has more than 50 predefined styles
Facets
                             view layout [
●   Facets are default           text "Hello world!" bold font-size 20 red
    attributes of style       ]

●   modify: text, size,
    color, images,
    actions...
●   can be optionaly used
    in layout definition
Custom styles
●   shortcuts that save time
●   completely new GUI elements
●   can be defined in layout using STYLE keyword
     (usually quick shortcuts)
●   outside layout block using STYLIZE function
    (handy for creating stylesheet(s))
Custom styles
●   Example
    view layout [
        style rtext text bold font-size 20 red
        text "Hello world!"
        rtext "Hello world!"
     ]
Custom styles
●   Strict style definition
    view layout/styles [
        button "Hello world!"
        rtext "Hello world!"
     ] stylize [
        rtext: text bold font-size 20 red
        button: button
     ]
Custom styles
●   enhancement of master stylesheet:
    stylize/master [
         rtext: text bold font-size 20 red
         h1u: h1 underline
         gbut: button green
     ]
     view layout [
         h1 "Hello world!"
         h1u "Hello world!"
         text "Hello world!"
         rtext "Hello world!"
         button "Hello world!"
         gbut "Hello world!"
     ]
WITH keyword
●   direct (re)definition of face
     stylize/master [
        my-banner: banner underline with [
           font: make font [
              shadow: none
              color: white
           ]
           image: make image! [1x4
    #{A4C8FFA4C8FF808080808080}]
           effect: [tile]
        ]
     ]
     view layout [
        banner "Hello world!"
        my-banner "Hello world!"
     ]
Creation of style from scratch
●   use 'template' object system/view/vid/vid-face
●   vid-face object equals to predefined FACE style
●   minimal definition
    stylize/master [
         my-style: face with [
           size: 100x100
           init: []
         ]
     ]
     view layout [
         my-style "Hello world!"
     ]
Useful vid-face fields
●   INIT: block! contaning 'startup' code of style
●   MULTI: object! specifies handling of arguments
●   WORDS: block! with custom defined Facets
●   FLAGS: block! holding flags (behaviour
    attributes)
●   ACCESS: object! with basic accessor functions
●   DOC: object! with style documentation strings
Useful vid-face fields
●   RESIZE: function! hadling the style during
    resizing
●   UPDATE: function! used to actualize style data
    etc.
●   RESET: function! used to reset style to initial
    state
Custom style example
    Let's create a:
●   window style
●   draggable titlebar
●   set content
●   set colors
●   basic resize
Custom style example
●   face skeleton:
         window: face with [
             title: "noname"
             color: none
             titlebar: none
             size: 100x100
             dirty?: true
             click: none
          ]
          feel: …
          init: …
          words: …
          multi: …
          access: …
          update: …
          resize: …
          doc: …
     ]
Custom style example
●   FEEL object:
    feel: make feel [
          engage: func [f a e][
            if a = 'down [
                click: e/offset
            ]
            if a = 'up [
                click: none
            ]
            if all [click find [over away] a][
                f/offset: f/offset + (e/offset – click)
                show f
            ]
          ]
       ]
Custom style example
●   INIT block:
    init-code: does [
         titlebar: make face [
              edge: none
              color: any [all [colors colors/2] white]
              size: 0x20
              text: title
         ]
         if dirty? [
              pane: reduce [titlebar layout/offset data 0x20]
              size: second span? Pane
         ]
         titlebar/size/x: size/x
         pane/2/color: any [color blue]
         dirty?: false
      ]
      init: [
         init-code
      ]
Custom style example
●   WORDS block:
    words: [
        content [
           new/data: second args
           next args
        ]
      ]
Custom style example
●   MULTI object:
    multi: make multi [
         text: func [face blk][
             if pick blk 1 [
                 face/title: first blk
             ]
         ]
         file: image: block: none
     ]
Custom style example
●   ACCESS object:
    access: make object! [
        set-face*: func [face value][
           face/data: value face/dirty?: true
        ]
        get-face*: func [face][face/data]
        clear-face*: func [face][
           face/data: [size 100x100] face/dirty?: true
        ]
        reset-face*: func [face][
           face/data: [size 100x100] face/dirty?: true
        ]
      ]
Custom style example
●   UPDATE function:
    update: does [
       init-code
       show self/parent-face
     ]
Custom style example
●   RESIZE object:
    resize: func [new /x /y][
         either any [x y] [
            if x [size/x: new]
            if y [size/y: new]
         ][
            size: any [new size]
         ]
         pane/1/size/x: size/x
         pane/2/size: size
         foreach f pane/2/pane [
            f/size/x: new/x - (2 * f/offset/x)
         ]
      ]
Custom style example
●   DOC object:
    doc: make object! [
         info: "document text"
         string: "window title"
         image: none
         logic: none
         integer: "width of window"
         pair: "width and height of window"
         tuple: ["background color" "titlebar color"]
         file: none
         url: none
         decimal: none
         time: none
         block: none
         keywords: [content "content layout of window"]
      ]
●   Demo code:
    view layout [
         size 640x480
         win: window "My window" content [button "test"] red green
         button "get face" [probe get-face win]
         button "set face" [set-face win [field "test"]]
         button "clear face" [clear-face win]
         button "resize" [win/resize 40x40 + random 300x300]
         button "update" [win/update]
       ]
Real world examples
Real world examples
Real world examples
Real world examples
Real world examples
THANKS FOR YOUR ATTENTION

     cyphre@seznam.cz

Weitere ähnliche Inhalte

Andere mochten auch (11)

Glance rebol
Glance rebolGlance rebol
Glance rebol
 
Livecode
LivecodeLivecode
Livecode
 
bfarm-v2
bfarm-v2bfarm-v2
bfarm-v2
 
What we can learn from Rebol?
What we can learn from Rebol?What we can learn from Rebol?
What we can learn from Rebol?
 
Rebol
RebolRebol
Rebol
 
Rebol installation
Rebol installationRebol installation
Rebol installation
 
Where is Carl?
Where is Carl?Where is Carl?
Where is Carl?
 
Rebol
RebolRebol
Rebol
 
Rebol
RebolRebol
Rebol
 
Rebol brainwasher
Rebol brainwasherRebol brainwasher
Rebol brainwasher
 
Syllable OS
Syllable OSSyllable OS
Syllable OS
 

Ähnlich wie Rebol VID STYLE CREATION AND DESIGN

Dreamweaver day4
Dreamweaver day4Dreamweaver day4
Dreamweaver day4
Law Chng
 

Ähnlich wie Rebol VID STYLE CREATION AND DESIGN (20)

Rethink Frontend Development With Elm
Rethink Frontend Development With ElmRethink Frontend Development With Elm
Rethink Frontend Development With Elm
 
Advanced Custom Fields - Flexible Content
Advanced Custom Fields - Flexible ContentAdvanced Custom Fields - Flexible Content
Advanced Custom Fields - Flexible Content
 
Page maker
Page makerPage maker
Page maker
 
Introduction to HTML-CSS-Javascript.pdf
Introduction to HTML-CSS-Javascript.pdfIntroduction to HTML-CSS-Javascript.pdf
Introduction to HTML-CSS-Javascript.pdf
 
How to develop frontend application
How to develop frontend applicationHow to develop frontend application
How to develop frontend application
 
Variations on a Theme
Variations on a ThemeVariations on a Theme
Variations on a Theme
 
Dreamweaver day4
Dreamweaver day4Dreamweaver day4
Dreamweaver day4
 
Youidraw Logo Creator User Guide - online Logo Maker
Youidraw Logo Creator User Guide - online Logo Maker  Youidraw Logo Creator User Guide - online Logo Maker
Youidraw Logo Creator User Guide - online Logo Maker
 
Component-Oriented Web Development with Dart
Component-Oriented Web Development with DartComponent-Oriented Web Development with Dart
Component-Oriented Web Development with Dart
 
Introduction to html5 and css3
Introduction to html5 and css3Introduction to html5 and css3
Introduction to html5 and css3
 
Creating WordPress Sites in 2 Hours
Creating WordPress Sites in 2 HoursCreating WordPress Sites in 2 Hours
Creating WordPress Sites in 2 Hours
 
Adobe demo1 by robin thakral
Adobe demo1 by robin thakralAdobe demo1 by robin thakral
Adobe demo1 by robin thakral
 
Jetpack Compose a nova forma de implementar UI no Android
Jetpack Compose a nova forma de implementar UI no AndroidJetpack Compose a nova forma de implementar UI no Android
Jetpack Compose a nova forma de implementar UI no Android
 
A proper introduction to Elm
A proper introduction to ElmA proper introduction to Elm
A proper introduction to Elm
 
Rethink Frontend Development With Elm
Rethink Frontend Development With ElmRethink Frontend Development With Elm
Rethink Frontend Development With Elm
 
Libre Office Impress Lesson 1
Libre Office Impress Lesson 1Libre Office Impress Lesson 1
Libre Office Impress Lesson 1
 
Componentization css angular
Componentization css angularComponentization css angular
Componentization css angular
 
Getting Visual with Ruby Processing
Getting Visual with Ruby ProcessingGetting Visual with Ruby Processing
Getting Visual with Ruby Processing
 
Android Jetpack Compose - Turkey 2021
Android Jetpack Compose - Turkey 2021Android Jetpack Compose - Turkey 2021
Android Jetpack Compose - Turkey 2021
 
Effective Design in PowerPoint
Effective Design in PowerPoint Effective Design in PowerPoint
Effective Design in PowerPoint
 

Mehr von crazyaxe (9)

Livecode widget course
Livecode widget courseLivecode widget course
Livecode widget course
 
Introduzione all'open source e Linux
Introduzione all'open source e LinuxIntroduzione all'open source e Linux
Introduzione all'open source e Linux
 
Neo-Sens
Neo-SensNeo-Sens
Neo-Sens
 
Neo-Sens
Neo-SensNeo-Sens
Neo-Sens
 
1 A Chi Appartiene
1 A Chi Appartiene1 A Chi Appartiene
1 A Chi Appartiene
 
Prodotti Biologici Una Grande Truffa
Prodotti Biologici Una Grande TruffaProdotti Biologici Una Grande Truffa
Prodotti Biologici Una Grande Truffa
 
Introduzione all'Open Source e Linux
Introduzione all'Open Source e LinuxIntroduzione all'Open Source e Linux
Introduzione all'Open Source e Linux
 
Come Funzianano Internet Email Chat Newsgro
Come Funzianano Internet Email Chat NewsgroCome Funzianano Internet Email Chat Newsgro
Come Funzianano Internet Email Chat Newsgro
 
Chromium problems
Chromium problemsChromium problems
Chromium problems
 

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 

Rebol VID STYLE CREATION AND DESIGN

  • 1. VID STYLE CREATION AND DESIGN By Richard 'Cyphre' Smolak 2005
  • 2. WHAT IS VID? ● Rebol Visual Interface Dialect ● Layer over View composition engine ● Powerful method of describing user interface ● Simple to learn
  • 3. Simple VID example view layout [ text "Hello world!" field "enter any string" text-list 200x100 data ["item 1" "item 2" "item 3"] button "Ok" ]
  • 4. VID styles ● text,field, text-list, button are styles ● style describes face(s) structure ● REBOL has more than 50 predefined styles
  • 5. Facets view layout [ ● Facets are default text "Hello world!" bold font-size 20 red attributes of style ] ● modify: text, size, color, images, actions... ● can be optionaly used in layout definition
  • 6. Custom styles ● shortcuts that save time ● completely new GUI elements ● can be defined in layout using STYLE keyword (usually quick shortcuts) ● outside layout block using STYLIZE function (handy for creating stylesheet(s))
  • 7. Custom styles ● Example view layout [ style rtext text bold font-size 20 red text "Hello world!" rtext "Hello world!" ]
  • 8. Custom styles ● Strict style definition view layout/styles [ button "Hello world!" rtext "Hello world!" ] stylize [ rtext: text bold font-size 20 red button: button ]
  • 9. Custom styles ● enhancement of master stylesheet: stylize/master [ rtext: text bold font-size 20 red h1u: h1 underline gbut: button green ] view layout [ h1 "Hello world!" h1u "Hello world!" text "Hello world!" rtext "Hello world!" button "Hello world!" gbut "Hello world!" ]
  • 10. WITH keyword ● direct (re)definition of face stylize/master [ my-banner: banner underline with [ font: make font [ shadow: none color: white ] image: make image! [1x4 #{A4C8FFA4C8FF808080808080}] effect: [tile] ] ] view layout [ banner "Hello world!" my-banner "Hello world!" ]
  • 11. Creation of style from scratch ● use 'template' object system/view/vid/vid-face ● vid-face object equals to predefined FACE style ● minimal definition stylize/master [ my-style: face with [ size: 100x100 init: [] ] ] view layout [ my-style "Hello world!" ]
  • 12. Useful vid-face fields ● INIT: block! contaning 'startup' code of style ● MULTI: object! specifies handling of arguments ● WORDS: block! with custom defined Facets ● FLAGS: block! holding flags (behaviour attributes) ● ACCESS: object! with basic accessor functions ● DOC: object! with style documentation strings
  • 13. Useful vid-face fields ● RESIZE: function! hadling the style during resizing ● UPDATE: function! used to actualize style data etc. ● RESET: function! used to reset style to initial state
  • 14. Custom style example Let's create a: ● window style ● draggable titlebar ● set content ● set colors ● basic resize
  • 15. Custom style example ● face skeleton: window: face with [ title: "noname" color: none titlebar: none size: 100x100 dirty?: true click: none ] feel: … init: … words: … multi: … access: … update: … resize: … doc: … ]
  • 16. Custom style example ● FEEL object: feel: make feel [ engage: func [f a e][ if a = 'down [ click: e/offset ] if a = 'up [ click: none ] if all [click find [over away] a][ f/offset: f/offset + (e/offset – click) show f ] ] ]
  • 17. Custom style example ● INIT block: init-code: does [ titlebar: make face [ edge: none color: any [all [colors colors/2] white] size: 0x20 text: title ] if dirty? [ pane: reduce [titlebar layout/offset data 0x20] size: second span? Pane ] titlebar/size/x: size/x pane/2/color: any [color blue] dirty?: false ] init: [ init-code ]
  • 18. Custom style example ● WORDS block: words: [ content [ new/data: second args next args ] ]
  • 19. Custom style example ● MULTI object: multi: make multi [ text: func [face blk][ if pick blk 1 [ face/title: first blk ] ] file: image: block: none ]
  • 20. Custom style example ● ACCESS object: access: make object! [ set-face*: func [face value][ face/data: value face/dirty?: true ] get-face*: func [face][face/data] clear-face*: func [face][ face/data: [size 100x100] face/dirty?: true ] reset-face*: func [face][ face/data: [size 100x100] face/dirty?: true ] ]
  • 21. Custom style example ● UPDATE function: update: does [ init-code show self/parent-face ]
  • 22. Custom style example ● RESIZE object: resize: func [new /x /y][ either any [x y] [ if x [size/x: new] if y [size/y: new] ][ size: any [new size] ] pane/1/size/x: size/x pane/2/size: size foreach f pane/2/pane [ f/size/x: new/x - (2 * f/offset/x) ] ]
  • 23. Custom style example ● DOC object: doc: make object! [ info: "document text" string: "window title" image: none logic: none integer: "width of window" pair: "width and height of window" tuple: ["background color" "titlebar color"] file: none url: none decimal: none time: none block: none keywords: [content "content layout of window"] ]
  • 24. Demo code: view layout [ size 640x480 win: window "My window" content [button "test"] red green button "get face" [probe get-face win] button "set face" [set-face win [field "test"]] button "clear face" [clear-face win] button "resize" [win/resize 40x40 + random 300x300] button "update" [win/update] ]
  • 30. THANKS FOR YOUR ATTENTION cyphre@seznam.cz