Console and GUI Programs

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

An Introduction to Visual Basic Terms & Concepts.
Information System Design Lab 5&6. User Interface Design.
Introduction to Visual Basic Programming. Lecture Outline History What is Visual Basic First Look at the VB 6.0 Environment Some VB Terminology Our first.
Introduction to Visual Basic. What is Visual Basic? An environment for developing Windows applications Components –A GUI (Graphical User Interface - gooey)
Fundamentals of Programming in Visual Basic 3.1 Visual basic Objects Visual Basic programs display a Windows style screen (called a form) with boxes into.
Introduction to Visual Basic Chulantha Kulasekere.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
Chapter 1 P. 1 Writing Windows applications with Visual Basic Figure 1.1 The first program works as follows: (These operations can be performed in any.
An Introduction to Visual Basic
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
Basic Controls & Properties Chapter 2. Overview u VB-IDE u Basic Controls  Command Button  Label  Text Box  Picture Box u Program Editor  Setting.
Visual C++ Programming: Concepts and Projects
Copyright © 2010 Wolters Kluwer Health | Lippincott Williams & Wilkins Introduction to Windows Chapter 2.
 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions.
Copyright © Curt Hill First Window Builder Program Easy GUIs in Eclipse.
CHAPTER TWO INTRODUCTION TO VISUAL BASIC © Prepared By: Razif Razali 1.
CC111 Lec7 : Visual Basic 1 Visual Basic(1) Lecture 7.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Applications Development
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.
CSC 157 (Blum)1 Hello World. CSC 157 (Blum)2 Start/Programs/Microsoft Visual Studio.NET 2003/Microsoft Visual Studio.NET 2003.
Practical Programming COMP153-08S Week 5 Lecture 1: Screen Design Subroutines and Functions.
Copyright © Curt Hill More Components Varying the input of Dev-C++ Windows Programs.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 14 Event-Driven Programming with Graphical User Interfaces.
Copyright © – Curt Hill Building Windows Applications in wxDev-C++
Software Interfaces. Learning Objectives Describe the characteristics of different types of user interfaces. Discuss the types of user interfaces which.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Fundamentals of Windows Mouse n 4 Basic Operations: –Pointing –Clicking –Double Clicking –Dragging.
Introduction To Visual Basic 6
Visual Basic.NET Windows Programming
Windows Basics Computers 1.
Development Environment
PYGAME.
Chapter 1: An Introduction to Visual Basic 2015
Visual Basic Code & No.: CS 218
Chapter Topics 15.1 Graphical User Interfaces
Chapter 2 – Introduction to the Visual Studio .NET IDE
An Introduction to Computers and Visual Basic
Computer Software Digital Literacy.
1. Introduction to Visual Basic
An Introduction to Computers and Visual Basic
Understand Windows Forms Applications and Console-based Applications
Using Procedures and Exception Handling
An Introduction to Visual Basic
What is an operating system?
Chapter 2 Visual Basic Interface
Microsoft Office Illustrated Introductory, Windows XP Edition
Predefined Dialog Boxes
Hands-on Introduction to Visual Basic .NET
CIS16 Application Development Programming with Visual Basic
Windows Basics Computers 1.
Windows xp PART 1 DR.WAFAA SHRIEF.
Exploring the Basics of Windows XP
GRAPHICAL USER INTERFACE
Cmdlets “Command-lets”
An Introduction to Computers and Visual Basic
Chapter 15: GUI Applications & Event-Driven Programming
First Window Builder Program
Java Looking at our first console application in Eclipse
Let’s Talk about… Smalltalk.
Event loops.
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
Presentation transcript:

Console and GUI Programs Two Models for Programming This is used for C++, Java and VB. Check which one is most current. Copyright © 2001-2012 Curt Hill

Paradigms Pronounced Pair-a-dime Definition: A model or example A way of approaching a situation that affects every action that is taken Copyright © 2001-2012 Curt Hill

Operating Systems A set of programs that runs the computer Performs a number of important functions: Interprets user commands Establishes a file system Handles errors Among other things Copyright © 2001-2012 Curt Hill

User commands Early operating systems used console input These include DOS, UNIX, VMS Later operating systems adopted a GUI Graphical User Interface Pronounced “Gooey” These include Mac OS, Windows, Xwindows The two use different computing models Copyright © 2001-2012 Curt Hill

Simple Example The Console and GUI program will be demonstrated using a program to compute greatest common factor Each program will receive two numbers from the user Compute GCF using Euclid’s method Copyright © 2001-2012 Curt Hill

Euclid’s Method for GCF Make the larger num1 and smaller num2 Divide num1 by num2 and keep remainder Set num1 to num2 Set num2 to remainder Repeat the division until num2 < 2 Copyright © 2001-2012 Curt Hill

The Console Version This program computes the Greatest Common Factor using Euclid's method Enter the first number 323 Enter the second number 437 GCF is 19 Do you want to do another? n Copyright © 2001-2012 Curt Hill

The GUI Version Copyright © 2001-2012 Curt Hill

The Console Screen Usually a list of messages and inputs When a program writes a message Appears on the bottom of the list All previous messages scroll up When input is needed the user types it at bottom No need for a pointing device, like a mouse Copyright © 2001-2012 Curt Hill

The Console Paradigm The model for computing is that the program is in control It starts executing at some designated point Continues from there If it needs input, it initiates the input Prompts user and then reads The order of input is determined by program Copyright © 2001-2012 Curt Hill

Form of Console Program OS Pgm Subr Subr Subr Subr Subr Subr Service Service Copyright © 2001-2012 Curt Hill

Form Again In a console program the Operating System starts the main program This program may in turn call subroutines Methods, functions, procedures These may call others Some will call OS services Such as input and output Copyright © 2001-2012 Curt Hill

Other Console Comments Interrupts are used by OS but not a factor in programs Interrupt: A response to an event whose timing is unpredictable When interrupt processing is done, whatever was running is resumed Copyright © 2001-2012 Curt Hill

The GUI Screen Usually a series of Windows Each window has certain characteristics and controls A control is an item within the window Buttons Edit boxes List boxes Copyright © 2001-2012 Curt Hill

GUI History Developed at Xerox Palo Alto Research Center Alan Kay and others They were not going to market it Jobs of Apple saw it and used for Mac Gates developed Windows because of success of Mac Xwindows was developed for UNIX independently Copyright © 2001-2012 Curt Hill

WIMP The classic GUI is also known as WIMP Windows Icons Menus Pointer (mouse or trackball) Copyright © 2001-2012 Curt Hill

The GUI Paradigm The model for computing is that the operating system and user is in control The program starts It displays its windows through the operating system Then waits for the user to do something Most of the execution is in response to some user action, communicated by the OS Copyright © 2001-2012 Curt Hill

A Sample Window Copyright © 2001-2012 Curt Hill

Form of GUI Program OS Pgm Subr Subr Subr Subr Subr Service Service Copyright © 2001-2012 Curt Hill

Form Again In a GUI program the Operating System starts the main program Main program describes how windows are to be drawn It then returns to OS It also registers event handlers These are subroutines The events are things like a button click The subroutines may call other subroutines as well OS services Event handlers are called by OS not program Copyright © 2001-2012 Curt Hill

Objects In many programming environments the controls are objects in the technical sense An object is some data and code that acts on it These objects often conform to the PME model Copyright © 2001-2012 Curt Hill

The PME Model Properties Methods Events Data that is part of the object and affects how it is used Methods Code that manipulates the object Events What to do if some user action occurs Copyright © 2001-2012 Curt Hill

Properties Data that affects how the control looks or acts Examples: The caption of a button or text of an edit box The alignment of the text The position: Left, top, width, height Some of these are modified at design time and others at run time Copyright © 2001-2012 Curt Hill

Methods Actions that can be performed at run-time on the control Usually involves a substantial amount of programming by someone else Clearing an edit box can be done by assigning an empty string to its text property or executing its Clear method Copyright © 2001-2012 Curt Hill

Events When a button is clicked some action needs to be taken An event is an action that occurs at unpredictable times, so some code handles it Examples: Mousing over a control Left click, right click or double click of a control Receiving or losing focus Typing in a control Copyright © 2001-2012 Curt Hill

Languages C++, SmallTalk, Java are full object oriented languages Full support for objects, PME, inheritance, polymorphism There are one or more full GUI development environments Visual BASIC is half of an object oriented language Has objects, most of PME No inheritance, no polymorphism Has a full GUI development environment Copyright © 2001-2012 Curt Hill