SlideShare une entreprise Scribd logo
1  sur  35
Télécharger pour lire hors ligne
Ernest Micklei
                             emicklei@philemonworks.com
                              Amersfoort, The Netherlands
                                    ESUG 10th
                                Douai, August 29 2002



emicklei@philemonworks.com
     RSI (Repetitive Strain Injuiry)
     Fast access to simple programs (=objects)
     Explore mixed interfaces (pixels-ASCII)
     Simplest UI possible
     client-server
     module for SmallScript




     emicklei@philemonworks.com
     A widget displays an aspect of an object in a
      defined region of a window
     A region is defined by a rectangular area of
      characters organized in rows and columns
     Keyboard events are handled by the controller
      of the widget (MVC)




     emicklei@philemonworks.com
     TerminalForm is a UI component that displays
      a grid of ASCII characters
     For displaying, widgets map their contents to
      characters of that grid




     emicklei@philemonworks.com
     Core classes are:
         TerminalCharacter
         TerminalGrid
         TerminalWidget
         TerminalController
     Others
         CompositeWidget, Appearance, Form




     emicklei@philemonworks.com
access by Points: row@column

                       S     M A   L   L   T   A   L   K




                       (grid at: (1@2)) = $M
emicklei@philemonworks.com
     Terminal screen is showing a matrix of
      graphical characters organized in rows and
      columns.
     TerminalCharacter
     TerminalGrid
                              A A A A
                                  A   A A   A
                                  A   A A   A
                                  A   A A   A

     emicklei@philemonworks.com
     holds collection of TerminalCharacter
     read/write strings to grid (matrix)
     for display only
         Terminal OS-window holds grid




     emicklei@philemonworks.com
| window txt |

   "window"
   window := TerminalWidget textClass in: (1@1 corner: 24@80).

   "build"
   txt := TerminalWidget textClass in: (1@1 corner: 8@20).
   txt string: 'This is a Smalltalk terminal application'.
   window add: txt.

   "open"
   Terminal show: window




emicklei@philemonworks.com
| window list |

   "window"
   window := TerminalWidget windowClass in: (1@1 corner: 24@80).

   "build"
   list := TerminalWidget listClass in: (1@1 corner: 8@20).
   list items: #('ESUG' '10th' 'Douai' 'France' ).
   window add: list.

   "open"
   Terminal show: window




emicklei@philemonworks.com
| window list |

   "window"
   window := TerminalWidget windowClass in: (1@1 corner: 24@80).

   "build"
   image := TerminalWidget imageClass in: (1@1 corner: 8@20).
   image bitmap: (Bitmap fromFile: 'splash.bmp').
   window add: image.

   "open"
   Terminal show: window




emicklei@philemonworks.com
| window list |

   "window"
   window := TerminalWidget windowClass in: (1@1 corner: 24@80).

   "build"
   menu := TerminalWidget menuClass in: (1@1 corner: 4@20).
   menu add: '1. Stockrates' key: $1 do: [self startStockrateView].
   menu add: '2. Accounts' key: $2 do: [self startAccountView].
   menu addLine.
   menu add: '3. Invoices' key: $3 do: [self startInvoicesView].
   window add: menu.

   "open"
   Terminal show: window




emicklei@philemonworks.com
| window list |

  "window"
  window := TerminalWidget windowClass in: (1@1 corner: 24@80).

  "build"
  menuBar := TerminalWidget menuBarClass in: (1@1 corner: 1@80).
  menuBar add: 'File' key: $f menu: self fileMenu.
  menuBar add: 'Edit' key: $o menu: self editMenu.
  menuBar add: 'Help' key: $h menu: self helpMenu.
  window add: menuBar.

  "open"
  Terminal show: window




emicklei@philemonworks.com
     is top container for terminal windows
     can show, hide and (will in future) stack
      windows

     implementation is dialect specific
         but requires minimal behavior




     emicklei@philemonworks.com
     widgets claim a region of the screen
     has a controller to handle keyboard events
     has a model for storing its domain value
     has an appearance
     is the "V" in MVC
     when:send:to:, broadcast: (AOS)




     emicklei@philemonworks.com
     displays a single character in some (fixed) font
     can display decoration (border lines)
     has an appearance




     emicklei@philemonworks.com
     character (re)display
     inputController
     appearance




     emicklei@philemonworks.com
     observation: painting complete screen is too
      expensive
     damage rectangles intersection is too
      expensive
     widget knows which characters to update

     but, does not help with overlapping OS-
      windows
         may need double buffering



     emicklei@philemonworks.com
     like the VW ParagraphEditor, but...
     break text into lines, localizing updates
     replace CRLF with CR
         every character takes up one space
     cursor can be beyond text
     cursor can be on CR position
     adopt color emphasis
     scrolling (vertically only)
     no TAB

     emicklei@philemonworks.com
     window appearance
     widget appearance
     character appearance
     properties "inherited" by composition hierarchy
     modifiable at each "level"




     emicklei@philemonworks.com
