This section describes items related to macros.
The table below describes each item on the Macro menu and its corresponding command. For more information about working with macros, see Recorded Macros, Programmable Macros, and the Slick-C® Macro Programming Guide.
|
Macro Menu Item |
Description |
Command |
|---|---|---|
|
Load Module |
Loads a macro source module. |
gui_load |
|
Unload Module |
Unloads a Slick-C macro file from the state file. |
gui_unload |
|
List User-Loaded Macros |
Lists user-loaded Slick-C modules. See Macro Dialogs and Views. |
gui_list_macfiles |
|
Record Macro |
Starts recording a Slick-C language macro. |
record_macro_toggle |
|
Stop Recording Macro |
Stops recording a Slick-C language macro. |
record_macro_toggle |
|
Execute last-macro |
Runs last recorded macro. |
record_macro_end_execute |
|
Save last-macro |
Saves the last recorded macro under a name you specify. See Save Macro Dialog. |
gui_save_macro |
|
List Macros |
Lists saved, recorded macros. See List Macros Dialog. |
list_macros |
|
Set Macro Variable |
Allows you to set global macro variables. See Set Variable Dialog and Variable Editor Dialog. |
gui_set_var |
|
Start Slick-C Debugger |
Activates the Slick-C debugger window. See "Slick-C Debugger" in the Help → Index. |
slickc_debug_start |
|
Go to Slick-C Definition |
Opens a macro source file and places your cursor on the definition of a macro symbol. |
gui_find_proc |
|
Find Slick-C Error |
Places your cursor on the macro source line which caused the last interpreter run-time error. |
find_error |
|
New Form |
Opens a new form for editing with the Dialog editor. |
new_form |
|
Open Form |
Opens an existing or new form for editing with the Dialog editor. |
open_form |
|
Selected Form |
Displays edited form window currently selected. |
show_selected |
|
Load and Run Form |
Loads form, loads Slick-C code, and runs the currently selected/edited form. |
run_selected |
|
Grid |
Sets form grid settings. This affects the distance displayed between the dots on a form that is being edited. See Grid Settings Dialog. |
gui_grid |
|
Menus |
Lists all menus and allows you to edit, create, delete, or show menus. Provides access to the Menu Editor dialog box. See Menu Editor Dialog. |
open_menu |
|
Insert Form or Menu Source |
Inserts source code into current file for a form or menu you specify. |
insert_object |
The User-Loaded Modules dialog is used to view a list of Slick-C® modules that you have loaded. It also lets you add, delete, and re-order modules. See Slick-C® Modules for more information.
To display the dialog, from the main menu, click Macro → List User-Loaded Modules, or, use the gui_list_macfiles command on the SlickEdit® Core command line.

To add a module to the list, double-click where indicated or click the Add button. To remove a module from the list, select it, then click the Delete button. Use the arrow buttons to rearrange the order, moving the selected module up and down in the list. This is the order in which modules are re-loaded when you upgrade to a newer version of SlickEdit Core.
When you add a module to the list, SlickEdit Core prompts to load the module in the editor. When you delete a module from the list, SlickEdit Core prompts to also unload the module. See Loading and Unloading Slick-C Modules for more information.
The Save Macro dialog appears automatically when you end macro recording, or when you click Macro → Save last-macro. You can also display the dialog by using the gui_save_macro command.

The dialog contains the following elements:
Macro Name - Specifies the name for the recorded macro. If you attempt to give the macro a name that is already taken, a message is displayed asking if you want to overwrite the existing macro.
Macro list - The box under the Macro Name field shows a list of all macros you have recorded (if any exist).
Requires editor control - When selected, the macro only operates if the target is an editor control.
Allow in read only mode - When selected, the macro is permitted to operate even in read-only mode. Select this option if your macro does not modify the current buffer.
Allow when window is iconized - When selected, the macro is permitted to operate even when the edit window is iconized. If the macro modifies the current buffer, you may prefer to leave this option off.
Allow in non-MDI editor control - When selected, the macro is permitted to operate even in a non-MDI editor control. This is typical for commands which require an editor control but do not open or close editor windows/buffers.
Save and Bind to Key - Saves the recorded macro by appending the source code of the macro to the vusrmacs.e user macros file located in your configuration directory, then displays the Key Bindings option screen so you can create a keyboard shortcut for the macro. See Binding Recorded Macros to Keys for more information.
Save - Saves the recorded macro by appending the source code of the macro to the vusrmacs.e user macros file located in your configuration directory.
Edit - (Alt+E) Displays the macro source code in a new editor window (to save it, click Macros → Save last-macroorto bind the macro to a key, use the menu item Macro → List Macros). Note that this button is disabled for existing macros because with the Save Macro dialog, you can only edit the macro you have just recorded prior to saving it. To edit a macro that has been previously recorded and saved, use the List Macros dialog. See Saving and Editing Recorded Macros for more information.
Delete - Deletes the selected macro.
The List Macros dialog is used to view and work with a list of macros you have recorded. It is accessed by clicking Macro → List Macros on the main menu, or by using the list_macros command on the SlickEdit® Core command line.

