亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? scicomm.c

?? 計算器源代碼c。和windows自帶的功能差不多。很多科學計算還沒有加入。
?? C
?? 第 1 頁 / 共 2 頁
字號:
/****************************Module*Header***********************************\
* Module Name: SCICOMM.C
*
* Module Descripton:
*
* Warnings:
*
* Created:
*
* Author:
\****************************************************************************/

#include "scicalc.h"
#include "calchelp.h"
#include "unifunc.h"
#include "input.h"

extern HWND        hStatBox;
extern HNUMOBJ     ghnoNum, ghnoLastNum, ghnoMem;
extern HNUMOBJ     ghnoParNum[25], ghnoPrecNum[25];

extern eNUMOBJ_FMT nFE;
extern INT         nTempCom, nParNum, nPrecNum, gcIntDigits,
                   nOpCode, nOp[25], nPrecOp[25];
extern BOOL        bError;
extern TCHAR       szBlank[6];
extern TCHAR      *rgpsz[CSTRINGS];


int             nLastCom;   // Last command entered.
CALCINPUTOBJ    gcio;       // Global calc input object for decimal strings
BOOL            gbRecord;   // Global mode: recording or displaying


/* Puts up the wait cursor if the calc will take a long time */
HCURSOR ghcurOld = NULL;

BOOL SetWaitCursor( BOOL fOn ) {
    if (fOn && ghcurOld == NULL) {
        ghcurOld = SetCursor( LoadCursor(NULL, IDC_WAIT) );
    } else if (!fOn && ghcurOld != NULL) {
        SetCursor( ghcurOld );
        ghcurOld = NULL;
    }

    return (fOn && ghcurOld != NULL);
}

/* Process all keyclicks whether by mouse or accelerator.                 */
VOID NEAR RealProcessCommands(WPARAM wParam);

VOID NEAR ProcessCommands(WPARAM wParam)
{
    if (wParam != IDM_ABOUT)
    {
        TimeCalc(TRUE);
    }

    try
    {
        RealProcessCommands( wParam );
    }
    catch( ... )
    {
        // note:  it should be impossible for a throw to reach this level, this is put here as an
        // emergency backup only.  Throws are normally caught at the boundry between calc and ratpak.
        ASSERT( 0 );
        MessageBox( g_hwndDlg, TEXT("An unknown error has occured."), TEXT("Error"), MB_OK );
    }

    if (wParam != IDM_ABOUT)
    {
        TimeCalc(FALSE);
    }
}

