140 likes | 345 Views
Event-Based Programming. Chris North cs3724: HCI. Presentations. HW#1 due today brian hostetler daniel boisson Vote: UI Hall of Fame/Shame?. Quiz. 3 UI interaction styles? dm Menu command. Quiz. 4 principles of direct manipulation? visual Actions reversible Feedback
E N D
Event-Based Programming Chris North cs3724: HCI
Presentations • HW#1 due today • brian hostetler • daniel boisson • Vote: UI Hall of Fame/Shame?
Quiz • 3 UI interaction styles? • dm • Menu • command
Quiz • 4 principles of direct manipulation? • visual • Actions reversible • Feedback • Point select
GUI Development: Goals • Learn basic GUI concepts • Events, graphics, components, … • Learn some specific technologies • VisualBasic, Java, ASP Goal: can pick-up new technologies quickly • .NET, C#, Xwin, Java 49
Technologies • Microsoft: • Visual Basic (6) • C++, MFC (dead!) • C#, .Net • Borland Delphi • Unix: • Xlib • Motif, … • Tcl/tk • Cross Platform: • Visix Galaxy (dead) • Java, Swing • Mac ??? • Palm • Web • Dhtml, javascript • ASP, JSP, cgi, … • Cold fusion, …
GUI Events System MS: Windows Unix: Xwindows Java: AWT/Swing event loop App Code: OK_button_callback() { do stuff; } Cancel_button_callback() { do different stuff; } Mouse click, Mouse move, Key press, … Application OK Cancel
Typical GUI program App Code: Global storage for data state Startup stuff initialization create GUI Event callback proc Event callback proc Event callback proc Event callback proc … Example: Word Processor Datastruct current_text Startup() current_text = “” create window, text area, buttons Event text area keypress(char key) current_text.insert(key) Event bold button click() current_text.makebold() …
Unpredictable Flow Non-GUI app: Code Code Code Code Code Code Code Code Code Code Code Code Code GUI app: Global storage for data state Startup stuff initialization create GUI Event callback proc Event callback proc Event callback proc Event callback proc Event callback proc Event callback proc Event callback proc Most time spent idle!
Visual Basic • Form = window • RAD tools • Components: properties, methods, events • Modes: edit, run • Debug • Object Browser • msdn • CD • Web: http://www.msdn.microsoft.com/library/en-us/vbcon98/html/vbmscVisualBasicDocumentationMap.asp
Components • Properties • Read/write (get/set) • E.g. color • Methods • Procedures or functions • E.g. move x,y,w,h • Events • Send message to component’s container • E.g. buttonClick
Project 1: VB • See website • Due Thurs Feb 7 (2 weeks) • Virtual VCR programming tool • Idea: Cable PC, records onto huge disk drive • Visual Basic • 50% UI design, 50% program • Individual assignment
Next • Homework #1 due now Presentations: • Next Tues: bruce billian, nick meyers • Next Thurs: taylor mitchell, chris henry