亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
一区二区三国产精华液| 国产精品原创巨作av| 美女视频黄 久久| 不卡区在线中文字幕| 欧美一区二区黄| 一二三区精品视频| 国产一区二区三区av电影| 欧美影院午夜播放| 国产清纯白嫩初高生在线观看91 | 国产精品视频你懂的| 丝袜亚洲另类欧美综合| 91视频.com| 国产精品久线观看视频| 麻豆精品视频在线观看| 欧美精品久久99久久在免费线 | 成人免费观看av| 精品国产精品网麻豆系列| 亚洲韩国精品一区| 91精品1区2区| 国产精品婷婷午夜在线观看| 久久激情综合网| 日韩欧美国产wwwww| 五月婷婷另类国产| 欧美日韩亚洲综合在线| 一区二区三区 在线观看视频 | 高清av一区二区| 欧美精品一区二区久久久| 久88久久88久久久| 欧美日韩精品一区二区天天拍小说 | 国产精品嫩草影院av蜜臀| 国产在线国偷精品免费看| 精品国产91乱码一区二区三区| 午夜精品爽啪视频| 欧美日韩国产一级二级| 亚洲成在线观看| 9191久久久久久久久久久| 日日夜夜免费精品视频| 欧美一级午夜免费电影| 美女性感视频久久| 欧美大度的电影原声| 精品亚洲porn| 2023国产一二三区日本精品2022| 精品亚洲porn| 国产精品欧美一区二区三区| 91啪亚洲精品| 亚洲电影中文字幕在线观看| 欧美一区二区三区影视| 久久er精品视频| 久久精品欧美一区二区三区麻豆| 国产成人av一区| 亚洲欧美成人一区二区三区| 欧美三级中文字| 裸体健美xxxx欧美裸体表演| 国产日韩欧美高清| 色综合天天在线| 日韩精品一级中文字幕精品视频免费观看 | 亚洲精品一区二区三区香蕉| 国产成人丝袜美腿| 亚洲麻豆国产自偷在线| 欧美一区二区三区性视频| 国产一区二区三区在线看麻豆| 国产精品久久久久一区二区三区| 日本韩国欧美一区二区三区| 日本在线观看不卡视频| 久久精品一区八戒影视| 色婷婷亚洲精品| 麻豆91在线看| 亚洲精品美腿丝袜| 欧美大片顶级少妇| 99久久国产综合精品色伊| 爽好多水快深点欧美视频| 久久久不卡影院| 欧美另类z0zxhd电影| 粉嫩一区二区三区在线看| 日韩精品久久理论片| 一区在线观看免费| 亚洲精品一区二区三区四区高清| 日本久久一区二区| 国产乱淫av一区二区三区| 亚洲第一会所有码转帖| 国产精品久久久久久久久动漫| 欧美一区二区三区色| 色综合亚洲欧洲| 国产成人高清在线| 激情六月婷婷久久| 亚洲国产成人tv| 亚洲人吸女人奶水| 精品少妇一区二区三区| 欧美日韩在线播放三区| 本田岬高潮一区二区三区| 久久99久久久欧美国产| 婷婷开心久久网| 亚洲一区二区三区四区中文字幕| 久久精品视频一区二区| 精品日韩99亚洲| 欧美久久一二区| 欧美曰成人黄网| 91蝌蚪porny九色| 国产成人精品亚洲午夜麻豆| 蜜臂av日日欢夜夜爽一区| 亚洲成人一区在线| 亚洲另类中文字| 18涩涩午夜精品.www| 国产精品三级在线观看| 国产欧美一区视频| 久久精品免费在线观看| 久久一夜天堂av一区二区三区| 91精品国产色综合久久不卡电影| 欧美色欧美亚洲另类二区| 一本色道亚洲精品aⅴ| www.日本不卡| 99热这里都是精品| 波多野结衣精品在线| 成人免费高清在线观看| 成人午夜电影网站| 成人精品视频一区二区三区尤物| 国产综合久久久久久鬼色| 精品亚洲欧美一区| 国产一区二区三区在线看麻豆| 国产一区二区视频在线| 国产盗摄视频一区二区三区| 国产精品亚洲第一区在线暖暖韩国| 九色|91porny| 成人久久18免费网站麻豆| 99精品热视频| 欧美午夜免费电影| 欧美一级夜夜爽| 久久久久久免费网| 国产精品美女久久久久aⅴ| 国产精品毛片高清在线完整版| 综合精品久久久| 亚洲黄一区二区三区| 丝袜美腿亚洲综合| 日本视频一区二区| 国产一区视频导航| 国产91丝袜在线播放0| 91啪亚洲精品| 欧美精品丝袜久久久中文字幕| 日韩女同互慰一区二区| 中文字幕成人在线观看| 亚洲成在线观看| 国产精品中文有码| 色婷婷综合激情| 欧美成人猛片aaaaaaa| 国产精品视频你懂的| 亚洲国产精品久久人人爱蜜臀| 久久成人免费电影| 99久久国产综合色|国产精品| 欧美自拍偷拍一区| 精品久久国产老人久久综合| 国产免费久久精品| 午夜欧美在线一二页| 国产一区二区精品在线观看| 91蜜桃免费观看视频| 欧美大片拔萝卜| 亚洲综合激情小说| 国产乱一区二区| 欧美乱妇一区二区三区不卡视频| 久久网站热最新地址| 亚洲高清免费观看| 丁香婷婷深情五月亚洲| 6080亚洲精品一区二区| 国产精品天天看| 久久99日本精品| 欧美图区在线视频| 欧美高清在线视频| 奇米精品一区二区三区在线观看| 不卡的av电影| 精品粉嫩超白一线天av| 午夜精彩视频在线观看不卡| 99精品视频在线免费观看| 久久综合九色综合97婷婷女人| 五月婷婷综合网| 日本电影亚洲天堂一区| 国产精品蜜臀av| 国产成人在线视频网站| 91精品国产综合久久福利| 亚洲蜜桃精久久久久久久| 国产凹凸在线观看一区二区| 日韩欧美aaaaaa| 天堂成人免费av电影一区| 91麻豆国产精品久久| 国产日韩v精品一区二区| 久久99国产精品成人| 欧美精品在线观看一区二区| 自拍偷拍欧美精品| av男人天堂一区| 日本一区二区久久| 国产夫妻精品视频| 26uuu精品一区二区| 蜜桃av一区二区在线观看| 欧美一区二区三区婷婷月色| 亚洲国产综合色| 欧美日韩久久一区| 午夜视频在线观看一区| 欧美网站大全在线观看| 亚洲午夜免费福利视频| 欧美午夜在线观看| 蜜臀久久99精品久久久久久9 | 一区二区三区日韩在线观看|