2001-11-28 23:43:44 +03:00
|
|
|
<HTML>
|
2006-10-29 17:16:03 +03:00
|
|
|
<HEAD>
|
|
|
|
<TITLE>Fl_Text_Display</TITLE>
|
|
|
|
</HEAD>
|
2001-11-28 23:43:44 +03:00
|
|
|
<BODY>
|
|
|
|
|
2001-11-28 21:00:17 +03:00
|
|
|
<!-- NEW PAGE -->
|
2001-11-28 23:43:44 +03:00
|
|
|
|
2001-12-03 21:29:49 +03:00
|
|
|
<H2><A name="Fl_Text_Display">class Fl_Text_Display</A></H2>
|
2001-11-28 23:43:44 +03:00
|
|
|
|
2001-11-27 05:09:45 +03:00
|
|
|
<HR>
|
2001-11-28 23:43:44 +03:00
|
|
|
|
2001-11-27 05:09:45 +03:00
|
|
|
<H3>Class Hierarchy</H3>
|
2001-11-28 23:43:44 +03:00
|
|
|
|
2001-11-27 05:09:45 +03:00
|
|
|
<UL>
|
|
|
|
<PRE>
|
2001-11-28 23:43:44 +03:00
|
|
|
<A href="Fl_Group.html">Fl_Group</A>
|
2001-11-27 05:09:45 +03:00
|
|
|
|
|
2001-11-28 23:43:44 +03:00
|
|
|
+----<B>Fl_Text_Display</B>----<A HREF="Fl_Text_Buffer.html">Fl_Text_Buffer</A>
|
2001-11-27 05:09:45 +03:00
|
|
|
|
|
2001-11-28 23:43:44 +03:00
|
|
|
+----<A href="Fl_Text_Editor.html">Fl_Text_Editor</A>
|
2001-11-27 05:09:45 +03:00
|
|
|
</PRE>
|
|
|
|
</UL>
|
|
|
|
<H3>Include Files</H3>
|
2001-11-28 23:43:44 +03:00
|
|
|
|
2001-11-27 05:09:45 +03:00
|
|
|
<UL>
|
|
|
|
<PRE>
|
2001-11-28 23:43:44 +03:00
|
|
|
#include <FL/Fl_Text_Display.H>
|
2001-11-27 05:09:45 +03:00
|
|
|
</PRE>
|
|
|
|
</UL>
|
2001-11-28 23:43:44 +03:00
|
|
|
|
2001-11-27 05:09:45 +03:00
|
|
|
<H3>Description</H3>
|
|
|
|
|
2001-11-28 23:43:44 +03:00
|
|
|
<P>This is the FLTK text display widget. It allows the user to
|
|
|
|
view multiple lines of text and supports highlighting and
|
|
|
|
scrolling. The buffer that is displayed in the widget is managed
|
|
|
|
by the <A HREF="Fl_Text_Buffer.html"><TT>Fl_Text_Buffer</TT></A>
|
|
|
|
class.
|
|
|
|
|
2001-11-27 05:09:45 +03:00
|
|
|
|
|
|
|
<H3>Methods</H3>
|
2001-11-28 23:43:44 +03:00
|
|
|
|
2002-10-04 21:23:09 +04:00
|
|
|
<TABLE CELLPADDING="10">
|
|
|
|
<TR VALIGN="TOP"><TD><UL>
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<LI><A HREF="#Fl_Text_Display.Fl_Text_Display">Fl_Text_Display</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.~Fl_Text_Display">~Fl_Text_Display</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.buffer">buffer</A></LI>
|
2004-03-11 08:17:12 +03:00
|
|
|
<LI><A HREF="#Fl_Text_Display.cursor_color">cursor_color</A></LI>
|
2001-11-28 23:43:44 +03:00
|
|
|
<LI><A HREF="#Fl_Text_Display.cursor_style">cursor_style</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.hide_cursor">hide_cursor</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.highlight_data">highlight_data</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.in_selection">in_selection</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.insert">insert</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.insert_position">insert_position</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.move_down">move_down</A></LI>
|
2002-10-04 21:23:09 +04:00
|
|
|
|
|
|
|
</UL></TD><TD><UL>
|
|
|
|
|
2001-11-28 23:43:44 +03:00
|
|
|
<LI><A HREF="#Fl_Text_Display.move_left">move_left</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.move_right">move_right</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.move_up">move_up</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.next_word">next_word</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.overstrike">overstrike</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.position_style">position_style</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.previous_word">previous_word</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.redisplay_range">redisplay_range</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.scrollbar_align">scrollbar_align</A></LI>
|
2005-07-14 18:42:00 +04:00
|
|
|
<LI><A HREF="#Fl_Text_Display.scrollbar_width">scrollbar_width</A></LI>
|
2002-10-04 21:23:09 +04:00
|
|
|
|
|
|
|
</UL></TD><TD><UL>
|
|
|
|
|
2001-11-28 23:43:44 +03:00
|
|
|
<LI><A HREF="#Fl_Text_Display.scroll">scroll</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.show_cursor">show_cursor</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.show_insert_position">show_insert_position</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.textcolor">textcolor</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.textfont">textfont</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.textsize">textsize</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.word_end">word_end</A></LI>
|
|
|
|
<LI><A HREF="#Fl_Text_Display.word_start">word_start</A></LI>
|
2005-07-14 18:42:00 +04:00
|
|
|
<LI><A HREF="#Fl_Text_Display.wrap_mode">wrap_mode</A></LI>
|
2001-11-28 23:43:44 +03:00
|
|
|
|
2002-10-04 21:23:09 +04:00
|
|
|
</UL></TD></TR>
|
|
|
|
</TABLE>
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.Fl_Text_Display">Fl_Text_Display(int X, int Y, int W, int H, const char *l = 0);</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Creates a new text display widget.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.~Fl_Text_Display">~Fl_Text_Display();</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Destroys a text display widget.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.buffer">void buffer(Fl_Text_Buffer* buf);<BR>
|
2002-03-27 15:40:59 +03:00
|
|
|
void buffer(Fl_Text_Buffer& buf);<BR>
|
2001-11-28 23:43:44 +03:00
|
|
|
Fl_Text_Buffer* buffer();</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Sets or gets the current text buffer associated with the text widget.
|
|
|
|
Multiple text widgets can be associated with the same text buffer.
|
|
|
|
|
2004-03-11 08:17:12 +03:00
|
|
|
<H4><A NAME="Fl_Text_Display.cursor_color">void cursor_color(Fl_Color c);</A><br>
|
|
|
|
Fl_Color cursor_color();</H4>
|
|
|
|
|
|
|
|
<P>Sets or gets the text cursor color.
|
|
|
|
|
2001-11-28 23:43:44 +03:00
|
|
|
<H4><A NAME="Fl_Text_Display.cursor_style">void cursor_style(int style);</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Sets the text cursor style to one of the following:
|
|
|
|
|
|
|
|
<UL>
|
|
|
|
|
|
|
|
<LI><CODE>Fl_Text_Display::NORMAL_CURSOR</CODE> - Shows an I beam.
|
|
|
|
|
|
|
|
<LI><CODE>Fl_Text_Display::CARET_CURSOR</CODE> - Shows a caret under the text.
|
|
|
|
|
|
|
|
<LI><CODE>Fl_Text_Display::DIM_CURSOR</CODE> - Shows a dimmed I beam.
|
|
|
|
|
|
|
|
<LI><CODE>Fl_Text_Display::BLOCK_CURSOR</CODE> - Shows an unfilled box around the current
|
|
|
|
character.
|
|
|
|
|
|
|
|
<LI><CODE>Fl_Text_Display::HEAVY_CURSOR</CODE> - Shows a thick I beam.
|
|
|
|
|
|
|
|
</UL>
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.hide_cursor">void hide_cursor();</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Hides the text cursor.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.highlight_data">void highlight_data(Fl_Text_Buffer *styleBuffer,
|
|
|
|
Style_Table_Entry *styleTable, int nStyles, char
|
|
|
|
unfinishedStyle, Unfinished_Style_Cb unfinishedHighlightCB, void
|
|
|
|
*cbArg);</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Sets the text buffer, text styles, and callbacks to use when
|
|
|
|
displaying text in the widget. Style buffers cannot be shared
|
|
|
|
between widgets and are often used to do syntax highlighting.
|
|
|
|
The editor example from <A HREF="editor.html">Chapter 4</A>
|
|
|
|
shows how to use the <CODE>highlight_data()</CODE> method.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.in_selection">int in_selection(int x, int y);</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Returns non-zero if the specified mouse position is inside the current
|
|
|
|
selection.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.insert">void insert(const char* text);</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Inserts text at the current insert position.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.insert_position">void insert_position(int newPos);<BR>
|
|
|
|
int insert_position()</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Sets or gets the current insert position.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.move_down">int move_down();</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Moves the current insert position down one line.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.move_left">int move_left();</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Moves the current insert position left one character.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.move_right">int move_right();</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Moves the current insert position right one character.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.move_up">int move_up();</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Moves the current insert position up one line.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.next_word">void next_word(void);</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Moves the current insert position right one word.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.overstrike">void overstrike(const char* text);</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Replaces text at the current insert position.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.position_style">int position_style(int lineStartPos, int lineLen, int lineIndex,
|
|
|
|
int dispIndex);</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Returns the style associated with the character at position
|
|
|
|
<CODE>lineStartPos + lineIndex</CODE>.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.previous_word">void previous_word(void);</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Moves the current insert position left one word.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.redisplay_range">void redisplay_range(int start, int end);</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Marks text from <CODE>start</CODE> to <CODE>end</CODE> as needing a redraw.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.scrollbar_align">void scrollbar_align(Fl_Align a);<BR>
|
|
|
|
Fl_Align scrollbar_align();</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Sets or gets where scrollbars are attached to the widget -
|
|
|
|
<CODE>FL_ALIGN_LEFT</CODE> and <CODE>FL_ALIGN_RIGHT</CODE> for
|
|
|
|
the vertical scrollbar and <CODE>FL_ALIGN_TOP</CODE> and
|
|
|
|
<CODE>FL_ALIGN_BOTTOM</CODE> for the horizontal scrollbar.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.scrollbar_width">void scrollbar_width(int w);<BR>
|
|
|
|
int scrollbar_width();</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Sets or gets the width/height of the scrollbars.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.scroll">void scroll(int topLineNum, int horizOffset);</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Scrolls the current buffer to start at the specified line and column.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.show_cursor">void show_cursor(int b = 1);</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Shows or hides the text cursor.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.show_insert_position">void show_insert_position();</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Scrolls the text buffer to show the current insert position.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.textcolor">void textcolor(unsigned n);<BR>
|
|
|
|
Fl_Color textcolor() const;</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Sets or gets the default color of text in the widget.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.textfont">void textfont(uchar s);<BR>
|
|
|
|
Fl_Font textfont() const;</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Sets or gets the default font used when drawing text in the widget.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.textsize">void textsize(uchar s);<BR>
|
|
|
|
uchar textsize() const;</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Sets or gets the default size of text in the widget.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.word_end">int word_end(int pos);</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Moves the insert position to the end of the current word.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
|
|
|
<H4><A NAME="Fl_Text_Display.word_start">int word_start(int pos);</A></H4>
|
|
|
|
|
2002-10-04 06:30:34 +04:00
|
|
|
<P>Moves the insert position to the beginning of the current word.
|
2001-11-28 23:43:44 +03:00
|
|
|
|
2005-07-14 18:42:00 +04:00
|
|
|
<H4><A NAME="Fl_Text_Display.wrap_mode">void wrap_mode(int mode, int pos);</A></H4>
|
|
|
|
|
|
|
|
<P>If <i>mode</i> is not zero, this call enables automatic word wrapping at column <i>pos</i>.
|
|
|
|
Word-wrapping does not change the text buffer itself, only the way that the text is displayed.
|
|
|
|
|
2001-11-28 23:43:44 +03:00
|
|
|
</BODY>
|
|
|
|
</HTML>
|