More on Graphical User Interfaces

Slides:



Advertisements
Similar presentations
Using Macros and Visual Basic for Applications (VBA) with Excel
Advertisements

CS112 Scientific Computation Department of Computer Science Wellesley College Geese honk, but they don’t wave Sinusoidal waves.
Chapter 8 and 9 Review: Logical Functions and Control Structures Introduction to MATLAB 7 Engineering 161.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Automating Tasks With Macros
Create slices and hotspots Create links in Web pages Create rollovers from slices Create basic animation Add tweening symbol instances to create animation.
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
CS112 Scientific Computation Department of Computer Science Wellesley College Interactive Programs Graphical User Interfaces.
Access Tutorial 10 Automating Tasks with Macros
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Programming a GUI Hanan sedaghat pisheh. For calling GUI, we need a function with no inputs or outputs First We create a m.file m file has the same name.
XP Tutorial 5 Buttons, Behaviors, and Sounds. XP New Perspectives on Macromedia Flash MX Buttons Interactive means that the user has some level.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
A short intermission about function handles and cell arrays A MATLAB function may be referenced by a handle. >> sphere(100)
Introduction to the Graphical User Interface (GUI) in MATLAB
Matlab GUIs GUIDE.
CS 170 – INTRO TO SCIENTIFIC AND ENGINEERING PROGRAMMING.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
Introduction to Matlab & Data Analysis
Java Software Solutions Lewis and Loftus Chapter 10 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphical User Interfaces --
GUI development with Matlab: GUI Front Panel Components 1 GUI front panel components In this section, we will look at -GUI front panel components -Programming.
Introduction to Matlab’s Graphical User Interface (GUI) Type “guide” “Guide” creates interface on a Figure window and code in an M-file. Some hidden code.
Graphical User Interfaces I The central station is the bubble gum planet with 280 pounds of clay and three head phone lines that come out and orbit the.
function varargout = MovieJoiner(varargin) % MOVIEJOINER M-file for MovieJoiner.fig % MOVIEJOINER, by itself, creates a new MOVIEJOINER or raises the.
Introduction to MATLAB Damon Tomlin February 22, 2008 Lecture 3: Data Visualization & User Interfaces.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Introduction to Matlab & Data Analysis 2015 In this tutorial we will: Build a practical application using GUIDE Learn more about graphical user interface.
MATLAB for Engineers 4E, by Holly Moore. © 2014 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected by Copyright.
GUI development with Matlab: GUI Front Panel Components GUI development with Matlab: Other GUI Components 1 Other GUI components In this section, we will.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4: Events Programming with Alice and Java First Edition by John Lewis.
Video in Macromedia Flash (Optional) – Lesson 121 Video in Macromedia Flash (Optional) Lesson 12.
CS112 Scientific Computation Department of Computer Science Wellesley College Interactive Programs Graphical User Interfaces.
EGR 115 Introduction to Computing for Engineers
EGR 115 Introduction to Computing for Engineers Graphical User Interface Design in MATLAB - Part 2 Monday 24 Nov 2014 EGR 115 Introduction to Computing.
Oct 091 Example Program DemoInputValidation1.java DemoInputValidation2.java.
Introduction to Matlab Module #10 Page 1 Introduction to Matlab Module #10 – Creating Graphical User Interfaces Topics 1.Overview of GUI Development using.
CS112 Scientific Computation Department of Computer Science Wellesley College Blind to change More on GUIs.
Lecture (7) Introduction to GUI Eng. Osama Talaat 1.
MATLAB and SimulinkLecture 61 To days Outline Graphical User Interface (GUI) Exercise on this days topics.
PATTERN RECOGNITION LAB 8 TA : Nouf Al-Harbi::
CIS 205—Web Design & Development Flash Chapter 3 Working with Symbols and Interactivity.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
Dive Into® Visual Basic 2010 Express
Graphical User Interfaces I
Excel Tutorial 8 Developing an Excel Application
Reading and Writing Image Files
Java FX: Scene Builder.
MSC.visualNastran 4D Exercise Workbook
Topics Graphical User Interfaces Using the tkinter Module
Graphical User Interface in MATLAB
Chapter Topics 15.1 Graphical User Interfaces
Chapter 2 – Introduction to the Visual Studio .NET IDE
3.01 Apply Controls Associated With Visual Studio Form
3.01 Apply Controls Associated With Visual Studio Form
Using Procedures and Exception Handling
Chap 7. Building Java Graphical User Interfaces
Graphical User Interfaces -- Introduction
MODULE 7 Microsoft Access 2010
Microsoft Visual Basic 2005: Reloaded Second Edition
T. Jumana Abu Shmais – AOU - Riyadh
Items, Group Boxes, Check Boxes & Radio Buttons
Chapter 15: GUI Applications & Event-Driven Programming
Using Animation and Multimedia
Creating Additional Input Items
Tutorial 10 Automating Tasks with Macros
Presentation transcript:

More on Graphical User Interfaces Blind to Change More on Graphical User Interfaces today learn more about how to create graphical user interfaces for our programs -

