Review: Event Driven Programming & GUI. CSCE155N Matlab Fall 2016

Similar documents
BUILDING A MATLAB GUI. Education Transfer Plan Seyyed Khandani, Ph.D. IISME 2014

Event driven programming

Still More About Matlab GUI s (v. 1.3) Popup Menus. Popup Menu Exercise. Still More GUI Info - GE /29/2012. Copyright C. S. Tritt, Ph.D.

Building a Graphical User Interface

Graphical User Interface. GUI in MATLAB. Eng. Banan Ahmad Allaqta

Level 3 Computing Year 2 Lecturer: Phil Smith

Event-driven Programming: GUIs

Mid Unit Review. Of the four learning outcomes for this unit, we have covered the first two. 1.1 LO1 2.1 LO2 LO2

GUI Building for Test & Measurement Applications

Part #10. AE0B17MTB Matlab. Miloslav Čapek Viktor Adler, Pavel Valtr, Filip Kozák

SBT 645 Introduction to Scientific Computing in Sports Science #5

There are two ways to launch Graphical User Interface (GUI). You can either

We are IntechOpen, the world s leading publisher of Open Access books Built by scientists, for scientists. International authors and editors

Completing this project will help you learn about one-dimensional arrays and how to implement and use functions. More on Matlab graphics GUI design.

UI Toolkits. HCID 520 User Interface Software & Technology

Sharing is the Key. Lecture 25: Parallelism. Canonical Example. Bad Interleavings. Common to have: CS 62 Fall 2016 Kim Bruce & Peter Mawhorter

Widgets. Widgets Widget Toolkits. 2.3 Widgets 1

Special Topics II: Graphical User Interfaces (GUIs)

MATLAB. Creating Graphical User Interfaces Version 7. The Language of Technical Computing

GI PageBus AMS Integration Demo

Widgets. Widgets Widget Toolkits. User Interface Widget

The Life Cycle of an Event

UI Toolkits. HCID 520 User Interface Software & Technology

CS 4300 Computer Graphics

PTN-202: Advanced Python Programming Course Description. Course Outline

Computational Methods of Scientific Programming. Matlab Lecture 3 Lecturers Thomas A Herring Chris Hill

User can customize the default power behavior as follows. Close Lid: Choose what Windows does when a laptop lid is closed.

DEVELOPMENT OF MOTOR CONTROL USING GRAPHICAL USER INTERFACE KHAIRUL ANUAR BIN ARIS UNIVERSITY MALAYSIA PAHANG

Java for Programmers Course (equivalent to SL 275) 36 Contact Hours

Introduction to Computer Science

User Interaction. User Interaction. Input devices. Input devices. Input devices GUIs and GUI design Event-driven programming 3D interaction

Micrium OS Kernel Labs

Lab. Lecture 26: Concurrency & Responsiveness. Assignment. Maze Program

Event Driven Programming

Module 4 Multi threaded Programming, Event Handling. OOC 4 th Sem, B Div Prof. Mouna M. Naravani

CITS3403 Agile Web Development Semester 1, 2018

Cell Arrays, Struct Arrays, Matlab Path

Critical Thinking Assignment #6: Java Program #6 of 6 (70 Points)

Computational Methods of Scientific Programming

Module 4 Multi threaded Programming, Event Handling. OOC 4 th Sem, B Div Prof. Mouna M. Naravani

Fall UI Design and Implementation 1

Vive Input Utility Developer Guide

SINGLE EVENT HANDLING

CSC Web Programming. JavaScript Browser Objects

Software. Programming Languages. Types of Software. Types of Languages. Types of Programming. Software does something

JavaScript. Like PHP, JavaScript is a modern programming language that is derived from the syntax at C.

Test Case Design using Keywords

Rendering a 3-Dimensional Cube Applet Using Light Weight Java Graphing Library (LWJGL) with Java Swing with NetBeans IDE 6.1

Lecture 19 GUI Events

Purpose: How to train an MLP neural network in MATLAB environment!

using event driven model with Mathematica Manipulate[] programming

