multi-function scientific calculator an introduction to graphical user interfaces (gui)

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

Upload: noel-arnold

Post on 11-Jan-2016

224 views

Category:

Documents


1 download

TRANSCRIPT

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

Multi-function Scientific Multi-function Scientific CalculatorCalculator

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

Page 2: Multi-function Scientific Calculator An Introduction to Graphical 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)

Page 3: Multi-function Scientific Calculator An Introduction to Graphical User Interfaces (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.

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

CharacteristicsCharacteristics

PointersPointers ClassesClasses StringsStrings InheritanceInheritance

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

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

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

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.

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

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.

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

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.

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

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 .

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

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

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

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

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

GUIGUI

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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

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

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

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

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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

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

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