home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / edctl1.zip / eventmgr.c < prev    next >
C/C++ Source or Header  |  1994-03-03  |  4KB  |  105 lines

  1. #pragma    title("List Box Replacement  --  Version 1.1 -- (EventMgr.C)")
  2. #pragma    subtitle("   Event Manager - Interface Definitions")
  3.  
  4. /* Program name: Listbox.C    Title: A List Box    Replacement        */
  5. /*                                    */
  6. /* OS/2    Developer Magazine, Issue:  Jan    '94, page 66                    */
  7. /* Author:  Mark Benge       IBM Corp.                    */
  8. /*        Matt Smith       Prominare Inc.                */
  9. /* Description:     Replacement for OS/2 List Box,    first of a series.    */
  10. /*                                    */
  11. /* Program Requirements:  OS/2 2.x                    */
  12. /*              IBM C    Set/2                    */
  13. /*              WATCOM C 386/9.0                */
  14. /*              Borland C++ for OS/2                */
  15. /*              OS/2 Toolkit                    */
  16.  
  17. /* Copyright ╕ International Business Machines Corp. 1991-1994        */
  18. /* Copyright ╕ 1989-1994  Prominare Inc.  All Rights Reserved.        */
  19.  
  20.  
  21. /************************************************************************/
  22. /************************************************************************/
  23. /*               DISCLAIMER OF WARRANTIES.            */
  24. /************************************************************************/
  25. /************************************************************************/
  26. /*     The following [enclosed]    code is    source code created by the    */
  27. /*     authors.     This source code is  provided to you solely        */
  28. /*     for the purpose of assisting you    in the development of your    */
  29. /*     applications.  The code is provided "AS IS", without        */
  30. /*     warranty    of any kind.  The authors shall    not be liable        */
  31. /*     for any damages arising out of your use of the source code,    */
  32. /*     even if they have been advised of the possibility of such    */
  33. /*     damages.     It is provided    purely for instructional and        */
  34. /*     illustrative purposes.                        */
  35. /************************************************************************/
  36. /************************************************************************/
  37.  
  38. #pragma    info(noext)
  39. #pragma    strings(readonly)
  40.  
  41. #define    INCL_WIN           /* Include OS/2 PM Windows Interface    */
  42.  
  43. #include <os2.h>
  44.  
  45. #include "entryfld.h"
  46.  
  47. /* This    module contains    the routines that handle the event management    */
  48. /* for the list    box.  All notifications    to the owner window are    handled    */
  49. /* through these routines.                        */
  50. /*                                    */
  51. /* Equivalent command line invocation of each module using the        */
  52. /* IBM C Set++ Compiler    Version    2.0 is:                    */
  53. /*                                    */
  54. /*     Icc -G3e- -O+ -Rn -C -W3    -FoEventMgr EventMgr.C            */
  55.  
  56. /* Filename:   EventMgr.C                        */
  57.  
  58. /*  Version:   1.1                            */
  59. /*  Created:   1994-03-01                        */
  60. /*  Revised:   1994-03-01                        */
  61.  
  62. /* Routines:   MRESULT mrNotifyOwner(PENTRYFWIN    pefw,               */
  63. /*                     ULONG ulNotification);        */
  64.  
  65. /* --------------------------------------------------------------------    */
  66.  
  67. #pragma    subtitle("   Event Manager - Owner Notification Procedure")
  68. #pragma    page( )
  69.  
  70. /* --- mrNotifyOwner ----------------------------------- [ Public } ---    */
  71. /*                                    */
  72. /*     This function is    used to    send the notification message to the    */
  73. /*     window owning the list box control.  The    notification message    */
  74. /*     is one of the defined messages for the control.            */
  75. /*                                    */
  76. /* Standard List Box notification messages                */
  77. /*                                    */
  78. /*     EN_SETFOCUS          0x0001                */
  79. /*     EN_KILLFOCUS          0x0002                */
  80. /*     EN_CHANGE          0x0004                */
  81. /*     EN_SCROLL          0x0008                */
  82. /*     EN_MEMERROR          0x0010                */
  83. /*     EN_OVERFLOW          0x0020                */
  84. /*     EN_INSERTMODETOGGLE      0x0040                */
  85. /*                                    */
  86. /*     Upon Entry:                            */
  87. /*                                    */
  88. /*     PENTRYFWIN pefw;          = List Box Internal Data Pointer     */
  89. /*     ULONG       ulNotification; = Notification Value            */
  90. /*                                    */
  91. /*     Upon Exit:                            */
  92. /*                                    */
  93. /*     mrNotifyOwner = Notification Result                */
  94. /*                                    */
  95. /* --------------------------------------------------------------------    */
  96.  
  97. MRESULT    mrNotifyOwner(PENTRYFWIN pefw, ULONG ulNotification)
  98.  
  99. {
  100.  
  101. return(WinSendMsg(pefw->hwndOwner, WM_CONTROL,
  102.           MPFROM2SHORT(pefw->id, (USHORT)ulNotification),
  103.           MPFROMHWND((pefw->hWnd))));
  104. }
  105.