Exploring “change blindness” The human visual system can be “blind” to changes in a scene, unless we draw our attention to the area undergoing change This GUI-based program displays a pair of alternating images on the left, until the user notices the change and presses the stop button The user can select which pair to view, the amount of time each image is displayed, and the time between image frames Results on the total time needed to detect the change for each pair can be viewed on the right GUIs

Functions defined in blindGUI.m blindGUI: top-level function at the beginning of the file that is called from the Command Window. This function initializes the GUI program and opens the GUI window. This function is not modified blindGUI_OpeningFcn: executed just before the GUI window is made visible. Code is added to this function to set up an initial pair of images for testing, and to create a vector to store the experimental results blindGUI_OutputFcn: returns outputs to the Command Window. This function is not modified - similar to energyGUI program, many functions automatically created GUIs 3

Changes to blindGUI_OpeningFcn % --- Executes just before blindGUI is made visible. function blindGUI_OpeningFcn (hObject,eventdata,handles,varargin) % variables to store image pair, initialized to airplane images handles.im1 = imread('plane1.bmp’); handles.im2 = imread('plane2.bmp’); % results of tests: number of repeats needed to detect change, for % each pair of images (currently four image pairs) handles.results = zeros(1,4); % Choose default command line output for blindGUI handles.output = hObject; % Update handles structure guidata(hObject, handles); - sets up initial pair of airplane images and vector to store experimental results - creates new fields for handles structure and assigns initial values - multiple Callback functions will need to access images and results, so put it in handles structure that is passed to every function as input GUIs 4

global handles structure! imagesMenu_Callback function imagesMenu_Callback(hObject, eventdata, handles) % loads selected image pair imageChoice = get(handles.imagesMenu, 'Value'); if (imageChoice == 1) handles.im1 = imread('plane1.bmp'); handles.im2 = imread('plane2.bmp'); elseif (imageChoice == 2) handles.im1 = imread('dinner1.bmp'); handles.im2 = imread('dinner2.bmp'); elseif (imageChoice == 3) handles.im1 = imread('farm1.bmp'); handles.im2 = imread('farm2.bmp'); else handles.im1 = imread('market1.bmp'); handles.im2 = imread('market2.bmp'); end % update handles structure guidata(hObject, handles); - when user selects a new image pair in the pop-up menu of image names, the corresponding images are loaded into handles.im1 and handles.im2 - guidata command is also added, because a change is made to the handles structure Don’t forget to update global handles structure! GUIs 5

demoButton_Callback (part 1) function demoButton_Callback(hObject, eventdata, handles) % create blank frame of the same size as the image pair [rows cols rgb] = size(handles.im1); blank = 0.8*ones(rows, cols, rgb); % get presentation and gap times from the GUI presentTime = str2double(get(handles.presentTextbox, ‘String’)); gapTime = str2double(get(handles.gapTextbox, ‘String’)); % switch to testAxes display area and enable the stop button axes(handles.testAxes); set(handles.stopButton, ‘Enable’, ‘on’); % initialize number of repetitions needed to detect change nreps = 0; … - blank frame placed between two images as they are alternated (to avoid direct detection of motion) - text entered into edit text boxes is returned as a string - str2double used to convert string to number - uses axes function to specify which display area - sometimes don’t want user to be able to interact with a certain GUI component at a particular time, so can disable it using the “Enable” property, which exists for any type of component – grays out GUIs 6

demoButton_Callback (part 2) % keep alternating between the two images, with blank frame in % between, until the user clicks on the stop button while (get(handles.stopButton, ‘Value’) == 0) imshow(handles.im1); pause(presentTime); imshow(blank); pause(gapTime); imshow(handles.im2); nreps = nreps + 1; end % record results (number of repeats needed to detect change) handles.results(get(handles.imagesMenu, ‘Value’)) = nreps; % reset and disable the stop button set(handles.stopButton, ‘Value’, 0); set(handles.stopButton, ‘Enable’, ‘off’); % update handles structure guidata(hObject, handles); - loop: image1, blank, image2, blank, with pauses in between (MATLAB pause function, input seconds) - each time increment nreps – 4 image names in menu, 4 locations in results vector, can use index of selected image name as index for results - reset stopButton to be off and disabled - changed something in handles structure, so need to call guidata! GUIs 7

resultsButton_Callback function resultsButton_Callback(hObject, eventdata, handles) % display results of tests as a bar graph of the number of % repeats needed to detect change for each image pair axes(handles.resultsAxes); bar(handles.results); axis([0 5 0 max(handles.results)]) set(gca, ‘XTickLabel’, {‘plane’ ‘dinner’ ‘farm’ ‘market’}); ylabel(‘number of repeats’); title(‘time needed to detect change’); - when press “show results”, display bar graph of results in right display area – use axes function to direct graph there, set x/y range with axis - remember how words on axis with e.g. set(gca, ‘XTickLabel’, {…}) cell array GUIs 8

Bells and whistles Other things you may want to explore in a GUI for your final project: - adding animation - other GUI components Slider Listbox Radio Buttons - dialog boxes - pull-down menus - mouse control - multi-line text boxes - we can help you figure out these things GUIs 9