6.2 multiline word wrap

Defined multiline widget as below does not wraps word ( last letetr is cut
in half ) using ttf universal font.

Is it a code proble or wrap problem? What would be work around?

// create multiline explanation box with automatic word wrap
area.pos.x = 200;
area.pos.y = 60;
area.size.w = 340;
area.size.h = 240;






// Set up argument list
PtSetArg (&arg[i++], Pt_ARG_AREA, area, 0);
PtSetArg (&arg[i++], Pt_ARG_TEXT_FONT, FONT_NAME[font], 0);
PtSetArg (&arg[i++], Pt_ARG_FILL_COLOR, Pg_TRANSPARENT, 0);
PtSetArg (&arg[i++], Pt_ARG_COLOR, color, 0);
PtSetArg (&arg[i++], Pt_ARG_HORIZONTAL_ALIGNMENT, horiz_alignment,
0);
PtSetArg (&arg[i++], Pt_ARG_FLAGS, Pt_FALSE,
Pt_HIGHLIGHTED|Pt_GETS_FOCUS);
PtSetArg (&arg[i++], Pt_ARG_MARGIN_HEIGHT, 0, 0);
PtSetArg (&arg[i++], Pt_ARG_MARGIN_WIDTH, 0, 0);
if (Language::strlen(tc) > GUI_MULTILINE_DISPLAY_LENGTH)
{
failure.raise (FILE, LINE, FC_DISPLAY_OVERRUN,
(int)Language::strlen(tc));
}
else
{
char utf8_buf [MULTILINE_BUFLEN];
Language::lookup (tc, utf8_buf, MULTILINE_BUFLEN);
PtSetArg (&arg[i++], Pt_ARG_TEXT_STRING, utf8_buf, 0);
}

// Create multitext widget
result = PtCreateWidget (PtMultiText, parent, i, arg);

// Error check and return
if (result == NULL)
{
failure.raise (FILE, LINE, FC_WIDGET_CREATION_FAIL);
}

Janusz.

If the displayed text is “Printing Last Treatment Report” - formating is
fine but in text “Printing Last Treatment Report\n”
last letter ‘t’ is missing.


“Janusz Ruszel” <janusz_ruszel@baxter.com> wrote in message
news:bb8knh$lid$1@inn.qnx.com

Defined multiline widget as below does not wraps word ( last letetr is cut
in half ) using ttf universal font.

Is it a code proble or wrap problem? What would be work around?

// create multiline explanation box with automatic word wrap
area.pos.x = 200;
area.pos.y = 60;
area.size.w = 340;
area.size.h = 240;






// Set up argument list
PtSetArg (&arg[i++], Pt_ARG_AREA, area, 0);
PtSetArg (&arg[i++], Pt_ARG_TEXT_FONT, FONT_NAME[font], 0);
PtSetArg (&arg[i++], Pt_ARG_FILL_COLOR, Pg_TRANSPARENT, 0);
PtSetArg (&arg[i++], Pt_ARG_COLOR, color, 0);
PtSetArg (&arg[i++], Pt_ARG_HORIZONTAL_ALIGNMENT, horiz_alignment,
0);
PtSetArg (&arg[i++], Pt_ARG_FLAGS, Pt_FALSE,
Pt_HIGHLIGHTED|Pt_GETS_FOCUS);
PtSetArg (&arg[i++], Pt_ARG_MARGIN_HEIGHT, 0, 0);
PtSetArg (&arg[i++], Pt_ARG_MARGIN_WIDTH, 0, 0);
if (Language::strlen(tc) > GUI_MULTILINE_DISPLAY_LENGTH)
{
failure.raise (FILE, LINE, FC_DISPLAY_OVERRUN,
(int)Language::strlen(tc));
}
else
{
char utf8_buf [MULTILINE_BUFLEN];
Language::lookup (tc, utf8_buf, MULTILINE_BUFLEN);
PtSetArg (&arg[i++], Pt_ARG_TEXT_STRING, utf8_buf, 0);
}

// Create multitext widget
result = PtCreateWidget (PtMultiText, parent, i, arg);

// Error check and return
if (result == NULL)
{
failure.raise (FILE, LINE, FC_WIDGET_CREATION_FAIL);
}

Janusz.