TerminalObjectAppearance (abstract superclass)
        foreground background selectionForeground
        selectionBackground

          TerminalWindowAppearance
               font fontName characterWidth characterHeight

          TerminalWidgetAppearance
               windowAppearance borderColor
          showBorderOnFocus

          TerminalCharacterAppearance
               widgetAppearance




emicklei@philemonworks.com
     finds colors from parent appearance
         a WindowAppearance
     but can override values by replacing nil-values
     example:

TerminalObjetAppearance>>background

      ^background isNil
           ifTrue:[self hasParent
                      ifTrue:[nil]
                      ifFalse:[self parentAppearance background]]
           ifFalse:[background]




     emicklei@philemonworks.com
     initially meant for per-character coloring
     became obsolete when introducing
      EmphasizedText
         VA rewrite of VW Text


     'ESUG' asEmphasizedText
         from: 1
         to: 2
         setForeground: Color yellow


     emicklei@philemonworks.com
     demo




     emicklei@philemonworks.com
     demo




     emicklei@philemonworks.com
     shell interface to an almost empty object space
      (image)
     demo




     emicklei@philemonworks.com
     implementation issues
     design issues
     fit of purpose issues
     exploring the "Smalltalk Objects Shell"




     emicklei@philemonworks.com
     rewrite InputController
         got tips from Samuel Shuster
     finish port from VAST to SmallScript
         put it on the web
     text selection for InputController
         cut,copy,paste
     handle OS-paints
     build from Pollock XML?



     emicklei@philemonworks.com
     display methods
         draw a line
         draw a String character
         set colors
     dispatch keyboard events
     handle focus events
     have a window to paint on

     (almost) done for SmallScript

     emicklei@philemonworks.com
     how to design characterbased applications
         and still be object-oriented
     what do I need for client-server architecture
         maybe TELNET is fine, why bother
     missing widgets? buttons,dropdowns
         do I really want to mimic Windows




     emicklei@philemonworks.com
     motivation for porting to "imageless"
      SmallScript
     use objects in stead of just (fat)executable

     think about what objects are really powerful
      but do not need a UI
         graphical image processing
         3D language generators




     emicklei@philemonworks.com
     Re-inventing wheels? (curses)
     Is mixing character-based and full graphics
      only just "yes we can do-it" ?
     Will performance be acceptable ?




     emicklei@philemonworks.com
     Can be done (what else would you expect)
     Might be useful
     Mixing with other widgets not explored
     Highly portable (to other dialects)
     Mouseless apps




     emicklei@philemonworks.com
Reference module: PhilemonTerminalView.

[
            | window | := Terminal windowClass in:(1@1 corner: 20@40).
            | text | := Terminal textClass in:(2@2 corner: 19@39).
            window add: text.
            Terminal show: window
]



".dll = 56kB"


    emicklei@philemonworks.com
download @
                http://www.philemonworks.com




emicklei@philemonworks.com

Contenu connexe

Similaire à Terminal Widgets

DotNet Introduction
DotNet IntroductionDotNet Introduction
DotNet Introduction
nandhu8124
 
Introduction to XAML and WPF
Introduction to XAML and WPFIntroduction to XAML and WPF
Introduction to XAML and WPF
Doncho Minkov
 
Dot netsupport in alpha five v11 coming soon
Dot netsupport in alpha five v11 coming soonDot netsupport in alpha five v11 coming soon
Dot netsupport in alpha five v11 coming soon
Richard Rabins
 
Plug-in Architectures
Plug-in ArchitecturesPlug-in Architectures
Plug-in Architectures
elliando dias
 

Similaire à Terminal Widgets (20)

Maxbox starter19
Maxbox starter19Maxbox starter19
Maxbox starter19
 
Fb cheatsheet12b
Fb cheatsheet12bFb cheatsheet12b
Fb cheatsheet12b
 
XAML and WPF - Dinko Jakovljević
XAML and WPF - Dinko JakovljevićXAML and WPF - Dinko Jakovljević
XAML and WPF - Dinko Jakovljević
 
DotNet Introduction
DotNet IntroductionDotNet Introduction
DotNet Introduction
 
DOTNET
DOTNETDOTNET
DOTNET
 
Introduction to XAML and WPF
Introduction to XAML and WPFIntroduction to XAML and WPF
Introduction to XAML and WPF
 
Howto curses
Howto cursesHowto curses
Howto curses
 
