CS360/CS580H GUI & Windows Programming Introduction.

Slides:



Advertisements
Similar presentations
Module 1: Creating an Application by Using Windows Presentation Foundation Overview of WPF Creating a Simple WPF Application Handling Events and Commands.
Advertisements

Brown University Swim Center
The Microsoft Technical Roadshow 2006 Windows Presentation Foundation (WPF) Marcus Perryman
 2007 Dr. Natheer Khasawneh. Chapter 13. Graphical User Interface Concepts: Part 1.
WPF vs Silverlight Stuart Haas. WPF  Windows Presentation Foundation  Included in Vista, Server 2008 and XP service pack 2  Deployed in desktop and.
Dinko Jakovljević Microsoft Student Partner | BambooLab
Windows Presetation Foundation (WPF) 1. Introduction.
Gustavo Cavalcanti tinyfit.com. About me... Programmer since mid-90s BS in Computer Science (Catholic University of Pernambuco, Brazil) MBA with emphasis.
WPF. Origins – Who, When, Where  Who? Microsoft  When? November 2006  Where? Windows Vista Windows Server 2003 Windows XP Service Pack 2.
Introduction & Welcome Marcus Perryman Mike Taulty
Event-based Programming Roger Crawfis. Window-based programming Most modern desktop systems are window-based. Non-window based environment Window based.
Getting Started Example ICS2O curriculum
Microsoft Visual Basic 2012 CHAPTER ONE Introduction to Visual Basic 2012 Programming.
Microsoft Visual Basic 2005 CHAPTER 1 Introduction to Visual Basic 2005 Programming.
Written by Liron Blecher
2 A First Look at Windows Presentation Foundation Everywhere ("WPF/E") Joe Stegman Lead Program Manager Microsoft Corporation.
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. WEB.
Rujchai Ung-arunyawee Department of Computer Engineering Khon Kaen University.
CS360/CS580H GUI & Windows Programming. Outline Win32/Windows API & SDK Visual Studio MFC – Microsoft Foundation Classes C# &.NET – concepts Windows Forms.
Next Generation for Desktop Applications Doncho Minkov Telerik School Academy schoolacademy.telerik.com Technical Trainer
An Introduction to Silverlight Matt Harrington Developer Evangelist, Microsoft October 20, 2011.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
Windows Presentation Foundation. Agenda Introduction Developing Applications WPF and WF interoperability Custom Controls Styles and Templates Data Binding.
Windows Presentation Foundation. Goal The goal of Windows Presentation Foundation (WPF) is to provide these advances for Windows. Included in version.
ASP.NET Web Server Controls Basic Web Server Controls.
Introduction to OpenGL and GLUT GLUT. What is OpenGL? An application programming interface (API) A (low-level) Graphics rendering API Generate high-quality.
CS360/CS580H GUI & Windows Programming Introduction.
Windows Presentation Foundation Adam Calderon Principal Engineer Interknowlogy LLC
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
Programming in C#. I. Introduction C# (or C-Sharp) is a programming language. C# is used to write software that runs on the.NET Framework. Although C#
Microsoft Foundation Classes. What is MFC? Set of C++ classes written by MS Simplifies writing complex programs Covers many areas: – GUI – I/O – O/S interfaces.
Object Oriented Software Development 9. Creating Graphical User Interfaces.
The Microsoft Technical Roadshow 2007 Rich Client Development in XAML Mark Johnston Developer & Platform Group Microsoft Ltd
Presentation advances in.NET Framework 3.0 Mark Johnston Developer & Platform Group, Microsoft Ltd
JavaScript - A Web Script Language Fred Durao
C# GUI - Basics. Objectives.NET supports two types: WinForms, traditional, desktop GUI apps. WebForms – newer, for Web apps. Visual Studio.NET supports.
Dale Roberts Introduction to Visual Programming Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and.
A Lap Around Windows Presentation Foundation. Why hasn’t UX taken off in software? It’s Difficult! Animation 2D 3D Documents Styled Controls Video Windows.
WPF – Windows Presentation Foundation what is it, what can you do with it and how do you get started.
Windows Presentation Foundation (WPF). Introduction Separates appearance of user interface from behavior Appearance usually specified by XAML Behavior.
Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Windows Workflow Foundation Ruwan Wijesinghe.
Introduction to visual programming C#. Learning Outcomes In this chapter, you will learn about :  Event-Based Programming  The Event Based Model  Application.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
1 Välkommen till Sommarkollo Windows Presentation Foundation Per Östman ISV Developer Evangelist
.NET Framework Presentation. About Me Patrik Löwendahl –C# MVP –Certified Vista Touchdown Trainer Cornerstone
INFORMATION SYSTEM – SOFTWARE TOPIC: GRAPHICAL USER INTERFACE.
Module 1 Introducing C# and the.NET Framework. Module Overview Introduction to the.NET Framework 4 Creating Projects Within Visual Studio 2010 Writing.
User Interface Programming in C#: Basics and Events Chris North CS 3724: HCI.
Windows Presentation Foundation. User Experience: Recent Past Web HTML Sacrificed UX for portability, connectivity and simplicity 1997 – DHTML.
Microsoft Foundation Classes
Microsoft Visual Basic 2015 CHAPTER ONE Introduction to Visual Basic 2015 Programming.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Andy Wigley Device Application Development MVP APPA Mundi Ltd SESSION CODE: WEM309.
Part of the Microsoft.NET Framework 3.0 Tomer Shamam.NET Technologies Expert Sela Group
ANDROID LAYOUTS AND WIDGETS. Slide 2 Introduction Parts of the Android screen Sizing widgets and fonts Layouts and their characteristics Buttons, checkboxes.
Introduction to Avalon Mike Taulty Microsoft Ltd
Working in a Mobile App Development Environment Lesson 2.
Introducing Windows Applications Lesson 1. Objectives.
Introducing Windows Applications Lesson 1. Objectives.
Introduction to Windows Programming
Microsoft Foundation Classes MFC
CompSci 230 S Software Construction
Introduction to Visual Basic 2008 Programming
WPF vs Silverlight.
XAML User Interface Creation in C#
WPF AKEEL AHMED.
.NET and .NET Core 7. XAML Pan Wuming 2017.
תכנות אסינכרוני, תקשורת ופיתוח אפליקציות ל-Windows 8
Dot Net Application PROF. S. LAKSHMANAN, DEPT. OF B. VOC. (SD & SA),
Windows Presentation Foundation
Presentation transcript:

