⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ccide.c

📁 CC386 is a general-purpose 32-bit C compiler. It is not an optimizing compiler but given that the co
💻 C
📖 第 1 页 / 共 5 页
字号:
                dmgrHideWindow(DID_MEMWND, FALSE);
                break;
            case IDM_VIEWREGISTER:
                dmgrHideWindow(DID_REGWND, FALSE);
                break;
            case IDM_VIEWPROJECT:
                dmgrHideWindow(DID_TABWND, FALSE);
                return 0;
            case IDM_VIEWWATCH:
                dmgrHideWindow(DID_WATCHWND, FALSE);
                return 0;
            case IDM_VIEWERROR:
                dmgrHideWindow(DID_ERRORWND, FALSE);
                return 0;
            case IDM_ABOUT:
                doAbout();
                //               DialogBoxParam(hInstance,"ABOUTDLG",hwnd,(DLGPROC)WaitingProc,0) ;
                return 0;
            case IDM_NEWDRAW:
                CreateDrawWindow((DWINFO*) - 1);
                return 0;
            case IDM_OPEN:
                CreateDrawWindow(0);
                return 0;
            case IDM_EXIT:
                if (SendMessage(hwnd, WM_QUERYENDSESSION, 0, 0))
                    SendMessage(hwnd, WM_CLOSE, 0, 0);
                return 0;
            case IDM_CASCADE:
                SendMessage(hwndClient, WM_MDICASCADE, 0, 0);
                return 0;
            case IDM_TILE:
                SendMessage(hwndClient, WM_MDITILE, 0, 0);
                return 0;
            case IDM_ARRANGE:
                SendMessage(hwndClient, WM_MDIICONARRANGE, 0, 0);
                return 0;
            case IDM_NEWPROJECT:
                dmgrHideWindow(DID_TABWND, FALSE);
                CreateProjectWindow(2, 0);
                break;
            case IDM_OPENPROJECT:
                if (uState != notDebugging)
                {
                    if (ExtendedMessageBox("Alert", MB_YESNO, 
                        "Project Open requires the debugger be stopped.  Stop the debugger now?") != IDYES)
                    {
                        break;
                    }
                    abortDebug();
                }
                dmgrHideWindow(DID_TABWND, FALSE);
                CreateProjectWindow(FALSE, 0);
                break;
            case IDM_CLOSEPROJECT:
                if (!projectList || making)
                    break;
                if (uState != notDebugging)
                {
                    if (ExtendedMessageBox("Alert", MB_YESNO, 
                        "Project Close requires the debugger be stopped.  Stop the debugger now?") != IDYES)
                    {
                        break;
                    }
                    abortDebug();
                }
                dmgrHideWindow(DID_TABWND, FALSE);
                ProjectSaveList(TRUE);
                ProjectFreeList();
                SaveWorkspace(0);
                SendMessage(hwndTab, WM_CLOSE, 0, 0);
                if (IsDebuggerPresent())
                    SetWindowText(hwnd, "CC386 IDE (DEBUGEE)");
                else
                    SetWindowText(hwnd, "CC386 IDE");
                break;
            case IDM_SAVEPROJECT:
                if (!projectList)
                    break;
                if (QuerySaveAll() == IDCANCEL)
                    ExtendedMessageBox("Project Save", MB_SETFOREGROUND |
                        MB_SYSTEMMODAL, "Project List Not Saved");
                else
                {
                    ProjectSaveList(FALSE);
                    SaveWorkspace(0);
                }
                break;
            case IDM_ADDTARGET:
                dmgrHideWindow(DID_TABWND, FALSE);
                SendMessage(hwndProject, iMessage, wParam, lParam);
                break;
            case IDM_GENERALPROPERTIES:
                DisplayProperties(hInstance, hwndClient);
                break;
            case IDM_COMPILEFILE:
                win = (HWND)SendMessage(hwndClient, WM_MDIGETACTIVE, 0, 0);
                if (IsWindow(win) && !IsSpecialWindow(win))
                {
                    FindItemByWind(win, &proj, &sel);
                    Compiler(proj, sel);
                    CheckEditWindowChanged();
                }
                break;
            case IDM_COMPILEVIAPROJ:
            case IDM_MAKE:
            case IDM_BUILDALL:
            case IDM_PROJECTPROPERTIES:
            case IDM_CALCDEPENDS:
            case IDM_GENMAKE:
                if (making)
                    break;
            case IDM_STOPBUILD:
                if (!projectList)
                    break;
                if (hwndProject)
                {
                    PostMessage(hwndProject, WM_COMMAND, wParam, lParam);
                }
                break;
            case IDM_FINDINFILES:
                FindInFiles();
                break;
            case IDM_BOOKMARK:
                ToggleBookMark();
                break;
            case IDM_NEXTBOOKMARK:
                NextBookMark();
                break;
            case IDM_PREVBOOKMARK:
                PreviousBookMark();
                break;
            case IDM_BOOKMARKWINDOW:
                ShowBookMarks();
                break;
            case IDM_PRINT:
                win = (HWND)SendMessage(hwndClient, WM_MDIGETACTIVE, 0, 0);
                if (numberofdrawwindows && IsWindow(win))
                    if (!IsSpecialWindow(win))
                        Print(win);
                break;
            case IDM_BROWSE:
                if (IsWindow(win = (HWND)SendMessage(hwndClient,
                    WM_MDIGETACTIVE, 0, 0)) && !IsSpecialWindow(win))
                {
                    BrowseTo(win, 0);
                }
                break;
            case IDM_BROWSETO:
                browseToText[0] = 0;
                if (DialogBoxParam(hInstance, "BROWSETODIALOG", hwnd, (DLGPROC)
                    BrowseToProc, 0))
                    BrowseTo(0, browseToText);
                break;
            case IDM_BROWSEBACK:
                BrowseBack();
                break;
            case IDM_REMOVEALLBREAKPOINTS:
                TagRemoveAll(TAG_BP);
                break;
            case IDM_REMOVEBOOKMARKS:
                TagRemoveAll(TAG_BOOKMARK);
                break;
            case IDM_SAVEALL:
                SaveDrawAll();
                break;
            case IDM_WINDOW_MORE:
                ShowWindowList();
                break;
            default:
                if (wParam >= ID_MRU_LIST && wParam < ID_MRU_LIST + MAX_MRU)
                {
                    mrulist[wParam - ID_MRU_LIST]->dwLineNo =  - 1;
                    mrulist[wParam - ID_MRU_LIST]->logMRU = FALSE;
                    CreateDrawWindow(mrulist[wParam - ID_MRU_LIST]);
                    return 0;
                }
                else if (wParam >= ID_MRU_PROJ_LIST && wParam <
                    ID_MRU_PROJ_LIST + MAX_MRU)
                {
                    IndirectProjectWindow(mruprojlist[wParam -
                        ID_MRU_PROJ_LIST]);
                    return 0;
                }
                else if (wParam >= ID_WINDOW_LIST && wParam < ID_WINDOW_LIST +
                    MAX_WINMENU)
                {
                    SendMessage(hwndClient, WM_MDIACTIVATE, (WPARAM)
                        winMenu[wParam - ID_WINDOW_LIST], 0);
                }
                else if (IsWindow(win = GetFocus()))
                {
                    HWND win2 = GetParent(win);
                    if (!IsSpecialWindow(win2))
                        PostMessage(win2, WM_COMMAND, wParam, lParam);
                    else
                    {
                        win2 = GetParent(win2);
                        PostMessage(win2, WM_COMMAND, wParam, lParam);
                    }
                }
                break;
            }
            break;
        case WM_DESTROY:
            PostQuitMessage(0);
            return 0;
        case WM_REDRAWTOOLBAR:
            win = (HWND)SendMessage(hwndClient, WM_MDIGETACTIVE, 0, 0);
            mf_state = FALSE;
            if (numberofdrawwindows && IsWindow(win))
            if (!IsSpecialWindow(win))
            {
                mf_state = TRUE;
                //               SendMessage(GetDlgItem(win,ID_EDITCHILD),EM_GETSEL,(WPARAM)&selstart,(LPARAM)&selend) ;
            }
            SendMessage(hwndToolEdit, TB_ENABLEBUTTON, IDM_PRINT, MAKELONG
                (mf_state, 0));
            SendMessage(hwndToolEdit, TB_ENABLEBUTTON, IDM_CUT, MAKELONG
                (mf_state, 0));
            SendMessage(hwndToolEdit, TB_ENABLEBUTTON, IDM_COPY, MAKELONG
                (mf_state, 0));
            SendMessage(hwndToolEdit, TB_ENABLEBUTTON, IDM_PASTE, MAKELONG
                (mf_state, 0));
            SendMessage(hwndToolEdit, TB_ENABLEBUTTON, IDM_UNDO, MAKELONG
                (mf_state, 0));
            SendMessage(hwndToolEdit, TB_ENABLEBUTTON, IDM_FIND, MAKELONG
                (mf_state, 0));
            SendMessage(hwndToolEdit, TB_ENABLEBUTTON, IDM_TOUPPER, MAKELONG
                (mf_state /*&& selstart != selend*/, 0));
            SendMessage(hwndToolEdit, TB_ENABLEBUTTON, IDM_TOLOWER, MAKELONG
                (mf_state /*&& selstart != selend*/, 0));
            SendMessage(hwndToolEdit, TB_ENABLEBUTTON, IDM_INDENT, MAKELONG
                (mf_state /*&& selstart != selend*/, 0));
            SendMessage(hwndToolEdit, TB_ENABLEBUTTON, IDM_UNINDENT, MAKELONG
                (mf_state /*&& selstart != selend*/, 0));
            //         SendMessage(hwndToolEdit,TB_ENABLEBUTTON,IDM_FINDINFILES,MAKELONG(mf_state,0)) ;
            SendMessage(hwndToolEdit, TB_ENABLEBUTTON, IDM_FINDNEXT, MAKELONG
                (mf_state, 0));
            SendMessage(hwndToolEdit, TB_ENABLEBUTTON, IDM_REPLACE, MAKELONG
                (mf_state, 0));
            SendMessage(hwndToolEdit, TB_ENABLEBUTTON, IDM_GOTO, MAKELONG
                (mf_state || win == hwndASM || win == hwndDump, 0));
            SendMessage(hwndToolDebug, TB_ENABLEBUTTON, IDM_BREAKPOINT,
                MAKELONG(mf_state || win == hwndASM, 0));

            if (mf_state)
            {
                if (making)
                    mf_state = FALSE;
                FindItemByWind(win, &proj, &sel);
                if (!proj)
                    mf_state = FALSE;
            }
            SendMessage(hwndToolBuild, TB_ENABLEBUTTON, IDM_COMPILEFILE,
                MAKELONG(mf_state, 0));
            mf_state = projectList && !making ? TRUE : FALSE;
            SendMessage(hwndToolBuild, TB_ENABLEBUTTON, IDM_MAKE, MAKELONG
                (mf_state, 0));
            SendMessage(hwndToolBuild, TB_ENABLEBUTTON, IDM_BUILDALL, MAKELONG
                (mf_state, 0));

            if (projectList)
            {
                mf_state = TRUE;
                SendMessage(hwndToolDebug, TB_ENABLEBUTTON, IDM_STARTSTOP,
                    MAKELONG(mf_state, 0));
                mf_state = uState != notDebugging;
                i = SendMessage(hwndToolDebug, TB_GETSTATE, IDM_STARTSTOP, 0);
                if (mf_state)
                    SendMessage(hwndToolDebug, TB_SETSTATE, IDM_STARTSTOP,
                        MAKELONG(TBSTATE_CHECKED | i, 0));
                else
                    SendMessage(hwndToolDebug, TB_SETSTATE, IDM_STARTSTOP,
                        MAKELONG(~TBSTATE_CHECKED &i, 0));
            }
            else
            {
                mf_state = FALSE;
                SendMessage(hwndToolDebug, TB_ENABLEBUTTON, IDM_STARTSTOP,
                    MAKELONG(mf_state, 0));
            }
            mf_state = uState == atBreakpoint || uState == atException;
            SendMessage(hwndToolDebug, TB_ENABLEBUTTON, IDM_RUN, MAKELONG
                (mf_state, 0));
            SendMessage(hwndToolDebug, TB_ENABLEBUTTON, IDM_RUNTO, MAKELONG
                (mf_state, 0));
            SendMessage(hwndToolDebug, TB_ENABLEBUTTON, IDM_STEPOVER, MAKELONG
                (mf_state, 0));
            SendMessage(hwndToolDebug, TB_ENABLEBUTTON, IDM_STEPIN, MAKELONG
                (mf_state, 0));
            SendMessage(hwndToolDebug, TB_ENABLEBUTTON, IDM_STEPOUT, MAKELONG
                (mf_state, 0));

            mf_state = uState == Running;
            SendMessage(hwndToolDebug, TB_ENABLEBUTTON, IDM_STOP, MAKELONG
                (mf_state, 0));


            break;
        case WM_INITMENUPOPUP:
            SetWindowMenu();
            SetMenuCheckedState(DID_BUILDTOOL, IDM_VIEWBUILDBAR);
            SetMenuCheckedState(DID_EDITTOOL, IDM_VIEWEDITBAR);
            SetMenuCheckedState(DID_DEBUGTOOL, IDM_VIEWDEBUGBAR);
            mf_state = numberofdrawwindows ? MF_ENABLED : MF_GRAYED;
            EnableMenuItem(hMenuMain, IDM_SAVEALL, mf_state);
            mf_state = MF_GRAYED;
            win = (HWND)SendMessage(hwndClient, WM_MDIGETACTIVE, 0, 0);
            if (numberofdrawwindows && IsWindow(win) && !IsSpecialWindow(win))
            {
                mf_state = MF_ENABLED;
                SendMessage(GetDlgItem(win, ID_EDITCHILD), EM_GETSEL, (WPARAM)
                    &selstart, (LPARAM) &selend);
            }
            EnableMenuItem(hMenuMain, IDM_CLOSE, mf_state);
            EnableMenuItem(hMenuMain, IDM_SAVEAS, mf_state);
            EnableMenuItem(hMenuMain, IDM_SAVE, mf_state);
            EnableMenuItem(hMenuMain, IDM_PRINT, mf_state);
            EnableMenuItem(hMenuMain, IDM_CUT, mf_state);
            EnableMenuItem(hMenuMain, IDM_COPY, mf_state);
            EnableMenuItem(hMenuMain, IDM_PASTE, mf_state);
            EnableMenuItem(hMenuMain, IDM_TOUPPER, (mf_state == MF_ENABLED &&
                selstart != selend) ? MF_ENABLED : MF_GRAYED);
            EnableMenuItem(hMenuMain, IDM_TOLOWER, (mf_state == MF_ENABLED &&
                selstart != selend) ? MF_ENABLED : MF_GRAYED);
            EnableMenuItem(hMenuMain, IDM_INDENT, (mf_state == MF_ENABLED &&
                selstart != selend) ? MF_ENABLED : MF_GRAYED);
            EnableMenuItem(hMenuMain, IDM_UNINDENT, (mf_state == MF_ENABLED &&
                selstart != selend) ? MF_ENABLED : MF_GRAYED);
            EnableMenuItem(hMenuMain, IDM_SELECTALL, mf_state);
            EnableMenuItem(hMenuMain, IDM_FIND, mf_state);
            EnableMenuItem(hMenuMain, IDM_BROWSE, mf_state);
            // EnableMenuItem(hMenuMain,IDM_BROWSETO,mf_state) ;
            // EnableMenuItem(hMenuMain,IDM_BROWSEBACK,mf_state) ;
            EnableMenuItem(hMenuMain, IDM_BOOKMARK, mf_state);
            //EnableMenuItem(hMenuMain,IDM_NEXTBOOKMARK,mf_state) ;
            //EnableMenuItem(hMenuMain,IDM_PREVBOOKMARK,mf_state) ;
            EnableMenuItem(hMenuMain, IDM_FIND, mf_state);
            //      EnableMenuItem(hMenuMain,IDM_FINDINFILES,mf_state) ;
            EnableMenuItem(hMenuMain, IDM_FINDNEXT, mf_state);
            EnableMenuItem(hMenuMain, IDM_REPLACE, mf_state);
            x_state = mf_state;
            if (win == hwndASM || win == hwndDump)
                x_state = MF_ENABLED;
            EnableMenuItem(hMenuMain, IDM_GOTO, x_state);
            if (!making && !IsSpecialWindow(win))
            {
                FindItemByWind(win, &proj, &sel);
                if (!proj)
                    mf_state = MF_GRAYED;
                else
                    mf_state = MF_ENABLED;
            }
            else
                mf_state = MF_GRAYED;

            EnableMenuItem(hMenuMain, IDM_COMPILEFILE, mf_state);
            mf_state = MF_GRAYED;
            if (IsWindow(win))
                mf_state = MF_ENABLED;
            EnableMenuItem(hMenuMain, IDM_CASCADE, mf_state);
            EnableMenuItem(hMenuMain, IDM_TILE, mf_state);
            EnableMenuItem(hMenuMain, IDM_ARRANGE, mf_state);

            EnableMenuItem(hMenuMain, IDM_ADDTARGET, MF_ENABLED);
            EnableMenuItem(hMenuMain, IDM_VIEWPROJECT, MF_ENABLED);
            mf_state = MF_GRAYED;
            if (projectList)
                mf_state = MF_ENABLED;
            EnableMenuItem(hMenuMain, IDM_STARTDEBUGGING, mf_state);
            EnableMenuItem(hMenuMain, IDM_STOPDEBUGGING, mf_state);
            if (making)
                mf_state = MF_GRAYED;
            EnableMenuItem(hMenuMain, IDM_CLOSEPROJECT, mf_state);
            EnableMenuItem(hMenuMain, IDM_GENMAKE, mf_state);
            EnableMenuItem(hMenuMain, IDM_MAKE, mf_state);
            EnableMenuItem(hMenuMain, IDM_BUILDALL, mf_state);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -