Physical Layout of Menu Slots
You have probably noticed that, with only a few exceptions, all your screen menus have a similar layout of rows and columns. This is because most of the menus use the same "template". This template is created using a macro called Layout_body_1. This macro is used for example to define the layout of the Sm_create_1 menu:
DEFINE Layout_body_1
Headline_height ' | | | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Text_slot_height ' | '
Bottom_slot_height ' | | | '
Bottom_slot_height ' | | | '
END_DEFINE
Here is an explanation of the variables used in the above macro:
• Headline_height
The height of the menu title slot.
• Text_slot_height
The height of the slots containing the display text.
• Bottom_slot_height
The height of the small boxes at the bottom of each menu.
The slot height values are calculated during startup. This allows the menu size to be adapted to suit the window or display size on which Creo Elements/Direct Drafting was started. The values are defined in the hp_macro.m file. These definitions can be used as examples of how the slot sizes can be made self-adapting for different window or display sizes.
This templete macro is used in the following macro, which defines the CREATE 1 menu layout:
DEFINE Sm_create_1_layout
CURRENT_MENU 'Sm_create_1'
CURRENT_SCREEN 1
MENU_LAYOUT Menu_position RIGHT
Layout_body_1
Menu_home_point_top
END
MENU_STATUS ENABLE_INQ
LET Sm_create_1_layout_name 'Sm_create_1'
END_DEFINE
Here is an explanation of the variables used in the above macro:
• CURRENT_MENU 'Sm_create_1'
This sets the name for the CREATE 1 menu layout to Sm_create_1.
• CURRENT_SCREEN 1
This ensures that even in a dual screen environment the menu will be placed on the first screen.
• MENU_LAYOUT
The MENU_LAYOUT command causes the menu to be displayed at the right of the screen. The MENU_LAYOUT command is terminated by END.
• Menu_position
A macro containing the qualifier LOWER. This can be set to UPPER if required.
• Layout_body_1
This line calls the macro Layout_body_1.
• Menu_home_point_top
Moves the menu to the correct position on the screen. This position is calculated according to the Menu_position macro and user interface version (screen-only).
• MENU_STATUS ENABLE_INQ
This removes the inquiry protection from the menu.
• LET Sm_create_1_layout_name 'Sm_create_1'
The CREATE 1 menu does not use the layout name directly. To activate its layout the Sm_create_1_layout_name variable is used. Therefore Sm_create_1_layout_name has to be defined here to the correct string. This is usefull for deferring the actual generation of the menu layout until the menu is requested the first time. Until the first request, Sm_create_1_layout_name will define the macro name that generates the layout.