Customizing the SAS Windowing Environment |
Introduction to Marks and the Paste Buffer |
The SAS interface to Motif uses the SAS concepts of marks and the paste buffer to provide the normal X Window System cut-and-paste behavior. The mark defines and highlights a region of text. The SAS interface to Motif supports two methods of marking text. The paste buffer retains a collection of text lines. In SAS, you must associate marks with a paste buffer by issuing a command such as STORE or CUT. This is different from other X applications, in which marks and paste are generally synonymous with each other.
The default definitions enable you to cut and paste between the SAS interface to Motif and other X Window clients or between the SAS interface to Motif and the XPRIMARY buffer in OpenVMS.
You can do any of the following tasks with a marked area of text in many SAS windows:
use the text in an application to define a set of values that are operated on by a specified command.
Marking Text |
SAS supports the character mark and the block mark. The behavior of the character mark resembles text marking in most X Window System terminal emulators. The range of the character mark spans whole interior lines between the starting point and the ending point of the marked text. Interior lines are those that are between the lines containing the starting point and the ending point. By contrast, a block mark is a rectangular region that includes one corner at the starting point and one corner at the ending point of the mark.
The MARK command establishes a mode in the SAS window that lasts until you issue another MARK command.
To mark an area of text, complete the following steps:
Position the cursor by clicking at the beginning of the text that you want to mark.
Move the cursor to the end of the text that you want to mark and click.
Issue the MARK command a second time. Before you issue the second MARK command, the end point changes as you move the window's text cursor by using the keyboard arrow keys, tabbing, clicking the mouse, or scrolling through the window's contents. Mark highlighting also changes as you change the cursor position.
You can issue the MARK command from the command line, or you can assign it to a function key. If you want to select a rectangular block of text instead of a string of text, add the BLOCK argument to the MARK command. With the MARK command, you can select more than one area of text in the same window at the same time. To unmark the selected text, issue the UNMARK command.
You can also use the mouse to select text by clicking and dragging the left mouse button inside the SAS window. (The marks that are generated by this method are called drag marks.) You can use keyboard modifiers to change the behavior of the marking. When you end a drag mark by releasing the left mouse button, SAS performs an end-of-mark action that might generate a STORE command to save the contents of the mark into a SAS paste buffer. This feature is controlled by the SAS.markPasteBuffer resource. You can clear marks in a SAS window by clicking the left mouse button inside the SAS window or by starting a new drag mark in the SAS window.
The SAS interface to Motif supports the following mouse button behavior:
makes a SAS character mark starting at the point where the mouse button is pressed and marks an area with the mouse. The area that you mark is highlighted. Release the left mouse button to complete the mark.
Note: Any existing marks in the same window are deleted when you press the left mouse button.
frees existing drag marks in the window except those that were created by the MARK command. You can use the left mouse button to position the text cursor inside a SAS mark.
generates a PASTE command at the location of the click, using the SAS.markPasteBuffer value as the name of the paste buffer if the resource is defined. If SAS.markPasteBuffer is not defined, press the right mouse button to generate a PASTE command with BUFFER=DEFAULT.
There are three modifier keys that can be used with the left mouse button to produce the following results:
The normal end-of-mark action depends on the setting of the SAS.markPasteBuffer resource. If this resource is defined, the normal action is to generate a STORE BUFFER=<name> command to store the newly created mark to the named paste buffer. If this resource is not defined, the normal action is to suppress the generation of the STORE command; the marked area remains highlighted.
Paste Buffers |
SAS paste buffers are named objects that retain a copy of selected text. Each buffer is identified by a name of up to eight characters; the name is not case sensitive. Most commands operating on a SAS paste buffer support the BUFFER= option that enables you to identify the paste buffer. This paste buffer name directs the SAS interface to Motif to interact with the standard X inter-client data exchange mechanisms.
Paste buffers that are not associated with an X inter-client mechanism are called local paste buffers because their contents are known only within the scope of the SAS session. Paste buffers associated with X inter-client data exchange mechanisms are called extended paste buffers.
The SAS interface to Motif enables you to use X cut buffers and X selections to exchange information with other X clients. The paste buffer name determines whether the buffer has extended semantics in the context of the X data exchange mechanisms. The following list describes paste buffer names and their associations:
is the paste buffer associated with the X primary selection (PRIMARY). XPRIMARY is the default buffer. DEFAULT is an alias for XPRIMARY. If you copy or cut text into the XPRIMARY buffer, the text is actually copied or cut into all four of the paste buffers.
is the paste buffer associated with the secondary selection (SECONDARY).
is the paste buffer associated with the clipboard selection (CLIPBOARD). This paste buffer enables you to use the MIT X Consortium xclipboard client with SAS.
is the paste buffer associated with the exchange protocol used by the xterm client.
is the paste buffer associated with the X cut buffer n, where the range of n is 0 to 7.
If you want SAS to automatically copy selected text into your paste buffer every time you mark a region of text with the mouse, you should specify your paste buffer name in the SAS.markPasteBuffer resource. To generate a STORE command every time you mark a region of text with the mouse, define the following X resource for the SAS application:
SAS.markPasteBuffer: XPRIMARY
Because the DEFAULT paste buffer is aliased to XPRIMARY, you could also make the following declaration for SAS.markPasteBuffer to produce the same result:
SAS.markPasteBuffer: DEFAULT
The markPasteBuffer definition causes SAS to automatically issue a STORE command whenever you select text.
The STORE command, as well as the CUT and PASTE commands, support a BUFFER= option that specifies which buffer to use. When these commands are issued from function keys or menus whose definitions do not include the BUFFER= option, if the SAS.markPasteBuffer resource is not defined, these commands use BUFFER=DEFAULT. If this resource is defined, these commands use BUFFER=buffer-name.
You can customize your normal cut, copy, or paste keys to issue any of these commands with the BUFFER= option. For example, you can define a SAS SAS.keyboardTranslations binding for the sas-do-command() action that will be valid for the same set of operations in every SAS window and override the SAS SAS.keyboardTranslations definition for the osfCopy and osfPaste keys with the following specifications:
SAS.keyboardTranslations: #override\ <Key>osfCopy: sas-do-command("STORE BUFFER=XCLIPBRD") \n\ <Key>osfPaste: sas-do-command("PASTE BUFFER=XCLIPBRD")
For more information about customizing keys, see Customizing Key Definitions under OpenVMS.
When you cut or copy and paste text between SAS sessions using the XTERM, XPRIMARY, or XSCNDARY paste buffers, the color and attribute information is preserved. However, if you copy and paste the same text into an xterm window while using the vi editor, the color and attribute information is lost. If you change the definition for SAS.defaultPasteBuffer and SAS.markPasteBuffer to XCUT0, then you will not retain the text and attributes when you copy and paste text between two SAS sessions.
Note: When you use the xclipboard client, SAS text attributes are not preserved in exchanges made between SAS sessions. However, when you use the SAS XCLIPBRD paste buffer without a clipboard manager such as the xclipboard client, SAS text attributes are preserved in exchanges between SAS sessions.
You can use X Window paste buffers and X selections to exchange information with other X Window clients. The SAS paste-buffer interface allows this interaction for all paste-buffer interaction commands and operations. With the SAS interface to Motif, you can use the following paste buffers:
For more information about these paste buffers, see Paste Buffers.If you are not sure which X data exchange protocols your other X clients are using, you should use the XTERM paste buffer. You can specify your default paste buffer with the SAS.defaultPasteBuffer resource:
SAS.defaultPasteBuffer: XTERM
If you know that the X clients in your workstation environment all use the X PRIMARY selections to exchange data, you should use the XPRIMARY paste buffer:
SAS.defaultPasteBuffer: XPRIMARY
This specification uses both SAS and X resources more efficiently and provides for the on-demand transfer of data between clients.
You can also use the SAS XCLIPBRD paste buffer to interact with Motif clients that use the Motif clipboard mechanism for text exchanges. This clipboard mechanism makes it unnecessary to have a dedicated client such as xclipboard. For example, you can use XCLIPBRD to exchange text directly with the Motif xmeditor application when you select the Cut , Copy , or Paste items from the xmeditor Edit menu.
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.