Unit 20: Event Driven Programming

Slides:



Advertisements
Similar presentations
What Was I Thinking??. Key Terms 1. Control 1. Control 2. Design Mode 2. Design Mode 3. Event 3. Event 4. Form 4. Form 5. Interface 5. Interface 6. Properties.
Advertisements

VISUAL BASIC Visual Basic is derived from the Basic language (Beginner’s All-Purpose Symbolic Instruction Code) Visual Basic uses an event-driven programming.
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
Using VB with MS Applications R. Juhl, Delta College.
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Event-Driven Programming and Access Events
Slide 1 ICS 012 Visual Programming I Ahmed Esmat Second.
Promoting Code Reuse Often in programming, multiple procedures will perform the same operation IN OTHER WORDS – the same piece of code will do the same.
Introduction to Visual Basic. What is Visual Basic? An environment for developing Windows applications Components –A GUI (Graphical User Interface - gooey)
Software design and development Marcus Hunt. Application and limits of procedural programming Procedural programming is a powerful language, typically.
Describe the application and limits of procedural, object orientated and event driven programming. 
Programming Paradigms Imperative programming Functional programming Logic programming Event-driven programming Object-oriented programming A programming.
CS0004: Introduction to Programming Events. Review  Event Procedure  A set of instructions to be executed when a certain event happens.  Many event-driven.
Not in Text CP212 Winter No VBA Required “Regular” Programming traditional programming is sequential in nature o one command executed after another.
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
Unit 20: Event Driven Programming
CS 0004 –Lecture 1 Wednesday, Jan 5 th, 2011 Roxana Gheorghiu.
Intellicad Visual Basic Application Marian Kate Santos Programming Paradigm.
ChE 117 Motivation Lots of Tools Can’t always use “Canned Programs”
1 Visual Basic for Applications (VBA) for Excel Prof. Yitzchak Rosenthal.
Event Driven Programming
Mr C Johnston ICT Teacher BTEC IT Unit 06 - Lesson 01 Introduction to Computer Programming.
Integrated Development Environment (IDE)
IE 423 – Design of Decision Support Systems Visual Studio Introduction to VB.NET programming.
Outline Software and Programming Program Structure Tools for Designing Software Programming Languages Introduction to Visual Basic (VBA)
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
CHAPTER TWO INTRODUCTION TO VISUAL BASIC © Prepared By: Razif Razali 1.
Applications Development
MS Visual Basic 6 Walter Milner. VB 6 0 Introduction –background to VB, A hello World program 1 Core language 1 –Projects, data types, variables, forms,
I Power Higher Computing Software Development Development Languages and Environments.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 10 1 Microsoft Office Access 2003 Tutorial 10 – Automating Tasks With Macros.
GUI Programming Joseph Sant Sheridan College. Agenda Elements of GUI programming Component-Based Programming. Event-Based Programming. A process using.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
1 Visual Basic Part I - A tool for customizing your program Principles of GIS
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
Event Handling Tonga Institute of Higher Education.
Microsoft Visual Basic 2005 BASICS Lesson 3 Events and Code.
CIS 375—Web App Dev II ASP.NET 5 Events. 2 The Page_Load Event The Page_Load event is triggered when a page loads. [Example]Example Sub Page_Load lbl1.Text="The.
CIS 338: Events Dr. Ralph D. Westfall April, 2011.
Week 1 Lecture 1 Slide 1 CP2028 Visual Basic Programming 2 “The VB Team” Copyright © University of Wolverhampton CP2028 Visual Basic Programming 2 v Week.
12-Jun-16 Event loops. 2 Programming in prehistoric times Earliest programs were all “batch” processing There was no interaction with the user Input Output.
Visual Basic Fundamental Concepts
Unit 14 Event Driven Programming
Introduction to Programming and Visual Basic .NET
Introduction to Programming and Visual Basic
Introduction to Computer CC111
Chapter Topics 15.1 Graphical User Interfaces
11.10 Human Computer Interface
Event-driven programming
Event loops 16-Jun-18.
1. Introduction to Visual Basic
Microsoft Access 2003 Illustrated Complete
Event Driven Programming
Event Driven Programming
VISUAL BASIC.
Visual Basic..
Hands-on Introduction to Visual Basic .NET
Event loops.
Event Driven Programming
CS285 Introduction - Visual Basic
Visual Basic: Week 5 Review User defined functions
Event loops 17-Jan-19.
Event loops 17-Jan-19.
Chapter 15: GUI Applications & Event-Driven Programming
Event loops 8-Apr-19.
ICT Programming Lesson 5:
Event loops.
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
Event loops.
Event loops 19-Aug-19.
Presentation transcript:

Unit 20: Event Driven Programming Unit Descriptor

Aims Discuss what is an event driven program Define what is an event Look into event handlers and triggers Discuss event loops Look at example applications and languages Discuss key characteristics of an event driven program Discuss advantages and disadvantages of event driven programming Castle College

What are event driven programs? Event driven programs are typically used with GUI operating systems What events are triggered by a user using an OS? Clicks Movements Keys Timer What other software can you think of that is event driven? Spreadsheets, Databases, the lists go on..... Castle College

Define what an event is? An event is anything that happens to an object when the program is running. What is an object? Controls are objects, what controls can you think of? Form Buttons Lists Pictures etc...... Castle College

Page setup (Microsoft) Castle College

Define what an event handler is? Most objects have a large variety of possible events, i.e. Click, double click, mouse move etc... Event handler is the subroutine (procedure) that holds the code that runs when an event has occurred. Private Sub btnDisplayMessage_Click() MsgBox (“Hello World”) End Sub Event triggers selects the appropriate event handler that determines what code is executed. What part of the code shows the trigger? Castle College

Event Challenge Castle College Private Sub txtEnterText_Change() MsgBox ("Hello Life") End Sub Private Sub txtEnterText_Click() MsgBox ("Rock on") Private Sub btnClose_Click() MsgBox ("Hello World") End Sub Private Sub btnClose_MouseUp() MsgBox ("The King of Rock") Private Sub btnMessage_Click() Private Sub btnMessage_MouseMove() MsgBox ("Hello People") Castle College

Event loops Event driven programming languages need to have event loops. These loops are needed to keep testing the user interface to detect whether anything has happened, i.e. A mouse click. Even the programmer is not normally aware of this kind of loop. An event loop is part of an event driven program’s make up. There are other kinds of loops that the programmer will use, this is the same principle, however it is not programmed into an application by the programmer – it comes as part of the environment. Castle College

What are the key characteristics? These are the key characteristics of event driven programming languages. Event handlers Trigger functions Event loops Forms (which contain controls) Castle College

Programming languages A programming language is used by a programmer to develop event driven applications. Example event driven languages VB.net C# VBA VB6 Etc. Castle College

Some advantages of event driven programming Flexibility Programmer has control of where to place code and how to start it. Suitability for GUI An event driven language makes use of GUI controls to trigger Events. Simplicity of programming Visual programming makes application layout much easier to achieve. Code can simply be attached to various controls. Effective testing tools Castle College

A disadvantage of event driven programming Can be slow Loads of processing power is taken due to the need of the event loop. More processing is required due to the trigger functions as they match the type of event with the event handler. Castle College

Conclusion Discussed what is an event driven program Defined what is an event Looked into event handlers and triggers Discussed event loops Looked at example applications and languages Discussed key characteristics of an event driven program Discussed advantages and disadvantages of event driven programming Castle College