aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dw/textblock.hh1
-rw-r--r--dw/textblock_linebreaking.cc22
-rw-r--r--src/dialog.cc2
3 files changed, 18 insertions, 7 deletions
diff --git a/dw/textblock.hh b/dw/textblock.hh
index 481fd9f2..f3f619f1 100644
--- a/dw/textblock.hh
+++ b/dw/textblock.hh
@@ -347,6 +347,7 @@ protected:
later set by a_Dw_page_add_space */
};
+ void printWordShort (Word *word);
void printWord (Word *word);
struct Anchor
diff --git a/dw/textblock_linebreaking.cc b/dw/textblock_linebreaking.cc
index 020000d3..19927b7e 100644
--- a/dw/textblock_linebreaking.cc
+++ b/dw/textblock_linebreaking.cc
@@ -191,8 +191,6 @@ void Textblock::BadnessAndPenalty::print ()
#ifdef DEBUG
printf (" [%d + %d - %d vs. %d] + ",
totalWidth, totalStretchability, totalShrinkability, idealWidth);
-#else
- printf (" <no debug> + ");
#endif
printf ("(");
@@ -210,14 +208,15 @@ void Textblock::BadnessAndPenalty::print ()
printf (")");
}
-void Textblock::printWord (Word *word)
+void Textblock::printWordShort (Word *word)
{
switch(word->content.type) {
case core::Content::TEXT:
printf ("\"%s\"", word->content.text);
break;
case core::Content::WIDGET:
- printf ("<widget: %p>", word->content.widget);
+ printf ("<widget: %p (%s)>",
+ word->content.widget, word->content.widget->getClassName());
break;
case core::Content::BREAK:
printf ("<break>");
@@ -226,9 +225,13 @@ void Textblock::printWord (Word *word)
printf ("<?>");
break;
}
+}
- printf (" (flags = %d)", word->flags);
-
+void Textblock::printWord (Word *word)
+{
+ printWordShort (word);
+
+ printf (" (flags = %d)", word->flags);
printf (" [%d / %d + %d - %d => %d + %d - %d] => ",
word->size.width, word->origSpace, word->stretchability,
word->shrinkability, word->totalWidth, word->totalStretchability,
@@ -368,6 +371,13 @@ Textblock::Line *Textblock::addLine (int firstWord, int lastWord,
mustQueueResize = true;
+ //printWordShort (words->getRef (line->firstWord));
+ //printf (" ... ");
+ //printWordShort (words->getRef (line->lastWord));
+ //printf (": ");
+ //words->getRef(line->lastWord)->badnessAndPenalty.print ();
+ //printf ("\n");
+
return line;
}
diff --git a/src/dialog.cc b/src/dialog.cc
index 6a8fd071..3458adc2 100644
--- a/src/dialog.cc
+++ b/src/dialog.cc
@@ -298,7 +298,7 @@ void a_Dialog_text_window(const char *txt, const char *title)
td->textsize((int) rint(14.0 * prefs.font_factor));
/* enable wrapping lines; text uses entire width of window */
- td->wrap_mode(true, false);
+ td->wrap_mode(Fl_Text_Display::WRAP_AT_BOUNDS, 0);
window->add(td);
Fl_Return_Button *b = new Fl_Return_Button (0, wh-bh, ww, bh, "Close");