CS360/CS580H GUI & Windows Programming Introduction

Basic Course Outline Visual Studio 2013 Win32/Windows API & SDK MS Foundation Classes (MFC) & C++ HTML, XAML C# vs. C++ concepts/differences Common Gateway Interface (CGI) programming The.Net Framework Windows Forms WPF - Windows Presentation Foundation Using DirectX + XAML & RTL (post-Vista) Android

Paradigms 4 different ways to build a GUI program: Each has advantages/disadvantages – WIN32API – lower-level control, works on older systems – Microsoft Foundation Classes – many pre-built objects – Windows Forms – presentation separated from processing – Windows Presentation Foundation Can build common browser-based and desktop apps Easier handling of media types

Comparison of Paradigms Win32 API MFC Windows Forms Windows Forms+API Codepack WPF GUI forms and controls XXXX On-screen documents XXX Fixed-format documents (PDF) extXX ImagesBMPX Video/audio Use Media Player XX 2D graphics"XX 3D graphics"XX Note: WPF – see WindowsFormsHost control

Basic Concepts for all GUI's "Control" – MS term for mechanisms that manage what appears on the screen – Sliders, pointers, windows, data entry boxes, etc. Messages – system code indicating user action Message loop – Mechanism to pass execution between system  app – Uses messages to determine processing Multi-threading O/S

Fonts & Pixels Dots per inch (DPI) Device-independent pixel (DIPs) (1/96 of a logical inch) 1 pt = 1/72 inch (ALWAYS!!!) – 12pt font takes 12/72 inch in HEIGHT – Some characters need more or less space (e.g.; letters L and I) – A 72-point font is defined to be one logical inch tall = 96px – 1 logical inch=96 pixels – A 12pt font needs 12 points/(72 points per inch)=1/6 of an inch – 12 points = 1/6 logical inch = 96/6 = 16 pixels – BUT if display is set to 144 DPI, then 72pt font=144 px NOT 96 Because that inch now has to hold 144 pixels, not 72 or 96

MS naming conventions prefix data type by BYTE (unsigned char) b BOOL (int, TRUE=1 FALSE=0) c char dw DWORD (4-byte unsigned long) fn function h handle l long (4 bytes) n short (int) near pointer p pointer sz null-terminated char string w word (two bytes) lpsz long ptr to null-terminated str