Dot netsupport in alpha five v11 coming soon
Dot netsupport in alpha five v11 coming soonDot netsupport in alpha five v11 coming soon
Dot netsupport in alpha five v11 coming soon
 
Software Language Design & Engineering: Mobl & Spoofax
Software Language Design & Engineering: Mobl & SpoofaxSoftware Language Design & Engineering: Mobl & Spoofax
Software Language Design & Engineering: Mobl & Spoofax
 
Plug-in Architectures
Plug-in ArchitecturesPlug-in Architectures
Plug-in Architectures
 
Firefox extension Development
Firefox extension DevelopmentFirefox extension Development
Firefox extension Development
 
WPF - the future of GUI is near
WPF - the future of GUI is nearWPF - the future of GUI is near
WPF - the future of GUI is near
 
Class[3][5th jun] [three js]
Class[3][5th jun] [three js]Class[3][5th jun] [three js]
Class[3][5th jun] [three js]
 
U5 JAVA.pptx
U5 JAVA.pptxU5 JAVA.pptx
U5 JAVA.pptx
 
Matlab workshop
Matlab workshopMatlab workshop
Matlab workshop
 
Introduction to F#
Introduction to F#Introduction to F#
Introduction to F#
 
Software Language Design & Engineering
Software Language Design & EngineeringSoftware Language Design & Engineering
Software Language Design & Engineering
 
CLI313
CLI313CLI313
CLI313
 
Tech Lunch 9 25 2008
Tech Lunch 9 25 2008Tech Lunch 9 25 2008
Tech Lunch 9 25 2008
 
Building Accessible Apps using NET MAUI.pdf
Building Accessible Apps using NET MAUI.pdfBuilding Accessible Apps using NET MAUI.pdf
Building Accessible Apps using NET MAUI.pdf
 

Plus de ESUG

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
ESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
ESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
ESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
ESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
ESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
ESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
ESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
ESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
ESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
ESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
ESUG
 

Plus de ESUG (20)

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 

Dernier

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

