Working with menus

Return to Introduction  Previous page  Next page

In this tutorial you learn how to set up the Clarion menu and override with PowerToolbar.  Please note that the menu themes do NOT work in Clarion 7 and the PowerToolbar template automatically turns them off.  See the Limitations topic for more information.  As of Build 2.0.163 menus can again be themed in Clarion 7 and Clarion 8.

 

 

When working with the Clarion menu you must obey the following limitations:

Bullet If you choose to override the main Clarion menu you can NOT have (merging) menus in any child windows.

Bullet All items in menu must have a Use-variable set

Bullet All font colors must be COLOR:NONE

Bullet Width must be "default" on all items

Bullet Height must be "default" on all items

Bullet Top level menu-items is not supported

Bullet Runtime added top level-menus is not supported

 

 

The finished application for this tutorial can be found at: Clarion6\3rdParty\Examples\PowerToolbar\MenusTutorial.app

 

menustut_9

 

 

Part 1 - Populate templates

Onestep Create a new application

 

menustut_1

 

Onestep Add the global PowerToolbar template

See Adding the templates

 

Onestep Add AppFrame

Bullet Double-click the Main(Todo) procedure to bring up the "Select Procedure Type" dialog.

Bullet Select "Frame - Multiple Document Main Menu"

 

threadtut_3

 

Onestep Create the window

Bullet Click the Window button

Bullet Select "Application Main MDI Frame" and click OK. This will bring up the window formatter.

 

threadtut_4

 

Onestep Create a toolbar

Bullet Select the menu-item "Toolbar -> New Toolbar"

 

Onestep Populate PowerToolbar control

Bullet Click the "Control Template" toolbutton

    tplbutton

 

Bullet Choose the template "POToolbar - Toolbar Control"

   addtpl_c1_75pst

 

Bullet Click somewhere inside the Clarion toolbar or Window to place the PowerToolbar-control.

 

 

Part 2 - Set up the menu

Onestep Double-click the menu band to open the menu editor

 

Onestep Place use variable on all items

Bullet You must make sure that all items in the menu has a use-variable.

Bullet In the default menu there is one separator without use-variable. Set it to ?Sep1

menustut_2

 

Onestep Add submenu

Bullet Add a submenu under the "Help"-menu by clicking menustut_3

Bullet Make sure the new item get's a use-variable. By default it doesn't.

 

menustut_4

 

Onestep Add sub-menu item

Bullet Add a submenu-item under the newly created submenu by clicking menustut_5

 

menustut_6

 

Onestep Set icon

Bullet Select the "Appearance"-tab

Bullet Choose your favourite icon (16x16) by clicking the "..." button next to the Icon-prompt.

Bullet Click the "Close" button to accept the menu changes and get back to the window formatter.

 

menustut_7

 

 

Part 3 - Toolbar settings

Onestep Right-click the PowerToolbar control, and select "Actions"

 

Onestep Select the "Menu" tab

Bullet Click the "Override main Clarion menu"-checkbox

 

menustut_8

 

 

Part 4 - Try the application

Onestep Compile run your application

Bullet Make sure the icon for the item we added shows. If it's missing or placed on the wrong item, you probably got a menu-item without use-variable.

 

menustut_9

 



Direct link to this page on our website: http://www.icetips.com/manuals/powertoolbar/workingwithmenus.htm