4D v16

メニューバー

ホーム

 
4D v16
メニューバー

メニューバー    


 

 

Even though interfaces are currently more "push-button" oriented, let's see how to create a menu bar.

In 4D, we can create up to 32,000 menu bars. Each one can be named to make it easier to navigate among them.

A menu bar can be displayed by programming (such as the SET MENU BAR command) or when it's associated with a form. In this case, when the form appears, its menu bar replaces the previous one.

Now that our set up works, we're going to create a menu bar and call our "navigation" method from one of the items in this menu.

  • Display the Tool Box.
  • Select "Menus".

This window initially show a list of all the menu bars and menus available.

When you click on one of the menu bars, (by default the first one is selected), all of its menus appear.

Next, for each menu, we can see the items that are associated with it.

At first, we are just going to rename Menu Bar #1 "Navigation". We click on this menu bar and in the title area on the right, we call it "Navigation". Then we hit enter to validate the change.

Next, with a right click, we can choose "Attach a menu to the menu bar "Navigation" and then "New menu".

Then with a right click on this menu, we can use the context menu to add an item to it.

Next we can change the title of the menu item and choose the "NAVIGATION" method.

It's likely that you only have one item. The other methods that are available here are those available in the components that are installed.

After all this:

  • We associate the navigation method with item 1
  • Which is itself associated with menu 4
  • Which is itself associated with the menu bar.

So we can rename this menu as "Access", which will allow us to access different options that we are going to define.
To test these menus in the Run menu, we select "Test Application" and then we see the different menus including the "Access" menu which contains the "Navigation" item that will run the navigation method.

 
 

 
プロパティ 

プロダクト: 4D
テーマ: メニューバー

 
履歴 

 
ARTICLE USAGE

セルフトレーニング ( 4D v16)