Processing window messages Message codes for event triggering A "callback" mechanism (next slide) – O/S calls your function – Reverse of a "system call" Message processing loop in program – Tests for message types – Calls your handler functions Program is idle until an event

Callback Functions A thread-like mechanism: 1.Program issues a service call to O/S a.Tells O/S address of callback fn b.Tells O/S when to call it (msg filter) 2.Program loop waits for an "event" message 3.Program reads message from queue, tells O/S to signal the callback function, loops for more msgs, NO WAIT for msg processing 4.O/S starts callback fn to process the message 5.Callback returns to O/S

Model-View-Controller (MVC) Architecture 3 parts of an application: – Data, interface, operations MVC separates pgm data types from presentation Reduces complexities/dependencies Model – application data specs View – what the user sees (may also be controller) Controller - code to process the data – Accepts input – Rules for processing – Converts to pgm-usable data (codes, msgs, etc)

Win32API Architecture Core set of system interfaces – Kernel32.dll Mem mgmt., I/O, process, thread – User32.dll implements abstractions for Windows apps – HWND – MSG – Message loop – Build, obscure, size, move, dialogs, etc – GDI32.dll Drawing lines & curves Manage palettes Rendering fonts Predecessor of DirectX/OpenGL No "frames", no rasterization, SLOW

Win32 = Windows API Uses basic windows functions Usable with C/C++, Java Programmer must do almost everything Used with the Windows SDK (NOT MFC)

MICROSOFT FOUNDATION CLASSES

MFC architecture Based on Document/View concept – Separation of data from the user's view of data – Data is what user sees with "open a file" Operations – Design the window(s) - these are the "views" – Process the data based on user input – Switch/modify windows as needed to show results – E.g.; represent a collection of numbers as Table Graph

MS Foundation Classes (MFC) A C++ class library Builds on portions of the Win32API Pre-defined classes contain pre-written code: – Independent of user settings Create/Open/Close a window Open a dialog box – Adjustable (size, content, etc.) via the program

WINDOWS FORMS (WF)

Windows Forms (WF) Architecture Use C# or Visual Basic GUI part of.NET Framework Does not offer a paradigm comparable to Model– View–Controller paradigm of MFCModel– View–Controller Event driven Feature of.NET Framework Usage: – Design a form (e.g.; built-in wizard in MS Access, Visual Basic) – Specify parts of program that process each part – Function names to call are embedded in the form

WINDOWS PRESENTATION FOUNDATION

WPF Architecture Provides many h/w-related advances – Hardware acceleration (graphic adapter card) also called Graphics Processing Unit (GPU) – Enables modern UI features transparency, gradients and transforms Deployable on desktop or web browser Subset of.Net Framework types – Mostly in System.Windows – WPF provides additions for properties & routed events Uses markup & code-behind concepts – XAML – Managed languages (C#)

WPF (4.5 – Aug 2012 – might be the last version) 1 st release in 2005 Implements SOAP & non-MS web svc's tech's. DirectX vs. older GDI interface C#,.Net, XAML (based on XML) Standalone apps Embedded objects on a website RTL included in all Windows post-XP Unifies – Rendering, typography, vector graphics, animation, fixed, adaptive & pre-rendered docs, events, bindings Poor response-time, not for low-power devices

WPF vs. WinForms WPF – Does not rely on "standard" windows controls – A "window" is just a border around "content" – e.g.; Can make a button with image & text in it – BUT may take more work for "simple" things WF – ONLY uses standard "windows" Dialog/text boxes, etc. – Button w/image would require you to create your own button control type

WPF example – part 1 Click Me! x:Class associates – XAML def'n of window (above) – code-behind class (Awindow) on next slide This example (parts 1 & 2) is from:

WPF example –part 2 using System.Windows; // Window, RoutedEventArgs, MessageBox namespace SDKSample { public partial class AWindow : Window { public AWindow() { // Set properties and register event handlers InitializeComponent(); // Required to merge this class & XAML } void button_Click(object sender, RoutedEventArgs e) { // Show message box when button is clicked MessageBox.Show("Hello, from WPF app!"); }

.NET (3.0) stack.NET Apps.NET Tools CLR, Base Class Libraries, ASP.NET, ASO.NET, WinForms WPFCardSpace (InfoCard) Canceled! WF (Workflow) Windows

Deploying.NET Framework Apps Distinguish between the app and the Framework us/library/6hbb4k3e(v=vs.110).aspx us/library/6hbb4k3e(v=vs.110).aspx