Customizing the User Interface

From SecureCRT

A session is a set of options that are assigned to a connection to a remote machine. These settings and options are saved under a session name and allow the user to have different preferences for different hosts.

Telnet is a protocol that provides an interface for communications between clients and servers.

To close a Telnet, SSH, or other type of communication connection between a client and a server.


SecureCRT allows you to customize some parts of its user interface in two different ways: either by using the Customize dialog, or by editing the menu configuration file (described below). Using either of these methods, you can modify or remove existing menus, rearrange the main toolbar buttons, and much more, however, you must choose one or the other method, as they cannot be used together.

Customizing the Menu Configuration File

WARNING: Customizing the SecureCRT interface by editing the menu configuration file can be a complex undertaking. Some programming knowledge will be helpful.

The customizable interface features are listed below:

·    Menu titles on the main window

·    Menu options on the main window menus, the System menu, and right-click menus

·    Accelerators

·    Toolbar buttons

·    ToolTips

·    Status bar messages

To make changes to the items mentioned above, you will need to edit the SecureCRT menu configuration file found in the SecureCRT data folder. The default configuration file is Default.mnu, but other files can be used by changing the file specified in the Custom menu and toolbar file option in the Terminal category of the Global Options dialog.

Tip: To return SecureCRT to its default configuration, either delete any existing configuration files or clear the entry in the Custom menu and toolbar file entry box, and restart SecureCRT. This will force SecureCRT to return to default values.

Configuration File Format

This section covers the format and syntax of the menu and toolbar configuration file. The precedence for accelerator keys is F-Keys, Keymap, MenuItem, built in.

File format rules

The fields in a definition will be separated by a comma. Command arguments will be separated by a vertical bar or pipe (|).

Accelerator definitions will start with a unique string identifier. They will not contain a field for the command ID string, as that already exists in the associated menu or toolbar item definition.

String table definitions will start with a unique string identifier. They will not contain a field for the command ID string as that is already exists in the associated menu or toolbar item definition.

Accelerator and string table definitions must appear in the file before any menu or toolbar definitions.

Command strings

The SecureCRT menu configuration file supports command strings for most of the application commands. See the Menu Configuration Command Strings topic for a comprehensive list.

In addition to standard menu and toolbar commands, three user-defined commands are also available:

·    OPEN_SESSION -- This command connects you to the specified session.

·    OPEN_SESSION_TAB -- This command connects you to the specified session in a tab.

·    RUN -- This command runs the specified script. This command does not support arguments.

·    SEND -- This command sends the specified string.

The above command strings can be used as in the following examples extracted from the example file at the end of this topic:

TOOLBARITEM "server.bmp", "OPEN_SESSION", "server", "server", "server"

TOOLBARITEM "run.bmp", "RUN", "C:\vss\test.vbs", "script"

TOOLBARITEM "send.bmp", "SEND", "Hello World\n", "hello"

Keywords and syntax

Items enclosed in angle brackets (<>) are required. Items enclosed in square brackets ([]) are optional.

END ( ends a definition of a menu, toolbar, popup menu, accelerator keys, or string table)

MENU ( for main menu definitions )

MENU <“label”>
<definition of menu items or submenus>
END

TOOLBAR ( for toolbar definitions )

TOOLBAR <“label”>
<definition of buttons in the toolbar>
END

POPUPMENU ( for context and system menu as well as sub-menus )

POPUPMENU <”label”>
<definition of menu items or submenus>
END

ACCELERATOR ( for the definition of accelerator keys)

ACCELERATOR
<definition of accelerator keys>
END

An accelerator key definition is of the form:

<”unique_identifier”>,<”key”>,<”key modifiers separated by ‘|’ ”>

STRINGTABLE ( for the definition of status bar and ToolTip strings)

STRINGTABLE
<definition of status bar and tooltip strings>
END

A string table definition is of the form:

<”unique_identifier”>,<”status bar message\ntooltip”>

SEPARATOR ( indicates that a separator should be placed in the menu or toolbar )

MENUITEM ( designates that the following text defines a menu item )

MENUITEM <”label”>,<”command str”>[,” command argument(s)”][,”string table identifier”][,”accelerator identifier”]

TOOLBARITEM ( designates that the following text defines a toolbar button)

TOOLBARITEM <”icon”>,<”command str”>[,”command argument(s)”][,”string table identifier”][,”accelerator identifier”]

// (designates a comment)

// [comment string]

Any line that has // as the first two characters will be considered as a comment. Comments must be on a line by themselves.

For MENUITEM, the “label” and “command str” are required. The remaining arguments are optional. However, order is important. If an optional argument is not provided and it is followed by an argument that is provided, the argument separator (,) must be included. For example:

MENUITEM &MyItem,MY_MENU_COMMAND,, ”This is my menu item”

The above arguments are: <”label”>,<”command str”>, ,<”stringtable identifier”>

For TOOLBARITEM, one of “icon” and “command str” is required. Again order is important and skipped arguments must have the argument separator included.

Errors and warnings

When an error condition occurs, you will be informed about the nature of the error and that the default menu or toolbar will be loaded and displayed.

When a warning condition occurs, you will be informed about what caused the warning condition and that the particular menu or toolbar item, accelerator, or hint will not be used. However, those parts of the menu or toolbar that are correct will be loaded and displayed.

Example file

The following is an example menu and toolbar configuration file.

// accelerator table

ACCELERATOR

"server", "S", "VIRTKEY | CTRL | SHIFT"

"linuxR", "L", "VIRTKEY | CTRL| SHIFT"

"swcp", "W", "VIRTKEY| CTRL| SHIFT"

"linuxT", "A", "VIRTKEY| CTRL| SHIFT"

END

 

