{***********************************************************************}
{									}
{ __FastTWin  Place a title on a window border				}
{									}
{ procedure __FastTWin(WinPtr : _WindowPtr);				}
{									}
{	    WinPtr	Pointer to window descriptor.  The title is	}
{			is placed on the border of the specified window.}
{									}
{ Description This procedure is called by __DispWin and __TitleWin to	}
{	      place a string on the border of the window specified by	}
{	      the window pointer.  __FastScn is used to write to the	}
{	      window.  __FastTWin assumes that the window exists and	}
{	      that it is current (both __DispWin and __TitleWin) check	}
{	      this.  Finally, __FastTWin is an internal procedure and	}
{	      is only called by __DispWin and __TitleWin.		}
{									}
{ Version     4.00 (C)Copyright Blaise Computing Inc.  1987		}
{_______________________________________________________________________}

procedure __FastTWin(WinPtr : _WindowPtr);

  var
    Cols,X,Y : byte;
    TitleLen : byte;

  begin {__FastTWin}

    with WinPtr^ do
      begin
	Cols	 := _Dim._XLower - _Dim._XUpper + 1;
	TitleLen := Length(_Title._TitleStr);
	if (TitleLen > Cols) then
	   TitleLen := Cols;

	case _Title._TitlePos of
	  _TopCenter:
	       begin
		 X := _Dim._XUpper + ( Cols - TitleLen) div 2;
		 Y := _Dim._YUpper - 1;
	       end;
	  _TopRight:
	       begin
		 X := _Dim._XUpper + (Cols - TitleLen);
		 Y := _Dim._YUpper - 1;
	       end;
	  _TopLeft:
	       begin
		 X := _Dim._XUpper;
		 Y := _Dim._YUpper - 1;
	       end;
	  _BottomCenter:
	       begin
		 X := _Dim._XUpper + ( Cols - TitleLen) div 2;
		 Y := _Dim._YLower + 1;
	       end;
	  _BottomRight:
	       begin
		 X := _Dim._XUpper + (Cols - TitleLen);
		 Y := _Dim._YLower + 1;
	       end;
	  _BottomLeft:
	       begin
		 X := _Dim._XUpper;
		 Y := _Dim._YLower + 1;
	       end;
	end; {case _Title._TitlePos}

	__FastScn(X,Y,@_Title._TitleStr[1],TitleLen,
					 _Title._TFore,_Title._TBack,1);
      end

end; {__FastTWin}
