home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / gui / pmdev.lha / PopupMenuDeveloper / include / libraries / pm.h
Encoding:
C/C++ Source or Header  |  1997-02-26  |  5.3 KB  |  144 lines

  1. //
  2. //    $VER: pm.h 2.0 (27.2.97)
  3. //
  4. //    Library base, tags and macro definitions
  5. //    for popupmenu.library.
  6. //
  7. //    ©1996-1997 Henrik Isaksson
  8. //    All Rights Reserved.
  9. //
  10.  
  11. #ifndef LIBRARIES_POPUPMENU_H
  12. #define LIBRARIES_POPUPMENU_H
  13.  
  14. #ifndef EXEC_TYPES_H
  15. #include <exec/types.h>
  16. #endif
  17.  
  18. #ifndef EXEC_LIBRARIES_H
  19. #include <exec/libraries.h>
  20. #endif
  21.  
  22. #ifndef UTILITY_TAGITEM_H
  23. #include <utility/tagitem.h>
  24. #endif
  25.  
  26. //
  27. // Tags passed to OpenPopupMenu
  28. //
  29.  
  30. #define PM_SubMenuTimer        (TAG_USER+1)    // Delay before opening submenus
  31. #define PM_RecessSelected    (TAG_USER+2)    // Recess selected item
  32. #define PM_WideSelectBar    (TAG_USER+3)    // Wide selectbar
  33. #define PM_Menu            (TAG_USER+4)    // Pointer to menulist initialized by MakeMenu()
  34. #define PM_Compact        (TAG_USER+5)    // Make the menu more compact (smaller)
  35. #define PM_OldLook        (TAG_USER+6)    // Make the menu look (almost) like old intuition menus
  36. #define PM_SameHeight        (TAG_USER+7)    // Make all items the same height
  37. #define PM_CheckMark        (TAG_USER+8)    // Checkmark (Default: MENUCHECK)
  38. #define PM_ExcludeMark        (TAG_USER+9)    // Checkmark for items with exclusion or inclusion set (Default: MXIMAGE)
  39. #define PM_SubMenuMark        (TAG_USER+10)    // Menu mark (Default: RIGHTIMAGE)
  40. #define PM_SmartRefresh        (TAG_USER+11)    // Smart refreshing (uses more memory, faster)
  41.  
  42. //
  43. // Tags passed to MakeItem
  44. //
  45.  
  46. #define PM_Title        (TAG_USER+20)    // Item title
  47. #define PM_UserData        (TAG_USER+21)    // Anything, returned by OpenPopupMenu when this item is selected
  48. #define PM_ID            (TAG_USER+22)    // ID number, if you want to access this item later
  49. #define PM_Sub            (TAG_USER+23)    // Pointer to submenu list (from MakeMenu)
  50. #define PM_Flags        (TAG_USER+24)    // For internal use
  51. #define PM_NoSelect        (TAG_USER+25)    // Make the item unselectable
  52. #define PM_FillPen        (TAG_USER+26)    // Make the item appear in FILLPEN
  53. #define PM_Checkit        (TAG_USER+27)    // Leave space for a checkmark
  54. #define PM_Checked        (TAG_USER+28)    // Make this item is checked
  55. #define PM_Italic        (TAG_USER+29)    // Italic text
  56. #define PM_Bold            (TAG_USER+30)    // Bold text
  57. #define PM_Underlined        (TAG_USER+31)    // Underlined text
  58. #define PM_TitleBar        (TAG_USER+32)    // Horizontal separator bar
  59. #define PM_WideTitleBar        (TAG_USER+33)    // Same as above, but full width
  60. #define PM_ShadowPen        (TAG_USER+34)    // Draw text in SHADOWPEN
  61. #define PM_ShinePen        (TAG_USER+35)    // Draw text in SHINEPEN
  62. //#define PM_CenterText        (TAG_USER+36)
  63. #define PM_Exclude        (TAG_USER+37)    // Items to unselect (or select) when this gets selected
  64. #define PM_Disabled        (TAG_USER+38)    // Disable an item
  65. #define PM_ImageSelected    (TAG_USER+39)    // Image when selected, PM_Title will be render on top of the image
  66. #define PM_ImageUnselected    (TAG_USER+40)    // Image when unselected
  67. #define PM_IconSelected        (TAG_USER+41)    // Icon when selected
  68. #define PM_IconUnselected    (TAG_USER+42)    // Icon when unselected
  69. //#define PM_ImageMode        (TAG_USER+43)
  70. #define PM_AutoStore        (TAG_USER+44)    // Pointer to BOOL reflecting the current state of the item
  71. #define PM_TextPen        (TAG_USER+45)    // Pen number for text colour of this item, if you want to allocate a pen yourself
  72.  
  73. //
  74. // Tags passed to MakeMenu
  75. //
  76.  
  77. #define PM_Item            (TAG_USER+50)    // Item pointer from MakeItem
  78.  
  79. //
  80. // Tags passed to MakeIDList
  81. //
  82.  
  83. #define PM_ExcludeID        (TAG_USER+55)    // ID number of menu to deselect when this gets selected
  84. #define PM_IncludeID        (TAG_USER+56)    // ID number of menu to select when this gets selected
  85. #define PM_ReflectID        (TAG_USER+57)    // ID number of menu that should reflect the state of this one
  86. #define PM_InverseID        (TAG_USER+58)    // ID number of menu to inverse reflect the state of this one
  87.  
  88. //
  89. // Built-in Images
  90. //
  91.  
  92.                         //              /
  93. #define IMG_CHECKMARK        (0x10L)        // Checkmark        \/
  94. #define IMG_RIGHTARROW        (0x0CL)        // SysIClass Arrow    |>|
  95. #define IMG_MXIMAGE        (0x0FL)        // SysIClass MX        (*)
  96. #define IMG_CHECKIMAGE        (0x0EL)        // SysIClass Checkbox    | |
  97. #define IMG_AMIGAKEY        (0x11L)        // Amiga Key Image    |A|
  98.  
  99. #define    IMG_BULLET_A        (0x8000L)    // bullet        ·
  100. #define    IMG_BULLET_B        (0x8100L)    // 3d bullet        ·
  101. #define    IMG_ARROW_A        (0x8200L)    // Arrow        >
  102. #define IMG_ARROW_B        (0x8300L)    // 3d arrow        >
  103. #define IMG_ARROW_C        (0x8400L)    // Arrow        ->
  104.  
  105. //
  106. // Macros
  107. //
  108.  
  109. #define Menu(t)        MakeMenu(PM_Item, MakeItem(PM_Title, t, PM_NoSelect, TRUE, PM_ShinePen, TRUE, TAG_DONE),\
  110.             PM_Item, MakeItem(PM_WideTitleBar, TRUE, TAG_DONE)
  111. #define SubMenu(t)    PM_Sub, MakeMenu(PM_Item, MakeItem(PM_Title, t, PM_NoSelect, TRUE, PM_ShinePen, TRUE, TAG_DONE),\
  112.             PM_Item, MakeItem(PM_WideTitleBar, TRUE, TAG_DONE)
  113. #define Item(t)        PM_Item, MakeItem(PM_Title, t
  114. #define TitleBar    PM_Item, MakeItem(PM_WideTitleBar, TRUE
  115. #define NarrowTitleBar    PM_Item, MakeItem(PM_TitleBar, TRUE
  116. #define MenuTitle(t)    PM_Item, MakeItem(PM_Title, t, PM_NoSelect, TRUE, PM_ShinePen, TRUE, TAG_DONE),\
  117.             PM_Item, MakeItem(PM_WideTitleBar, TRUE, TAG_DONE)
  118. #define Excl        PM_Exclude, MakeIDList(
  119. #define ExID(id)    PM_ExcludeID, id
  120. #define InID(id)    PM_IncludeID, id
  121. #define RefID(id)    PM_ReflectID, id
  122. #define InvID(id)    PM_InverseID, id
  123. #define CheckItem(t,id)    PM_Item, MakeItem(PM_Title, t, PM_ID, id, PM_Checkit, TRUE
  124. #define End        TAG_DONE)
  125.  
  126. //
  127. // Library base
  128. //
  129.  
  130. struct PopupMenuBase {
  131.     struct Library        pmb_Library;
  132.     ULONG            pmb_SegList;
  133.     ULONG            pmb_Flags;
  134.     struct Library        *pmb_ExecBase;
  135.     struct Library        *pmb_UtilityBase;
  136.     struct Library        *pmb_IntuitionBase;
  137.     struct Library        *pmb_GfxBase;
  138. };
  139.  
  140. #define POPUPMENU_VERSION    2L
  141. #define POPUPMENU_NAME        "popupmenu.library"
  142.  
  143. #endif
  144.