Đang chuẩn bị liên kết để tải về tài liệu:
Lecture Programming principles and practice using C++: Chapter 16 - Bjarne Stroustrup
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Lecture Programming principles and practice using C++ - Chapter 16 introduce graphical user interfaces. In this chapter, you learned to: Perspective (I/O alternatives, GUI, layers of software), GUI example, GUI code (callbacks). Inviting you refer. | Chapter 16 Graphical User Interfaces Bjarne Stroustrup www.stroustrup.com/Programming Overview Perspective I/O alternatives GUI Layers of software GUI example GUI code callbacks Stroustrup/Programming I/O alternatives Use console input and output A strong contender for technical/professional work Command line interface Menu driven interface Graphic User Interface Use a GUI Library To match the “feel” of windows/Mac applications When you need drag and drop, WYSIWYG Event driven program design A web browser – this is a GUI library application HTML / a scripting language For remote access (and more) Stroustrup/Programming Common GUI tasks Titles / Text Names Prompts User instructions Fields / Dialog boxes Input Output Buttons Let the user initiate actions Let the user select among a set of alternatives e.g. yes/no, blue/green/red, etc. Stroustrup/Programming Common GUI tasks (cont.) Display results Shapes Text and numbers Make a window “look right” Style and color Note: our . | Chapter 16 Graphical User Interfaces Bjarne Stroustrup www.stroustrup.com/Programming Overview Perspective I/O alternatives GUI Layers of software GUI example GUI code callbacks Stroustrup/Programming I/O alternatives Use console input and output A strong contender for technical/professional work Command line interface Menu driven interface Graphic User Interface Use a GUI Library To match the “feel” of windows/Mac applications When you need drag and drop, WYSIWYG Event driven program design A web browser – this is a GUI library application HTML / a scripting language For remote access (and more) Stroustrup/Programming Common GUI tasks Titles / Text Names Prompts User instructions Fields / Dialog boxes Input Output Buttons Let the user initiate actions Let the user select among a set of alternatives e.g. yes/no, blue/green/red, etc. Stroustrup/Programming Common GUI tasks (cont.) Display results Shapes Text and numbers Make a window “look right” Style and color Note: our windows look different (and appropriate) on different systems More advanced Tracking the mouse Dragging and dropping Free-hand drawing Stroustrup/Programming GUI From a programming point of view GUI is based on two techniques Object-oriented programming For organizing program parts with common interfaces and common actions Events For connecting an event (like a mouse click) with a program action Stroustrup/Programming Layers of software When we build software, we usually build upon existing code Our program Our GUI/Graphics interface library FLTK The operating system Graphics GUI facilities Device driver layer Example of a layer Provides services Uses services Stroustrup/Programming GUI example Window with two Buttons, two In_boxes, and an Out_box Stroustrup/Programming GUI example Enter a point in the In_boxes Stroustrup/Programming GUI example When you hit Next point that point becomes the current (x,y) and is displayed in the Out_box Stroustrup/Programming GUI