Multi-function Scientific Calculator An Introduction to Graphical User Interfaces (GUI)
Group Members • Jaemar Miller (Foundation) • Kristie Powell (GUI) • Michael Adderley (Link to GUI)
Objective 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.
Characteristics • Pointers • Classes • Strings • Inheritance
Foundation Calculator.h has the prototype of the functions needed. Such as the add, subtract, multiply, divide and square functions.
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.
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.
Foundation The function calc here is check the choice of the user, whether to add, subtract, multiply and divide .
Foundation The main function of the driver was query the user of whether, they want to add, subtract, multiply or divide
Foundation In a test we subtracted 3 from 5 and displayed the answer which was 2
GUIcalc.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.
GUIcalc.cpp • This is the main application source file that contains the application class CCalcApp.
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.
GUI Resource.h • This is the standard header file, which defines new resource IDs. Microsoft Visual C++ reads and updates this file.
GUI Resource Files • 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.
GUI Resource Files • 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.
GUIResource Files • 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.
GUIResource Files • 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.
Link to GUI In order to change driver.cpp to a GUI calculator there must be a link.
Link to GUIObjectives • To create implementation files (CalcDlg.cpp and CalcClg.h) that contain the functions and definitions for each button on the calculator.
Link to GUI • This is the header file for calcdlg.h. This header file defines the class CCaldilg
Link to GUI • CalcDlg.cpp is the key code. It contains all of the definitions for the functions mentioned in the header file.
Improvements • Add more functions such as square root etc. • Utilize the math library and add sine and cosine buttons.
References • C++ Program Design 2nd Edition, James P. Cohoon/ Jack Davidson • http://www.cplusplus.com