TEACH XVED                                      Jonathan Meyer, Apr 1991
                                        Updated: Adrian Howard, Jan 1992

This tutorial should help you to get started using the XVed editor,  and
give you some pointers into the VED and XVed documentation.

         CONTENTS - (Use <ENTER> g to access required sections)

 -- Loading XVed
 -- How To Navigate This File
 -- Overview Of Features
 -- Things To Try
 -- ... Window Settings
 -- ... Global Settings
 -- ... Using The Mouse
 -- ... Drag And Drop
 -- Further Reading


-- Loading XVed -------------------------------------------------------

If you are not already running XVed you should exit Poplog and do the
following:

    % pop11

    Setpop
    : uses xved;    ;;; this may take some time
    : xvedsetup();
    : teach xved    ;;; return to this file.

If this doesn't work, try reading HELP *XVED and HELP *VEDTOXVED.


-- How To Navigate This File ------------------------------------------

If this window has  a scrollbar on its left or right hand side, you can
scroll this file by  selecting and dragging the scrollbar using the
pointer.

If this window does not have a scrollbar, you can still scroll using the
pointer by dragging the cursor by pressing the <Ctrl> key with the third
pointer button held down. Dragging the cursor outside the window will
scroll text in the window.

A third way of scrolling the text is by "clicking" the first most button
rapidly twice, holding the button down at the end of the second click.
Keeping the first button held while moving the mouse up and down will
scroll the file.

Clicking is the process of rapidly pressing and releasing a mouse
button, so the sequence of clicks to scroll the window is:

    i)      Button 1 down
    ii)     Button 1 up
    iii)    Button 1 down and hold

This sequence has to be performed quickly, otherwise different XVed
operations are invoked.

Alternatively, the four cursor keys (usually marked with arrows) will
move the text cursor in the appropriate directions as in normal terminal
VED.


-- Overview Of Features -----------------------------------------------

XVed is a full line-based editor for X Windows. It has many features and
options, most of which you can customise. XVed is itself built over a
sophisticated programmable editor called VED.

Some of the important features of XVed, that are not available in non-X
versions of VED, include:

    o Motif or OpenLook menus, dialogs and scrollbars (when available)

    o Support for interaction via the X pointer, or "mouse"

    o A high level of customisation for fonts, colours and other
      aspects of XVed windows.

    o Interclient communication via the familiar cut-copy-paste
      facilities found in most X applications

    o Interaction with OpenWindows using Drag-And-Drop for files
      and selections

This document acts as a starting point to learning about VED and XVed.
It suggests different approaches to the documentation suitable for
different kinds of users.


-- Things To Try ------------------------------------------------------

The rest of this file contains examples of commands that you can execute
in the XVed environment.


-- ... Window Settings ------------------------------------------------

If you have a colour X display, try:

    <ENTER> window foreground pink background black <RETURN>

    <ENTER> window statusBackground blue <RETURN>

This will change the colours of the main window and the status line.


All X displays will let you change the shape of the mouse pointer to any
of the standard X cursors. For example:

    <ENTER> window pointerShape gumby <RETURN>


To enlarge the size of the window, you can use:

    <ESCAPE> w

Repeating this will restore the window to its normal size.


You can also change the font used in an XVed window:

    <ENTER> window font 9x15 <RETURN>

    <ENTER> window font 6x13 <RETURN>


See HELP *VED_WINDOW for more information on window settings.


To close the window into an icon, you can do:

    <ENTER> window iconic true <RETURN>

If you have lots of VED buffers open, use:

    <ENTER> closeall <RETURN>

to iconify all of the windows.


-- ... Global Settings ------------------------------------------------

XVed has several global "application" settings. The <ENTER> xved command
will let you set these values.

To print out the current value of the AutoCut setting, do:

    <ENTER> xved AutoCut ? <RETURN>

Set mouse pointer warping on by doing:

    <ENTER> xved WarpPointer true <RETURN>

