4D v11 Menu Management
10/10/08 20:36 Filed in: 4D Summit
2008
New
v11 Menu Management:
Achim Peschke
Campatibility:
- Edit Menu: v2003 allowed us to insert our own edit menu. Compatibility option allowed the automatic generation of the edit menu.
In v11, there is no compatibility mode. You need to create the edit menu (no more 6.8 compatibility option).
Conversion of the database will automatically create the edit menu bar and will notify you about the changes when the conversionis one.
Counting of menus is different now:
- The Edit menu is included in the count of menus now (#2)
Demo in v2004. Shows how the Count Menus command returns 2 for the menu in the 3rd position (to the right of Edit)
$Count:=Count Menus
$x:= Get Menu Title (1)
$y:=Get Menu Title(2)
z:=Get Menu Title(3)
Converted the structure to v11. An Alert appears to explain that a new menu has been added. Make a note of this, since it is not wrien to any log.
The example from above now returns the expected values.
Now that 4D has merged the User and Design mode (Design Mode) and has the Custom Runtime (Appilcation Mode). you can administrate the records in the Design mode. New Menu actions for the Design mode.
Demo 2:
User mode features appear in the Tolbar in the Design mode.
Demo 3:
New Menu Editor
Left list has HL with 2 items; Menu bars and Menus.
- Menu Bars:
- Menus:
Select a menu item and a checkmark appers next to the Menu bar associated with the Menu
Action Popup at the bottom of the list allows user to add, delete or define a standard Eit menu
All of the Menus are Independant of Menu Bars. You can forget about the old way of relying on linked menus.
Preview Pane (right hand side of the window)
If you use external resource files with your menu titles, you couldn’t see the titles in the design mode. With XLIFF, this has changed.
Reference Item: reference to build intelligent menu items. So that the selected menu command knows that it was selected by the user.
Methods now come from a popup list (with clairvoyance).
A button to the right of the Associated Method item will open the method in the method editor.
The Options: Shortcut area has a link to the right of the field that will open the Shortcut dialog. In v11 the Alt modifier key is also available.
There is a Checkmark attribute available
There is an Item Icon attribute available. BUT, the icons are only available if they are located in the Picture library (for now)
Yo can also build heirarchical menus recursively referring to menus (position them as parent, child or grandchild menus, etc.)
Programmatical Creationof Menus:
New Referencing system:
- For menus created by programming
- Also for editor created menus
- For new and existing menu commands
- Doesn’t break the previous referencing system
Menu Bars:
Set menu Bar 91)
Set menu Bar (My Menu Bar)
New menu reference given by 4D
- |MR|00000000000036 (16 character string, starting with |MR|)
Set Menu Bar ($MenBarRef_s) Use vars to refer to the menus
Menus:
- Get Menu Items (1;...)
- Same new refrences like new menu bars
- Given by 4D
- Get Menu Items ($MenuRef_s)
Menu Items:
- Menu item by numbers
- -1 attribute added to indicate that the item should be positioned at the bottom of the list.
- Before
- $MenuNum:=Menu selected\65536
- ItemNum:= Menu Selected%65536
- New
- Get Selected menu item reference
- Set Menu Item Reference
Sub Menus:
- Item with a menu used as a sub menu gives a new reference (distinct from the same menu when it is used as a parent menu)
Demo 4:
Full set of menus built in the menu editor.
Setting the checkmark: $result:=Check_Refs(MenuBarRef;->SearchedString)
This will allow you to set the checkbox, icon, enable, disable, etc. It is in the demo Database
achimpeshke@de.4d.com
Menus on the Fly:
No difference between menu and menu br
List of entries
Hierarchically
Handle like Hierarchical Lists
Demo 6: Building Menus by Code:
MyCreateMenumethod: Notice that there is o Create menuBar command. Creating the File menuBar is created by calling the Create Menu command and inserting the File, Edit and Customer menus as Menu Items. Cool...
ONCE AGAIN, YOU CAN’T MANipulate the menu items using he item references, gotta use the methd from Demo 5...
Calling the Men bar has changed
!!!
As of v11.3 you can switch our meu bar at startup.
Demo 7: Combining Programmed menus with Menus created in the editor.
Associating Menus to Forms.
Dynamic Popup Menus:
- Uses menus created by programming
- Returns the Menu Item Reference
- Methods are Submenu Items Attached ?
Demo 8:
- Customers Output Form method, using the dynamic popup menu command. Very easy & cool.
Dynamic menu Items, when selected, return the Menu line reference. You need to handle the difference in behavior by filtering the called method by setting a flag. (sigh).
Achim Peschke
Campatibility:
- Edit Menu: v2003 allowed us to insert our own edit menu. Compatibility option allowed the automatic generation of the edit menu.
In v11, there is no compatibility mode. You need to create the edit menu (no more 6.8 compatibility option).
Conversion of the database will automatically create the edit menu bar and will notify you about the changes when the conversionis one.
Counting of menus is different now:
- The Edit menu is included in the count of menus now (#2)
Demo in v2004. Shows how the Count Menus command returns 2 for the menu in the 3rd position (to the right of Edit)
$Count:=Count Menus
$x:= Get Menu Title (1)
$y:=Get Menu Title(2)
z:=Get Menu Title(3)
Converted the structure to v11. An Alert appears to explain that a new menu has been added. Make a note of this, since it is not wrien to any log.
The example from above now returns the expected values.
Now that 4D has merged the User and Design mode (Design Mode) and has the Custom Runtime (Appilcation Mode). you can administrate the records in the Design mode. New Menu actions for the Design mode.
Demo 2:
User mode features appear in the Tolbar in the Design mode.
Demo 3:
New Menu Editor
Left list has HL with 2 items; Menu bars and Menus.
- Menu Bars:
- Menus:
Select a menu item and a checkmark appers next to the Menu bar associated with the Menu
Action Popup at the bottom of the list allows user to add, delete or define a standard Eit menu
All of the Menus are Independant of Menu Bars. You can forget about the old way of relying on linked menus.
Preview Pane (right hand side of the window)
If you use external resource files with your menu titles, you couldn’t see the titles in the design mode. With XLIFF, this has changed.
Reference Item: reference to build intelligent menu items. So that the selected menu command knows that it was selected by the user.
Methods now come from a popup list (with clairvoyance).
A button to the right of the Associated Method item will open the method in the method editor.
The Options: Shortcut area has a link to the right of the field that will open the Shortcut dialog. In v11 the Alt modifier key is also available.
There is a Checkmark attribute available
There is an Item Icon attribute available. BUT, the icons are only available if they are located in the Picture library (for now)
Yo can also build heirarchical menus recursively referring to menus (position them as parent, child or grandchild menus, etc.)
Programmatical Creationof Menus:
New Referencing system:
- For menus created by programming
- Also for editor created menus
- For new and existing menu commands
- Doesn’t break the previous referencing system
Menu Bars:
Set menu Bar 91)
Set menu Bar (My Menu Bar)
New menu reference given by 4D
- |MR|00000000000036 (16 character string, starting with |MR|)
Set Menu Bar ($MenBarRef_s) Use vars to refer to the menus
Menus:
- Get Menu Items (1;...)
- Same new refrences like new menu bars
- Given by 4D
- Get Menu Items ($MenuRef_s)
Menu Items:
- Menu item by numbers
- -1 attribute added to indicate that the item should be positioned at the bottom of the list.
- Before
- $MenuNum:=Menu selected\65536
- ItemNum:= Menu Selected%65536
- New
- Get Selected menu item reference
- Set Menu Item Reference
Sub Menus:
- Item with a menu used as a sub menu gives a new reference (distinct from the same menu when it is used as a parent menu)
Demo 4:
Full set of menus built in the menu editor.
Setting the checkmark: $result:=Check_Refs(MenuBarRef;->SearchedString)
This will allow you to set the checkbox, icon, enable, disable, etc. It is in the demo Database
achimpeshke@de.4d.com
Menus on the Fly:
No difference between menu and menu br
List of entries
Hierarchically
Handle like Hierarchical Lists
Demo 6: Building Menus by Code:
MyCreateMenumethod: Notice that there is o Create menuBar command. Creating the File menuBar is created by calling the Create Menu command and inserting the File, Edit and Customer menus as Menu Items. Cool...
ONCE AGAIN, YOU CAN’T MANipulate the menu items using he item references, gotta use the methd from Demo 5...
Calling the Men bar has changed

As of v11.3 you can switch our meu bar at startup.
Demo 7: Combining Programmed menus with Menus created in the editor.
Associating Menus to Forms.
Dynamic Popup Menus:
- Uses menus created by programming
- Returns the Menu Item Reference
- Methods are Submenu Items Attached ?
Demo 8:
- Customers Output Form method, using the dynamic popup menu command. Very easy & cool.
Dynamic menu Items, when selected, return the Menu line reference. You need to handle the difference in behavior by filtering the called method by setting a flag. (sigh).