NAME

TUI::MsgBox::MsgBoxText - message box and input box helper functions

SYNOPSIS

use TUI::MsgBox::MsgBoxText;

my $cmd = inputBox(
  'The Title',
  'Enter some text:',
  $string,
  30
);

my $cmd = messageBox(
  'Problem renaming %s',
  mfError | mfOkButton | mfCancelButton,
  $fileName
);

DESCRIPTION

TUI::MsgBox::MsgBoxText provides a set of convenience functions for displaying simple message boxes and input dialogs in TUI::Vision applications.

This module implements functional equivalents of the Turbo Vision inputBox, messageBox, and related helper routines found in the original demo sources.

All functions in this module are implemented as plain subroutines. No objects are created or required.

These functions may only be used within a running TUI::Vision application.

VARIABLES

The following global variables define the default text labels used by message boxes.

$yesText

Label text for the affirmative response button.

$noText

Label text for the negative response button.

$okText

Label text for the confirmation button.

$cancelText

Label text for the cancel action.

$warningText

Title text used for warning message boxes.

$errorText

Title text used for error message boxes.

$informationText

Title text used for informational message boxes.

$confirmText

Title text used for confirmation message boxes.

FUNCTIONS

inputBox

my $command = inputBox($title, $label, $string, $limit);

Displays a modal dialog containing a single input field.

title

Dialog window title (Str).

label

Prompt text displayed next to the input field (Str).

string

Initial value of the input field. The value may be modified by the user.

limit

Maximum length of the input string (Int).

Returns either cmOk or cmCancel depending on user selection.

inputBoxRect

my $command = inputBoxRect($bounds, $title, $label, \$string, $limit);

Identical to inputBox, but allows explicit control over dialog position and size.

bounds

Bounding rectangle of the dialog (TRect).

title

Dialog window title (Str).

label

Prompt text displayed next to the input field (Str).

string

Scalar reference receiving the edited text.

limit

Maximum length of the input string (Int).

Returns either cmOk or cmCancel.

messageBox

my $command = messageBox($message, $options, @params);

Displays a formatted message box with configurable buttons and style.

The message string and optional parameters are formatted using TUI::Vision formatting rules.

message

Message format string (Str).

options

Bitmask selecting message type and button layout (Int).

params

Optional parameters inserted into the message string.

Returns one of cmOk, cmCancel, cmYes, or cmNo.

messageBoxRect

my $command = messageBoxRect($bounds, $message, $options, @params);

Identical to messageBox, but allows explicit control over dialog position and size.

bounds

Bounding rectangle of the message box (TRect).

message

Message format string (Str).

options

Bitmask selecting message type and button layout (Int).

params

Optional parameters inserted into the message string.

Returns one of cmOk, cmCancel, cmYes, or cmNo.

MESSAGE BOX OPTIONS

Message box appearance and buttons are controlled via option flags.

Message types:

  • mfWarning

  • mfError

  • mfInformation

  • mfConfirmation

Button flags:

  • mfYesButton

  • mfNoButton

  • mfOkButton

  • mfCancelButton

  • mfYesNoCancel

  • mfOkCancel

IMPORTANT

These functions require a running TUI::Vision application environment. They must not be used outside of a TUI::Vision program.

SEE ALSO

TUI::Dialogs::Dialog, TUI::Dialogs::StaticText, TUI::Dialogs::InputLine

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).