📄 mmicalculator.h
字号:
#ifndef _MMI_CALC_WINDOW_H_
#define _MMI_CALC_WINDOW_H_
/*******************************************************************************
CONDAT (UK)
********************************************************************************
This software product is the property of Condat (UK) Ltd and may not be
disclosed to any third party without the express permission of the owner.
********************************************************************************
$Project name: Basic MMI
$Project code: BMI (6349)
$Module: Calculator
$File: MmCalculator.h
$Revision: 1.0
$Author: Condat(UK)
$Date: 25/10/00
********************************************************************************
Description:
This provides the main calculator functionality
********************************************************************************
$History: MmiCalculatorMain.h
25/10/00 Original Condat(UK) BMI version.
27/08/02 gdy add
$End
*******************************************************************************/
/*******************************************************************************
Include files
*******************************************************************************/
#include "MmiBookShared.h"
#include "MmiEditor.h"
#define MAXLEN 26
#define STEP_LEN 8
/*******************************************************************************
Data Types
*******************************************************************************/
typedef enum
{
CALCULATOR_INIT=0,
CALCULATOR_DISPLAY_RESULT,
CALCULATOR_ENTER_OPERAND,
// CALCULATOR_PLUS,
// CALCULATOR_MINUS,
// CALCULATOR_MULTIPLY,
// CALCULATOR_DIVIDE,
// CALCULATOR_DEFAULT,
CALC_EXIT
} CALCULATOR_events;
typedef struct Calc_Data
{
/* administrative data */
T_MMI_CONTROL mmi_control;
T_MFW_HND win;
T_MFW_HND parent_win;
T_EDITOR_DATA editor_data;
/* associated handlers */
T_MFW_HND kbd;
T_MFW_HND kbd_long;
/* internal data */
BOOL flag;//indicate if current operate number is the first or the second
int index;//indicate the position
BOOL pointflag;//indicate point appeared or not
int afterpoint;//count of number after point
char operate_number1[MAXLEN];//save the first operate number
char operate_number2[MAXLEN];//save the second operate number
char result[MAXLEN+MAXLEN];//save result
char SpecialResult[MAXLEN+MAXLEN];//displayed by E+ or E-
char opera[2];//save operator
BOOL continues;//true indicates contunues calculating
BOOL resultflag;//indicates if the previous operate is getting result
BOOL operaflag;//indicates if the previous operate is intputing operator
int sig;//indicates the result is positive or negative
int leftkey_indication;//
T_MFW_HND editor_win;
}CalcData;
/*******************************************************************************
Public Methods
*******************************************************************************/
int calculator_new(MfwMnu* m, MfwMnuItem* i);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -