Subscribe Bookmark
arati_mejdal

Staff

Joined:

May 21, 2014

Menu Customization in JMP 7 – Part 2

The menu editor has been given a new interface in the Windows version of JMP 7. You access the menu editor by selecting the “Menus and Toolbars” command from the “Customize” submenu at the bottom of the “Edit” menu.



(Click to view full size image)

Accessing the Menu Editor from the Edit->Customize menu.


This causes the Menus window to appear docked on the left-hand side of the main window. JMP 7 combines the ability to edit your main menu with the ability to edit your toolbars into one window. This facilitates copying and/or moving commands between your menus and your toolbars and is a big improvement over previous versions of JMP, in which the menu editor was in a separate window from the toolbar editor.


Your main menu and toolbars are represented using tree structures. The “root” of your main menu is the “Main Menu” node and the “root” of your list of toolbars is the “Toolbars” node. If you click on the plus “+” symbol next to the “Main Menu” node, the node “expands” and the list of menus that comprise your main menu appears. Meanwhile, if you click on the “Toolbars” node, the list of all your toolbars appears.



(Click to view full size image)

The Menus window -- the new menu editor in JMP 7.


To eliminate the display of a menu's command list, all you have to do is click on the minus “-“ symbol next to the menu’s node. This “collapses” the node.


Adding a command to an existing menu is very easy. In this example, I wanted to add a command to my File menu, called “Execute Query,” which will run some JSL to submit an SQL query to my dBASE database. I wanted to place this command beneath the “Open” command in the File menu. So, I expanded the “File” node and clicked with my right mouse button on the “Open” node. From the popup menu that appeared, I selected the “Insert After” command. As a result, a new item labeled “Untitled” was inserted into the tree directly beneath the “Open” node. I then right-mouse clicked on the “Untitled” item and selected the “Properties” command from the popup menu. This caused the “Menu Item Properties” dialog to appear. (I could just as easily have double-clicked on the “Untitled” node to make the “Menu Item Properties” dialog appear.)


I was then able to set all the properties I wanted my command to have – in particular, its caption and the JSL it should execute when selected. I also clicked on the "Icon" tab in the “Menu Item Properties” dialog and assigned a bitmap to my new command.



(Click to view full size image)

The “Menu Item Properties” dialog.


After I’d clicked the “OK” button to dismiss the “Menu Item Properties” dialog, I had to click the “Apply” button at the top right-hand corner of the Menus window in order to make my modifications take effect. Alternatively, I could also have clicked on the inverted red triangle directly above the “Apply” button and selected the “Apply Changes” command from the popup menu it provides. Once I’d instructed JMP to Apply my change, my new “Execute Query” command appeared in JMP's File menu.



(Click to view full size image)

The "Execute Query" command now appears in the File menu.


It is important to note that until you hit the “Apply” button, any changes you’ve made within the Menus window can be undone simply by selecting the “Discard Changes” command from the popup menu associated with the red triangle menu at the top right-hand corner of the Menus window.


Continuing with our example, I decided that I wanted to add my new “Execute Query” command to the File_Edit toolbar. (The File_Edit toolbar is one of the standard toolbars that JMP provides by default, but there’s no law that says I can’t modify it!)


First, I right-mouse clicked on the “Execute Query” item and selected “Copy” from the popup menu. Next, I expanded the “Toolbars” node, and then expanded the “File_Edit” node. I wanted my new command to appear to the right of the “Run Script” button in the File_Edit toolbar, so I right-mouse clicked on the “Run Script” node and selected “Paste” from the popup menu. I was then presented with a second popup menu, with the commands “Copy Before “Run Script”” and “Copy After ‘Run Script’” (as well as a “Cancel” command in case I changed my mind). I selected “Copy After ‘Run Script’”. This placed the “Execute Query” command beneath the “Run Script” command in the File_Edit toolbar within the Menu editor.


There is actually a second method that will accomplish the same thing, using drag-and-drop. While holding down the Control key, I could have left-mouse clicked on the “Execute Query” item. Continuing to hold down the Control key and my left-mouse button, I could have then dragged the “Execute Query” item down in the tree until my cursor was hovering over the “Run Script” item in the File_Edit toolbar and then released my mouse button. Had I followed this method, then after releasing the mouse button I would have been presented with a popup menu, from which I could have selected the “Copy After ‘Run Script’” command. (Note, if you use the drag-and-drop method just described but without holding down the Control key, then you will Move the item rather than merely Copy it.)


Regardless of which method I follow, in order to make this change take effect in the actual File_Edit toolbar, I must click the “Apply” button at the top right-hand corner of the Menus window.



(Click to view full size image)

A new button for the “Execute query” command appears in JMP's File_Edit toolbar.


In this next example, I decided that I wanted to add a new menu called “NTheory” to the main menu, positioned between the “Graph” and the “Tools” menus. My “NTheory” menu will have two commands: “Euler Phi” and “Fibonacci.”


First, in the Menus window, I expanded the Main Menu node and right-mouse clicked on the “Graph” menu item. I selected the “Insert After” command from the popup menu and as a result, an “Untitled” item appeared beneath the “Graph” item. I double-clicked on the new “Untitled” item and in the “Menu Item Properties” dialog, I observed that its “Menu Item Type” was already set to “Submenu,” as desired. So, all I had to do was change the “Caption” property to “NTheory” and click “OK” to dismiss the “Menu Item Properties” dialog.


Next, I right-mouse clicked on the “NTheory” item and selected “Insert into Submenu” from the popup.



(Click to view full size image)

Preparing to insert the first command into the NTheory menu.


This inserted a new “Untitled” item, beneath the “NTheory” node. This new item appeared slightly indented to the right, indicating that it belongs to the NTheory menu. I was then able to change its caption to be “Euler Phi” and set its action property appropriately in the usual way, by means of the “Menu Item Properties” dialog. Once I had added an item to the NTheory menu, I could proceed to add other items to my new menu as described in an earlier example. So, I right-mouse clicked on the “Euler Phi” item and selected “Insert After” from the popup menu. This created a new “Untitled” item which I then defined to be the “Fibonacci” command using the “Menu Item Properties” dialog.



(Click to view full size image)

The menu editor displays the NTheory menu with its two commands.


As always, in order to make these modifications take effect, I had to click the “Apply” button in the top right-hand corner of the Menus window.


In general, to add an entire submenu, the steps you must follow are exactly the same. First, you create a new item and set its “type” to be submenu. Then, in order to start adding commands to your submenu, you must click on your submenu and select the “Insert into Submenu” command from the popup. This adds a new item into the submenu itself. At that point, you can fill in the rest of your submenu using the “Insert Before” and “Insert After” commands as usual. Similar remarks apply to adding a new toolbar.



(Click to view full size image)

After clicking the Apply button, the NTheory menu appears in JMP's main menu.

3 Comments
Community Member

Jennifer Barb wrote:

Hello. I am very eager to try out the menu customization feature on the Mac. I have created my .jmpmenu file using Windows and have it stored in a file called "Factory Default Menus" as is required by Windows. Within this file are two files, a .jmpmenu file and a Dependencies file. I tried copying the Factory Default Menus file to the location you specified: JMP.app/Contents/Resources/en.lproj/Factory Default Menus/ painfully using UNIX but it didn't work. The error that I received was "Unable to extract from archive buffer". After I reread your instructions, I also saw that I can copy my .jmpmenu file to the other location: ~/Library/Application Support/JMP/ however, what about the Dependencies file? Does this need to go there too or is that unnecessary.

If we are able to get the customized menu in JMP 7 on the Mac, then we will be extremely grateful for the upgrade!!

Any help/advice that you can provide will be greatly appreciated.

Sincerely,

Jennifer

Community Member

Richard Potter wrote:

JMP 7 on the Mac provides partial support for projects and menu customization. For example, using the Mac version of JMP 7, you can select a JMP project file from the standard File Open dialog and open it -- all the documents and windows defined by the project will open as a result.

Unfortunately, the Mac version of JMP 7 does not provide the project tree editor which was illustrated in my blog. At this time, only the Windows version of JMP supports the visual project editor.

Likewise, JMP 7 on the Mac will honor menu customization files if they are placed in the proper location.

User-customized .jmpmenu files should go here: ~/Library/Application Support/JMP/

Factory-default menu additions (for English locale) should go here: JMP.app/Contents/Resources/en.lproj/Factory Default Menus/

All .jmpmenu files within this folder are applied to the menu bar.

Once again, the Mac version does not provide a visual editor so to create a jmpmenu file for your Mac, you would either need to use an XML editor and a Zip tool or else create the jmpmenu file for your Mac using the Windows version.

The remarks about the limitations on the Mac regarding projects and menu customizations also apply to the Linux version of JMP.

We will explore adding visual editors for projects and menus for our Mac and Linux users in a future version of JMP.

Community Member

M. Sundbom wrote:

I have used JMP for many years (version 1-6) on the Macintosh. I wonder if these new intriguing features that are covered in this blog (menu customization, file system tool bar, projects...) are implemented also in the Mac OS version of JMP 7?

Article Tags