minor formatting changes to Fl_Text_Display.cxx

fixed some out-dented text (but not exaggerated indents)
split some doxygen comments and added blank lines
added indenting to complex if statement in draw_vline()



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7791 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
engelsman 2010-11-02 20:30:42 +00:00
parent 8dac539491
commit ddd4bbff1b

View File

@ -152,9 +152,11 @@ Fl_Text_Display::Fl_Text_Display(int X, int Y, int W, int H, const char* l)
mSuppressResync = mNLinesDeleted = mModifyingTabDistance = 0; mSuppressResync = mNLinesDeleted = mModifyingTabDistance = 0;
} }
/** Free a text display and release its associated memory. Note, the text /**
BUFFER that the text display displays is a separate entity and is not Free a text display and release its associated memory.
freed, nor are the style buffer or style table.
Note, the text BUFFER that the text display displays is a separate
entity and is not freed, nor are the style buffer or style table.
*/ */
Fl_Text_Display::~Fl_Text_Display() { Fl_Text_Display::~Fl_Text_Display() {
if (scroll_direction) { if (scroll_direction) {
@ -540,6 +542,7 @@ void Fl_Text_Display::insert_position( int newPos ) {
/* draw cursor at its new position */ /* draw cursor at its new position */
redisplay_range(mCursorPos - 1, mCursorPos + 1); // FIXME utf8 redisplay_range(mCursorPos - 1, mCursorPos + 1); // FIXME utf8
} }
/** Shows the text cursor */ /** Shows the text cursor */
void Fl_Text_Display::show_cursor(int b) { void Fl_Text_Display::show_cursor(int b) {
mCursorOn = b; mCursorOn = b;
@ -549,20 +552,12 @@ void Fl_Text_Display::show_cursor(int b) {
/** /**
Sets the text cursor style to one of the following: Sets the text cursor style to one of the following:
<UL> \li Fl_Text_Display::NORMAL_CURSOR - Shows an I beam.
\li Fl_Text_Display::CARET_CURSOR - Shows a caret under the text.
<LI>Fl_Text_Display::NORMAL_CURSOR - Shows an I beam. \li Fl_Text_Display::DIM_CURSOR - Shows a dimmed I beam.
\li Fl_Text_Display::BLOCK_CURSOR - Shows an unfilled box around the current
<LI>Fl_Text_Display::CARET_CURSOR - Shows a caret under the text.
<LI>Fl_Text_Display::DIM_CURSOR - Shows a dimmed I beam.
<LI>Fl_Text_Display::BLOCK_CURSOR - Shows an unfilled box around the current
character. character.
\li Fl_Text_Display::HEAVY_CURSOR - Shows a thick I beam.
<LI>Fl_Text_Display::HEAVY_CURSOR - Shows a thick I beam.
</UL>
*/ */
void Fl_Text_Display::cursor_style(int style) { void Fl_Text_Display::cursor_style(int style) {
mCursorStyle = style; mCursorStyle = style;
@ -905,6 +900,7 @@ int Fl_Text_Display::move_right() {
} }
return 1; return 1;
} }
/** Moves the current insert position left one character.*/ /** Moves the current insert position left one character.*/
int Fl_Text_Display::move_left() { int Fl_Text_Display::move_left() {
int ok = 0; int ok = 0;
@ -1467,11 +1463,14 @@ void Fl_Text_Display::draw_vline(int visLineNum, int leftClip, int rightClip,
last newline position and the line start we're using. Since scanning last newline position and the line start we're using. Since scanning
back to find a newline is expensive, only do so if there's actually a back to find a newline is expensive, only do so if there's actually a
rectangular Fl_Text_Selection which needs it */ rectangular Fl_Text_Selection which needs it */
if (mContinuousWrap && (range_touches_selection(buf->primary_selection(), if (mContinuousWrap &&
lineStartPos, lineStartPos + lineLen) || range_touches_selection( (range_touches_selection(buf->primary_selection(),
buf->secondary_selection(), lineStartPos, lineStartPos + lineLen) || lineStartPos, lineStartPos + lineLen) ||
range_touches_selection(buf->highlight_selection(), lineStartPos, range_touches_selection(buf->secondary_selection(),
lineStartPos + lineLen))) { lineStartPos, lineStartPos + lineLen) ||
range_touches_selection(buf->highlight_selection(),
lineStartPos, lineStartPos + lineLen)))
{
dispIndexOffset = buf->count_displayed_characters( dispIndexOffset = buf->count_displayed_characters(
buf->line_start(lineStartPos), lineStartPos); buf->line_start(lineStartPos), lineStartPos);
} else } else
@ -1483,7 +1482,10 @@ void Fl_Text_Display::draw_vline(int visLineNum, int leftClip, int rightClip,
that character */ that character */
X = text_area.x - mHorizOffset; X = text_area.x - mHorizOffset;
outIndex = 0; outIndex = 0;
for ( charIndex = 0; ; charIndex += lineStr ? fl_utf8len(lineStr[charIndex]) : 1 ) { for (charIndex = 0;
;
charIndex += lineStr ? fl_utf8len(lineStr[charIndex]) : 1 )
{
charLen = charIndex >= lineLen ? 1 : charLen = charIndex >= lineLen ? 1 :
Fl_Text_Buffer::expand_character( lineStr+charIndex, outIndex, Fl_Text_Buffer::expand_character( lineStr+charIndex, outIndex,
expandedChar, buf->tab_distance()); expandedChar, buf->tab_distance());