Chapter 12 Graphical User Interface Concepts Part 1
- Slides: 86
Chapter 12 - Graphical User Interface Concepts: Part 1 Outline 12. 1 Introduction 12. 2 Windows Forms 12. 3 Event-Handling Model 12. 3. 1 Basic Event Handling 12. 4 Control Properties and Layout 12. 5 Labels, Text. Boxes and Buttons 12. 6 Group. Boxes and Panels 12. 7 Check. Boxes and Radio. Buttons 12. 8 Picture. Boxes 12. 9 Mouse Event Handling 12. 10 Keyboard Event Handling © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 1 Introduction • Graphical user interface – – Allow interaction with program visually Give program distinct look and feel Built from window gadgets Is an object, accessed via keyboard or mouse © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 1 Introduction Button Menu Label Menu Bar Text. Box Fig. 12. 1 Sample Internet Explorer window with GUI components. © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Scrollbar
12. 1 Introduction © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 2 Windows Forms • Windows Forms – Create GUIs for programs – Element on the desktop – Represented by: • Dialog • Window • MDI window © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 2 Windows Forms • Component – Class that implements IComponent interface – Lacks visual parts • Control – Component with graphical part • Such as button or label – Are visible • Event – Generated by movement from mouse or keyboard – Event handlers performs action • Specifics written by programmer © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 2 Windows Forms Fig. 12. 3 Components and controls for Windows Forms. © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 2 Windows Forms © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 3 Event-Handling Model • GUIs are event driven • Event handlers – Methods that process events and perform tasks • Associated delegate – Objects that reference methods – Contain lists of method references • Must have same signature – Intermediaries for objects and methods – Signature for control’s event handler © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 3 Event-Handling Model calls Handler 1 for event E calls Object A raises event E Delegate for event E Handler 2 for event E Handler 3 for event E Fig. 12. 5 Event-handling model using delegates. © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 3. 1 Basic Event Handling • Event handler – – Must have same signature as corresponding delegate Two object references are passed in Control. Name_Event. Name Must be registered with delegate object • Add event handlers to the delegate’s invocation list – New delegate object for each event handler • Event multicasting – Have multiple handlers for one event – Order called for event handlers is indeterminate © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 3. 1 Basic Event Handling Events icon List of events supported by control Selected event Event description Fig. 12. 6 Events section of the Properties window. © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Current even handler (none)
Outline Form 1. h 1 of 3 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 2 of 3 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 3 of 3 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. cpp 1 of 1 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 3. 1 Basic Event Handling List of events Fig. 12. 9 List of Form events. © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Class name
12. 3. 1 Basic Event Handling Event name Event delegate Fig. 12. 10 Details of Click event. © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Event argument class
12. 4 Control Properties and Layout • Common properties – Derive from class Control – Text property • Specifies the text that appears on a control – Focus method • Transfers the focus to a control • Becomes active control – Tab. Index property • Order in which controls are given focus • Automatically set by Visual Studio. NET – Enable property • Indicate a control’s accessibility © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 4 Control Properties and Layout • Visibility control – Hide control from user • Or use method Hide • Anchor property – Anchoring control to specific location • Constant distance from specified location – Unanchored control moves relative to the position – Docking allows control to spread itself along and entire side – Both options refer to the parent container • Size structure – Allow for specifying size range • Minimum. Size and Maximum. Size property © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 4 Control Properties and Layout © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 4 Control Properties and Layout After resize Before resize Constant distance to left and top sides Fig. 12 Anchoring demonstration. © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 4 Control Properties and Layout Darkened bar indicates to which wall control is anchored Click down-arrow in Anchor property to display anchoring window Fig. 12. 13 Manipulating the Anchor property of a control. © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 4 Control Properties and Layout Control expands along top portion of the form Fig. 12. 14 Docking demonstration. © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 4 Control Properties and Layout © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 5 Labels, Text. Boxes and Buttons • Labels – Provide text instruction • Read only text – Defined with class Label • Derived from class Control • Textbox – Class Text. Box – Area for text input • Password textbox © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 5 Labels, Text. Boxes and Buttons • Button – Control to trigger a specific action • Checkboxes or radio buttons – Derived from Button. Base © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 5 Labels, Text. Boxes and Buttons © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 5 Labels, Text. Boxes and Buttons © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 5 Labels, Text. Boxes and Buttons © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 1 of 5 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 2 of 5 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 3 of 5 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 4 of 5 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 5 of 5 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. cpp 1 of 1 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 6 Group. Boxes and Panels • Arrange components on a GUI – Group. Boxes can display a caption • Text property determines its caption – Panels can have scrollbar • View additional controls inside the Panel © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 6 Group. Boxes and Panels © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 6 Group. Boxes and Panels © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 6 Group. Boxes and Panels Controls inside panel scrollbars Fig. 12. 23 Creating a Panel with scrollbars. © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 1 of 4 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 2 of 4 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 3 of 4 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 4 of 4 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. cpp 1 of 1 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Fig. 12. 25 Group. Box and Panel demonstration. © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 7 Check. Boxes and Radio. Buttons • State buttons – On/off or true/false state – Derived from class Button. Base • Check. Box – No restriction on usage • Radio. Button – Grouped together – Only one can be true – Mutually exclusive options © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 7 Check. Boxes and Radio. Buttons © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 1 of 3 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 2 of 3 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 3 of 3 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. cpp 1 of 1 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
© Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 7 Check. Boxes and Radio. Buttons © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 1 of 7 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 2 of 7 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 3 of 7 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 4 of 7 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 5 of 7 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 6 of 7 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 7 of 7 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. cpp 1 of 1 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Error icon type Exclamation icon type OKCancel button type © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. OK button type
Information icon type Abort. Retry. Ignore button type Yes. No button type © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Question icon type Yes. No. Cancel button type Retry. Cancel button type
12. 8 Picture. Boxes • Class Picture. Box – Displays an image • Image set by object of class Image. – The Image property sets the Image object to use – Size. Mode property sets how the image is displayed © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 8 Picture. Boxes © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 1 of 3 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 2 of 3 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 3 of 3 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. cpp 1 of 1 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 9 Mouse Event Handling • Class Mouse. Event. Args – – – Contain coordinates of the mouse pointer The mouse pressed Number of clicks Number of notches the wheel turned Passing mouse event Mouse event-handling methods take an object and Mouse. Event. Args object as argument – The Click event uses delegate Event. Handler and event arguments Event. Args © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 9 Mouse Event Handling © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 1 of 4 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 2 of 4 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 3 of 4 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 4 of 4 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. cpp 1 of 1 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 10 Keyboard Event Handling • Key events – Control that inherits from System: : Windows: : Forms: : Control – Delegate Key. Press. Event. Handler • Event argument Key. Press. Event. Args • Key. Press – ASCII character pressed – No modifier keys – Delegate Key. Event. Handler • Event argument Key. Event. Args • Key. Up or Key. Down – Special modifier keys • Key enumeration value © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 10 Keyboard Event Handling Fig. 12. 38 Keyboard events, delegates and event arguments. (1 of 2) © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
12. 10 Keyboard Event Handling Fig. 12. 38 Keyboard events, delegates and event arguments. (2 of 2) © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 1 of 4 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 2 of 4 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 3 of 4 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. h 4 of 4 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Outline Form 1. cpp 1 of 1 © Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
© Copyright 1992 -2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
- Graphical user interface testing
- Principles of input design
- Principles of user interface design
- What is gui
- Java graphical user interface
- Graphical user interface history
- Gui vs web interface
- Graphical user interface testing tools
- Characteristics of graphical user interface
- Graphical user interface in data structures
- Components of graphical user interface
- Characteristics of web user interface
- History of the graphical user interface
- Metasploit gui
- Graphical device interface with c
- Idscenter
- Graphical device interface with c
- Ruby on rails gui
- Programming graphical user interfaces in r
- What is interface in java
- Areas of the screen that behave as if they were independent
- Industrial interfaces
- Interface------------ an interface *
- Yahoo user interface
- Xml user interface language
- User interface management system
- Scratch interface labeled
- User interface design cycle
- The importance of user interface
- User interface in software engineering
- User interface analysis and design
- Touch screen technology seminar
- Interactible
- User interface theory
- Define mdi
- Soal pilihan ganda user interface
- Task conformance in hci
- User interface feedback
- Komponen antarmuka
- Cognitive walkthrough vs heuristic evaluation
- User interface and its types
- User interface design for atm screens
- User interface instagram
- User interface design and evaluation
- User interface design in system analysis and design
- What is user interface design in software engineering
- User interface revit
- Human interface designer
- Interface between user and hardware
- User interface toolkit
- User interface design in software engineering
- Apa pengertian antarmuka pemakai (user interface) ?
- User interface solutions
- Python user interface design
- Dialog dalam konteks perancangan user interface adalah
- Visualization in user interface design
- Backoffice design
- User interface analysis
- Recoverability in user interface design
- Format output design
- Prinsip desain antarmuka sistem
- What are the advantages of command line interface
- Operating system ui
- User interface design steps in software engineering
- Windows 7 user interface
- Interface structure design
- User interface structure
- User interface process application block
- User interface prototyping in software engineering
- Task centered user interface design
- Interface design in software engineering
- Mengapa sistem embedded harus memiliki kehandalan sistem
- Nui natural user interface
- User interface hall of shame
- Ben shneiderman designing the user interface
- Interface between hardware and software
- Labview user interface design examples
- User familiarity
- Petronas supplier self service (sus) portal
- Character user interface
- 5 tipe utama interaksi user interface
- In the context of user interface designs, a heuristic is
- Voice user interface
- Gui characteristics
- User interface design process in software engineering
- Coherent ui a modern user interface
- Komponen user interface