NAME
TFrame - frame class for window components in Turbo Vision
HIERARCHY
TObject
TView
TFrame
SYNOPSIS
use TUI::Views;
my $frame = TFrame->new(bounds => $bounds);
$frame->draw();
DESCRIPTION
TFrame implements the visual border that surrounds a window. It is responsible for drawing the window frame, including the title, border lines, and standard window icons such as close, zoom, and resize indicators.
Frame objects are normally created and managed automatically by TWindow. Applications rarely instantiate TFrame directly and typically do not interact with it except through subclassing or customization hooks provided by the window.
To customize the appearance of a window frame, applications override TWindow::initFrame to instantiate a TFrame-derived object with modified behavior, such as a different color palette.
VARIABLES
The following global variables define the visual appearance and behavior of TFrame.
$initFrame
Initial frame definition table used to map frame styles and states.
$frameChars
Character set used to draw frame borders. The default value uses CP437 line-drawing characters.
$closeIcon
Icon text used for the close window command.
$zoomIcon
Icon text used for the zoom window command.
$unZoomIcon
Icon text used for the unzoom window command.
$dragIcon
Icon text used to indicate window dragging (CP437).
CONSTRUCTOR
new
my $frame = TFrame->new(bounds => $bounds);
Creates a new frame object with the specified bounds. This constructor is normally called internally by TWindow::initFrame.
- bounds
-
Bounding rectangle of the frame (TRect).
new_TFrame
my $frame = new_TFrame($bounds);
Factory-style constructor using positional arguments.
This constructor is equivalent to calling new with the bounds parameter and is provided for compatibility with traditional Turbo Vision construction patterns.
METHODS
draw
$self->draw();
Draws the frame, including the window title and any enabled window icons. The exact appearance depends on the current view state flags.
getPalette
my $palette = $self->getPalette();
Returns the color palette used to draw the frame. The default implementation returns the standard frame palette.
To customize frame colors, override TWindow::initFrame to create a TFrame-derived object that overrides this method.
handleEvent
$self->handleEvent($event);
Handles events directed at the frame. This method delegates general event processing to TView::handleEvent and processes events related to frame icons such as close or zoom.
setState
$self->setState($state, $enable);
Updates the frame state. After delegating to TView::setState, the frame is redrawn if the active or dragging state changes.
dragWindow
$self->dragWindow($event, $mode);
Handles interactive dragging of the owning window using the mouse.
SEE ALSO
TUI::Views::Window, TUI::Views::View
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) 2021-2026 the "AUTHORS" as listed above.
This software is licensed under the MIT license (see the LICENSE file, which is part of the distribution). This documentation is provided under the same terms as the Turbo Vision library itself.