Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

CalculatorForm Class Reference

class implements a calculator. More...

#include <CalcForm.h>

Inheritance diagram for CalculatorForm:

Form Collaboration diagram for CalculatorForm:

Collaboration graph
[legend]
List of all members.

Public Methods

 CalculatorForm () FORM_SECTION1
 constructor, does nothing. More...


Static Public Methods

CalculatorForm * instance () FORM_SECTION1
 returns reference to SplitsForm instance. More...


Public Attributes

Int32 amount
 initial amount to be diplayed. More...

Int8 sign
 sign of the amount memorised. More...


Private Methods

void updateDisplay () FORM_SECTION1
 updates calculator display display. More...

Boolean handleUpdateEvent (UInt16 update_code) FORM_SECTION1
 redraws form and update display. More...

Boolean handleOpenEvent () FORM_SECTION1
 draws initial calculator. More...

Boolean handleCtlSelectEvent (UInt16 control_id) FORM_SECTION1
 handles all control interaction. More...

void handleButton (Char c) FORM_SECTION1
 update entry with information from a button. More...

void doMath (Char newop) FORM_SECTION1
 carry out operation. More...

void flipSign (void) FORM_SECTION1
 flip sign. More...


Private Attributes

Char entry [32]
 current calculator entry. More...

Char dotLabel [2]
 text for decimal separator. More...

FlpCompDouble accu
FlpCompDouble operand
Char operation
Boolean disp_accu

Static Private Attributes

CalculatorForm * _instance
 singleton reference to this form. More...


Detailed Description

class implements a calculator.

Copyright (C) 2001-2002 Vlad Mereuta <dizzy@users.sourceforge.net>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Definition at line 29 of file CalcForm.h.


Constructor & Destructor Documentation

CalculatorForm::CalculatorForm  
 

constructor, does nothing.


Member Function Documentation

void CalculatorForm::doMath Char    newop [private]
 

carry out operation.

void CalculatorForm::flipSign void    [private]
 

flip sign.

void CalculatorForm::handleButton Char    c [private]
 

update entry with information from a button.

Boolean CalculatorForm::handleCtlSelectEvent UInt16    control_id [private, virtual]
 

handles all control interaction.

Reimplemented from Form.

Boolean CalculatorForm::handleOpenEvent   [private, virtual]
 

draws initial calculator.

Reimplemented from Form.

Boolean CalculatorForm::handleUpdateEvent UInt16    update_code [private, virtual]
 

redraws form and update display.

Reimplemented from Form.

CalculatorForm* CalculatorForm::instance   [static]
 

returns reference to SplitsForm instance.

Only allowed way to use the class

void CalculatorForm::updateDisplay   [private]
 

updates calculator display display.


Member Data Documentation

CalculatorForm* CalculatorForm::_instance [static, private]
 

singleton reference to this form.

Definition at line 52 of file CalcForm.h.

FlpCompDouble CalculatorForm::accu [private]
 

Definition at line 47 of file CalcForm.h.

Int32 CalculatorForm::amount
 

initial amount to be diplayed.

Definition at line 33 of file CalcForm.h.

Boolean CalculatorForm::disp_accu [private]
 

Definition at line 50 of file CalcForm.h.

Char CalculatorForm::dotLabel[2] [private]
 

text for decimal separator.

Definition at line 46 of file CalcForm.h.

Char CalculatorForm::entry[32] [private]
 

current calculator entry.

Definition at line 44 of file CalcForm.h.

FlpCompDouble CalculatorForm::operand [private]
 

Definition at line 48 of file CalcForm.h.

Char CalculatorForm::operation [private]
 

Definition at line 49 of file CalcForm.h.

Int8 CalculatorForm::sign
 

sign of the amount memorised.

Definition at line 35 of file CalcForm.h.


The documentation for this class was generated from the following file:
Generated on Thu Jan 16 23:11:14 2003 for FreeCoins by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002