summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dw/alignedtextblock.cc4
-rw-r--r--dw/alignedtextblock.hh2
-rw-r--r--dw/listitem.cc4
-rw-r--r--dw/listitem.hh2
-rw-r--r--dw/tablecell.cc4
-rw-r--r--dw/tablecell.hh2
-rw-r--r--dw/textblock.cc5
-rw-r--r--dw/textblock.hh19
-rw-r--r--dw/textblock_linebreaking.cc27
-rw-r--r--src/form.cc4
-rw-r--r--src/html.cc9
-rw-r--r--src/plain.cc2
-rw-r--r--src/prefs.c2
-rw-r--r--src/prefs.h1
-rw-r--r--src/prefsparser.cc18
-rw-r--r--src/table.cc4
-rw-r--r--test/dw_anchors_test.cc2
-rw-r--r--test/dw_border_test.cc4
-rw-r--r--test/dw_example.cc2
-rw-r--r--test/dw_find_test.cc4
-rw-r--r--test/dw_images_scaled.cc2
-rw-r--r--test/dw_images_scaled2.cc2
-rw-r--r--test/dw_images_simple.cc2
-rw-r--r--test/dw_links.cc2
-rw-r--r--test/dw_links2.cc2
-rw-r--r--test/dw_lists.cc4
-rw-r--r--test/dw_resource_test.cc2
-rw-r--r--test/dw_table.cc2
-rw-r--r--test/dw_table_aligned.cc2
-rw-r--r--test/dw_ui_test.cc14
30 files changed, 93 insertions, 62 deletions
diff --git a/dw/alignedtextblock.cc b/dw/alignedtextblock.cc
index dde408b2..934c43ec 100644
--- a/dw/alignedtextblock.cc
+++ b/dw/alignedtextblock.cc
@@ -59,8 +59,8 @@ void AlignedTextblock::List::unref(int pos)
int AlignedTextblock::CLASS_ID = -1;
-AlignedTextblock::AlignedTextblock (bool limitTextWidth):
- Textblock (limitTextWidth)
+AlignedTextblock::AlignedTextblock (bool limitTextWidth, int penaltyHyphen):
+ Textblock (limitTextWidth, penaltyHyphen)
{
registerName ("dw::AlignedTextblock", &CLASS_ID);
}
diff --git a/dw/alignedtextblock.hh b/dw/alignedtextblock.hh
index 7bac15bb..084bfcb3 100644
--- a/dw/alignedtextblock.hh
+++ b/dw/alignedtextblock.hh
@@ -42,7 +42,7 @@ private:
int listPos;
protected:
- AlignedTextblock(bool limitTextWidth);
+ AlignedTextblock(bool limitTextWidth, int penaltyHyphen);
virtual int getValue () = 0;
virtual void setMaxValue (int maxValue, int value) = 0;
diff --git a/dw/listitem.cc b/dw/listitem.cc
index ed7a2c75..54901e1a 100644
--- a/dw/listitem.cc
+++ b/dw/listitem.cc
@@ -26,8 +26,8 @@ namespace dw {
int ListItem::CLASS_ID = -1;
-ListItem::ListItem (ListItem *ref, bool limitTextWidth):
- AlignedTextblock (limitTextWidth)
+ListItem::ListItem (ListItem *ref, bool limitTextWidth, int penaltyHyphen):
+ AlignedTextblock (limitTextWidth, penaltyHyphen)
{
registerName ("dw::ListItem", &CLASS_ID);
setRefTextblock (ref);
diff --git a/dw/listitem.hh b/dw/listitem.hh
index 2e303d5d..31b5cd27 100644
--- a/dw/listitem.hh
+++ b/dw/listitem.hh
@@ -15,7 +15,7 @@ protected:
public:
static int CLASS_ID;
- ListItem(ListItem *ref, bool limitTextWidth);
+ ListItem(ListItem *ref, bool limitTextWidth, int penaltyHyphen);
~ListItem();
void initWithWidget (core::Widget *widget, core::style::Style *style);
diff --git a/dw/tablecell.cc b/dw/tablecell.cc
index 90dc310d..79bc77d2 100644
--- a/dw/tablecell.cc
+++ b/dw/tablecell.cc
@@ -26,8 +26,8 @@ namespace dw {
int TableCell::CLASS_ID = -1;
-TableCell::TableCell (TableCell *ref, bool limitTextWidth):
- AlignedTextblock (limitTextWidth)
+TableCell::TableCell (TableCell *ref, bool limitTextWidth, int penaltyHyphen):
+ AlignedTextblock (limitTextWidth, penaltyHyphen)
{
registerName ("dw::TableCell", &CLASS_ID);
diff --git a/dw/tablecell.hh b/dw/tablecell.hh
index 4bb8633c..11003544 100644
--- a/dw/tablecell.hh
+++ b/dw/tablecell.hh
@@ -20,7 +20,7 @@ protected:
public:
static int CLASS_ID;
- TableCell(TableCell *ref, bool limitTextWidth);
+ TableCell(TableCell *ref, bool limitTextWidth, int penaltyHyphen);
~TableCell();
};
diff --git a/dw/textblock.cc b/dw/textblock.cc
index 00edf418..f40f6c91 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -40,7 +40,7 @@ namespace dw {
int Textblock::CLASS_ID = -1;
-Textblock::Textblock (bool limitTextWidth)
+Textblock::Textblock (bool limitTextWidth, int penaltyHyphen)
{
registerName ("dw::Textblock", &CLASS_ID);
setFlags (BLOCK_LEVEL);
@@ -86,6 +86,7 @@ Textblock::Textblock (bool limitTextWidth)
availDescent = 0;
this->limitTextWidth = limitTextWidth;
+ this->penaltyHyphen = penaltyHyphen;
for (int layer = 0; layer < core::HIGHLIGHT_NUM_LAYERS; layer++) {
/* hlStart[layer].index > hlEnd[layer].index means no highlighting */
@@ -1704,7 +1705,7 @@ void Textblock::addHyphen ()
if (wordIndex >= 0) {
Word *word = words->getRef(wordIndex);
- word->badnessAndPenalty.setPenalty (HYPHEN_BREAK);
+ word->badnessAndPenalty.setPenalty (penaltyHyphen);
// TODO Optimize? Like spaces?
word->hyphenWidth = layout->textWidth (word->style->font, "\xc2\xad", 2);
diff --git a/dw/textblock.hh b/dw/textblock.hh
index 42286134..7c4f8820 100644
--- a/dw/textblock.hh
+++ b/dw/textblock.hh
@@ -212,15 +212,6 @@ private:
};
protected:
- enum {
- /**
- * The penalty for hyphens, multiplied by 100. So, 100 means
- * 1.0. See dw::Textblock::BadnessAndPenalty::setPenalty for
- * more details.
- */
- HYPHEN_BREAK = 100
- };
-
struct Line
{
int firstWord; /* first word's index in word vector */
@@ -363,6 +354,14 @@ protected:
bool mustQueueResize;
+ /**
+ * The penalty for hyphens, multiplied by 100. So, 100 means
+ * 1.0. INT_MAX and INT_MIN are also allowed. See
+ * dw::Textblock::BadnessAndPenalty::setPenalty for more
+ * details. Set from preferences.
+ */
+ int penaltyHyphen;
+
bool limitTextWidth; /* from preferences */
int redrawY;
@@ -527,7 +526,7 @@ protected:
public:
static int CLASS_ID;
- Textblock(bool limitTextWidth);
+ Textblock(bool limitTextWidth, int penaltyHyphen);
~Textblock();
core::Iterator *iterator (core::Content::Type mask, bool atEnd);
diff --git a/dw/textblock_linebreaking.cc b/dw/textblock_linebreaking.cc
index 81cab950..ebe3d534 100644
--- a/dw/textblock_linebreaking.cc
+++ b/dw/textblock_linebreaking.cc
@@ -98,6 +98,9 @@ void Textblock::BadnessAndPenalty::calcBadness (int totalWidth, int idealWidth,
* to deal with fractional numbers, without having to use floating
* point numbers. So, to set a penalty to 0.5, pass 50.
*
+ * INT_MAX and INT_MIN (representing inf and -inf, respectively) are
+ * also allowed.
+ *
* The definition of penalties depends on the definition of badness,
* which adheres to the description in \ref dw-line-breaking, section
* "Criteria for Line-Breaking". The exact calculation may vary, but
@@ -108,14 +111,20 @@ void Textblock::BadnessAndPenalty::calcBadness (int totalWidth, int idealWidth,
*/
void Textblock::BadnessAndPenalty::setPenalty (int penalty)
{
- // This factor consists of: (i) 100^3, since in calcBadness(), the
- // ratio is multiplied with 100 (again, to use integer numbers for
- // fractional numbers), and the badness (which has to be compared
- // to the penalty!) is the third power or it; (ii) the denominator
- // 100, of course, since 100 times the penalty is passed to this
- // method.
- this->penalty = penalty * (100 * 100 * 100 / 100);
- penaltyState = PENALTY_VALUE;
+ if (penalty == INT_MAX)
+ setPenaltyProhibitBreak ();
+ else if (penalty == INT_MIN)
+ setPenaltyForceBreak ();
+ else {
+ // This factor consists of: (i) 100^3, since in calcBadness(), the
+ // ratio is multiplied with 100 (again, to use integer numbers for
+ // fractional numbers), and the badness (which has to be compared
+ // to the penalty!) is the third power or it; (ii) the denominator
+ // 100, of course, since 100 times the penalty is passed to this
+ // method.
+ this->penalty = penalty * (100 * 100 * 100 / 100);
+ penaltyState = PENALTY_VALUE;
+ }
}
void Textblock::BadnessAndPenalty::setPenaltyProhibitBreak ()
@@ -690,7 +699,7 @@ int Textblock::hyphenateWord (int wordIndex)
// Note: there are numBreaks + 1 word parts.
if (i < numBreaks) {
// TODO There should be a method fillHyphen.
- w->badnessAndPenalty.setPenalty (HYPHEN_BREAK);
+ w->badnessAndPenalty.setPenalty (penaltyHyphen);
w->hyphenWidth =
layout->textWidth (origWord.style->font, "\xc2\xad", 2);
PRINTF (" [%d] + hyphen\n", wordIndex + i);
diff --git a/src/form.cc b/src/form.cc
index 11f27b47..90dc6d50 100644
--- a/src/form.cc
+++ b/src/form.cc
@@ -868,10 +868,10 @@ void Html_tag_open_button(DilloHtml *html, const char *tag, int tagsize)
html->styleEngine->setNonCssHint (PROPERTY_X_TOOLTIP, CSS_TYPE_STRING,
attrbuf);
}
- /* We used to have Textblock (prefs.limit_text_width) here,
+ /* We used to have Textblock (prefs.limit_text_width, ...) here,
* but it caused 100% CPU usage.
*/
- page = new Textblock (false);
+ page = new Textblock (false, prefs.penalty_hyphen);
page->setStyle (html->styleEngine->backgroundStyle ());
ResourceFactory *factory = HT2LT(html)->getResourceFactory();
diff --git a/src/html.cc b/src/html.cc
index f2bf7e44..b1396fd5 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -352,7 +352,8 @@ bool a_Html_tag_set_valign_attr(DilloHtml *html, const char *tag, int tagsize)
*/
static void Html_add_textblock(DilloHtml *html, int space)
{
- Textblock *textblock = new Textblock (prefs.limit_text_width);
+ Textblock *textblock =
+ new Textblock (prefs.limit_text_width, prefs.penalty_hyphen);
HT2TB(html)->addParbreak (space, html->styleEngine->wordStyle ());
HT2TB(html)->addWidget (textblock, html->styleEngine->style ());
@@ -458,7 +459,8 @@ void DilloHtml::initDw()
dReturn_if_fail (dw == NULL);
/* Create the main widget */
- dw = stack->getRef(0)->textblock = new Textblock (prefs.limit_text_width);
+ dw = stack->getRef(0)->textblock =
+ new Textblock (prefs.limit_text_width, prefs.penalty_hyphen);
bw->num_page_bugs = 0;
dStr_truncate(bw->page_bugs, 0);
@@ -3519,7 +3521,8 @@ static void Html_display_listitem(DilloHtml *html)
HT2TB(html)->addParbreak (0, wordStyle);
- list_item = new ListItem ((ListItem*)*ref_list_item,prefs.limit_text_width);
+ list_item = new ListItem ((ListItem*)*ref_list_item,prefs.limit_text_width,
+ prefs.penalty_hyphen);
HT2TB(html)->addWidget (list_item, style);
HT2TB(html)->addParbreak (0, wordStyle);
*ref_list_item = list_item;
diff --git a/src/plain.cc b/src/plain.cc
index 4da618e4..b29bf226 100644
--- a/src/plain.cc
+++ b/src/plain.cc
@@ -90,7 +90,7 @@ DilloPlain::DilloPlain(BrowserWindow *p_bw)
/* Init internal variables */
bw = p_bw;
- dw = new Textblock (prefs.limit_text_width);
+ dw = new Textblock (prefs.limit_text_width, prefs.penalty_hyphen);
Start_Ofs = 0;
state = ST_SeekingEol;
diff --git a/src/prefs.c b/src/prefs.c
index a7fa1bcf..09e48862 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -101,6 +101,8 @@ void a_Prefs_init(void)
prefs.start_page = a_Url_new(PREFS_START_PAGE, NULL);
prefs.theme = dStrdup(PREFS_THEME);
prefs.w3c_plus_heuristics = TRUE;
+
+ prefs.penalty_hyphen = 100;
}
/*
diff --git a/src/prefs.h b/src/prefs.h
index 7622aea3..7392d74e 100644
--- a/src/prefs.h
+++ b/src/prefs.h
@@ -89,6 +89,7 @@ struct _DilloPrefs {
bool_t show_msg;
bool_t show_extra_warnings;
bool_t middle_click_drags_page;
+ int penalty_hyphen;
};
/* Global Data */
diff --git a/src/prefsparser.cc b/src/prefsparser.cc
index aa810b1e..d555a55f 100644
--- a/src/prefsparser.cc
+++ b/src/prefsparser.cc
@@ -12,6 +12,8 @@
#include <sys/types.h>
#include <stdlib.h>
#include <locale.h> /* for setlocale */
+#include <math.h> /* for isinf */
+#include <limits.h>
#include "prefs.h"
#include "misc.h"
@@ -28,6 +30,7 @@ typedef enum {
PREFS_URL,
PREFS_INT32,
PREFS_DOUBLE,
+ PREFS_FRACTION_100,
PREFS_GEOMETRY,
PREFS_PANEL_SIZE
} PrefType_t;
@@ -107,7 +110,8 @@ int PrefsParser::parseOption(char *name, char *value)
{ "small_icons", &prefs.small_icons, PREFS_BOOL },
{ "start_page", &prefs.start_page, PREFS_URL },
{ "theme", &prefs.theme, PREFS_STRING },
- { "w3c_plus_heuristics", &prefs.w3c_plus_heuristics, PREFS_BOOL }
+ { "w3c_plus_heuristics", &prefs.w3c_plus_heuristics, PREFS_BOOL },
+ { "penalty_hyphen", &prefs.penalty_hyphen, PREFS_FRACTION_100 },
};
node = NULL;
@@ -160,6 +164,18 @@ int PrefsParser::parseOption(char *name, char *value)
case PREFS_DOUBLE:
*(double *)node->pref = strtod(value, NULL);
break;
+ case PREFS_FRACTION_100:
+ {
+ double d = strtod (value, NULL);
+ if (isinf(d)) {
+ if (d > 0)
+ *(int*)node->pref = INT_MAX;
+ else
+ *(int*)node->pref = INT_MIN;
+ } else
+ *(int*)node->pref = 100 * d;
+ }
+ break;
case PREFS_GEOMETRY:
a_Misc_parse_geometry(value, &prefs.xpos, &prefs.ypos,
&prefs.width, &prefs.height);
diff --git a/src/table.cc b/src/table.cc
index 98157e76..3487bab3 100644
--- a/src/table.cc
+++ b/src/table.cc
@@ -421,9 +421,9 @@ static void Html_tag_content_table_cell(DilloHtml *html,
== TEXT_ALIGN_STRING)
col_tb = new dw::TableCell (
((dw::Table*)S_TOP(html)->table)->getCellRef (),
- prefs.limit_text_width);
+ prefs.limit_text_width, prefs.penalty_hyphen);
else
- col_tb = new Textblock (prefs.limit_text_width);
+ col_tb = new Textblock (prefs.limit_text_width, prefs.penalty_hyphen);
if (html->styleEngine->style()->borderCollapse == BORDER_MODEL_COLLAPSE){
Html_set_collapsing_border_model(html, col_tb);
diff --git a/test/dw_anchors_test.cc b/test/dw_anchors_test.cc
index cb839f40..74a2be86 100644
--- a/test/dw_anchors_test.cc
+++ b/test/dw_anchors_test.cc
@@ -55,7 +55,7 @@ static void anchorCallback (Fl_Widget *widget, void *data)
static void textTimeout (void *data)
{
Textblock *oldTop = topTextblock;
- topTextblock = new Textblock (false);
+ topTextblock = new Textblock (false, 100);
if (oldTop) {
oldTop->addLinebreak (wordStyle);
diff --git a/test/dw_border_test.cc b/test/dw_border_test.cc
index 988abc33..f523750b 100644
--- a/test/dw_border_test.cc
+++ b/test/dw_border_test.cc
@@ -76,7 +76,7 @@ int main(int argc, char **argv)
Style *widgetStyle2 = Style::create (layout, &styleAttrs);
- Textblock *textblock1 = new Textblock (false);
+ Textblock *textblock1 = new Textblock (false, 100);
textblock1->setStyle (widgetStyle1);
layout->setWidget (textblock1);
@@ -101,7 +101,7 @@ int main(int argc, char **argv)
for(int i = 0; i < 1; i++) {
textblock1->addParbreak(0, wordStyle);
- Textblock *textblock2 = new Textblock (false);
+ Textblock *textblock2 = new Textblock (false, 100);
textblock1->addWidget (textblock2, widgetStyle2);
for(int j = 0; words2[j]; j++) {
diff --git a/test/dw_example.cc b/test/dw_example.cc
index 52aa2440..7879dfd8 100644
--- a/test/dw_example.cc
+++ b/test/dw_example.cc
@@ -62,7 +62,7 @@ int main(int argc, char **argv)
dw::core::style::Style *widgetStyle =
dw::core::style::Style::create (layout, &styleAttrs);
- dw::Textblock *textblock = new dw::Textblock (false);
+ dw::Textblock *textblock = new dw::Textblock (false, 100);
textblock->setStyle (widgetStyle);
layout->setWidget (textblock);
diff --git a/test/dw_find_test.cc b/test/dw_find_test.cc
index e5c79fd3..27817664 100644
--- a/test/dw_find_test.cc
+++ b/test/dw_find_test.cc
@@ -117,7 +117,7 @@ int main(int argc, char **argv)
styleAttrs.margin.left = 0;
Style *wordStyle = Style::create (layout, &styleAttrs);
- Textblock *textblock = new Textblock (false);
+ Textblock *textblock = new Textblock (false, 100);
textblock->setStyle (topWidgetStyle);
layout->setWidget (textblock);
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
for(int j = 0; j < 10; j++) {
Textblock *current;
if(j < 5) {
- current = new Textblock (false);
+ current = new Textblock (false, 100);
stack->getTop()->addWidget (current, widgetStyle);
stack->push (current);
} else {
diff --git a/test/dw_images_scaled.cc b/test/dw_images_scaled.cc
index 2f8896e6..415a727d 100644
--- a/test/dw_images_scaled.cc
+++ b/test/dw_images_scaled.cc
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
Style *widgetStyle = Style::create (layout, &styleAttrs);
- Textblock *textblock = new Textblock (false);
+ Textblock *textblock = new Textblock (false, 100);
textblock->setStyle (widgetStyle);
layout->setWidget (textblock);
diff --git a/test/dw_images_scaled2.cc b/test/dw_images_scaled2.cc
index 2adb1770..211d997d 100644
--- a/test/dw_images_scaled2.cc
+++ b/test/dw_images_scaled2.cc
@@ -97,7 +97,7 @@ int main(int argc, char **argv)
Style *widgetStyle = Style::create (layout, &styleAttrs);
- Textblock *textblock = new Textblock (false);
+ Textblock *textblock = new Textblock (false, 100);
textblock->setStyle (widgetStyle);
layout->setWidget (textblock);
diff --git a/test/dw_images_simple.cc b/test/dw_images_simple.cc
index 8f00f847..33e370a6 100644
--- a/test/dw_images_simple.cc
+++ b/test/dw_images_simple.cc
@@ -121,7 +121,7 @@ int main(int argc, char **argv)
Style *widgetStyle = Style::create (layout, &styleAttrs);
- Textblock *textblock = new Textblock (false);
+ Textblock *textblock = new Textblock (false, 100);
textblock->setStyle (widgetStyle);
layout->setWidget (textblock);
diff --git a/test/dw_links.cc b/test/dw_links.cc
index 5622cbd5..633fa73b 100644
--- a/test/dw_links.cc
+++ b/test/dw_links.cc
@@ -101,7 +101,7 @@ int main(int argc, char **argv)
Style *widgetStyle = Style::create (layout, &styleAttrs);
- Textblock *textblock = new Textblock (false);
+ Textblock *textblock = new Textblock (false, 100);
textblock->setStyle (widgetStyle);
layout->setWidget (textblock);
diff --git a/test/dw_links2.cc b/test/dw_links2.cc
index b8e8c55b..2ec10d0d 100644
--- a/test/dw_links2.cc
+++ b/test/dw_links2.cc
@@ -130,7 +130,7 @@ int main(int argc, char **argv)
Style *widgetStyle = Style::create (layout, &styleAttrs);
- Textblock *textblock = new Textblock (false);
+ Textblock *textblock = new Textblock (false, 100);
textblock->setStyle (widgetStyle);
layout->setWidget (textblock);
diff --git a/test/dw_lists.cc b/test/dw_lists.cc
index 12fa1627..64b66828 100644
--- a/test/dw_lists.cc
+++ b/test/dw_lists.cc
@@ -63,7 +63,7 @@ int main(int argc, char **argv)
Style *widgetStyle = Style::create (layout, &styleAttrs);
- Textblock *textblock = new Textblock (false);
+ Textblock *textblock = new Textblock (false, 100);
textblock->setStyle (widgetStyle);
layout->setWidget (textblock);
@@ -103,7 +103,7 @@ int main(int argc, char **argv)
ListItem *refItem = NULL;
for(int i = 1; i <= 100; i++) {
- ListItem *listItem = new ListItem (refItem, false);
+ ListItem *listItem = new ListItem (refItem, false, 100);
refItem = listItem;
textblock->addWidget (listItem, itemStyle);
diff --git a/test/dw_resource_test.cc b/test/dw_resource_test.cc
index a2a26c62..0b817dcb 100644
--- a/test/dw_resource_test.cc
+++ b/test/dw_resource_test.cc
@@ -64,7 +64,7 @@ int main(int argc, char **argv)
Style *widgetStyle = Style::create (layout, &styleAttrs);
- Textblock *textblock = new Textblock (false);
+ Textblock *textblock = new Textblock (false, 100);
textblock->setStyle (widgetStyle);
layout->setWidget (textblock);
diff --git a/test/dw_table.cc b/test/dw_table.cc
index 75842e60..ef1572a6 100644
--- a/test/dw_table.cc
+++ b/test/dw_table.cc
@@ -92,7 +92,7 @@ int main(int argc, char **argv)
table->addRow (wordStyle);
for (int j = 0; j < 4; j++) {
- Textblock *cell = new Textblock (false);
+ Textblock *cell = new Textblock (false, 100);
cell->setStyle (cellStyle);
table->addCell (cell, 1, 1);
diff --git a/test/dw_table_aligned.cc b/test/dw_table_aligned.cc
index 022e7026..927c397e 100644
--- a/test/dw_table_aligned.cc
+++ b/test/dw_table_aligned.cc
@@ -90,7 +90,7 @@ int main(int argc, char **argv)
TableCell *ref = NULL;
for(int i = 0; i < 10; i++) {
//for(int i = 0; i < 1; i++) {
- TableCell *cell = new TableCell (ref, false);
+ TableCell *cell = new TableCell (ref, false, 100);
cell->setStyle (cellStyle);
ref = cell;
table->addRow (wordStyle);
diff --git a/test/dw_ui_test.cc b/test/dw_ui_test.cc
index 60893f06..ee024acc 100644
--- a/test/dw_ui_test.cc
+++ b/test/dw_ui_test.cc
@@ -104,7 +104,7 @@ int main(int argc, char **argv)
// Note on complex buttons: before any operations on the widget, which
// need a layout, the complex button resource should be created, since
// then, a layout and a platform are instantiated.
- Textblock *cbuttontext = new Textblock(false);
+ Textblock *cbuttontext = new Textblock(false, 100);
ComplexButtonResource *cbuttonres =
layout->getResourceFactory()->createComplexButtonResource (cbuttontext,
true);
@@ -131,7 +131,7 @@ int main(int argc, char **argv)
// Create the widgets.
table->addRow (cellStyle);
- Textblock *label1 = new Textblock(false);
+ Textblock *label1 = new Textblock(false, 100);
label1->setStyle (cellStyle);
table->addCell (label1, 1, 1);
label1->addText ("val1 = ", cellStyle);
@@ -143,7 +143,7 @@ int main(int argc, char **argv)
table->addRow (cellStyle);
- Textblock *label2 = new Textblock(false);
+ Textblock *label2 = new Textblock(false, 100);
label2->setStyle (cellStyle);
table->addCell (label2, 1, 1);
label2->addText ("val2 = ", cellStyle);
@@ -155,7 +155,7 @@ int main(int argc, char **argv)
table->addRow (cellStyle);
- Textblock *label = new Textblock(false);
+ Textblock *label = new Textblock(false, 100);
label->setStyle (cellStyle);
table->addCell (label, 1, 1);
label->addText ("text = ", cellStyle);
@@ -168,7 +168,7 @@ int main(int argc, char **argv)
table->addRow (cellStyle);
- Textblock *radiolabel1 = new Textblock(false);
+ Textblock *radiolabel1 = new Textblock(false, 100);
radiolabel1->setStyle (cellStyle);
table->addCell (radiolabel1, 2, 1);
Embed *radio1 = new Embed (radiores1);
@@ -177,7 +177,7 @@ int main(int argc, char **argv)
radiolabel1->flush ();
table->addRow (cellStyle);
- Textblock *radiolabel2 = new Textblock(false);
+ Textblock *radiolabel2 = new Textblock(false, 100);
radiolabel2->setStyle (cellStyle);
table->addCell (radiolabel2, 2, 1);
Embed *radio2 = new Embed (radiores2);
@@ -186,7 +186,7 @@ int main(int argc, char **argv)
radiolabel2->flush ();
table->addRow (cellStyle);
- Textblock *checklabel = new Textblock(false);
+ Textblock *checklabel = new Textblock(false, 100);
checklabel->setStyle (cellStyle);
table->addCell (checklabel, 2, 1);
Embed *check = new Embed (checkres);