home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_C / LSTBX1.ZIP / EVENTMGR.C < prev    next >
C/C++ Source or Header  |  1994-01-07  |  4KB  |  110 lines

  1. #pragma    title("List Box Replacement  --  Version 1.0 -- (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. /*              Zortech C++ for OS/2                */
  16. /*              OS/2 Toolkit                    */
  17.  
  18. /* Copyright ╕ International Business Machines Corp. 1991-1994        */
  19. /* Copyright ╕ 1989-1994  Prominare Inc.  All Rights Reserved.        */
  20.  
  21.  
  22. /************************************************************************/
  23. /************************************************************************/
  24. /*               DISCLAIMER OF WARRANTIES.            */
  25. /************************************************************************/
  26. /************************************************************************/
  27. /*     The following [enclosed]    code is    source code created by the    */
  28. /*     authors.     This source code is  provided to you solely        */
  29. /*     for the purpose of assisting you    in the development of your    */
  30. /*     applications.  The code is provided "AS IS", without        */
  31. /*     warranty    of any kind.  The authors shall    not be liable        */
  32. /*     for any damages arising out of your use of the source code,    */
  33. /*     even if they have been advised of the possibility of such    */
  34. /*     damages.     It is provided    purely for instructional and        */
  35. /*     illustrative purposes.                        */
  36. /************************************************************************/
  37. /************************************************************************/
  38.  
  39. #pragma    info(noext)
  40. #pragma    strings(readonly)
  41.  
  42. #if defined(__ZTC__)
  43.  
  44. #define    _Seg16
  45.  
  46. #endif
  47.  
  48. #define    INCL_WIN           /* Include OS/2 PM Windows Interface    */
  49.  
  50. #include <os2.h>
  51.  
  52. #include "listbox.h"
  53.  
  54. /* This    module contains    the routines that handle the event management    */
  55. /* for the list    box.  All notifications    to the owner window are    handled    */
  56. /* through these routines.                        */
  57. /*                                    */
  58. /* Equivalent command line invocation of each module using the        */
  59. /* IBM C Set++ Compiler    Version    2.0 is:                    */
  60. /*                                    */
  61. /*     Icc -G3e- -O+ -Rn -C -W3    -FoEventMgr EventMgr.C            */
  62.  
  63. /* Filename:   EventMgr.C                        */
  64.  
  65. /*  Version:   1.0                            */
  66. /*  Created:   1993-10-14                        */
  67. /*  Revised:   1993-10-21                        */
  68.  
  69. /* Routines:   MRESULT mrNotifyOwner(PLISTBOXWIN plbw,            */
  70. /*                     ULONG ulNotification);        */
  71.  
  72. /* --------------------------------------------------------------------    */
  73.  
  74. #pragma    subtitle("   Event Manager - Owner Notification Procedure")
  75. #pragma    page( )
  76.  
  77. /* --- mrNotifyOwner ----------------------------------- [ Public } ---    */
  78. /*                                    */
  79. /*     This function is    used to    send the notification message to the    */
  80. /*     window owning the list box control.  The    notification message    */
  81. /*     is one of the defined messages for the control.            */
  82. /*                                    */
  83. /* Standard List Box notification messages                */
  84. /*                                    */
  85. /*     LN_SELECT          1                    */
  86. /*     LN_SETFOCUS          2                    */
  87. /*     LN_KILLFOCUS          3                    */
  88. /*     LN_SCROLL          4                    */
  89. /*     LN_ENTER              5                    */
  90. /*                                    */
  91. /*     Upon Entry:                            */
  92. /*                                    */
  93. /*     PLISTBOXWIN plbw;       = List Box Internal Data Pointer    */
  94. /*     ULONG       ulNotification; = Notification Value            */
  95. /*                                    */
  96. /*     Upon Exit:                            */
  97. /*                                    */
  98. /*     mrNotifyOwner = Notification Result                */
  99. /*                                    */
  100. /* --------------------------------------------------------------------    */
  101.  
  102. MRESULT    mrNotifyOwner(PLISTBOXWIN plbw,    ULONG ulNotification)
  103.  
  104. {
  105.  
  106. return(WinSendMsg(plbw->hwndOwner, WM_CONTROL,
  107.           MPFROM2SHORT(plbw->id, (USHORT)ulNotification),
  108.           MPFROMHWND((plbw->hWnd))));
  109. }
  110.