NAME
TUI::Editors::Indicator - indicator which displays the editor cursor position
HIERARCHY
TObject
TView
TIndicator
SYNOPSIS
use TUI::Objects;
use TUI::Editors;
use TUI::toolkit;
my $indicator = new_TIndicator( $bounds );
$indicator->setValue( TPoint->new(), false );
DESCRIPTION
TIndicator is a one-line view that displays the current cursor position of an editor as line:column (both one-based). If the editor contents have been modified, a modification marker is shown at the left edge of the view.
While the owning view is being dragged, the frame at the left edge is drawn with a different glyph and color, as in the original Turbo Vision indicator.
The view grows vertically with its owner's bottom edge, so it keeps its height when the owner is resized.
ATTRIBUTES
location
Current cursor position (TPoint).
modified
Indicates whether the editor contents have been modified (Bool).
CONSTRUCTOR
new
my $view = TIndicator->new(
bounds => $bounds
);
Creates a new indicator view with the cursor at position 0,0 and the modified flag cleared.
- bounds
-
Bounding rectangle defining the position and size of the view (TRect).
new_TIndicator
my $view = new_TIndicator($bounds);
Factory-style constructor using positional arguments.
METHODS
draw
$view->draw();
Renders the frame, the modification marker and the cursor position.
getPalette
my $palette = $view->getPalette();
Returns the palette used by the indicator (TPalette).
setState
$view->setState( $aState, $enable );
Calls the inherited setState and redraws the view when sfDragging is set or cleared.
setValue
$view->setValue( $aLocation, $aModified );
Updates the displayed cursor position and modified flag. The view is redrawn only if one of them has changed.
- aLocation
-
The cursor position as TPoint, zero-based.
- aModified
-
True if the editor contents have been modified.
SEE ALSO
AUTHORS
Borland International (original Turbo Vision design)
J. Schneider <brickpool@cpan.org> (Perl implementation and maintenance)
COPYRIGHT AND LICENSE
Copyright (c) 1990-1994, 1997 by Borland International
Copyright (c) 2026 the "AUTHORS" as listed above.
This software is licensed under the MIT license (see the LICENSE file, which is part of the distribution).