AnsweredAssumed Answered

vrf Custom Menus

Question asked by gregwale on Apr 6, 2004
Hi,
Custom menus are cool. The Vxl add-in which I sell, uses a custom menu like
the new System menu. The difference is, the System menu already has access
to the entire .Net infrastructure, but the Vxl add-in requires the init menu
item be executed first because it imports the Vxl UserFunction library (and
initializes Excel ActiveX Automation). Nobody has ever griped about the need
to call the init first. Most Vxl menu items just call a UF in the imported
library. My power point slides describing this approach are on the US VEE
Days handout.

So if you use this approach yourself, you can get the best of both:
convenience of a custom menu, and ability to edit the UF functionality and
you can step down off that soapbox

Also, one example I really like that does not contain a UF call in a menu is
the Vxl utilities / iterate array menu item. This places about three objects
in your workspace which iterate an array - the need for which is ubiquitous
in any language.


Regards,
Greg Wale
www.passtechnologies.com

> -----Original Message-----
> From: Pickles, Warren [mailto:Warren.Pickles@tycoelectronics.com]
> Sent: Tuesday, April 06, 2004 9:42 AM
> Subject: RE: Custom Menus
>
> Tim,
>
> I see your argument.  I intended my comments as a warning to the unwary
> (which I'm sure includes none of you, but all the same).
>
> Don't get me wrong - like you, I'm happy they put those menu items in;
> means
> I don't have to do so much work to learn .net, and most of the common
> stuff
> is already done for me.  But I just have a gut feeling that most of the
> system menu stuff ought to be in userfunctions.
>
> It all comes down to when you should use a userfunction and when not -
> probably we all have slightly different views on that.  I agree one
> shouldn't use the custom menu for large sections of code.  But that's not
> the only time when a userfunction is appropriate.  I like to put any
> repeated task in a userfunction, even the most simple.  You just can't
> predict when you might want to make a small change.
>
> Let's take an example:  System ... File ... Delete File.  Let's assume
> that
> that formula will delete a read-only file without warning (probably not
> true
> - just for argument's sake), and I don't want that.  But I only find that
> out after I've put the formula in a dozen different bits of code.  Now I
> wish I had used a userfunction.
>
> The VEE 7 system menu gives you code that looks simple enough, because
> it's
> generally just a one or two line formula.  But in fact the tasks performed
> are reasonably complex, at least they are sufficiently complex to be
> potentially subject to change.
>
> Regards,
> Warren
>
>
>
> -----Original Message-----
> From: MEANEY,TIM (A-USA,ex1) [mailto:tim_meaney@agilent.com]
> Sent: 06 April 2004 14:56
> To: VRF
> Subject: [vrf] RE: Custom Menus (was Version 7 - System menu with
> printerchoi ce ?)
>
>
> Hi Warren,
>      When referencing "functions", VEE help/documentation is referring to
> a function such as those in the "Function and Object Browser" listed under
> the "Functions" column. If the comment below mentioned "UserFunctions"
> then
> I would agree with you. I don't believe the two terms are meant to be
> synonymous.
>      When you have a group of several objects designed to perform some
> operation it may make sense to package them into a UserFunction. When you
> have a single object, such as a custom formula that you intend to use
> regularly, then the custom menu ability is a handy tool. I would suggest
> that this use is not bad programming practice. I believe the custom menu
> ability was not intended to be used with large sections of code that would
> normally be packaged into a UserFunction.
>
> Tim
>
>
> -----Original Message-----
> From: Pickles, Warren [mailto:Warren.Pickles@tycoelectronics.com]
> Sent: Tuesday, April 06, 2004 5:40 AM
> To: PDL-LISTS,VRF (A-Lists,unix1)
> Subject: [vrf] Custom Menus (was Version 7 - System menu with
> printerchoi ce ?)
>
>
> "Custom menus are useful for putting commonly used functions on a menu for
> easy access. "
>
> That should read "commonly used code" not "commonly used functions".
>
> Custom menus can't be used to put userfunctions into the workspace, only
> userobjects, or code samples.  When you select a custom menu item you get
> a
> clone of the code in Main in a specific VEE file, but not its
> userfunctions.
> So if you use that menu item multiple times, you get clones of the same
> code
> doing the same thing.  That's the situation where you should be using a
> userfunction.  Custom menus are a very handy thing, but they encourage bad
> programming practice in that respect.
>
> What I plan to do is put the code from each file referenced in the VEE 7
> custom menus into a user function in a dedicated global library which will
> be imported by all my VEE programs.  Then change the menu files so that
> they
> contain only a call to the appropriate function.
>
> (The files containing the code called up by the system menu are all under
> the Lib directory in the VEE installation directory).
>
> Regards,
> Warren
>
>
> -----Original Message-----
> From: MEANEY,TIM (A-USA,ex1) [mailto:tim_meaney@agilent.com]
> Sent: 05 April 2004 16:53
> To: VRF
> Subject: [vrf] RE: AW: RE: Version 7 - System menu with printerchoice ?
>
>
> Hi Detlef,
> >Cant you provide an item there to switch to different printers? To solve
> an
> >old problem also from all the others who want to print once on a
> standard
> >printer and also to a .pdf file or a different printer, maybe one
> landscape
> >and one portrait ? Within one VEE Session .
> The system menu has an object titled "What is this menu". This object is a
> notepad with info about the new system menu and how to customize it. I
> have
> cut and pasted a portion of this section below.
> Customize this menu
> All the operations on the System menu are created using the custom menu
> functionality in VEE.  Custom menus are useful for putting commonly used
> functions on a menu for easy access.  You can see how it is done if you
> edit
> the file named System.mnu  in the VEE installation directory.  To edit the
> file, use any ASCII text editor such as Notepad or Wordpad.  There are
> more
> details on creating a custom menu in the file named <VEE install dir>
> lib
>  customMenu.mnu file.
>
> >The example below provided by Tim is not 100%
> >running so far....
> I have tried your attached vee program on my system, substituting the
> names
> of three printer I have installed. Two are pdf printers and one is a
> networked printer. The program seems to reliably switch default printers
> for
> me and then prints without error. What problems are you experiencing?
> Tim
> -----Original Message-----
> From: Baranski, Detlef [mailto:Detlef.Baranski@PILKINGTON.de]
> Sent: Monday, April 05, 2004 11:01 AM
> To: PDL-LISTS,VRF (A-Lists,unix1)
> Subject: [vrf] AW: RE: Version 7 - System menu with printerchoice ?
> Hi Scott and the vrf,
> thanks for your hints - until now i did not see the system menu
> Cant you provide an item there to switch to different printers? To solve
> an
> old problem also from all the others who want to print once on a  standard
> printer and also to a .pdf file or a different printer, maybe one
> landscape
> and one portrait ? Within one VEE Session .
> Is it possible to do so ? The example below provided by Tim is not 100%
> running so far....
> One other observation:
> If i install the Eval - Pro7 Version to harddisk D:, and i have a runtime
> and Development Version 6.01 and 6.2 Version installed before,
> the .vee programs are still opening Version 6.01...which seems to be good
> for downcompatibility Its not a bug now ...
> -----Ursprngliche Nachricht-----
> Von: BAYES,SCOTT (A-Loveland,ex1) [mailto:scott_bayes@agilent.com]
> Gesendet: Samstag, 3. April 2004 01:10
> An: VRF
> Cc: Barrie Walden
> Betreff: [vrf] RE: Version 7
> Hi Barrie and the vrf,
> > I see a lot of energy going into "Vee's place in the world"
> > discussions
> > and, curiously, almost nothing about the Ver 7.0 release.  Does this
> > mean few have tried it or nobody wants to talk about it?
> Very good point, Barrie, though here in Agilent we're still finding lots
> of
> interest in the topics Jeff started about VEE's place in the world, and
> are
> learning a lot from them.
> Anyway, to get going with .NET I found the best way is not to pick up a
> heavy book, but to start with 2 goodies that we included in 7.0:
> - the System menu, between the existing Device and IO menus. Lots (100 or
> so) of small but useful snippets there, instant gratification from mostly
> one-liners. Finding your IP address is dead easy with this (Environment
> sub-menu).
> - the Help menu, select the Open example... item, go to DotNET directory.
> 29
> fairly useful and instructive examples there, if I counted correctly. More
> instant gratification and mostly simple enough to understand with little
> .NET background, especially if you've already done battle with ActiveX.
> The DrawOnBitMap example is kind of neat, you can do all kinds of drawing,
> then display it on a VEE Picture object, integrate to a Panel if you like.
> Pretty easy to see how it's done from this example.
> Once you've seen (some of) what .NET is good for and played with it a bit,
> you probably want to go and read Chapter 7 of the 7.0 User's Guide for
> gritty details.
> If you got a 7.0 upgrade, this new version of the manual will be in the
> box.
> If you're using the eval download, don't throw the unzip-ped files away
> until you grab the User's Guide from the Books directory. If you've
> already
> deleted this stuff, go to < www.agilent.com/find/adn >, get logged in, and
> choose the Drivers/Downloads link on the right of the page. Select
> Software:
> VEE Pro > VEE Pro. The 7.0 User's Guide is a 7 MB download on that page.
> This is also a good place to get a copy of 7.0 to try out if you haven't
> already done so.
> Advanced Techniques and the Tutorials didn't change for 7.0, so you've
> really only got one chapter to read, chapter 7. Other 7.0 changes are
> scattered through the manuals, and you probably will figure them with
> little
> trouble, even without reading about them.
> Once you've read the hardcopy or pdf, you may want to know where you can
> get
> a refresher course on .NET or all of VEE.
> The Help menu, Contents and Index gets you to the new Online Help system.
> There's a cool little browser tool there, beside the long yellow box with
> the icons in it near the top. It will open up on the .NET Framework topic
> when you first start up Help. It takes you on a guided path through .NET
> usage. But it also covers a bunch of other VEE topic areas. This thing
> might
> also be pretty good for colleagues who are new to VEE altogether.
> After you've played with these features would be a good time to decide
> whether you want to get a book on .NET.
> Re the Properties Window: I think I'll get to like it more as I use it
> more.
> Right now I keep right-clicking on objects before I think of going to the
> new window. Muscle memory.
> I guess one of the main things I notice is that it's more standard than
> the
> previous right-click dialogs, so there's a bit less of a mental gear
> change
> required when I start to use VEE after using something else. Same with
> Undo
> using CTL-Z, pretty standard. "Standard is better than better"
> Best Regards,
> Scott Bayes
> Software Technical Support
> Agilent Technologies, Inc.
> 815 14th Street S.W.
> Loveland, CO, U.S.A. 80537
> 970 679 3799 Tel
> 970 635 6867 Fax
> This message and any attachments are confidential, for the exclusive use
> of
> the addressee and may be legally privileged. Any other distribution, use
> or
> reproduction is unauthorised and prohibited. If you have received this
> message in error, please notify the sender immediately and delete the
> message from your system.
> Visit our internet site at http://www.pilkington.com
>
>
> ---
> You are currently subscribed to vrf as: tim_meaney@agilent.com
> To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
> To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
> To send messages to this mailing list,  email "vrf@agilent.com".
> If you need help with the mailing list send a message to
> "owner-vrf@it.lists.it.agilent.com".
>
> ---
> You are currently subscribed to vrf as: Warren.Pickles@tycoelectronics.com
> To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
> To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
> To send messages to this mailing list,  email "vrf@agilent.com".
> If you need help with the mailing list send a message to
> "owner-vrf@it.lists.it.agilent.com".



---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".

Outcomes