Example #1
0
File: main.c Project: RPG-7/reactos
/***********************************************************************
 *
 *           NOTEPAD_MenuCommand
 *
 *  All handling of main menu events
 */
static int NOTEPAD_MenuCommand(WPARAM wParam)
{
    switch (wParam)
    {
    case CMD_NEW: DIALOG_FileNew(); break;
    case CMD_OPEN: DIALOG_FileOpen(); break;
    case CMD_SAVE: DIALOG_FileSave(); break;
    case CMD_SAVE_AS: DIALOG_FileSaveAs(); break;
    case CMD_PRINT: DIALOG_FilePrint(); break;
    case CMD_PAGE_SETUP: DIALOG_FilePageSetup(); break;
    case CMD_EXIT: DIALOG_FileExit(); break;

    case CMD_UNDO: DIALOG_EditUndo(); break;
    case CMD_CUT: DIALOG_EditCut(); break;
    case CMD_COPY: DIALOG_EditCopy(); break;
    case CMD_PASTE: DIALOG_EditPaste(); break;
    case CMD_DELETE: DIALOG_EditDelete(); break;
    case CMD_SELECT_ALL: DIALOG_EditSelectAll(); break;
    case CMD_TIME_DATE: DIALOG_EditTimeDate(); break;

    case CMD_SEARCH: DIALOG_Search(); break;
    case CMD_SEARCH_NEXT: DIALOG_SearchNext(); break;
    case CMD_REPLACE: DIALOG_Replace(); break;
    case CMD_GOTO: DIALOG_GoTo(); break;

    case CMD_WRAP: DIALOG_EditWrap(); break;
    case CMD_FONT: DIALOG_SelectFont(); break;

    case CMD_STATUSBAR: DIALOG_ViewStatusBar(); break;

    case CMD_HELP_CONTENTS: DIALOG_HelpContents(); break;
    case CMD_HELP_SEARCH: DIALOG_HelpSearch(); break;
    case CMD_HELP_ON_HELP: DIALOG_HelpHelp(); break;

    case CMD_ABOUT:
        DialogBox(GetModuleHandle(NULL),
                  MAKEINTRESOURCE(IDD_ABOUTBOX),
                  Globals.hMainWnd,
                  AboutDialogProc);
        break;

    case CMD_ABOUT_WINE: DIALOG_HelpAboutWine(); break;

    default:
        break;
    }
    return 0;
}
Example #2
0
/***********************************************************************
 *          NOTEPAD_OnMenuCommand
 *
 *  All handling of main menu events
 *
 *  ARGUMENTS:
 *    - handle of window:
 *         HWND hWnd
 *    - menu command id:
 *         int Id
 *    - (not used):
 *         HWND hwndCtl
 *    - (not used):
 *         uint codeNotify
 *  RETURNS: none
 */
static void NOTEPAD_OnMenuCommand(HWND hwnd, int Id, HWND hwndCtl, uint codeNotify)
{
    switch (Id) {
        case CMD_NEW:     DIALOG_FileNew();    break;
        case CMD_OPEN:    DIALOG_FileOpen();   break;
        case CMD_SAVE:    DIALOG_FileSave();   break;
        case CMD_SAVE_AS: DIALOG_FileSaveAs(); break;
        case CMD_EXIT:    DIALOG_FileExit();   break;
        case CMD_WRAP:    DIALOG_EditWrap();   break;

        case CMD_TEXT_HOME:
            EDIT_MoveCaret(DIR_TEXT_HOME);
            UpdateStuff(true);
            break;

        case CMD_TEXT_END:
            EDIT_MoveCaret(DIR_TEXT_END);
            UpdateStuff(true);
            break;

        default:          break;
    }
}