The Basic Calculator Dialog Box Use Case

Use Case

Abstract

This article discusses the CAAIDDBasicCalc.m module of the CAACodeGenTools.edu framework. It shows how to create a dialog box design file using the Rich Application Presentation Designer - IDD, and how to build an interactive application needed to display and run it.

What You Will Learn With This Use Case

This integration example is intended to cover the tasks needed in order to design a basic calculator dialog box with the designer. These tasks are:

The CAAIDDBasicCalc Use Case

CAAIDDBasicCalc is a use case of the CAACodeGenTools.edu framework that illustrates the Rich Application Presentation Designer's capabilities.

What Does CAAIDDBasicCalc Do

This example shows how to create a basic calculator by using only labels and buttons, edit properties, simulate dialog box behavior and how to use the callbacks mechanism onto controls. The basic calculator allows to add or subtract an input value and displays result as a label.

Below is how the basic calculator dialog box looks like:

Basic Calculator

How to Launch CAAIDDBasicCalc

To launch CAAIDDBasicCalc, you will need to set up the build time environment, then compile CAAIDDBasicCalc along with its prerequisites, set up the run time environment, and then execute the use case [1] and [2].

Where to Find the CAAIDDBasicCalc Code

The CAAIDDBasicCalc use case is made of a several classes located in the CAAIDDBasicCalc.m module of the CAACodeGenTools.edu framework:

InstallRootFolder\CAADoc\CAACodeGenTools.edu\CAAIDDBasicCalc.m\

where InstallRootFolder [1] is the folder where the API CD-ROM is installed.

The CAAIDDBasicCalc.m module includes 4 files:

CAABasicCalcApplication.cpp  The interactive application (the one that launches the dialog) source file
CAAIDDBasicCalcDialog.DSGen  The Dassault Systemes code generation file

The designer will automatically generate the C++ files (header and implementation) associated to a designed dialog box which are:

CAAIDDBasicCalcDialog.h The dialog box header file
CAAIDDBasicCalcDialog.cpp The dialog box source file

Step-by-Step

Here are some videos that show you how to completely design a basic calculator, they include dialog box creation, simulation of design behavior, callbacks definition onto controls and illustrate how to build and run the basic calculator application.

  1. Creating and designing The Basic Calculator Dialog Box
  2. The Basic Calculator Dialog box code view
  3. The Basic Calculator Dialog box dialog simulation
  4. The Basic Calculator using resize widgets toggles
  5. The Basic Calculator adding a new callback
  6. The Basic Calculator working with callbacks
  7. The Basic Calculator dialog integration and execution

References

[1] Building and Launching a Use Case
[2] Starting Rich Application Presentation Designer

History

Version: 1 [May 2010] Document created by am2