VOID NEAR RealProcessCommands(WPARAM wParam)
{
    static BOOL    bNoPrevEqu=TRUE, /* Flag for previous equals.          */
                   bChangeOp=FALSE; /* Flag for changing operation.       */
    INT            nx, ni;
    TCHAR          szJunk[50], szTemp[50];
    static BYTE    rgbPrec[24]={      0,0,  IDC_OR,0, IDC_XOR,0,  IDC_AND,1, 
                                IDC_ADD,2, IDC_SUB,2,    RSHF,3, IDC_LSHF,3,
                                IDC_MOD,3, IDC_DIV,3, IDC_MUL,3,  IDC_PWR,4};

    // Make sure we're only getting commands we understand.

    ASSERT( xwParam(IDC_FIRSTCONTROL, IDC_LASTCONTROL) || // Is it a button?
            xwParam(IDM_FIRSTMENU,    IDM_LASTMENU) );    // or a menu command?

    // Save the last command.  Some commands are not saved in this manor, these
    // commands are:
    // Inv, Hyp, Deg, Rad, Grad, Stat, FE, MClear, Back, and Exp.  The excluded
    // commands are not
    // really mathematical operations, rather they are GUI mode settings.

    if ( !xwParam(IDC_INV, IDC_HYP)    && !xwParam(IDM_HEX, IDM_BIN)  &&
         !xwParam(IDM_QWORD, IDM_BYTE) && !xwParam(IDM_DEG, IDM_GRAD) &&
         wParam!=IDC_STAT && wParam!=IDC_FE &&
         wParam!=IDC_MCLEAR && wParam!=IDC_BACK && wParam!=IDC_EXP)
    {
        nLastCom=nTempCom;
        nTempCom=(INT)wParam;
    }

    // If error and not a clear key or help key, BEEP.

    if (bError && (wParam !=IDC_CLEAR) && (wParam !=IDC_CENTR) &&
        (wParam != IDM_HELPTOPICS))
    {
        MessageBeep(0);
        return;
    }

    // Toggle Record/Display mode if appropriate.

    if (gbRecord)
    {
        if (xwParam(IDC_AND, IDC_MPLUS)        ||
            xwParam(IDC_AVE, IDC_CLOSEP)       ||
            xwParam(IDC_INV, IDC_HYP)          ||
            xwParam(IDM_HEX, IDM_BIN)          ||
            xwParam(IDM_QWORD, IDM_BYTE)       ||
            xwParam(IDM_DEG, IDM_GRAD)         ||
            wParam == IDM_PASTE)
        {
            gbRecord = FALSE;
            SetWaitCursor(TRUE);
            CIO_vConvertToNumObj(&ghnoNum, &gcio);
            DisplayNum();   // Causes 3.000 to shrink to 3. on first op.
            SetWaitCursor(FALSE);
        }
    }
    else
    {
        if ( xwParam(IDC_0, IDC_F) || wParam == IDC_PNT)
        {
            gbRecord = TRUE;
            CIO_vClear(&gcio);
        }
    }

    // Interpret digit keys.

    if (xwParam(IDC_0, IDC_F))
    {
        int iValue = (int)(wParam-IDC_0);

        // this is redundant, illegal keys are disabled
        if (iValue >= nRadix)
        {
            //ASSERT( 0 );
            MessageBeep(0);
            return;
        }


        if (!CIO_bAddDigit(&gcio, iValue))
        {
            MessageBeep(0);
            return;
        }

        DisplayNum();
        return;
    }


    // STATISTICAL FUNCTIONS:
    if (xwParam(IDC_AVE,IDC_DATA))
    {
        /* Do statistics functions on data in fpStatNum array.        */
        if (hStatBox)
        {
            DisplayNum();       // Make sure gpszNum has the correct string
            try
            {
                StatFunctions (wParam);
            }
            catch ( ... )
            {
                ASSERT( 0 );    // the only thing stat box should be able to throw is out of memory
                        // which in previous versions of calc caused a program crash
            }
            if (!bError)
                DisplayNum ();
        }
        else
            /* Beep if the stat box is not active.                    */
            MessageBeep(0);

        /* Reset the inverse flag since some functions use it.        */
        SetBox (IDC_INV, bInv=FALSE);
        return;
    }


    // BINARY OPERATORS:
    if (xwParam(IDC_AND,IDC_PWR))
    {
        if (bInv && wParam==IDC_LSHF)
        {
            SetBox (IDC_INV, bInv=FALSE);
            wParam=RSHF;
        }

        /* Change the operation if last input was operation.          */
        if (nLastCom >=IDC_AND && nLastCom <=IDC_PWR)
        {
            nOpCode=(INT)wParam;
            return;
        }

        /* bChangeOp is true if there was an operation done and the   */
        /* current ghnoNum is the result of that operation.  This is so */
        /* entering 3+4+5= gives 7 after the first + and 12 after the */
        /* the =.  The rest of this stuff attempts to do precedence in*/
        /* Scientific mode.                                           */
        if (bChangeOp)
        {
        DoPrecedenceCheckAgain:

            nx=0;
            while (wParam!=rgbPrec[nx*2] && nx <12)
                nx++;

            ni=0;
            while (nOpCode!=rgbPrec[ni*2] && ni <12)
                ni++;

            if (nx==12) nx=0;
            if (ni==12) ni=0;

            if (rgbPrec[nx*2+1] > rgbPrec[ni*2+1] && nCalc==0)
            {
                if (nPrecNum <25)
                {
                    NumObjAssign( &ghnoPrecNum[nPrecNum], ghnoLastNum );
                    nPrecOp[nPrecNum]=nOpCode;
                }
                else
                {
                    nPrecNum=24;
                    MessageBeep(0);
                }
                nPrecNum++;
            }
            else
            {
                /* do the last operation and then if the precedence array is not
                 * empty or the top is not the '(' demarcator then pop the top
                 * of the array and recheck precedence against the new operator
                 */

                SetWaitCursor(TRUE);

                DoOperation(nOpCode, &ghnoNum, ghnoLastNum);

                SetWaitCursor(FALSE);

                if ((nPrecNum !=0) && (nPrecOp[nPrecNum-1]))
                {
                    nPrecNum--;
                    nOpCode=nPrecOp[nPrecNum] ;
                    if (NumObjOK( ghnoPrecNum[nPrecNum] ))
                        NumObjAssign(&ghnoLastNum , ghnoPrecNum[nPrecNum]);
                    else
                        NumObjAssign(&ghnoLastNum, HNO_ZERO);

                    goto DoPrecedenceCheckAgain ;
                }

                if (!bError)
                    DisplayNum ();
            }
        }

        NumObjAssign(&ghnoLastNum, ghnoNum);
        NumObjAssign(&ghnoNum, HNO_ZERO);
        nOpCode=(INT)wParam;
        bNoPrevEqu=bChangeOp=TRUE;
        return;
    }

    // UNARY OPERATORS:
    if (xwParam(IDC_CHOP,IDC_PERCENT))
    {
        /* Functions are unary operations.                            */

        /* If the last thing done was an operator, ghnoNum was cleared. */
        /* In that case we better use the number before the operator  */
        /* was entered, otherwise, things like 5+ 1/x give Divide By  */
        /* zero.  This way 5+=gives 10 like most calculators do.      */
        if (nLastCom >= IDC_AND && nLastCom <= IDC_PWR)
            NumObjAssign( &ghnoNum, ghnoLastNum );

        SetWaitCursor(TRUE);
        SciCalcFunctions ( &ghnoNum, (DWORD)wParam);
        SetWaitCursor(FALSE);

        if (bError)
            return;

        /* Display the result, reset flags, and reset indicators.     */
        DisplayNum ();

        /* reset the bInv and bHyp flags and indicators if they are set
            and have been used */

        if (bInv &&
            (wParam == IDC_CHOP || wParam == IDC_SIN || wParam == IDC_COS ||
             wParam == IDC_TAN  || wParam == IDC_SQR || wParam == IDC_CUB ||
             wParam == IDC_LOG  || wParam == IDC_LN  || wParam == IDC_DMS))
        {
            bInv=FALSE;
            SetBox (IDC_INV, FALSE);
        }

        if (bHyp &&
            (wParam == IDC_SIN || wParam == IDC_COS || wParam == IDC_TAN))
        {
            bHyp = FALSE;
            SetBox (IDC_HYP, FALSE);
        }
        bNoPrevEqu=TRUE;
        return;
    }

    // BASE CHANGES:
    if (xwParam(IDM_HEX, IDM_BIN))
    {
        // Change radix and update display.
        if (nCalc==1)
        {
            wParam=IDM_DEC;
        }

        SetRadix((DWORD)wParam);
        return;
    }

    SetWaitCursor(TRUE);

    /* Now branch off to do other commands and functions.                 */
    switch(wParam)
    {
        case IDM_COPY:
        case IDM_PASTE:
        case IDM_ABOUT:
        case IDM_SC:
        case IDM_SSC:
        case IDM_USE_SEPARATOR:
        case IDM_HELPTOPICS:
            // Jump to menu command handler in scimenu.c.
            MenuFunctions((DWORD)wParam);
            DisplayNum();
            break;

        case IDC_CLEAR: /* Total clear.                                       */
            NumObjAssign( &ghnoLastNum, HNO_ZERO );

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久精品免费| 亚洲自拍与偷拍| 成人小视频在线| 国产精品美日韩| 91视频在线观看| 五月综合激情网| 欧美tickle裸体挠脚心vk| 国产一区二区福利视频| 中文一区二区在线观看| 91福利在线观看| 蜜桃一区二区三区在线观看| 国产亚洲成年网址在线观看| 一本色道久久加勒比精品| 日韩精品一卡二卡三卡四卡无卡| 日韩欧美国产综合在线一区二区三区| 久久精品国产精品亚洲综合| 国产精品久久久久久一区二区三区| 波多野结衣亚洲| 日韩av电影免费观看高清完整版| 精品国产制服丝袜高跟| av在线不卡免费看| 奇米色777欧美一区二区| 国产精品久久久久7777按摩 | 久久国产欧美日韩精品| 国产精品乱码人人做人人爱| 精品视频在线免费看| 国内外精品视频| 亚洲综合久久久久| 久久久国产午夜精品| 欧美综合久久久| 国产精品77777竹菊影视小说| 一区二区不卡在线播放| 久久午夜羞羞影院免费观看| 色94色欧美sute亚洲线路一ni| 美腿丝袜一区二区三区| 亚洲一区影音先锋| 国产欧美精品一区二区色综合朱莉| 在线观看亚洲a| 国产激情偷乱视频一区二区三区 | 亚洲成人av在线电影| 国产日韩成人精品| 88在线观看91蜜桃国自产| av在线播放一区二区三区| 久久超级碰视频| 亚洲高清一区二区三区| 亚洲色图视频免费播放| 国产亚洲午夜高清国产拍精品| 欧美系列在线观看| 99re这里只有精品6| 国产激情偷乱视频一区二区三区| 琪琪一区二区三区| 亚洲午夜久久久久久久久电影网 | 一卡二卡三卡日韩欧美| 中文字幕一区二区三区在线观看| 欧美电影精品一区二区| 欧美精品三级日韩久久| 色综合婷婷久久| 99久久国产综合精品色伊| 国产麻豆精品久久一二三| 蜜臀av在线播放一区二区三区| 日日摸夜夜添夜夜添亚洲女人| 一区二区三区91| 亚洲色图.com| 欧美日韩在线三级| 亚洲激情av在线| 中文字幕av一区二区三区高| 亚洲蜜桃精久久久久久久| 日韩亚洲欧美在线观看| 欧美日韩国产高清一区二区| 91成人免费在线视频| 色拍拍在线精品视频8848| av一二三不卡影片| 成年人网站91| eeuss鲁片一区二区三区在线观看| 懂色一区二区三区免费观看| 国产成人激情av| 粉嫩aⅴ一区二区三区四区| 懂色av中文一区二区三区| 高清久久久久久| www.亚洲免费av| 99精品欧美一区二区蜜桃免费| 99久久精品99国产精品| 色综合视频在线观看| 色婷婷av一区| 欧美日产国产精品| 日韩一区二区麻豆国产| 日韩精品一区二区三区在线播放| 精品久久人人做人人爽| 欧美激情综合网| 一区二区三区欧美亚洲| 亚洲不卡一区二区三区| 日本女优在线视频一区二区| 狠狠色丁香久久婷婷综合_中 | 亚洲人123区| 亚洲综合另类小说| 麻豆国产一区二区| 成人黄色片在线观看| 欧美视频中文字幕| 日韩久久精品一区| 国产精品对白交换视频| 亚洲综合男人的天堂| 麻豆91免费观看| 91亚洲精华国产精华精华液| 欧美日韩精品一区二区三区蜜桃 | 亚洲自拍与偷拍| 免费在线成人网| jlzzjlzz欧美大全| 欧美精品久久天天躁| 久久精品一区蜜桃臀影院| 亚洲美女屁股眼交3| 久久99国内精品| 97久久精品人人做人人爽| 欧美一二三区精品| 国产精品不卡一区二区三区| 日本不卡高清视频| 91亚洲男人天堂| 日韩欧美的一区二区| 亚洲视频每日更新| 美洲天堂一区二卡三卡四卡视频| 成人av免费网站| 日韩视频一区二区在线观看| 国产精品的网站| 国内欧美视频一区二区| 欧美在线你懂的| 国产精品高潮呻吟久久| 久久成人免费日本黄色| 欧洲国内综合视频| 日本一区二区三区久久久久久久久不| 亚洲一区二区偷拍精品| 成人黄色一级视频| 欧美精品一区二区蜜臀亚洲| 成人免费视频播放| 欧美丰满嫩嫩电影| 亚洲精品一二三区| 成人免费毛片片v| 精品国产一区二区三区不卡| 亚洲综合一区二区三区| a4yy欧美一区二区三区| 久久久精品免费网站| 日韩国产欧美一区二区三区| 色哟哟一区二区三区| 亚洲欧洲三级电影| 国产精品一区一区三区| 日韩欧美国产三级| 日韩精彩视频在线观看| 欧美性受xxxx黑人xyx性爽| 国产精品美女一区二区三区 | 亚洲夂夂婷婷色拍ww47| 国产成人精品1024| 精品国产一区二区精华| 人人超碰91尤物精品国产| 欧美日韩国产大片| 夜夜精品浪潮av一区二区三区| jlzzjlzz亚洲女人18| 亚洲国产精品激情在线观看 | 麻豆精品国产传媒mv男同| 欧美剧情片在线观看| 亚洲成人7777| 欧美日韩日日摸| 视频一区二区不卡| 欧美高清性hdvideosex| 五月激情综合色| 欧美肥胖老妇做爰| 日本成人中文字幕| 日韩欧美国产系列| 寂寞少妇一区二区三区| 久久一夜天堂av一区二区三区| 久久av资源网| 久久久精品国产免费观看同学| 国产精品影视天天线| 国产精品视频yy9299一区| fc2成人免费人成在线观看播放| 国产精品人妖ts系列视频| 9人人澡人人爽人人精品| 亚洲少妇屁股交4| 欧美日韩你懂得| 日本vs亚洲vs韩国一区三区| 精品国产一区二区三区av性色| 国产一区在线看| 国产精品乱码一区二区三区软件 | 91成人网在线| 天堂一区二区在线| 日韩欧美中文字幕一区| 激情六月婷婷久久| 国产精品欧美经典| 欧美性受极品xxxx喷水| 开心九九激情九九欧美日韩精美视频电影| 欧美成人福利视频| 成人黄色电影在线| 亚洲大片在线观看| 欧美不卡在线视频| 99re免费视频精品全部| 亚洲v中文字幕| 久久蜜桃香蕉精品一区二区三区| 国产成人综合视频| 亚洲一二三四在线观看| 日韩女同互慰一区二区| av资源站一区| 日本成人在线网站| 成人免费小视频|