home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / OS2BAS.ZIP / WINMENU.BI < prev    next >
Text File  |  1989-09-05  |  3KB  |  110 lines

  1. '**************************************************************
  2. '*
  3. '* Include File: WinMenu.BI
  4. '*
  5. '* Requires:     PMBase.BI (RECTL type)
  6. '*
  7. '* Description:  Menu Manager
  8. '*
  9. '*************************************************************
  10.  
  11. ' Menu control styles
  12.  
  13. CONST MSACTIONBAR        = &H00000001&
  14. CONST MSTITLEBUTTON      = &H00000002&
  15. CONST MSVERTICALFLIP     = &H00000004&
  16.  
  17. DECLARE FUNCTION WinLoadMenu&(BYVAL hwndFrame AS LONG,_
  18.                               BYVAL hmod AS INTEGER,_
  19.                               BYVAL idMenu AS INTEGER)
  20.  
  21. ' Menu class name
  22.  
  23. CONST WCMENU         = &Hffff0004&
  24.  
  25. ' Menu control messages
  26.  
  27. CONST MMINSERTITEM           = &H0180
  28. CONST MMDELETEITEM           = &H0181
  29. CONST MMQUERYITEM            = &H0182
  30. CONST MMSETITEM              = &H0183
  31. CONST MMQUERYITEMCOUNT       = &H0184
  32. CONST MMSTARTMENUMODE        = &H0185
  33. CONST MMENDMENUMODE          = &H0186
  34. CONST MMDISMISSMENU          = &H0187
  35. CONST MMREMOVEITEM           = &H0188
  36. CONST MMSELECTITEM           = &H0189
  37. CONST MMQUERYSELITEMID       = &H018a
  38. CONST MMQUERYITEMTEXT        = &H018b
  39. CONST MMQUERYITEMTEXTLENGTH  = &H018c
  40. CONST MMSETITEMHANDLE        = &H018d
  41. CONST MMSETITEMTEXT          = &H018e
  42. CONST MMITEMPOSITIONFROMID   = &H018f
  43. CONST MMITEMIDFROMPOSITION   = &H0190
  44. CONST MMQUERYITEMATTR        = &H0191
  45. CONST MMSETITEMATTR          = &H0192
  46. CONST MMISITEMVALID          = &H0193
  47.  
  48. ' WinCreateMenu is not the advised method of creating a menu.
  49. ' It requires creating a binary resource area in the data
  50. ' segment using a variant record (which is not supported in BASIC)
  51. ' documented in Chapter 17 of "OS/2 Programmer's Reference, Volume I".
  52. ' It is advised to use the resource compiler and WinLoadMenu instead.
  53. DECLARE FUNCTION WinCreateMenu&(BYVAL hwndParent AS LONG,_
  54.                                 BYVAL lpmt AS LONG)
  55.  
  56. ' Owner Item Structure (Also used for listboxes)
  57.  
  58. TYPE OWNERITEM 
  59.     hwnd AS LONG
  60.     hps AS LONG
  61.     fsState AS INTEGER
  62.     fsAttribute AS INTEGER
  63.     fsStateOld AS INTEGER
  64.     fsAttributeOld AS INTEGER
  65.     rclItem AS RECTL
  66.     idItem AS INTEGER ' field contains idItem for menus, iItem for lb.
  67.     hItem AS LONG
  68. END TYPE
  69.  
  70. ' Menu item
  71.  
  72. TYPE MENUITEM 
  73.     iPosition AS INTEGER
  74.     afStyle AS INTEGER
  75.     afAttribute AS INTEGER
  76.     id AS INTEGER
  77.     hwndSubMenu AS LONG
  78.     hItem AS LONG
  79. END TYPE
  80.  
  81. CONST MITEND         =-1
  82. CONST MITNONE        =-1
  83. CONST MITMEMERROR    =-1
  84. CONST MITERROR       =-1
  85. CONST MIDNONE        =MITNONE
  86. CONST MIDERROR       =-1
  87.  
  88. ' Menu item styles & attributes
  89.  
  90. CONST MISTEXT            = &H0001
  91.  
  92. CONST MISBITMAP          = &H0002
  93. CONST MISSEPARATOR       = &H0004
  94.  
  95. CONST MISOWNERDRAW       = &H0008
  96.  
  97. CONST MISSUBMENU         = &H0010
  98. CONST MISSYSCOMMAND      = &H0040
  99. CONST MISHELP            = &H0080
  100. CONST MISSTATIC          = &H0100
  101. CONST MISBUTTONSEPARATOR = &H0200
  102. CONST MISBREAK           = &H0400
  103. CONST MISBREAKSEPARATOR  = &H0800
  104.  
  105. CONST MIANODISMISS       = &H0020
  106. CONST MIAFRAMED          = &H1000
  107. CONST MIACHECKED         = &H2000
  108. CONST MIADISABLED        = &H4000
  109. CONST MIAHILITED         = &H8000
  110.