Presentation is loading. Please wait.

Presentation is loading. Please wait.

Multi-function Scientific Calculator An Introduction to Graphical User Interfaces (GUI)

Similar presentations


Presentation on theme: "Multi-function Scientific Calculator An Introduction to Graphical User Interfaces (GUI)"— Presentation transcript:

1 Multi-function Scientific Calculator An Introduction to Graphical User Interfaces (GUI)

2 Group Members Jaemar Miller (Foundation) Jaemar Miller (Foundation) Kristie Powell (GUI) Kristie Powell (GUI) Michael Adderley (Link to GUI) Michael Adderley (Link to GUI)

3 Objective To grasps the concepts of Graphical User Interfaces (GUI) To grasps the concepts of Graphical User Interfaces (GUI) To present those concepts so this presentation can be used in future Software Hardware Integration classes. To present those concepts so this presentation can be used in future Software Hardware Integration classes.

4 Characteristics Pointers Pointers Classes Classes Strings Strings Inheritance Inheritance

5 Hierarchy Chart Link to GUI CalcDlg.cpp, CalcDlg.h GUI Calc.h, Calc.cpp, resource.h, stdafx.cpp, stdafx.h Foundation Calculator.cpp, calculator.h, driver.h

6 Foundation Calculator.h has the prototype of the functions needed. Such as the add, subtract, multiply, divide and square functions.

7 Foundation Calculator.cpp has the definitions of the functions of the scientific calculator. The functions are also constant as they do not change the values sent to them but return a calculated value.

8 Foundation The Driver.cpp file was not needed for the GUI, but was designed to show an example of a simple calculator if we did not create a GUI for the project. The program uses function to do the arithmetic calculations.

9 Foundation The function calc here is check the choice of the user, whether to add, subtract, multiply and divide.

10 Foundation The main function of the driver was query the user of whether, they want to add, subtract, multiply or divide

11 Foundation In a test we subtracted 3 from 5 and displayed the answer which was 2

12 GUI

13 GUI calc.h This is the main header file for the application. It includes other project specific headers (including Resource.h) and declares the CCalcApp application class. This is the main header file for the application. It includes other project specific headers (including Resource.h) and declares the CCalcApp application class.

14 GUI calc.cpp This is the main application source file that contains the application class CCalcApp. This is the main application source file that contains the application class CCalcApp.

15 GUI Stdafx.cpp, Stdafx.h These files are used to build a precompiled header (PCH) file named Calc.pch and a precompiled types file named StdAfx.obj. These files are used to build a precompiled header (PCH) file named Calc.pch and a precompiled types file named StdAfx.obj.

16 GUI Resource.h This is the standard header file, which defines new resource IDs. Microsoft Visual C++ reads and updates this file. This is the standard header file, which defines new resource IDs. Microsoft Visual C++ reads and updates this file.

17 GUI Resource Files Calc.ico Calc.ico This is an icon file, which is used as the application's icon. This icon is included by the main resource file Calc.rc. This is an icon file, which is used as the application's icon. This icon is included by the main resource file Calc.rc.

18 GUI Resource Files Calc.rc Calc.rc This is a listing of all of the Microsoft Windows resources that the program uses. It includes the icons, bitmaps, and cursors that are stored in the RES subdirectory. This file can be directly edited in Microsoft Visual C++. Your project resources are in 1033. This is a listing of all of the Microsoft Windows resources that the program uses. It includes the icons, bitmaps, and cursors that are stored in the RES subdirectory. This file can be directly edited in Microsoft Visual C++. Your project resources are in 1033.

19 GUI Resource Files Calc.rc2 Calc.rc2 This file contains resources that are not edited by Microsoft Visual C++. You should place all resources not editable by the resource editor in this file. This file contains resources that are not edited by Microsoft Visual C++. You should place all resources not editable by the resource editor in this file.

20 GUI Resource Files Calc.manifest Calc.manifest Application manifest files are used by Windows XP to describe an applications dependency on specific versions of Side-by-Side assemblies. The loader uses this information to load the appropriate assembly from the assembly cache or private from the application. The Application manifest maybe included for redistribution as an external.manifest file that is installed in the same folder as the application executable or it may be included in the executable in the form of a resource. Application manifest files are used by Windows XP to describe an applications dependency on specific versions of Side-by-Side assemblies. The loader uses this information to load the appropriate assembly from the assembly cache or private from the application. The Application manifest maybe included for redistribution as an external.manifest file that is installed in the same folder as the application executable or it may be included in the executable in the form of a resource.

21 Link to GUI In order to change driver.cpp to a GUI calculator there must be a link.

22 Link to GUI Objectives To create implementation files (CalcDlg.cpp and CalcClg.h) that contain the functions and definitions for each button on the calculator. To create implementation files (CalcDlg.cpp and CalcClg.h) that contain the functions and definitions for each button on the calculator.

23 Link to GUI This is the header file for calcdlg.h. This header file defines the class CCaldilg This is the header file for calcdlg.h. This header file defines the class CCaldilg

24 Link to GUI Calcdlg.h (cont)

25 Link to GUI CalcDlg.cpp is the key code. It contains all of the definitions for the functions mentioned in the header file. CalcDlg.cpp is the key code. It contains all of the definitions for the functions mentioned in the header file.

26 Link to GUI calcdlg.cpp (cont)

27

28

29

30

31

32

33

34

35

36

37 Improvements Add more functions such as square root etc. Add more functions such as square root etc. Utilize the math library and add sine and cosine buttons. Utilize the math library and add sine and cosine buttons.

38 References C++ Program Design 2 nd Edition, James P. Cohoon/ Jack Davidson C++ Program Design 2 nd Edition, James P. Cohoon/ Jack Davidson http://www.cplusplus.com http://www.cplusplus.com


Download ppt "Multi-function Scientific Calculator An Introduction to Graphical User Interfaces (GUI)"

Similar presentations


Ads by Google