NAME
FLTK::TextDisplay -
Description
Functions
append
at
my $chr = $textdisplay->at( $index );
-
Same as
text()[$index]
, but may be faster in plausible implementations. No bounds checking is done.
buffer
$textdisplay->buffer( $buffer );
-
Attach a text buffer to display, replacing the current buffer (if any).
my $buffer = $textdisplay->buffer( );
-
Get the associated text buffer.
cursor_color
my $color = $textdisplay->cursor_color( );
-
Returns cursor color.
$textdisplay->cursor_color( $color );
-
Set cursor color.
cursor_on
cursor_style
find_next_char
my $start = $textdisplay->find_next_char( $position );
-
Finds the start of the next character, starting from
$position
. If$position
points to the start of a character, it is returned. This is mainly used with UTF-8 strings.
find_prev_char
my $start = $textdisplay->find_prev_char( $position );
-
Finds the start of the previous character, starting from
$position
. If$position
points to the start of a character, it is returned. This is mainly used with UTF-8 strings.
hide_cursor
highlight_data
$textdisplay->highlight_data( $styleBuffer, $styleTable, $nStyles, $unfinishedStyle, \&unfinishedHighlightCB, $cbArg );
-
Attach (or remove) highlight information in text display and redisplay. Highlighting information consists of a style buffer which parallels the normal text buffer, but codes font and color information for the display; a style table which translates style buffer codes (indexed by buffer character - 'A') into fonts and colors; and a callback mechanism for as-needed highlighting, triggered by a style buffer entry of "unfinishedStyle". Style buffer can trigger additional redisplay during a normal buffer modification if the buffer contains a primary TextSelection.
Style buffers, tables and their associated memory are managed by the caller.
hor_offset
in_selection
my $inside = $textdisplay->in_selection( $X, $Y );
-
Returns a true value if position
($X, $Y)
is inside of the primary TextSelection.
insert
insert_position
$textdisplay->insert_position( $newPos );
-
Set new cursor position.
my $currentPos = $textdisplay->insert_position( );
-
Get current cursor position.
line_end
my $end = $textdisplay->line_end( $position, $start_pos_is_line_start );
-
Returns the end of the line where
$position
is located.
line_start
my $start = $textdisplay->line_start( $position );
-
Returns the beginning of the line where
$position
is located.
linenumber_width
$textdisplay->linenumber_width( $width );
-
Set line number area width.
my $width = $textdisplay->linenumber_width( );
-
Returns line number area width.
move_down
move_left
move_right
move_up
new
my $group = $textdisplay->new( $x, $y, $w, $h, $label );
-
Creates a new TextDisplay widget using the given position, size, and label string.
next_word
overstrike
position_to_xy
my $in_range = $textdisplay->position_to_xy( $position, $X, $Y );
-
Translates a buffer text position to the
XY
location where the top left of the cursor would be positioned to point to that character. Returns0
if the position is not displayed because it is vertically outof view. If the position is horizontally out of view, returns theX
coordinate where the position would be if it were visible.
redisplay_range
scroll
show_cursor
show_insert_position
size
my $length = $textdisplay->size( );
-
Returns the number of characters in
text()
. This may be greater thanlength($input->text())
if there areNULL
characters in it.
static_text
my $ret = $textdisplay->static_text( $string );
-
Same as
text($string)
, except it does not copy the string, instead it makestext()
return a pointer to$string
.$string
must point to static memory that will not be altered until at least the TextDisplay widget is destroyed or thetext()
is changed again. If the user attempts to edit the string it is then copied to the internal buffer and the editing done there. This can save a lot of time and memory if your program is changing the string to various constants a lot but the user rarely edits it.
text
my $string = $textdisplay->text( );
-
The current string, as edited by the user.
size()
returns how many bytes are in the string. $textdisplay->text( $string );
-
Set the text.
top_line
total_lines
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 349:
Unknown directive: =cor
- Around line 510:
=over without closing =back