Author: matt
Date: 2010-05-01 01:57:49 -0700 (Sat, 01 May 2010)
New Revision: 7579
Log:
Also testing font heights
Modified:
branches/branch-1.3-STR2158-matt/src/Fl_Text_Display.cxx
branches/branch-1.3-STR2158-matt/test/editor.cxx
Modified: branches/branch-1.3-STR2158-matt/src/Fl_Text_Display.cxx
===================================================================
--- branches/branch-1.3-STR2158-matt/src/Fl_Text_Display.cxx 2010-05-01
08:41:01 UTC (rev 7578)
+++ branches/branch-1.3-STR2158-matt/src/Fl_Text_Display.cxx 2010-05-01
08:57:49 UTC (rev 7579)
@@ -757,15 +757,13 @@
pos < mFirstChar || pos > mLastChar)
return 0;
*lineNum = mAbsTopLineNum + buffer()->count_lines(mFirstChar, pos);
- *column
- = buffer()->count_displayed_characters(buffer()->line_start(pos), pos);
+ *column =
buffer()->count_displayed_characters(buffer()->line_start(pos), pos);
return 1;
}
retVal = position_to_line( pos, lineNum );
if ( retVal ) {
- *column = mBuffer->count_displayed_characters(
- mLineStarts[ *lineNum ], pos );
+ *column = mBuffer->count_displayed_characters(mLineStarts[ *lineNum ], pos
);
*lineNum += mTopLineNum;
}
return retVal;
@@ -799,8 +797,7 @@
if (dispLineStart == -1)
return column;
lineStart = buffer()->line_start(dispLineStart);
- return column
- + buffer()->count_displayed_characters(lineStart,
dispLineStart);
+ return column + buffer()->count_displayed_characters(lineStart,
dispLineStart);
}
/**
Modified: branches/branch-1.3-STR2158-matt/test/editor.cxx
===================================================================
--- branches/branch-1.3-STR2158-matt/test/editor.cxx 2010-05-01 08:41:01 UTC
(rev 7578)
+++ branches/branch-1.3-STR2158-matt/test/editor.cxx 2010-05-01 08:57:49 UTC
(rev 7579)
@@ -70,7 +70,8 @@
{ FL_BLUE, FL_COURIER, 14 }, // D - Strings
{ FL_DARK_RED, FL_COURIER, 14 }, // E - Directives
{ FL_DARK_RED, FL_COURIER_BOLD, 14 }, // F - Types
- { FL_BLUE, FL_COURIER_BOLD, 14 } // G - Keywords
+ { FL_BLUE, FL_COURIER_BOLD, 14 }, // G - Keywords
+ { FL_MAGENTA, FL_HELVETICA, 12 } // H - Font
height test
};
const char *code_keywords[] = { // List of known C/C++
keywords...
"and",
@@ -199,6 +200,8 @@
if (length == 0) break;
} else if (strncmp(text, "/*", 2) == 0) {
current = 'C';
+ } else if (strncmp(text, "[", 1) == 0) {
+ current = 'H';
} else if (strncmp(text, "\\\"", 2) == 0) {
// Quoted quote...
*style++ = current;
@@ -260,6 +263,14 @@
current = 'A';
col += 2;
continue;
+ } else if (current == 'H' && strncmp(text, "]", 1) == 0) {
+ // Close a font test style
+ *style++ = current;
+ text ++;
+ length --;
+ current = 'A';
+ col += 1;
+ continue;
} else if (current == 'D') {
// Continuing in string...
if (strncmp(text, "\\\"", 2) == 0) {
@@ -826,7 +837,7 @@
"/* たれそ つねならむ うゐのおくやま */\n"
"けふこえて あさきゆめみし ゑひも\n"
"せす\n\n"
- "Even colours and sweet perfume / Will eventually fade /\n"
+ "Even colours and [sweet perfume] / Will eventually fade /\n"
"Even our world / Is not eternal /\n"
"The deep mountains of vanity / Cross them today /\n"
"And superficial dreams / Shall no longer delude you.\n"
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit