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

Preview:

Citation preview

Multi-function Scientific Multi-function Scientific CalculatorCalculator

An Introduction to Graphical An Introduction to Graphical User Interfaces (GUI)User Interfaces (GUI)

Group MembersGroup Members

Jaemar Miller (Foundation)Jaemar Miller (Foundation) Kristie Powell (GUI)Kristie Powell (GUI)

Michael Adderley (Link to GUI)Michael Adderley (Link to GUI)

ObjectiveObjective

To grasps the concepts of Graphical To grasps the concepts of Graphical User Interfaces (GUI)User Interfaces (GUI)

To present those concepts so this To present those concepts so this presentation can be used in future presentation can be used in future

Software Hardware Integration classes.Software Hardware Integration classes.

CharacteristicsCharacteristics

PointersPointers ClassesClasses StringsStrings InheritanceInheritance

Hierarchy ChartHierarchy Chart

Link to GUICalcDlg.cpp, CalcDlg.h

GUICalc.h, Calc.cpp, resource.h, stdafx.cpp, stdafx.h

FoundationCalculator.cpp, calculator.h, driver.h

FoundationFoundation

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

FoundationFoundation

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

FoundationFoundation

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

FoundationFoundation

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

FoundationFoundation

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

dividedivide

FoundationFoundation

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

GUIGUI

GUIGUIcalc.hcalc.h

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

GUIGUIcalc.cppcalc.cpp

This is the main application source This is the main application source file that contains the application file that contains the application class CCalcApp.class CCalcApp.

GUIGUI Stdafx.cpp, Stdafx.h Stdafx.cpp, Stdafx.h

These files are used to build a These files are used to build a precompiled header (PCH) file named precompiled header (PCH) file named Calc.pch and a precompiled types file Calc.pch and a precompiled types file named StdAfx.obj.named StdAfx.obj.

GUIGUI Resource.h Resource.h

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

GUIGUI Resource Files Resource Files

Calc.ico Calc.ico This is an icon file, which is used as the This is an icon file, which is used as the

application's icon. This icon is included application's icon. This icon is included by the main resource file Calc.rc.by the main resource file Calc.rc.

GUIGUI Resource Files Resource Files

Calc.rc Calc.rc This is a listing of all of the Microsoft This is a listing of all of the Microsoft

Windows resources that the program Windows resources that the program uses. It includes the icons, bitmaps, and uses. It includes the icons, bitmaps, and cursors that are stored in the RES cursors that are stored in the RES subdirectory. This file can be directly subdirectory. This file can be directly edited in Microsoft Visual C++. Your edited in Microsoft Visual C++. Your project resources are in 1033.project resources are in 1033.

GUIGUIResource FilesResource Files

Calc.rc2 Calc.rc2 This file contains resources that are not This file contains resources that are not

edited by Microsoft Visual C++. You edited by Microsoft Visual C++. You should place all resources not editable should place all resources not editable by the resource editor in this file.by the resource editor in this file.

GUIGUIResource FilesResource Files

Calc.manifest Calc.manifest Application manifest files are used by Windows Application manifest files are used by Windows

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

Link to GUILink to GUI

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

Link to GUILink to GUIObjectivesObjectives

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

Link to GUILink to GUI This is the This is the

header file for header file for calcdlg.h. calcdlg.h. This header This header file defines file defines the class the class CCaldilgCCaldilg

Link to GUILink to GUICalcdlg.h (cont)Calcdlg.h (cont)

Link to GUILink to GUI CalcDlg.cpp is CalcDlg.cpp is

the key code. the key code. It contains all It contains all of the of the definitions for definitions for the functions the functions mentioned in mentioned in the header file.the header file.

Link to GUILink to GUIcalcdlg.cpp (cont)calcdlg.cpp (cont)

Link to GUILink to GUIcalcdlg.cpp (cont)calcdlg.cpp (cont)

Link to GUILink to GUIcalcdlg.cpp (cont)calcdlg.cpp (cont)

Link to GUILink to GUIcalcdlg.cpp (cont)calcdlg.cpp (cont)

Link to GUILink to GUIcalcdlg.cpp (cont)calcdlg.cpp (cont)

Link to GUILink to GUIcalcdlg.cpp (cont)calcdlg.cpp (cont)

Link to GUILink to GUIcalcdlg.cpp (cont)calcdlg.cpp (cont)

Link to GUILink to GUIcalcdlg.cpp (cont)calcdlg.cpp (cont)

Link to GUILink to GUIcalcdlg.cpp (cont)calcdlg.cpp (cont)

Link to GUILink to GUIcalcdlg.cpp (cont)calcdlg.cpp (cont)

Link to GUILink to GUIcalcdlg.cpp (cont)calcdlg.cpp (cont)

ImprovementsImprovements

Add more functions such as square Add more functions such as square root etc.root etc.

Utilize the math library and add sine Utilize the math library and add sine and cosine buttons. and cosine buttons.

ReferencesReferences

C++ Program Design 2C++ Program Design 2ndnd Edition, Edition, James P. Cohoon/ Jack DavidsonJames P. Cohoon/ Jack Davidson

http://www.cplusplus.comhttp://www.cplusplus.com

Recommended