home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilsd / evntshell / Docs / Menus < prev    next >
Encoding:
Text File  |  1995-11-11  |  14.1 KB  |  570 lines

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