Terminal Widgets

  • 1. Ernest Micklei emicklei@philemonworks.com Amersfoort, The Netherlands ESUG 10th Douai, August 29 2002 emicklei@philemonworks.com
  • 2.   RSI (Repetitive Strain Injuiry)   Fast access to simple programs (=objects)   Explore mixed interfaces (pixels-ASCII)   Simplest UI possible   client-server   module for SmallScript emicklei@philemonworks.com
  • 3.   A widget displays an aspect of an object in a defined region of a window   A region is defined by a rectangular area of characters organized in rows and columns   Keyboard events are handled by the controller of the widget (MVC) emicklei@philemonworks.com
  • 4.   TerminalForm is a UI component that displays a grid of ASCII characters   For displaying, widgets map their contents to characters of that grid emicklei@philemonworks.com
  • 5.   Core classes are:   TerminalCharacter   TerminalGrid   TerminalWidget   TerminalController   Others   CompositeWidget, Appearance, Form emicklei@philemonworks.com
  • 6. access by Points: row@column S M A L L T A L K (grid at: (1@2)) = $M emicklei@philemonworks.com
  • 7.   Terminal screen is showing a matrix of graphical characters organized in rows and columns.   TerminalCharacter   TerminalGrid A A A A A A A A A A A A A A A A emicklei@philemonworks.com
  • 8.   holds collection of TerminalCharacter   read/write strings to grid (matrix)   for display only   Terminal OS-window holds grid emicklei@philemonworks.com
  • 9. | window txt | "window" window := TerminalWidget textClass in: (1@1 corner: 24@80). "build" txt := TerminalWidget textClass in: (1@1 corner: 8@20). txt string: 'This is a Smalltalk terminal application'. window add: txt. "open" Terminal show: window emicklei@philemonworks.com
  • 10. | window list | "window" window := TerminalWidget windowClass in: (1@1 corner: 24@80). "build" list := TerminalWidget listClass in: (1@1 corner: 8@20). list items: #('ESUG' '10th' 'Douai' 'France' ). window add: list. "open" Terminal show: window emicklei@philemonworks.com
  • 11. | window list | "window" window := TerminalWidget windowClass in: (1@1 corner: 24@80). "build" image := TerminalWidget imageClass in: (1@1 corner: 8@20). image bitmap: (Bitmap fromFile: 'splash.bmp'). window add: image. "open" Terminal show: window emicklei@philemonworks.com
  • 12. | window list | "window" window := TerminalWidget windowClass in: (1@1 corner: 24@80). "build" menu := TerminalWidget menuClass in: (1@1 corner: 4@20). menu add: '1. Stockrates' key: $1 do: [self startStockrateView]. menu add: '2. Accounts' key: $2 do: [self startAccountView]. menu addLine. menu add: '3. Invoices' key: $3 do: [self startInvoicesView]. window add: menu. "open" Terminal show: window emicklei@philemonworks.com
  • 13. | window list | "window" window := TerminalWidget windowClass in: (1@1 corner: 24@80). "build" menuBar := TerminalWidget menuBarClass in: (1@1 corner: 1@80). menuBar add: 'File' key: $f menu: self fileMenu. menuBar add: 'Edit' key: $o menu: self editMenu. menuBar add: 'Help' key: $h menu: self helpMenu. window add: menuBar. "open" Terminal show: window emicklei@philemonworks.com
  • 14.   is top container for terminal windows   can show, hide and (will in future) stack windows   implementation is dialect specific   but requires minimal behavior emicklei@philemonworks.com
  • 15.   widgets claim a region of the screen   has a controller to handle keyboard events   has a model for storing its domain value   has an appearance   is the "V" in MVC   when:send:to:, broadcast: (AOS) emicklei@philemonworks.com
  • 16.   displays a single character in some (fixed) font   can display decoration (border lines)   has an appearance emicklei@philemonworks.com
  • 17.   character (re)display   inputController   appearance emicklei@philemonworks.com
  • 18.   observation: painting complete screen is too expensive   damage rectangles intersection is too expensive   widget knows which characters to update   but, does not help with overlapping OS- windows   may need double buffering emicklei@philemonworks.com
  • 19.   like the VW ParagraphEditor, but...   break text into lines, localizing updates   replace CRLF with CR   every character takes up one space   cursor can be beyond text   cursor can be on CR position   adopt color emphasis   scrolling (vertically only)   no TAB emicklei@philemonworks.com
  • 20.   window appearance   widget appearance   character appearance   properties "inherited" by composition hierarchy   modifiable at each "level" emicklei@philemonworks.com
  • 21. TerminalObjectAppearance (abstract superclass) foreground background selectionForeground selectionBackground TerminalWindowAppearance font fontName characterWidth characterHeight TerminalWidgetAppearance windowAppearance borderColor showBorderOnFocus TerminalCharacterAppearance widgetAppearance emicklei@philemonworks.com
  • 22.   finds colors from parent appearance   a WindowAppearance   but can override values by replacing nil-values   example: TerminalObjetAppearance>>background ^background isNil ifTrue:[self hasParent ifTrue:[nil] ifFalse:[self parentAppearance background]] ifFalse:[background] emicklei@philemonworks.com
  • 23.   initially meant for per-character coloring   became obsolete when introducing EmphasizedText   VA rewrite of VW Text   'ESUG' asEmphasizedText from: 1 to: 2 setForeground: Color yellow emicklei@philemonworks.com
  • 24.   demo emicklei@philemonworks.com
  • 25.   demo emicklei@philemonworks.com
  • 26.   shell interface to an almost empty object space (image)   demo emicklei@philemonworks.com
  • 27.   implementation issues   design issues   fit of purpose issues   exploring the "Smalltalk Objects Shell" emicklei@philemonworks.com
  • 28.   rewrite InputController   got tips from Samuel Shuster   finish port from VAST to SmallScript   put it on the web   text selection for InputController   cut,copy,paste   handle OS-paints   build from Pollock XML? emicklei@philemonworks.com
  • 29.   display methods   draw a line   draw a String character   set colors   dispatch keyboard events   handle focus events   have a window to paint on   (almost) done for SmallScript emicklei@philemonworks.com
  • 30.   how to design characterbased applications   and still be object-oriented   what do I need for client-server architecture   maybe TELNET is fine, why bother   missing widgets? buttons,dropdowns   do I really want to mimic Windows emicklei@philemonworks.com
  • 31.   motivation for porting to "imageless" SmallScript   use objects in stead of just (fat)executable   think about what objects are really powerful but do not need a UI   graphical image processing   3D language generators emicklei@philemonworks.com
  • 32.   Re-inventing wheels? (curses)   Is mixing character-based and full graphics only just "yes we can do-it" ?   Will performance be acceptable ? emicklei@philemonworks.com
  • 33.   Can be done (what else would you expect)   Might be useful   Mixing with other widgets not explored   Highly portable (to other dialects)   Mouseless apps emicklei@philemonworks.com
  • 34. Reference module: PhilemonTerminalView. [ | window | := Terminal windowClass in:(1@1 corner: 20@40). | text | := Terminal textClass in:(2@2 corner: 19@39). window add: text. Terminal show: window ] ".dll = 56kB" emicklei@philemonworks.com
  • 35. download @ http://www.philemonworks.com emicklei@philemonworks.com