home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / mswindo / apps / 7420 < prev    next >
Encoding:
Text File  |  1993-01-22  |  3.0 KB  |  72 lines

  1. Nntp-Posting-Host: bones.et.byu.edu
  2. Lines: 60
  3. Path: sparky!uunet!gatech!news.byu.edu!news
  4. Message-ID: <iz#@byu.edu>
  5. Date: Wed, 20 Jan 93 16:18:06 MST
  6. Newsgroups: comp.os.ms-windows.apps
  7. Subject: Re: WPWin 5.2 macro language question
  8. References: <rreiner.727504902@yorku.ca>
  9. Organization: Brigham Young University, Provo UT USA
  10. From: bigdog@bones.et.byu.edu (Dan Canfield)
  11.  
  12. In article <rreiner.727504902@yorku.ca> rreiner@nexus.yorku.ca (Richard Reiner) writes:
  13. >The docs for the new MenuAddItem macro command in WPWin 5.2 state that
  14. >"a submenu is created by first adding a menu item to the main menu"; but
  15. >they do not say how this is done.  The obvious things -- giving an empty
  16. >string, or "WPWin", "WordPerfect", "Main", etc. as the MenuName
  17. >parameter do not work.  So, although I cna use MenuAddItem to add items
  18. >to existing WPWin menus, I can't create a new top-level menu,
  19. >
  20. >Has anybody figured this out?  I'm reluctant to call WP support about
  21. >this, because their support operators never know anything about the
  22. >macro language.  Any help will be appreciated.
  23. >
  24.  
  25. Now, Now, their operators do a fairly good job.
  26.  
  27. Anyway, I fiddled with this a bit and figured it out.  Below is an 
  28. example which will add a submenu to the "Window" menu called Dan's Test
  29. with a submenu under it called Bill's Test, with a macro under it called
  30. text macro.  As usual, " are very important, but left out of the documentation.
  31.  
  32. Example
  33. APPLICATION(WP;WPWP;Default)
  34. MenuAddItem(MenuName:"window";ItemName:"dan";Offset:0;Type:Submenu!;
  35. ItemText:"Dan's Test")
  36. MenuAddItem(MenuName:"dan";ItemName:"dan1";Offset:0;Type:Submenu!;
  37. ItemText:"Bill's Test")
  38. MenuAddItem(MenuName:"dan1";ItemName:"dan2";Offset:0;Type:Macro!;
  39. ItemText:"text macro";MacroName:"c:\wp51\macros\dan.wcm")
  40.  
  41. Some things I noticed were that ItemName must be unique in the entire
  42. menu system.  Therefore, if you are adding more than one item to any 
  43. menu, even if they are different menus, you have to use a different ItemName.
  44. Think of it as a unique variable.  Also, Offset can be anything from 0-255
  45. I believe and if you use 0 it will be the first item on the menu.  If you
  46. use -1 it will always be the last item on the menu.  ItemText is the text
  47. which appears on the menu.
  48.  
  49. Also, you can remove them with the menudeleteitem command.  To clear the
  50. menu otherwise you have to exit WP.  I also found that if you write the
  51. macor and add just thwe first submenu then edit the macro to add the other
  52. menu items, you have to exit to clear the menus before rerunning the 
  53. macro.  In other words, if the item has been added and you try to add it
  54. again the macro will bomb.
  55.  
  56. In myu example, I didn't use the seperator option for Type, but it will
  57. add in one of those little lines like is under font that splits up the 
  58. menu.
  59.  
  60. Hope this helps, let me know if I can help more.
  61.  
  62.  
  63. Dan Canfield
  64. bigdog@bones.et.byu.edu
  65.  
  66. DoD #0071,RP90
  67. '89 FJ1200
  68. '89 Indy707
  69. ------------------------------------------------------------------
  70. "Excuss me while I kiss the sky" - Jimi Hendrix
  71. ------------------------------------------------------------------
  72.