CSE 331 Software Design & Implementation

CS 498RK FALL RESTFUL APIs

Contents INTERFACING MATLAB WITH EMBEDDED SYSTEMS

MOBILE COMPUTING 1/20/18. How many of you. CSE 40814/60814 Spring have implemented a command-line user interface?

CS 231 Data Structures and Algorithms Fall Event Based Programming Lecture 06 - September 17, Prof. Zadia Codabux

Level 3 Computing Year 1 Lecturer: Phil Smith

Introduction To MATLAB Interactive Graphics

CS 354R: Computer Game Technology

EVENT-DRIVEN PROGRAMMING

Mobile Development Workshop DAY 2: INTRODUCTION TO JAVA

Chapter 2 Visual Basic Interface

Computational Methods of Scientific Programming Fall 2007

CS123. Programming Your Personal Robot. Part 2: Event Driven Behavior

Graphical User Interfaces. Comp 152

Model-View-Controller Architecture

CSE 331 Software Design and Implementation. Lecture 19 GUI Events

Homeworks on FFT Instr. and Meas. for Communication Systems- Gianfranco Miele. Name Surname

Project Zygote. Rapid prototyping for the Internet of Things

Embedded PC Master Application

Graphical User Interface (Part-1) Supplementary Material for CPSC 233

Event-driven Programming, Separation of Concerns, the Observer pattern and the JavaFX Event Infrastructure

Type of Classes Nested Classes Inner Classes Local and Anonymous Inner Classes

2015 The MathWorks, Inc. 1

CNBC Matlab Mini-Course

Kernel Korner AEM: A Scalable and Native Event Mechanism for Linux

Review: Recursions. CSCE155N Matlab Fall 2016

Tim Love. July 24, Introduction 2. 2 Info and help commands 2

Static Analysis for Android: GUIs, Callbacks, and Beyond

MRCP. Client Integration Manual. Developer Guide. Powered by Universal Speech Solutions LLC

User guide of Google Nest s cloud database

Chapter 1. Introduction to Programming and Visual Basic Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of

Graphics. Lecture 18 COP 3252 Summer June 6, 2017

HTML 5 and CSS 3, Illustrated Complete. Unit L: Programming Web Pages with JavaScript

Chapter 16 Graphical User Interfaces

Intermediate Python 3.x

ClareVision SD Card Motion Record Settings Product Bulletin

Chapter 16 Graphical User Interfaces

% Edit the above text to modify the response to help Video_Player. % Last Modified by GUIDE v May :38:12

Widget. Widget is a generic name for parts of an interface that have their own behaviour. e.g., buttons, progress bars, sliders, drop-down

Introduction to scripting with Gig Performer Draft V0.51. Dr. David H Jameson Nebojsa Djogo. Deskew Technologies, LLC May 4, 2018

Digital Input and Output

A Generative Programming Approach to Middleware Development

Solving Linear Programs Using the Simplex Method (Manual)

EVAL FUNCTION. eval Execute a string containing a MATLAB expression

The Language of Technical Computing. Computation. Visualization. Programming. Creating Graphical User Interfaces Version 1

Program Graph. Lecture 25: Parallelism & Concurrency. Performance. What does it mean?

Android User Interface Overview. Most of the material in this sec7on comes from h8p://developer.android.com/guide/topics/ui/index.

From Bing.com on Nov

1 CUSTOM TAG FUNDAMENTALS PREFACE... xiii. ACKNOWLEDGMENTS... xix. Using Custom Tags The JSP File 5. Defining Custom Tags The TLD 6

Transcription:

Review: Event Driven Programming & GUI CSCE155N Matlab Fall 2016

1. Which of the following is not true about event-driven programming? A. An event source is a GUI component that could generate an event when user interacts with it B. An event listener is a process or thread that is attached to an event source to listen for user interaction with that event source C. An event handler is a function that processes a recorded event D. Event-driven programming does not respond as timely as conventional, procedural programming such as using loops

