5. Adding or Modifying the Toolbar and Topmenu

Genero Studio video scripts

Related video: 5. Adding or Modifying the Toolbar and Topmenu

In this video, I’ll show you how to modify the TopMenu and or ToolBar that is used with your generated program. In this example, we’ll add our country_zoom action – added in the 3rd video in this series –  to the topmenu and toolbar.

Let’s start with the topmenu. Currently, the topmenu has a “zoom” action in it. Let’s modify it to be country_zoom instead.

Part 1: Create a topmenu based on dbApp.4tm

First, let’s create a new topmenu based on the dbApp template. (File > New > Templates > 4tm).

As you can see, this xml file includes all of the actions in our current topmenu. Now, let’s save it to our application node. At this point you might want to add a library node to organize your external entities, but for this example, we’ll just keep things in our Application node.

Note that I’ve given it the name dbApp.4tm. This is important because this is a local copy of the file, but with the same name as the template. Because we’ve given it the same name as the template, Genero Studio will automatically use this file at runtime instead of the template.

Build and run.

Part 2: Create a toolbar based on dbApp.4tb

Now, let’s add the country_zoom action to our toolbar. I’ll go through the same process and be sure to name the file dbApp.4tb for simplicity and to have this file picked up at runtime instead of the template. (File New Templates > 4tb)

Part 3: Create consistency with dbApp.4ad

Since we’ve added our country_zoom action to both the toolbar and topmenu, let’s make things a bit more consistent by grouping the attributes for this action in an action default file. We can follow the same process again, creating a new 4ad file based on the template and giving it a dbApp.4ad name. Now that we have a 4ad file with the necessary attributes, let’s remove those attributes settings from the 4tm and 4tb files.

Let’s build and run again and see our changes.