1 Visual Basic: An Object Oriented Approach 7 – The User interface.

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

Designing a Graphical User Interface (GUI) 10 IST – Topic 6.
An Introduction to Visual Basic Terms & Concepts.
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
McGraw-Hill/Irwin Programming in Visual Basic 6.0 © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Update Edition Chapter 2 More Controls.
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.
Automating Tasks With Macros
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
Introduction to computers & Visual Basic School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 3, Monday 1/27/2003)
Chapter 3 Introduction to Event Handling and Windows Forms Applications.
Slide 1 Chapter 2 Visual Basic Interface. Slide 2 Chapter 2 Windows GUI  A GUI is a graphical user interface.  The interface is what appears on the.
Microsoft Visual Basic 2012 CHAPTER TWO Program and Graphical User Interface Design.
Visual Basic Chapter 1 Mr. Wangler.
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
An Introduction to Visual Basic
Designing a Graphical User Interface (GUI) Krisana Chinnasarn, Ph.D. January 2007.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
Multiple Forms, Container Controls, AddHandler This presentation is based on the Forms and ContainerControls VB Projects 1.
Visual Basic 101.
PROBLEM SOLVING The first step in writing instructions to carry out a task is to determine what the output should be (What should the task produce?)
Chapter 8: Writing Graphical User Interfaces Visual Basic.NET Programming: From Problem Analysis to Program Design.
Visual Basic 2005 CHAPTER 2 Program and Graphical User Interface Design.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 2 Creating a User Interface.
Enhancing the Graphical User Interface Multiple Forms, Controls, and Menus.
Lecture 5(b), Slide 1 CP2030 Copyright © University of Wolverhampton CP2030 Visual Basic for C++ Programmers v Component 5(b) HCI aspects of VB programming.
S511 Session 7, IU-SLIS 1 DB Implementation: MS Access Forms.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
CHAPTER TWO INTRODUCTION TO VISUAL BASIC © Prepared By: Razif Razali 1.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
DB Implementation: MS Access Forms. MS Access Forms  Purpose Data entry, editing, & viewing data in tables Forms are user-friendlier to end-users than.
C# GUI - Basics. Objectives.NET supports two types: WinForms, traditional, desktop GUI apps. WebForms – newer, for Web apps. Visual Studio.NET supports.
CHAPTER:07 JAVA IDE PROGRAMMING-II Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
Visual Basic Programming Introduction VB is one of the High level language VB has evolved from the BASIC language. BASIC stands for Beginners All-purpose.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 10 1 Microsoft Office Access 2003 Tutorial 10 – Automating Tasks With Macros.
McGraw-Hill/Irwin Programming in Visual Basic 6.0 © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Update Edition Chapter 2 More Controls.
Copyright © 2015 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 13 GUI Programming.
Object-Oriented Application Development Using VB.NET 1 Chapter 10 VB.NET GUI Components Overview.
Slide 1 Using Menu Bar & Common Dialog Boxes. Slide 2 Setting Up the Main Items v First open the form on which you want the menu located v Then start.
Microsoft Visual Basic 2010 CHAPTER TWO Program and Graphical User Interface Design.
CMPF114 Computer Literacy Chapter 3 The Visual Basic Environment 1.
1 Introduction to Visual Basic Dr Mohd Nabil Almunawar MS 3403 Advanced Computing.
L10: Model-View-Controller General application structure. User Interface: Role, Requirements, Problems Design patterns: Model – View – Controller, Observer/Observable.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 14 Event-Driven Programming with Graphical User Interfaces.
IMS 3253: Controls 1 Dr. Lawrence West, MIS Dept., University of Central Florida Topics Check Boxes Radio Buttons Date Time Picker Masked.
TOOLBOX. The Toolbox Intrinsic Controls - always included in the Toolbox ActiveX Controls - separate files with ocx file extension Insertable Objects.
DB Implementation: MS Access Forms. MS Access Forms: Purpose Data entry, editing, & viewing data in Tables Forms are user-friendlier to end-users than.
Visual Basic.NET Windows Programming
Microsoft Visual Basic 2005: Reloaded Second Edition
Topics Graphical User Interfaces Using the tkinter Module
Chapter 1: An Introduction to Visual Basic 2015
Chapter 8: Writing Graphical User Interfaces
Developing Forms and Subforms.
Program and Graphical User Interface Design
1. Introduction to Visual Basic
An Introduction to Visual Basic
DB Implementation: MS Access Forms
Chapter 2 Visual Basic Interface
Program and Graphical User Interface Design
VISUAL BASIC.
Hands-on Introduction to Visual Basic .NET
DB Implementation: MS Access Forms
6. WinForms 2003 C# GUI - Basics.
Visual C# - GUI and controls - 1
Chapter 4 Enhancing the Graphical User Interface
Chapter 4 Enhancing the Graphical User Interface
Presentation transcript:

1 Visual Basic: An Object Oriented Approach 7 – The User interface

