Annotation of os232sdk/toolkt20/c/samples/style/sty_edit.c, revision 1.1

1.1     ! root        1: /*==============================================================*\
        !             2:  *  Edit.c - routines for handling the standard edit menu
        !             3:  *              commands.
        !             4:  *      Created 1990, Microsoft, IBM  Corp.
        !             5:  *--------------------------------------------------------------
        !             6:  *
        !             7:  *  This module contains the code for the WM_COMMAND messages
        !             8:  *  posted by the standard edit menu.
        !             9:  *
        !            10:  *--------------------------------------------------------------
        !            11:  *
        !            12:  *  This source file contains the following functions:
        !            13:  *
        !            14:  *           EditUndo(mp2);
        !            15:  *           EditCut(mp2);
        !            16:  *           EditCopy(mp2);
        !            17:  *           EditPaste(mp2);
        !            18:  *           EditClear(mp2);
        !            19: 
        !            20: \*==============================================================*/
        !            21: 
        !            22: /*--------------------------------------------------------------*\
        !            23:  *  Include files, macros, defined constants, and externs
        !            24: \*--------------------------------------------------------------*/
        !            25: 
        !            26: #define INCL_WINMLE
        !            27: 
        !            28: #include <os2.h>
        !            29: #include "sty_main.h"
        !            30: #include "sty_xtrn.h"
        !            31: 
        !            32: /*--------------------------------------------------------------*\
        !            33:  *  Global variables
        !            34: \*--------------------------------------------------------------*/
        !            35: 
        !            36: /*--------------------------------------------------------------*\
        !            37:  *  Entry point declarations
        !            38: \*--------------------------------------------------------------*/
        !            39: 
        !            40: 
        !            41: /****************************************************************\
        !            42:  *  Undo routine
        !            43:  *--------------------------------------------------------------
        !            44:  *
        !            45:  *  Name:   EditUndo(mp2)
        !            46:  *
        !            47:  *  Purpose: Processes the Edit menu's Undo item.
        !            48:  *
        !            49:  *  Usage:  called whenever Undo from the Edit menu is selected
        !            50:  *
        !            51:  *  Method:
        !            52:  *
        !            53:  *  Returns:
        !            54:  *
        !            55: \****************************************************************/
        !            56: VOID EditUndo(mp2)
        !            57: MPARAM mp2;     /* second parameter of WM_COMMAND message */
        !            58: {
        !            59: 
        !            60:     if(!WinSendMsg(hwndMLE, MLM_UNDO, NULL, NULL))
        !            61:         MessageBox(hwndMLE,
        !            62:                    IDMSG_UNDOFAILED,
        !            63:                    MB_OK | MB_ERROR,
        !            64:                    FALSE);
        !            65: 
        !            66: 
        !            67:     /* This routine currently doesn't use the mp2 parameter but       *\
        !            68:      *  it is referenced here to prevent an 'Unreferenced Parameter'
        !            69:     \*  warning at compile time.                                      */
        !            70:     mp2;
        !            71: 
        !            72: }   /* EditUndo() */
        !            73: 
        !            74: /****************************************************************\
        !            75:  *  Cut routine
        !            76:  *--------------------------------------------------------------
        !            77:  *
        !            78:  *  Name:   EditCut(mp2)
        !            79:  *
        !            80:  *  Purpose: Processes the Edit menu's Cut item.
        !            81:  *
        !            82:  *  Usage:  called whenever Cut from the Edit menu is selected
        !            83:  *
        !            84:  *  Method:
        !            85:  *
        !            86:  *  Returns:
        !            87:  *
        !            88: \****************************************************************/
        !            89: VOID EditCut(mp2)
        !            90: MPARAM mp2;     /* second parameter of WM_COMMAND message */
        !            91: {
        !            92: 
        !            93:     WinSendMsg(hwndMLE, MLM_CUT, NULL, NULL);
        !            94: 
        !            95:     /* This routine currently doesn't use the mp2 parameter but       *\
        !            96:      *  it is referenced here to prevent an 'Unreferenced Parameter'
        !            97:     \*  warning at compile time.                                      */
        !            98:     mp2;
        !            99: 
        !           100: }   /* EditCut() */
        !           101: 
        !           102: /****************************************************************\
        !           103:  *  Copy routine
        !           104:  *--------------------------------------------------------------
        !           105:  *
        !           106:  *  Name:   EditCopy(mp2)
        !           107:  *
        !           108:  *  Purpose: Processes the Edit menu's Copy item.
        !           109:  *
        !           110:  *  Usage:  called whenever Copy from the Edit menu is selected
        !           111:  *
        !           112:  *  Method:
        !           113:  *
        !           114:  *  Returns:
        !           115:  *
        !           116: \****************************************************************/
        !           117: VOID EditCopy(mp2)
        !           118: MPARAM mp2;     /* second parameter of WM_COMMAND message */
        !           119: {
        !           120: 
        !           121:     WinSendMsg(hwndMLE, MLM_COPY, NULL, NULL);
        !           122: 
        !           123: 
        !           124:     /* This routine currently doesn't use the mp2 parameter but       *\
        !           125:      *  it is referenced here to prevent an 'Unreferenced Parameter'
        !           126:     \*  warning at compile time.                                      */
        !           127:     mp2;
        !           128: 
        !           129: }   /* EditCopy() */
        !           130: 
        !           131: /****************************************************************\
        !           132:  *  Paste routine
        !           133:  *--------------------------------------------------------------
        !           134:  *
        !           135:  *  Name:   EditPaste(mp2)
        !           136:  *
        !           137:  *  Purpose: Processes the Edit menu's Paste item.
        !           138:  *
        !           139:  *  Usage:  called whenever Paste from the Edit menu is
        !           140:  *          selected
        !           141:  *
        !           142:  *  Method:
        !           143:  *
        !           144:  *  Returns:
        !           145:  *
        !           146: \****************************************************************/
        !           147: VOID EditPaste(mp2)
        !           148: MPARAM mp2;     /* second parameter of WM_COMMAND message */
        !           149: {
        !           150: 
        !           151:     WinSendMsg(hwndMLE, MLM_PASTE, NULL, NULL);
        !           152: 
        !           153: 
        !           154:     /* This routine currently doesn't use the mp2 parameter but       *\
        !           155:      *  it is referenced here to prevent an 'Unreferenced Parameter'
        !           156:     \*  warning at compile time.                                      */
        !           157:     mp2;
        !           158: 
        !           159: }   /* EditPaste() */
        !           160: 
        !           161: /****************************************************************\
        !           162:  *  Clear routine
        !           163:  *--------------------------------------------------------------
        !           164:  *
        !           165:  *  Name:   EditClear(mp2)
        !           166:  *
        !           167:  *  Purpose: Processes the Edit menu's Clear item.
        !           168:  *
        !           169:  *  Usage:  called whenever Clear from the Edit menu is
        !           170:  *          selected
        !           171:  *
        !           172:  *  Method:
        !           173:  *
        !           174:  *  Returns:
        !           175:  *
        !           176: \****************************************************************/
        !           177: VOID EditClear(mp2)
        !           178: MPARAM mp2;     /* second parameter of WM_COMMAND message */
        !           179: {
        !           180: 
        !           181:     WinSendMsg(hwndMLE, MLM_CLEAR, NULL, NULL);
        !           182: 
        !           183: 
        !           184:     /* This routine currently doesn't use the mp2 parameter but       *\
        !           185:      *  it is referenced here to prevent an 'Unreferenced Parameter'
        !           186:     \*  warning at compile time.                                      */
        !           187:     mp2;
        !           188: 
        !           189: }   /* EditClear() */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.