Provided by: ivtools-dev_1.2.11a1-2_amd64 bug


       TextEditor - basic unstructured text editing


       #include <InterViews/texteditor.h>


       A  TextEditor  is  an  interactor  that  provides an interactive interface for simple text
       editing of a TextBuffer.  TextEditor uses an editing  model  based  on  a  single  current
       selection.  Editing operations operate on the text in the selection, alter the position or
       size of the selection, or scroll the display to view other parts of the text.   TextEditor
       interprets a perspective for interactive scrolling using a scroller.

       TextEditor does not provide a default set of keyboard bindings.  You can implement the key
       bindings you desire by subclassing and redefining the  Handle  operation  or  by  handling
       keyboard events in an entirely separate class.


       TextEditor(int rows, int cols, int tabsize, int highlight)
              Create  or  destroy an instance of TextEditor.  The natural size of a TextEditor is
              specified by rows and columns.  The TextEditor will be tall enough to display  rows
              lines  of  text  in the current font, and it will be wide enough to display columns
              characters.  For proportionally-spaced fonts, the width of  the  character  'n'  is
              taken  to  be representative.  Tab characters in the text are expanded to multiples
              of tabsize character widths.  The current selection highlighted with the text style

       void Edit(TextBuffer*, int index = 0)
              Specify  the  text  buffer  to  edit.   A  text buffer must be specified before the
              TextEditor is displayed.   The  optional  index  parameter  specifies  the  initial
              selection  point.   If  necessary, the TextEditor is scrolled so that the selection
              point is visible.

       int Dot()
       int Mark()
              point), dot and mark are equal.

       void InsertText(const char* string, int count)
       void DeleteText(int count)
       void DeleteSelection()
              newly inserted text.  DeleteText deletes count characters  at  dot.   If  count  is
              changing the selection to an insertion point.

       void BackwardCharacter(int count)
       void ForwardCharacter(int count)
       void BackwardLine(int count)
       void ForwardLine(int count)
       void BackwardWord(int count)
       void ForwardWord(int count)
       void BackwardPage(int count)
       void ForwardPage(int count)
              before the beginning of after the end of the text.

       void BeginningOfLine()
       void EndOfLine()
       void BeginningOfWord()
       void EndOfWord()
       void BeginningOfSelection()
       void EndOfSelection()
       void BeginningOfText()
       void EndOfText()

       void ScrollToSelection(boolean always = false)
       void SetScrollAlignment(Alignment)
       Alignment GetScrollAlignment()
              ScrollToSelction  scrolls  the  display  so  that  dot  will be visible.  If dot is
              currently visible and always is false, no scrolling takes  place;  if  dot  is  not
              visible  or  always is true, the display is scrolled so that dot will be positioned
              as  close  as  possible  to   the   position   specified   by   SetScrollAlignment.
              GetScrollAlignment  returns the current scroll alignment.  The default alignment is

       void ScrollToView(Coord x, Coord y)
       void ScrollBy(Coord dx, Coord dy)
              ScrollToView scrolls the display so that the text currently at the position (x,  y)
              will  be  visible.  If the specified point is currently visible, no scrolling takes
              place.  ScrollBy specifies an amount by which  to  scroll  the  display.   Positive
              values  scroll  the  display  upwards  and  to  the right.  In each case, the final
              position of the display is limited so that some text will be visible.

       void GrabScroll(Event&)
       void RateScroll(Event&)
              Initiate grab scrolling or rate scrolling.  Once  called,  GrabScroll  (RateScroll)
              polls  the  current mouse position as long as the middle (right) button is pressed.
              As GrabScroll polls, it scrolls the text to follow the mouse  position,  making  it
              appear  as though the user is dragging the text itself.  Each time RateScroll polls
              the mouse, it scrolls the text by  an  amount  corresponding  to  the  differential
              between  the  current  and initial mouse positions.  This creates the illusion of a
              joystick interface: the further away the mouse is from its  initial  position,  the
              greater  the  scrolling  increment  and  the  faster  the  text  appears to scroll;
              scrolling slows down, stops, and reverses direction as the  user  drags  the  mouse
              back towards and past the initial position.

       void Select(int dot)
       void Select(int dot, int mark)
       void SelectMore(int mark)
       void SelectAll()
              and  mark  can  be  controlled  independently.  SelectMore leaves dot unchanged and

       int Locate(Coord x, Coord y)
              Return the text index most closely matching the point (x, y).


       Interactor(2I), TextBuffer(3I)