2 Interacting with the User  The User is the most important concern when developing software for interactive use  Microsoft spends billions each year on beta-testing programmes  Most recent advances in software development have been to improve user-friendliness  The User-Interface (an awful term) is the parts of a program the user interacts with  Forms, controls, menus

3 User Interface Requirements  The UI should be designed to…  Simplify the use of software by providing a simple control model  Clarify the output from software, using graphics, tabular formatting etc. where appropriate  Reflect the logical structure of the underlying software, regardless of the actual physical implementation  The ideal User-Interface is invisible  The user will only notice it when it is difficult

4 U/I Options - 1  Input-Process-Output  The program controls the user - not friendly  User interaction follows the program structure  InputBox( ) and MsgBox( ) style interaction ProcessOutputInput

5 U/I Options - 2  Event-driven  Windows/VB’s natural UI mechanism  User controls program  Input and Output via specialized controls  Need to organize UI for modal/non-modal behaviour  Modal behaviour - use of dialog boxes  Non-modal behaviour - program reacts to user input

6 User Interface Tools  Most modern development systems (including VB) include facilities for developing a UI  ‘Visual’ model is common (not universal)  Ideal is to develop both software and UI  as independently as possible  to minimize unnecessary interactions between them  Stress should be placed on  Developing object model  Developing control model to connect to this as simply as possible

7 Component User-Interfaces Sometimes, UI components are incorporated into the object model Only sensible if UI component is specific to a particular object Must merit the additional development time Only worthwhile if reuse is certain VB Provides for the development of Controls, components that can be added to the toolbox

8 Forms, Views and Controllers  A Form is a Window (also an object)  Should act as ‘controller’ or ‘view’ for a part of the object model (OM)  Controller sends command messages to OM  View is updated by OM  An interactive form can be both View and Controller  MVC (Model-View-Controller) is an established UI method  See Journal of OOP - A Cookbook for Using the MVC User Interface Paradigm, Krasner & Pope, Aug/Sept 1988

9 Standard MVC Design  A single Object Model  Possible multiple views  e.g. Digital/Analogue clock  Possible multiple controllers  e.g. Front panel + remote

10 Modified MVC  In GUI software, often the View and Controller are a single unit  e.g. List Box with scroll bar  This simplified model is closer to that type of system

11 Event-Driven User Interfaces  Use of Forms containing input and command controls  Input - Text Boxes, Check Boxes, Lists etc.  Command - buttons, menus  A form should allow user-input in any order  Processing triggered when a command is issued  Ideally, commands are unavailable until all required input information is provided  Users should be led through the appropriate actions

12 Form-Based U/I Elements OK Button, defines a command as a positive action Cancel Button, allows user to back-off Options - note use of frame to group options Check box - should initially show default choice Text Boxes - note labels to make purpose clear Form caption shows overall purpose

13  Text Boxes  Free-form text input (single or multi-line)  Numeric input (use Changed event to filter out non- numeric characters)  Check Boxes  True/False, Yes/No etc input.  Option Buttons  Arranged in groups of possible options Standard Control Use

14 Standard Control Use - 2  List and Combo boxes  List - selection from a (possibly large) set - all on view at all times  Combo - as above but only selected option on view  Scroll Bars  Graphical interaction - shows analogue of input value - sets a numeric

15 U/I Guidelines  Simple is best  Standard windows controls are well known  Windows colour scheme is normally set so that all controls are optimally visible  Where possible, let user Select from a number of possible options  List Boxes, Combo Boxes, Option Groups etc.

16 U/I Guidelines - 2  Where possible, provide a default action  Option, List selection, input text value etc.  chosen/set if user does nothing  Guide the user by making controls available as necessary  Use Enabled property to disable controls if…  Other controls must be set first  Current settings make their use inappropriate

17 Typical Use of Enabled Property OK Button disabled until its use is valid Sub txtName_Change( )‘ Do same for txtAddress CheckEnabled End Sub Sub CheckEnabled( ) If txtName.Text<>”” And txtAddress.Text<>”” Then cmdOK.Enabled = True Else cmdOK.Enabled = False End If End Sub Note - Cancel button is always valid - can cancel at any time

18 Separating the User-Interface from the Object Model  In general, it is good practice to develop an Object Model in code, and then attach a user- interface to it  Allows for changes in Model  Allows for changes in UI  Creates a more easily testable system  Easiest route is to develop object model and forms as separate classes  Form design can include new properties and methods  A Form is a controller  Information collected on Forms can be passed to Objects

19 System is developed as an Object Model Forms are Viewers and Controllers of Object Model Forms operate on domains in model Using Object-Oriented Design

20 O-O System Development Tasks 1. Create Model Specification 2. Create System Design Determine Classes to develop, Attributes & Behaviours Determine Object Instances required 3. Detailed design of Class Interfaces 4. Design Viewer/Controllers for Objects 5. Implement Object Model Write Code Test Object Model 6. Implement Viewer/Controllers (Forms) 7. Integrate components to create system