2. Which of the following is not true? A. Edit textboxes, buttons, checkboxes, sliders, and other uicontrol items are event sources found in MATLAB B. In MATLAB, programmers have to explicitly link or map event sources to their listeners C. In MATLAB, programmers have to explicitly link or map event sources to their handlers D. In MATLAB, programmers define, design, and implement event handlers

3. Which of the following is not part of implementing a GUI? A. Create an overall window using MATLAB s built-in function figure() B. Create individual GUI components (event sources) using MATLAB s built-in uicontrol() function C. Attach event sources to their event handlers using @ function handle D. Implement event handlers as nested functions E. All of the above are parts of implementing a GUI

4. Which of the following is not true about event handlers? A. We implement event handlers as nested functions so that variables of the primary function or main script can be accessed within the functions without having to pass them in B. An event handler can be linked or attached to an event source using the field name callback and a function handle @ C. In addition to callback, there are other event types buttondownfcn, widnowbuttonupfcn, windownbuttonmotionfcn, closerequestfcn, etc. D. An event handler can only be attached to one event source

5. Consider the given code. Which of the following is an event source that would trigger an event handler? A. The list B. The edit box C. The push button D. The figure S.fh = figure('units','pixels',... 'position',[500 500 200 300],... 'menubar','none',... 'name','gui_2',... 'numbertitle','off',... 'resize','off'); S.ls = uicontrol('style','list',... 'position',[10 110 180 180],... 'min',0,'max',2,... 'string',{'one';'two';'three';'four'}); S.ed = uicontrol('style','edit',... 'position',[10 60 180 30],... 'string','new String'); S.pb = uicontrol('style','push',... 'units','pix',... 'position',[10 10 180 40],... 'string','add String',... 'callback',{@ed_call,s});

6. Consider the given code. What is not true about the event handler? A. It is triggered when user clicks the push button B. It is attached or linked to the event source edit box and the event source list C. Grab the existing strings in the list, grab the existing strings in the edit box, concatenate them, and replace the existing strings in the list with the concatenated string D. Changing the struct S inside the event handler function also changes the struct S outside the function S.fh = figure('units','pixels',... 'resize','off'); S.ls = uicontrol('style','list',... 'string',{'one';'two';'three';'four'}); S.ed = uicontrol('style','edit',... 'string','new String'); S.pb = uicontrol('style','push',... 'string','add String',... 'callback',{@ed_call,s}); function [] = ed_call(varargin) S = varargin{3}; % Get the structure. oldstr = get(s.ls,'string'); addstr = {get(s.ed,'string')}; set(s.ls,'string',{addstr{:},oldstr{:}}); end

7. Consider the given code. Which of the following GUIs corresponds to the code? C S.fh = figure('units','pixels',... 'position',[500 500 200 300],... 'menubar','none',... 'name','gui_2',... 'numbertitle','off',... 'resize','off'); S.ls = uicontrol('style','list',... 'position',[10 110 180 180],... 'min',0,'max',2,... 'string',{'one';'two';'three';'four'}); S.ed = uicontrol('style','edit',... 'position',[10 60 180 30],... 'string','new String'); S.pb = uicontrol('style','push',... 'units','pix',... 'position',[10 10 180 40],... 'string','add String',... 'callback',{@ed_call,s}); A B D

8. Consider the given code. Which of the following GUIs corresponds to the code? A C B D S.fh = figure('units','pixels',... 'position',[300 300 390 100],... 'menubar','none',... 'name','gui_16',... 'numbertitle','off',... 'resize','off'); S.sl = uicontrol('style','slide',... 'position',[60 10 270 30],... 'min',1,'max',100,'val',50); S.ed(1) = uicontrol('style','edit',... 'position',[10 10 40 30],... 'fontsize',12,... 'string','1'); % Displays the min. S.ed(2) = uicontrol('style','edit',... 'position',[60 50 270 30],... 'fontsize',16,... 'string','50'); % Displays the value. S.ed(3) = uicontrol('style','edit',... 'position',[340 10 40 30],... 'fontsize',12,... 'string','100'); % Displays the max. set([s.ed(:);s.sl],'call',{@sl_call,s});