User Interface Software Visual Basic - PowerPoint PPT Presentation

1 / 44
About This Presentation
Title:

User Interface Software Visual Basic

Description:

UI is collection of interactor objects (often called widgets) User directly manipulates them ... Object-oriented hierarchy of UI interactors called widgets ... – PowerPoint PPT presentation

Number of Views:51
Avg rating:3.0/5.0
Slides: 45
Provided by: jeffp8
Category:

less

Transcript and Presenter's Notes

Title: User Interface Software Visual Basic


1
User Interface SoftwareVisual Basic
  • A look under the hood
  • Example GUI builder tool - VB

2
Agenda
  • Styles of tools
  • Design tools
  • UI toolkits
  • GUI builder tools
  • Demo of VB
  • HW 2 accounts

3
Get What You Ask For
4
User Interface Software
  • What support is provided for building graphical
    user interfaces?
  • UI toolkits
  • GUI builder tools
  • Lets examine some background

5
GUI System Architecture
What does it look like?
6
Layered Architecture
Application
Higher level Tool
UI Toolkit
Window System
OS
Hardware
7
Window System
  • Virtual display abstraction
  • Coordinates different input devices
  • Provides window primitives
  • Important components
  • Graphics model
  • Input model
  • May or may not include window manager

8
UI Toolkit
  • What application programmer typically programs
    with
  • Combination of interface objects and management
    behaviors
  • Usually object-oriented now
  • Library of software components and routines that
    programmer puts together
  • X Windows X Toolkit Motif
  • Macintosh Mac Toolbox, MacApp
  • Windows Windows Developers Toolkit
  • Java Swing

9
Higher Level Tools
  • Provide assistance or some automation in
    developing UIs
  • Many names
  • User Interface Management System (UIMS)
  • User Interface Builder
  • User Interface Development Environment (UIDE)

10
Separation of Concerns
  • Application
  • Core functionality
  • Operations
  • Data
  • Interface
  • Interface components
  • Graphics
  • I/O

Should these be separated in code? Why? Why
not?
11
How Does a Toolkit Work?
  • What exactly does it provide?
  • How is it organized?

12
Toolkit Workings
  • User takes actions, interacts with interface
  • Those actions must be delivered to application in
    meaningful ways
  • Application takes appropriate actions, perhaps
    updating display

13
Seeheim Model
Conversational model
Applicationinterface
Dialogcontrol
Presentation
Dominant model for long time
14
Object Model
  • UI is collection of interactor objects (often
    called widgets)
  • User directly manipulates them
  • Objects responsible for transmitting user actions
    to application in meaningful ways

Application
UI
User
15
Locus of Control
  • Traditional software
  • Control is in system, query user when input
    needed
  • Event-driven software
  • Control is with user (wait for action)
  • Code reacts to user actions
  • More difficult to write code this way, harder to
    modularize, etc.

16
Event-Driven Program
  • Initialize display system
  • Repeat
  • Wait for and get next user action
  • Decipher action
  • Take appropriate action
  • Update display
  • Until Done

17
Event-Driven Program
UI
Mainapplicationcode
Entrypoint
System
Whats that?
18
Callback Routine
  • Software procedure, part of application
  • Invoked when particular action occurs to UI
    component, such as pressing a PushButton
  • Procedure is invoked with event parameters

19
Example X Motif
  • Object-oriented hierarchy of UI interactors
    called widgets
  • Associate callback routines in your code with
    them
  • Interface is built up by putting child widgets
    onto parent widgets

20
Widget
Graphical user interface interactor object
21
Widget Hierarchy
  • Widgets organized into inheritance hierarchy

Primitive
Button
Label
Scroll Bar
Text
Push Button
Toggle Button
Drawn Button
22
Widget
  • Visual appearance
  • Set of tailorable attributes
  • Interactive behavior

PushButton Color BackGround int
MarginLeft int MarginRight int
BorderWidth Pixmap ArmPixmap Boolean
FillOnArm CallbackList ActivateCallback
23
Widget Use
  • Set up widget attributes
  • Create widget object (as child of parent widget)
  • Define callback or event procedure for widget

24
Widget and Callback
n 0 xmstr XmStringCreate("Color",XmSTRI
NG_DEFAULT_CHARSET) XtSetArg(argsn,
XmNlabelString, xmstr) n
XtSetArg(argsn, XmNbackground, red)
n colorbut XtCreateManagedWidget("colorbutton
", xmPushButtonWidgetClass,focusro
wcol, args, n) XtAddCallback(colorbut,
XmNactivateCallback,
colorChangeCB, id) void colorChangeCB(Widget
w, XtPointer userdata, XtPointer evtdata)
// Actions
25
Main Program Event Loop
voidCheckXEvents() XEvent xev while
(XtAppPending(_context))
XtAppNextEvent(_context, xev)
XtDispatchEvent(xev)
26
OO Systems
  • Javas GUI programming done with AWT and Swing
  • More distributed model (separate threads)
  • Primary action here is dispatching events to
    objects (widgets) as messages
  • Delegation important
  • Can make particular objects responsible for event
    handling

27
Example - Java AWT
public void mouseReleased(MouseEvent
e) System.out.println ("Changing color") if
(bHighlight) frame.setBackground(highlight)
else frame.setBackground(normal) bHighligh
t !bHighlight

28
GUI Builder Tools
  • Why build graphical (visual) interface with
    textual commands?
  • Why not show what you want it to look like?
  • Visual builder tools Visual Basic, Visual C,
    Borland Delphi, Symantec Cafe

29
Tool Methods
  • Work area (interface being built)
  • Drag and drop interactors/widgets onto work area
  • Specify position, color, look, etc.
  • Often provide Build/Test modes

30
Example dtbuilder (Motif)
31
Example Visual Basic
32
(No Transcript)
33
Widgets in Toolbox
34
Widget Fields
35
Build vs. Run Mode
36
Connecting Code
37
Compiling an Executable
38
Making Menus
39
Alignment
40
Different Controls
  • Checkboxes
  • Scrollbars
  • ...

41
Timer Events
42
Interested in This?
  • Take CS 6456, Principles of UI Software
  • Should have a good programming background

43
Heads up for HW2
  • Building simple VB app
  • Will need access to VB
  • If need access to CoC cluster
  • Fill out account form, submit to Peter Wan (CCB
    213)
  • Access to CCB 103 (Intel lab)
  • Have me sign it
  • Turn it in ASAP
  • If have CoC account, make sure it works in the
    clusters (need access to HG domain)
  • If not email Peter Wan

44
Next on the Menu
  • Dialog Pen PDA
  • Handling errors
  • Help documentation
Write a Comment
User Comments (0)
About PowerShow.com