// stringtable for status bar and tooltips

STRINGTABLE

"server", "Connect to session server\nserver"

"linuxR", "Connect to Linux using rlogin\nrlogin linux"

"linuxT", "Connect to Linux using telnet\ntelnet linux"

"swcp", "Connect to Southwest Cyberport\nSWCP"

"script", "Run my vbs script\ntest.vbs"

"hello", "Send 'Hello World'\nHello World"

END

 

// main menu

MENU "[main]"

POPUPMENU "&File"

MENUITEM "&Connect ", "MENU_CONNECT"

MENUITEM "&Quick Connect...", "MENU_QUICK_CONNECT"

MENUITEM "&Disconnect", "MENU_DISCONNECT"

MENUITEM "&Reconnect", "MENU_RECONNECT"

SEPARATOR

POPUPMENU "&Printing"

MENUITEM "&Auto Print ", "MENU_PRINT_AUTO"

MENUITEM "&Screen", "MENU_PRINT_SCREEN"

MENUITEM "Se&lection", "MENU_PRINT_SELECTION"

MENUITEM "&Eject page", "MENU_PRINT_EJECT_PAGE"

MENUITEM "&Cancel", "MENU_PRINT_CANCEL"

END

MENUITEM "Print Set&up...", "MENU_PRINT_SETUP"

SEPARATOR

MENUITEM "&Log Session", "MENU_LOG_SESSION"

MENUITEM "&Raw Log Session", "MENU_DEBUG_LOG"

MENUITEM "&Trace Options", "MENU_TRACE_OPTIONS"

SEPARATOR

MENUITEM "Most Recent", "MENU_MRU_FILE1"

SEPARATOR

MENUITEM "&Load Default", "TOOLS_LOAD_DEFAULT_MAIN_MENU"

MENUITEM "E&xit", "MENU_EXIT"

END

 

// this is a stand alone menu item that has no submenus

MENUITEM "&Load Default", "TOOLS_LOAD_DEFAULT_MAIN_MENU"

 

POPUPMENU "&Options"

MENUITEM "&Session Options...", "MENU_SESSION_OPTIONS"

MENUITEM "&Global Options...", "MENU_GLOBAL_OPTIONS"

SEPARATOR

MENUITEM "&Auto Save Options", "MENU_AUTO_SAVE"

MENUITEM "Save Settings &Now", "MENU_SAVE_NOW"

END

 

POPUPMENU "&Sessions"

MENUITEM "&server", "OPEN_SESSION", "server|/POS 100 100", "server", "server"

MENUITEM "linux &rlogin", "OPEN_SESSION", "linux rlogin", "linuxR", "linuxR"

MENUITEM "linux &telnet", "OPEN_SESSION", "linux", "linuxT", "linuxT"

MENUITEM "&SWCP", "OPEN_SESSION", "swcp-ssh2", "swcp", "swcp"

MENUITEM "&Run script", "RUN", "C:\vss\test.vbs", "script"

MENUITEM "S&end String", "SEND", "Hello World\n", "hello"

END

END

 

POPUPMENU "[context]"

MENUITEM "&Load Default", "TOOLS_LOAD_DEFAULT_CONTEXT_MENU"

MENUITEM "&server", "OPEN_SESSION", "server| /POS 150 150", "server", "server"

MENUITEM "linux &rlogin", "OPEN_SESSION", "linux rlogin", "linuxR", "linuxR"

MENUITEM "linux &telnet", "OPEN_SESSION", "linux", "linuxT"

MENUITEM "&SWCP", "OPEN_SESSION", "swcp-ssh2", "swcp", "swcp"

END

 

POPUPMENU "[system]"

MENUITEM "&Connect", "MENU_CONNECT"

SEPARATOR

MENUITEM "&Restore", "SYS_MENU_RESTORE"

MENUITEM "&Move", "SYS_MENU_MOVE"

MENUITEM "&Size", "SYS_MENU_SIZE"

MENUITEM "&Mi&nimize", "SYS_MENU_MINIMIZE"

MENUITEM "&Ma&ximize", "SYS_MENU_MAXIMIZE"

MENUITEM "&Close", "SYS_MENU_CLOSE"

SEPARATOR

MENUITEM "&Load Default", "TOOLS_LOAD_DEFAULT_SYS_MENU"

SEPARATOR

POPUPMENU "&Sessions"

MENUITEM "&server", "OPEN_SESSION", "server | /POS 200 200", "server", "server"

MENUITEM "linux &rlogin", "OPEN_SESSION", "linux rlogin", "linuxR", "linuxR"

MENUITEM "linux &telnet", "OPEN_SESSION", "linux", "linuxT"

MENUITEM "&SWCP", "OPEN_SESSION", "swcp-ssh2", "swcp", "swcp"

END

END

 

// the toolbar

// Note: the Connect, Quick Connect, and Help buttons use the built-in icon

TOOLBAR "[toolbar]"

TOOLBARITEM "MENU_CONNECT", "MENU_CONNECT"

TOOLBARITEM "MENU_QUICK_CONNECT", "MENU_QUICK_CONNECT"

SEPARATOR

TOOLBARITEM "server.bmp", "OPEN_SESSION", "server", "server", "server"

TOOLBARITEM "linux1.bmp", "OPEN_SESSION", "linux", "linuxT", "linuxT"

TOOLBARITEM "swcp.bmp", "OPEN_SESSION", "swcp-ssh2", "swcp", "swcp"

TOOLBARITEM "run.bmp", "RUN", "C:\vss\test.vbs", "script"

TOOLBARITEM "send.bmp", "SEND", "Hello World\n", "hello"

SEPARATOR

TOOLBARITEM "MENU_HELP_FINDER", "MENU_HELP_FINDER"

END