home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / basic / eventshell / Docs / Menus < prev    next >
Encoding:
Text File  |  1996-04-11  |  14.4 KB  |  590 lines

  1. PROCshell_AttachMenu()
  2. =>    int    window handle
  3.     int    icon handle
  4.     int    item handle
  5.     bool    shift flag (not implemented)
  6.     bool    ctrl flag (not implemented)
  7.     bool    alt flag (not implemented)
  8.  
  9. The shift, ctrl and alt flags are for future
  10. enhancements to the library and should be set
  11. to 0 on this release.
  12.  
  13. If the menu is attached to an icon (rather than
  14. a window work area) a click with SELECT or MENU
  15. will open the menu. Also the button type of the
  16. icon is changed to 3 (click) to ensure the menu
  17. pops up when SELECT is used.
  18.  
  19. User FN (PROCshell_AttachMenu)
  20. =>    str    text of menu selection
  21.  
  22. The function to call when the user makes
  23. a choice from the menu.
  24.  
  25. --------------------------------------------------------
  26.  
  27. PROCshell_AttachMenuMaker()
  28. =>    int    window handle
  29.     int    icon handle
  30.     str    function name
  31.  
  32. Registers a function to be called before the
  33. menu is opened, allowing ticking, shading etc
  34. of menu items.
  35.  
  36. User FN (PROCshell_AttachMenuMaker)
  37. =>    int    window handle over which MENU
  38.          was pressed
  39.     int    icon handle over which MENU was
  40.          pressed (-1 for no icon)
  41.  
  42. This function is called before the menu is
  43. opened.
  44.  
  45. --------------------------------------------------------
  46.  
  47. PROCshell_AttachFontMenu()
  48. =>    int    item handle
  49.     str    function to call when menu_select
  50.          event occurs (optional, may be "")
  51.  
  52. Use this routine to attach the FontMenu to an icon or
  53. a window. Attach the FontMenu to an existing menu
  54. structure with PROCshell_AttachFontSubMenu.
  55.  
  56. This routine will attempt to load the necessary
  57. 'FontMenu' support module if it is not already
  58. loaded. It expects to find it in the
  59. EvntShell$Path (usually inside !EvntShell).
  60.  
  61. User FN (PROCshell_AttachFontMenu) 
  62. =>    str    selection string
  63.  
  64. <=    int    ignored
  65.  
  66. This function can be used to discover the name
  67. of the font (if any) that has been selected in
  68. the FontMenu. Use FNshell_FontMenuGetLastSelectedFont
  69. for this.
  70.  
  71. --------------------------------------------------------
  72.  
  73. FNshell_FontMenuGetLastSelectedFont
  74. =>    None
  75.  
  76. <=    str    font name (could be "")
  77.  
  78. This routine should be used in the function
  79. called when a menu_select event has occurred to
  80. discover if font menu selection has been made,
  81. and if so the name of the font.
  82.  
  83. If no valid font menu selection has been made
  84. the function will return "" and no action should
  85. be taken.
  86.  
  87. --------------------------------------------------------
  88.  
  89. PROCshell_FontMenuSelectFont()
  90. =>    str    name of font to select
  91.  
  92. The font name is used by the library routines
  93. to decide which font name to select when the
  94. font menu opens. As the same font menu can be
  95. used by different applications it is important
  96. to set this up just before the menu opens.
  97.  
  98. --------------------------------------------------------
  99.  
  100. PROCshell_AttachMenuDBox()
  101. =>    int    menu item handle
  102.     str    window identifier
  103.     str    function name
  104.     str    function name
  105.  
  106. Calling this routine will automatically setup the sub
  107. menu arrow on the menu item, and also set the 'menu
  108. warning' flag. It is not necessary to do this in the
  109. menu editor.
  110.  
  111. User FN (PROCshell_AttachMenuDBox)
  112. =>    int    window handle
  113.  
  114. The function to call after creating the window
  115. but before opening it. This can be used to fill
  116. in icon fields etc. A function name of "" may
  117. be used if you don't need to call a function.
  118.  
  119. User FN (PROCshell_AttachMenuDBox)
  120. =>int    window handle
  121.  
  122. The function to call after opening the window.
  123. A function name of "" may be used if you don't
  124. need to call a function.
  125.  
  126. --------------------------------------------------------
  127.  
  128. PROCshell_OpenMenu()
  129. =>    int    menu x coordinate
  130.     int    menu y coordinate
  131.     int    handle of menu to open
  132.  
  133. Normally this routine is called internally
  134. by the library routines in response to menu
  135. open events set up by PROCshell_AttachMenu.
  136. In some circumstances it may be advantageous
  137. to call it from the user applications.
  138.  
  139. Note that this routine checks the last window/
  140. icon pair clicked over and assumes that the
  141. menu is attached to these. If you open the
  142. menu in response to a click on the iconbar
  143. icon the Y coordinate will be ignored. In
  144. general you should always attach menus to
  145. windows or window/icon pairs rather than using
  146. this call.
  147.  
  148. --------------------------------------------------------
  149.  
  150. FNshell_MenuLastXPos
  151. Returns the X coordinate of the last menu
  152. opened by PROCshell_OpenMenu.
  153.  
  154. --------------------------------------------------------
  155.  
  156. FNshell_MenuLastYPos
  157. Returns the Y coordinate of the last menu
  158. opened by PROCshell_OpenMenu.
  159.  
  160. --------------------------------------------------------
  161.  
  162. PROCshell_MenuShade()
  163. =>    int    menu or item handle
  164.     int    state
  165.  
  166. Shades menu items. If a menu handle is
  167. given then all items in the menu are
  168. shaded or deshaded.
  169.  
  170. Menu Shade States
  171. The state is 0 for no shading, non 0 for shading.
  172.  
  173. --------------------------------------------------------
  174.  
  175. PROCshell_MenuShadeAllItems()
  176. =>    int    menu handle
  177.  
  178. Shades all the menu items in the specified menu
  179.  
  180. --------------------------------------------------------
  181.  
  182. PROCshell_MenuUnshadeAllItems()
  183. =>    int    menu handle
  184.  
  185. Unshades all the menu items in the specified menu
  186.  
  187. --------------------------------------------------------
  188.  
  189. PROCshell_MenuTick()
  190. =>    int    menu or item handle
  191.     int    state
  192.  
  193. Adds or removes ticks for menu
  194. items. If a menu handle is given
  195. then all items in the menu are
  196. ticked or not ticked.
  197.  
  198. See also PROCshell_MenuTickOnly1,
  199.          PROCshell_MenuTickOnly2
  200.  
  201. Menu Tick States
  202. The state is 0 for no  tick, non 0 for a tick.
  203.  
  204. --------------------------------------------------------
  205.  
  206. PROCshell_MenuTickAllItems()
  207. =>    int    menu handle
  208.  
  209. Adds ticks to every item in the specified menu
  210.  
  211. See also    PROCshell_MenuTickOnly1,
  212.             PROCshell_MenuTickOnly2
  213.             PROCshell_MenuUntickAllItems
  214.          
  215. --------------------------------------------------------
  216.  
  217. PROCshell_MenuUntickAllItems()
  218. =>    int    menu handle
  219.  
  220. Removes ticks from every item in the specified menu
  221.  
  222. See also    PROCshell_MenuTickOnly1,
  223.             PROCshell_MenuTickOnly2
  224.             PROCshell_MenuTickAllItems
  225.          
  226. --------------------------------------------------------
  227.  
  228. PROCshell_MenuPutData()
  229. =>    int    menu item handle
  230.     str    data to write into menu item
  231.  
  232. This routine is used to alter the items of a
  233. menu when the program runs. The width of the
  234. menu is adjusted automatically.
  235.  
  236. --------------------------------------------------------
  237.  
  238. PROCshell_AttachSubMenu()
  239. =>    int    item handle
  240.     int    submenu menu handle
  241.     str    function to call when menu_warning
  242.          message is received (optional, may
  243.          be "")
  244.  
  245. User FN (PROCshell_AttachSubMenu) 
  246. =>    int    window handle
  247.     int    icon handle
  248.  
  249. <=    int    junk
  250.          
  251. --------------------------------------------------------
  252.  
  253. PROCshell_AttachFontSubMenu()
  254. =>    int    item handle
  255.     str    function to call when menu_warning
  256.          message is received (optional, may
  257.          be "")
  258.  
  259. This routine will attempt to load the necessary
  260. 'FontMenu' support module if it is not already
  261. loaded. It expects to find it in the
  262. EvntShellSystem$Path (usually in !EvntShell).
  263.  
  264. User FN (PROCshell_AttachFontSubMenu) 
  265. =>    int    window handle
  266.     int    icon handle
  267.  
  268. <=    int    junk
  269.  
  270. This function can be used to set the currently
  271. selected font in the menu about to be opened.
  272. Use PROCshell_FontMenuSelectFont to do this.
  273.  
  274. --------------------------------------------------------
  275.  
  276. PROCshell_MenuWritable()
  277. =>    int    menu or menu item handle
  278.     int    state
  279.     int    size of indirected buffer
  280.     str    validation string
  281.  
  282. Makes the given menu item writable or non writable
  283. depending on the state parameter. If a menu handle
  284. is given then all items in the menu are made
  285. writable or non writable.
  286.  
  287. MenuWritable States
  288. The state is 0 for non writable, non 0
  289. for writable.
  290.  
  291. --------------------------------------------------------
  292.  
  293. PROCshell_MenuDotted()
  294. =>    int    menu or menu item handle
  295.     int    state
  296.  
  297. Adds or removes a dotted line from below
  298. the given menu item. If a menu handle is
  299. given instead all items in the menu are
  300. effected.
  301.  
  302. MenuDotted States
  303. The state is 0 for non writable, non 0
  304. for writable.
  305.  
  306. --------------------------------------------------------
  307.  
  308. FNshell_MenuNew()
  309. =>    str    menu title (11 characters max)
  310.     str    menu identifier (for
  311.          future use)
  312.     int    nr of items in this menu
  313.          (approximate only, needed
  314.          to overcome a MenuUtils bug)
  315.  
  316. <=    int    menu handle
  317.          
  318. Creates a new menu with the given title.
  319.  
  320. --------------------------------------------------------
  321.  
  322. FNshell_MenuAdd()
  323. =>    int    menu or menu item handle
  324.     str    text for menu item
  325.     str    fn to call when item is selected
  326.  
  327. <=    int    menu item handle
  328.          
  329. Adds a new item to an existing menu. If a menu
  330. handle is given then the new item is added to
  331. the end of the menu, if an item handle is given
  332. the new item is added before the existing item.
  333.  
  334. User FN (FNshell_MenuAdd)
  335. =>    int    menu decode block
  336.  
  337. Menu decode block
  338. blk+00 position of selected menu item in menu
  339.        (starting from 0)
  340. blk+04 pointer to selected item data
  341. blk+08 selected item handle or zero if item
  342.        was created without MenuUtils
  343. blk+12 pointer to text string of selected item
  344. blk+16 position of parent menu item in menu
  345.        (starting from 0)
  346. blk+20 pointer to parent item data
  347. blk+24 parent item handle or zero if item was
  348.        created without MenuUtils
  349. blk+28 pointer to text string of parent item 
  350.  
  351. --------------------------------------------------------
  352.  
  353. PROCshell_MenuTickOnly1()
  354. =>    int    menu handle
  355.     int    position of item in menu
  356.  
  357. Ticks only the item given by the menu handle
  358. and the position of the item. This call is
  359. provided for when you don't know the handle
  360. of the menu item.
  361.  
  362. See also PROCshell_MenuTickOnly2
  363.  
  364. --------------------------------------------------------
  365.  
  366. PROCshell_MenuTickOnly2()
  367. =>    int    menu item handle
  368.  
  369. Ticks only the item given by the menu item
  370. handle.
  371.  
  372. See also PROCshell_MenuTickOnly1
  373.  
  374. --------------------------------------------------------
  375.  
  376. PROCshell_MenuColours()
  377. =>    int    menu item handle
  378.     int    foreground colour    (0-15)
  379.     int    background colour    (0-15)
  380.  
  381. Sets the foreground and background colours
  382. of the item given. Note that the default
  383. colours are set out in the Style Guide.
  384.  
  385. --------------------------------------------------------
  386.  
  387. FNshell_MenuMakeFromFile()
  388. =>    str    menu title
  389.     str    menu identifier (for future use)
  390.     str    menu selection function
  391.     str    full file name of command
  392.          file
  393.  
  394. <=    int    menu handle
  395.          
  396. Creates a new menu with the given title,
  397. taking the menu items from the specified
  398. menu command file.
  399.  
  400. The command file consists of menu text items,
  401. blank lines and lines starting with a '#'
  402. character are ignored.
  403.  
  404. Example Command File..
  405.  
  406. Adachi
  407. Fuji HQ
  408. Panasonic HQ
  409. Sony
  410.  
  411. --------------------------------------------------------
  412.  
  413. PROCshell_MenuSortItems()
  414. =>    int    menu handle
  415.     str    comparision function (optional,
  416.          may be "")
  417.     bool    ascending flag, non 0 for
  418.          ascending sort, 0 for
  419.          descending sort
  420.     int    first item number to sort
  421.          (normally 0)
  422.     int    last item number to sort
  423.  
  424. This routine is used to sort the menu items
  425. into order. It should not be used if the items
  426. do not have the same handler routine, as only
  427. the menu text is moved around.
  428.  
  429. If a last item number is given that exceeds
  430. the number of items in the menu it is reset
  431. to be equal to the number of items.
  432.  
  433. If the comparision function is "" then a default
  434. one is used which retrieves the menu items as
  435. strings and compares them.
  436.  
  437. Comparision FN (PROCshell_MenuSortItems)
  438. =>    int    first  element nr
  439.     int    second element nr
  440.  
  441. <=    bool    TRUE if value of first element
  442.          is less than the second,
  443.          otherwise FALSE
  444.  
  445. --------------------------------------------------------
  446.  
  447. PROCshell_AttachColourPopupMenu()
  448. =>    int    window handle
  449.     int    menu    icon handle
  450.     int    display icon handle
  451.     int    menu handle
  452.     str    user function (optional)
  453.     str    preopen function (optional)
  454.  
  455. Provides for automatic updating of a display
  456. icon when a selection is made from the
  457. attached colour menu. If a user function name
  458. is not supplied then the display icon shows
  459. the selected menu item background colour.
  460.  
  461. The button type of the menu icon is changed
  462. to 3 to ensure the menu opens when <SELECT>
  463. is used.
  464.  
  465. User FN (AttachColourPopupMenu)
  466. =>    int    window handle
  467.     int    display icon handle
  468.     str    menu text of selected item
  469.  
  470. <=    bool    TRUE if display icon should be
  471.          automatically updated, FALSE
  472.          otherwise
  473.  
  474. Preopen FN (AttachColourPopupMenu)
  475. =>    int    menu handle
  476.  
  477. --------------------------------------------------------
  478.  
  479. PROCshell_AttachPopupMenu()
  480. =>        window handle
  481.     int    menu icon handle
  482.     int    display icon handle (optional,
  483.            may be -1)
  484.     int    menu handle
  485.     str    user function (optional, may be "")
  486.  
  487. Provides for automatic updating of a display
  488. icon when a selection is made from the
  489. attached menu  if a user function name is
  490. not supplied.
  491.  
  492. The button type of the menu icon is changed
  493. to 3 to ensure the menu opens when <SELECT>
  494. is used.
  495.  
  496. User FN (AttachPopupMenu)
  497. =>    int    window handle
  498.     int    display icon handle
  499.     str    menu text of selected item
  500.  
  501. <=    bool    TRUE if text should be inserted
  502.          in the display icon, FALSE
  503.          otherwise
  504.  
  505. --------------------------------------------------------
  506.  
  507. PROCshell_MenuDelete()
  508. =>int    menu or menu item handle
  509.  
  510. Deletes a menu item or a whole menu if
  511. a menu handle is specified. Note that if
  512. a menu is deleted any menu events are also
  513. deleted - so if you are deleting and then
  514. re-creating a menu you must also attach
  515. the new menu again.
  516.  
  517. --------------------------------------------------------
  518.  
  519. FNshell_MenuGetItemHandle()
  520. =>    int    menu handle
  521.     int    address of menu selection block
  522.  
  523. <=    int    item handle
  524.  
  525. Returns 0 if item cannot be found, or if item belongs
  526. to a menu that was not created with the MenuUtils module
  527.  
  528. It should normally not be necessary to use
  529. this call as the item handle is returned
  530. when the menu item is created (so store it
  531. if you are likely to need it later!)
  532.  
  533. Menu Selection Block
  534. the block contains :
  535.    0    Item in main menu selected.
  536.    4    Item in 1st submenu.
  537.    8    Item in 2nd submenu.
  538.   ++    ++
  539.     Terminated by -1
  540.  
  541. A selection block is normally returned by
  542. the wimp when a menu selection has been
  543. made.
  544.  
  545. --------------------------------------------------------
  546.  
  547. FNshell_MenuGetItemHandler()
  548. =>    int    menu handle
  549.     int    item number
  550.  
  551. <=    str    item handler FN
  552.  
  553. --------------------------------------------------------
  554.  
  555. FNshell_MenuGetItemHeight()
  556. =>    int    menu handle
  557.  
  558. <=    int    item height (os units)
  559.          
  560. --------------------------------------------------------
  561.  
  562. FNshell_MenuCalculateHeight()
  563. =>    int    menu handle
  564.  
  565. <=    int    height of menu (OS units)
  566.  
  567. --------------------------------------------------------
  568.  
  569. FNshell_MenuGetItemText()
  570. =>    int    menu handle
  571. int    item handle
  572.  
  573. <=    str    text of menu item
  574.  
  575. --------------------------------------------------------
  576.  
  577. FNshell_MenuGetNrDotted()
  578. =>    int    menu handle
  579.  
  580. <=    int    nr of items that have a dotted line
  581.          under them
  582.  
  583. --------------------------------------------------------
  584.  
  585. FNshell_MenuGetNrItems()
  586. =>    int    menu handle
  587.  
  588. <=    int    nr of items in menu
  589.  
  590. --------------------------------------------------------