The dialog shows a list of all macros you have recorded. Use the buttons to perform the following operations:
Run - Runs the selected macro. See Running a Recorded Macro for more information.
Cancel - Closes the dialog.
Edit - Opens the macro source for editing. See Saving and Editing Recorded Macros for more information.
Delete - Deletes the selected macro. See Deleting Recorded Macros for more information.
Bind to Key - Displays the Key Bindings option screen so you can assign a key or mouse shortcut to the macro. See Binding Recorded Macros to Keys for more information.
You can set Slick-C® variables to specific values using the Set Variable dialog box (Macro → Set Macro Variable or gui_set_var command).

Enter the name of Slick-C variable in the Variable text field. You may use the spacebar and "?" (completion) to assist you in entering the name. Click the drop-down arrow to select a variable from the list. Enter the new value of the variable in the Value text box and click OK, or click Edit to display the Variable Editor Dialog, used for editing complex variables such as arrays, hash tables, structures, and unions.
The Variable Editor dialog, shown below, is used to edit complex variables for macros. For more information about working with these programmable macros, see Programmable Macros. To access the Variable Editor, click Macro → Set Macro Variable, or use the gui_set_var command, select a variable to edit from the list, then click the Edit button.

The data structure of the variable is displayed in the list box at the top of the dialog, and the value for each entry is displayed in the Value text box.
The following buttons are available:
Expand Curr - Expands current item which has a Plus (+) bitmap.
Delete - Deletes current item.
Format - Allows you to change the type of the current item.
Insert - Inserts a new hash table or array element.
Expand All - Expands all items so you can see the entire data structure.
Collapse All - Display first level of variable with nothing expanded.
Update - Sets the contents of the variable to what is currently displayed in the Variable Editor.
Refresh - Cancels changes and displays current value of variable which is not necessarily the same as when this dialog box was originally displayed.
Squish - Deletes array items which have the value _notinit.
The Grid Settings dialog (Macro → Grid or gui_grid command) is used to set the width and height of grid dots displayed on forms when you use the Dialog Editor. These settings affect the distance between the dots on a form that is being edited.

The width and height parameters are in twips (1440 twips equal one inch on the display).
The Menu Editor dialog, shown below, contains options for editing menus. To access this dialog, click Macro → Menus, select the menu to edit from the list, then click Open.

The following fields and settings are available:
Menu name - Name of the current menu resource. You can define your own menu resource which is used instead of our menu bar WITHOUT changing the name of our default menu bar _mdi_menu. Use the -m invocation option (for example, -m mymenu) or set the def_mdi_menu macro variable to your menu name (see Setting/Changing Configuration Variables).
Caption - Title displayed for the menu item. For menu items, set the caption to "-" to specify a line separator.
Short Cut - Key binding shortcut for the menu item.
Command - Macro command executed when the menu item is selected. This may be an internal macro command or a command line for running an external program.
Alias - Displays the Menu Item Alias dialog box to set an alias for the menu item. See Defining Menu Item Aliases.
Help Cmd - Macro command executed when F1 is pressed when the menu item is selected. Usually it is a help or popup_imessage command. For example, if you specified gui_open as the menu item command, specify "help open dialog box" as the Help item. If you do not know the name of the dialog box displayed, search for Help on the command. The Help for each command should indicate the name of the dialog box displayed. Some commands do not display dialog boxes. For these commands, specify helpcommand where command is name of the command this menu item executes or help xxxx menu where xxxx is the name of the drop-down menu this command is on.
Message - Message text to be displayed when selection cursor is on this menu item. This message is currently only used when the menu is used as the SlickEdit® Core menu bar.
Submenu - Check this box if you want to create a menu which contains other menu items.
Auto Enable - Displays the Auto Enable Properties dialog box to set the properties for the menu item that should be automatically enabled. See Enabling/Disabling Menu Items and Auto Enable Properties Dialog .
Up - Moves the selected menu item above the previous menu item.
Down - Moves the selected menu item below the next menu item.
Next - Selects the menu item after the currently selected menu for editing. Use this button to insert a blank menu item after the last menu item in the list.
Insert - Inserts a blank menu item before the selected menu item.
Delete - Deletes the selected menu item.
This dialog is used to set the auto-enable properties for a menu item. For example, the screen capture below shows the Auto Enable Properties dialog for cut on the _textbox_menu. For more information, see Enabling/Disabling Menu Items. To access this dialog, click the Auto Enable button on the Menu Editor dialog.

The following settings are available:
Requires editor control - Indicates that this command should be enabled only if operating on an editor control.
Allow in read only mode - Indicates that this command should be enabled if the editor control is in strict read only mode.
Allow when window is iconized - Indicates that this command should be enabled if the editor control is an editor window which is iconized.
Requires selection in active buffer - Indicates that this command should be disabled if there is no selection in the active buffer.
Requires Context Tagging® - Indicates that this command should be disabled if Context Tagging does not support the current buffer language type.
Requires fileman mode - Indicates that this command should be disabled if the current buffer is not in Fileman mode.
Requires unicode buffer - Indicates that this command should be disabled if the current buffer is not Unicode.
Allow in non-MDI editor control - Indicates that this command should be allowed in a non-MDI editor control.
Requires block selection - Indicates that this command should be disabled if there is no selection or the current selection is not a type of block or column.
Requires a clipboard - Indicates that this command should be disabled if there is no editor control clipboard available.
Requires a selection - Indicates that this command should be disabled if there is no selection.