home *** CD-ROM | disk | FTP | other *** search
- Nntp-Posting-Host: bones.et.byu.edu
- Lines: 60
- Path: sparky!uunet!gatech!news.byu.edu!news
- Message-ID: <iz#@byu.edu>
- Date: Wed, 20 Jan 93 16:18:06 MST
- Newsgroups: comp.os.ms-windows.apps
- Subject: Re: WPWin 5.2 macro language question
- References: <rreiner.727504902@yorku.ca>
- Organization: Brigham Young University, Provo UT USA
- From: bigdog@bones.et.byu.edu (Dan Canfield)
-
- In article <rreiner.727504902@yorku.ca> rreiner@nexus.yorku.ca (Richard Reiner) writes:
- >The docs for the new MenuAddItem macro command in WPWin 5.2 state that
- >"a submenu is created by first adding a menu item to the main menu"; but
- >they do not say how this is done. The obvious things -- giving an empty
- >string, or "WPWin", "WordPerfect", "Main", etc. as the MenuName
- >parameter do not work. So, although I cna use MenuAddItem to add items
- >to existing WPWin menus, I can't create a new top-level menu,
- >
- >Has anybody figured this out? I'm reluctant to call WP support about
- >this, because their support operators never know anything about the
- >macro language. Any help will be appreciated.
- >
-
- Now, Now, their operators do a fairly good job.
-
- Anyway, I fiddled with this a bit and figured it out. Below is an
- example which will add a submenu to the "Window" menu called Dan's Test
- with a submenu under it called Bill's Test, with a macro under it called
- text macro. As usual, " are very important, but left out of the documentation.
-
- Example
- APPLICATION(WP;WPWP;Default)
- MenuAddItem(MenuName:"window";ItemName:"dan";Offset:0;Type:Submenu!;
- ItemText:"Dan's Test")
- MenuAddItem(MenuName:"dan";ItemName:"dan1";Offset:0;Type:Submenu!;
- ItemText:"Bill's Test")
- MenuAddItem(MenuName:"dan1";ItemName:"dan2";Offset:0;Type:Macro!;
- ItemText:"text macro";MacroName:"c:\wp51\macros\dan.wcm")
-
- Some things I noticed were that ItemName must be unique in the entire
- menu system. Therefore, if you are adding more than one item to any
- menu, even if they are different menus, you have to use a different ItemName.
- Think of it as a unique variable. Also, Offset can be anything from 0-255
- I believe and if you use 0 it will be the first item on the menu. If you
- use -1 it will always be the last item on the menu. ItemText is the text
- which appears on the menu.
-
- Also, you can remove them with the menudeleteitem command. To clear the
- menu otherwise you have to exit WP. I also found that if you write the
- macor and add just thwe first submenu then edit the macro to add the other
- menu items, you have to exit to clear the menus before rerunning the
- macro. In other words, if the item has been added and you try to add it
- again the macro will bomb.
-
- In myu example, I didn't use the seperator option for Type, but it will
- add in one of those little lines like is under font that splits up the
- menu.
-
- Hope this helps, let me know if I can help more.
-
-
- Dan Canfield
- bigdog@bones.et.byu.edu
-
- DoD #0071,RP90
- '89 FJ1200
- '89 Indy707
- ------------------------------------------------------------------
- "Excuss me while I kiss the sky" - Jimi Hendrix
- ------------------------------------------------------------------
-