summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2013-03-27 19:16:48 +0000
committerGreg Ercolano <erco@seriss.com>2013-03-27 19:16:48 +0000
commitfa75731c94df78ad31fa502a9fed17f78a3a1411 (patch)
tree345d8aeb9034e85fd3465b81ce543b35a0cb12a0
parentceb12d51ab643ab5c3089e6eeb338e38abe787b7 (diff)
Fix for fl_measure() missing drawsymbol flag
Added comments Added 3 line test. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9851 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--test/unittest_symbol.cxx28
1 files changed, 15 insertions, 13 deletions
diff --git a/test/unittest_symbol.cxx b/test/unittest_symbol.cxx
index 04ffc14ba..76f1ede52 100644
--- a/test/unittest_symbol.cxx
+++ b/test/unittest_symbol.cxx
@@ -26,7 +26,7 @@ class SymbolTest : public Fl_Widget
{
void DrawTextAndBoxes(const char *txt, int X, int Y) {
int wo = 0, ho = 0;
- fl_measure(txt, wo, ho, 0);
+ fl_measure(txt, wo, ho, 1);
// Draw fl_measure() rect
fl_color(FL_RED);
fl_rect(X, Y, wo, ho);
@@ -59,21 +59,23 @@ public:
// set the background colour - slightly off-white to enhance the green bounding box
fl_color(fl_gray_ramp(FL_NUM_GRAY - 3));
fl_rectf(x0, y0, w0, h0);
- int fsize = 30;
+ int fsize = 25;
fl_font(FL_HELVETICA, fsize);
int xx = x0+10;
- int yy = y0+20;
- DrawTextAndBoxes("Text" ,xx,yy); yy += fsize+10;
- DrawTextAndBoxes("@->" ,xx,yy); yy += fsize+10;
- DrawTextAndBoxes("@-> " ,xx,yy); yy += fsize+10;
- DrawTextAndBoxes("@-> Rt Arrow" ,xx,yy); yy += fsize+10;
- DrawTextAndBoxes("@-> Rt/Lt @<-" ,xx,yy); yy += fsize+10;
- DrawTextAndBoxes("@@ At/Lt @<-" ,xx,yy); yy += fsize+10;
- DrawTextAndBoxes("@-> Lt/At @@" ,xx,yy); yy += fsize+10;
- xx = x0+260;
+ int yy = y0+10;
+ DrawTextAndBoxes("Text" ,xx,yy); yy += fsize+10; // check no symbols
+ DrawTextAndBoxes("@->" ,xx,yy); yy += fsize+10; // check symbol alone
+ DrawTextAndBoxes("@-> " ,xx,yy); yy += fsize+10; // check symbol with trailing space
+ DrawTextAndBoxes("@-> Rt Arrow" ,xx,yy); yy += fsize+10; // check symbol at left edge
+ DrawTextAndBoxes("Lt Arrow @<-" ,xx,yy); yy += fsize+10; // check symbol at right edge
+ DrawTextAndBoxes("@-> Rt/Lt @<-" ,xx,yy); yy += fsize+10; // check symbol at lt+rt edges
+ DrawTextAndBoxes("@@ At/Lt @<-" ,xx,yy); yy += fsize+10; // check @@ at left, symbol at right
+ DrawTextAndBoxes("@-> Lt/At @@" ,xx,yy); yy += fsize+10; // check symbol at left, @@ at right
+ xx = x0+200;
yy = y0+10;
- DrawTextAndBoxes("Line1\nLine2",xx,yy); yy += 100;
- DrawTextAndBoxes("@-> Line1\nLine2 @<-",xx,yy); yy += 100;
+ DrawTextAndBoxes("Line1\nLine2",xx,yy); yy += (fsize+10)*2; // check 2 lines, no symbol
+ DrawTextAndBoxes("@-> Line1\nLine2 @<-",xx,yy); yy += (fsize+10)*2; // check 2 lines, lt+rt symbols
+ DrawTextAndBoxes("@-> Line1\nLine2\nLine3 @<-",xx,yy); yy += (fsize+10)*3;// check 3 lines, lt+rt symbols
fl_font(FL_HELVETICA, 14);
fl_color(FL_RED);