Make windows get placed automatically by doing:

    <ENTER> xved AutoWindowPlacement true <RETURN>

After modifying  these values,  you  can save  them into  your  resource
database so that they will  be present the next  time you use XVed.  See
REF *XVED for more information.


-- ... Using The Mouse ------------------------------------------------

To point to anything in the document, just place the mouse pointer over
the place where you wish to go and click the leftmost mouse button.
Clicking like this on the VED status line will switch you onto the
status line.

Selecting text with the mouse is easy. Press and hold the leftmost mouse
button while the pointer is within the VED window. Then start dragging
the mouse up or down. Text will appear in a highlighted colour.

Once you have highlighted some text, you can use the <META> modifier
(sometimes labeled "Left" or "Alt" --- the diamond shapes next to the
spacebar on Sun4 keyboards) in conjunction with a letter key to perform
operations to the selection.

Hold down the <META> key and press one try one of the following:

    <META> x        Cuts the text from the document
    <META> c        Copies the text to the clipboard
    <META> v        Pastes the last thing placed on the clipboard

    <META> d        Compiles the selected text
    <META> h        Gets help on the selected text

Note that you can paste text in from other programs as well. The <META>
v key will paste the current value of the clipboard into your document,
or onto the status line, no matter which program actually "owns" the
selection.

Try selecting some text from you terminal emulator window and then
pasting this into an XVed buffer.

For users familiar with VED, you can also mark ranges using the mouse.
Press and hold the <CONTROL> key (sometimes labeled "ctrl")  and then
drag the mouse with the leftmost mouse button pressed.

With the <SHIFT> modifier held down, you can you the left and right
mouse buttons (button 1 and button 3) to change the left and right text
margins of the document. Try holding the <SHIFT> key down whilst
dragging the left or right mouse buttons in a VED window.

You can scroll anywhere in a document just using the mouse. Pressing the
<CONTROL> key with the third mouse button will put you into scrolling
mode - you can then drag the pointer anywhere and the VED cursor will
follow.


-- ... Drag And Drop --------------------------------------------------

OpenWindows users can try the following.

Open the filemanager and select a file. Then drag it and drop it either
onto an XVed icon or an XVed buffer. If the file is a readable text
file, a new buffer appears with the contents of the file.

From the mailtool, you can select a mail message, and then drag this
onto VED. If you don't push the <CONTROL> key whilst doing this drag
operation, you will move the mail message from the mailtool into a VED
buffer. With the control key you will get a copy of the mail message in
a VED buffer.

You can also select and drag-and-drop textual selections from eg. the
textedit and cmndtool programs.


-- Further Reading ----------------------------------------------------

If you have not used VED before, you should start by reading:

    TEACH *TEACH    - How to read POPLOG TEACH files
    TEACH *VED      - Introduction to VED

    HELP  *VED      - Overview of the VED editor.

To access these files, move the text cursor over the '*' character shown
above, and press the key marked 'Esc' or 'Escape' followed by the letter
'h'. These files suggest further reading that may interest you.


If you are familiar with VED, but have not used XVed, you should read:

    HELP *XVEDMOUSE - Overview of mouse interaction library
    HELP *XVEDKEYS  - Overview of keyboard bindings

    HELP *VED_XVED
    HELP *VED_WINDOW - Simple interfaces to modifying XVed window
                       attributes


If you are currently a PWM VED user, you might also like to read:

    HELP *PWMTOXVED - Similarities and differences between XVed and PWM


If you are converting VED or PWM programs to XVed, you should read:

    HELP *VEDTOXVED - Converting programs to run under XVed

    REF *VEDVARS/vedusewindows - Variable that can be used to ascertain
        which version of VED is being used.


Finally, if you want more detailed information, read:

    REF *XVED - Details of the XVed system


--- C.x/x/ved/teach/xved ---------------------------------------------
--- Copyright University of Sussex 1991. All rights reserved. ----------
