Views an XMLbased independent GUI system - PowerPoint PPT Presentation

About This Presentation
Title:

Views an XMLbased independent GUI system

Description:

University of Pretoria, South Africa. Nigel Horspool. University of ... [Russel Jones, ... [Russel Jones, DevX, Aug 2003] Where GUIs are going. 2nd Rotor Workshop ... – PowerPoint PPT presentation

Number of Views:49
Avg rating:3.0/5.0
Slides: 14
Provided by: judith73
Category:

less

Transcript and Presenter's Notes

Title: Views an XMLbased independent GUI system


1
Views an XML-based independent GUI system
  • Judith Bishop
  • University of Pretoria, South Africa
  • Nigel Horspool
  • University of Victoria, Canada
  • http//www.cs.up.ac.za/rotor

2
Motivation
  • Forward looking
  • Move to platform independent GUI systems
  • Integration of XML into languages (cf XEN)
  • Technical
  • Rotor does not have a GUI capability
  • Interesting challenges in Reflection, RegEx etc
  • Educational
  • Dissatisfaction with method-oriented or drag and
    drop GUIs
  • Separation of concerns

3
Where GUIs are going
  • The reality of a single cross-language,
    cross-platform GUI interface programming model
    is in sight, based on an XML description
    language supported by fast native runtimes.
  • Russel Jones, DevX, Nov 2002
  • Supporting many GUIs isn't just a simple process
    of including one set of libraries or another
    it's often a frustrating and error-prone exercise
    in writing GUI-specific code.
  • Russel Jones, DevX, Aug 2003

4
Rotor CLI Implementation
VS.NET
System.Web (ASP.NET)
System.WinForms
System.WinForms
C
System.Drawing
System.Data (ADO.NET)
System.Xml
SDK Tools
System
Common Language Runtime


Platform Abstraction
5
GUI building today
6
A GUI using XML
7
Example in Views
XML
C
Views.Form f new Views.Form(_at_"ltFormgt
ltverticalgt lthorizontalgt ltButton
NameShow/gt ltButton NameHide/gt
lt/horizontalgt ltPictureBox Namepic
Image'Jacarandas.jpg' Height175/gt
lt/verticalgt lt/Formgt" )
string c for () c f.GetControl() if
(cnull) break PictureBox pb f"pic"
switch (c) case Show" pb.Show()
break case Hide" pb.Hide()
break
  • No pixel positioning
  • No generated code
  • Separation of concerns

8
The Views Notation
form ltformgt controlGroup lt/formgt controlGroup lt
verticalgt controlList lt/verticalgt
lthorizontalgt controlList lt/horizontalgt controlList
control textItemList ltitemgt text lt/itemgt
control controlGroup ltButton/gt
ltCheckBox/gt ltCheckedListBoxgt textItemList
lt/CheckedListBoxgt ltDomainUpDowngt textItemList
lt/DomainUpDowngt ltGroupBoxgt radioButtonList
lt/GroupBoxgt ltLabel/gt ltListBox/gt
ltOpenFileDialog/gt ltSaveFileDialog/gt
ltPictureBox/gt ltTextBox/gt ltProgressBar/gt
ltTrackBar/gt radioButtonList ltRadioButton/gt
9
The Eight Handler methods
Essentially five kinds of methods construct clo
se getControl get put PLUS direct access
Form(string spec,params) The constructor. void
CloseGUI( ) Terminates the execution thread
string GetControl( ) Waits for the user to
perform an action string GetText(string
name) Returns the value of the Text
attribute int GetValue(string name) Returns the
Value attribute from TrackBar, ProgressBar and
CheckBox int GetValue(string name, int index)
Returns the status of CheckBox at position
index void PutText(string name, string
s) Displays the string in a TextBox or ListBox
control. void PutValue(string name, int
v) Sets an integer value associated with a
ProgressBar or CheckBox
10
Views1 implementation
  • RegEx API would be nice for normalising XML
  • If REs fail to match, hard to create a use
    friendly error message
  • did not use the RE package.
  • XML API produces poor error messages when reading
    XML
  • implemented our own lexical analyzer for the XML
    specifications
  • preprocess the users XML then use the XML
    package,
  • Views inverts the interaction logic of controls
  • normally events cause invocation of handling
    routines asynchronously
  • our simple interface has the user invoke Views to
    wait for an event to happen ...
  • s form.GetControl()
  • switch(s) ...
  • case "Push Me"

11
Views2 implementation
  • Views2 is a general-purpose tool for creating
    sophisticated graph structures whose nodes are
    arbitrary class instances and where the structure
    layout is defined by a simple XML notation
  • Correspondence can be made to work with
    reflection
  • Views2.Create( "ltTagName A1V1 A2V2 A3V2 ..
    /gt" )
  • so we can introduce new tags without
    preprogramming Views for all controls
  • Views2 can handle asynchronous events
  • ltButton Name"Show" Click"ButtonClick"/gt
  • c.f. show.Click new EventHandler(ActionPerforme
    d)

12
Future Work
  • Completing Views2 and writing it up
  • Completing the TCL/Tk version and looking at
    alternative GUI tools
  • Completing a drag and drop stand-alone tool to
    emit Views XML
  • Further investigating the pedagogy
  • Thinking of asking MS to make Regex available in
    all operating systems
  • e.g. PDA .NET environment we've seen
    doesn'tinclude the regexp library, threading,
    reflection or a full version of collections.
  • Long term XML checking in the language

13
References on www.cs.up.ac.za/rotor
  • Horspool R N and Bishop J M, Views - and
    independent GUI development tool for Rotor, 1st
    Rotor Workshop, Cambridge July 2002.
  • Bishop J M and Horspool R N, Views - a Vendor
    Independent Extensible Windowing System,
    presented at IFIP WG2.4 meeting, Dagstuhl,
    Germany, November 2002
  • Bishop J M, Horspool R N and Worrall B G,
    Experience with integrating Java with C and
    .NET, JavaGrande, Seattle, November 2002, and
    Concurrency and Computation - Practice and
    Experience, to be published, January 2004
  • Bishop J M, Tutorial at RISE, University of
    Linkoping, Sweden, December 2002
  • Bishop J M and Horspool R N, Views report to
    Microsoft, January 2003
  • Bishop J M and Horspool R N, C - the modular
    language for the 2000s. Tutorial at JMLC,
    Klagenfurt, August 2003
  • Bishop J M and Horspool R N, C Concisely,
    Addison Wesley, appear October 2003.
  • Bishop J M and Horspool, Towards principles of
    GUI programming using Views, paper submitted to
    SIGCSE 2004.
Write a Comment
User Comments (0)
About PowerShow.com