Hi, that might have also been done already, but anyway, this is fairly simple: This patch makes the text input lines scroll in case the cursor went out of bounds.
I stumbled over quite a lot magics in lite/textline.c (e.g. colors, spacing dimensions, ...) - shouldn't they probably move to something like lite/lite_config.h or some other, more generic place? Daniel
diff --git a/lite/textline.c b/lite/textline.c index e381a1f..02abbc2 100644 --- a/lite/textline.c +++ b/lite/textline.c @@ -217,7 +217,7 @@ draw_textline(LiteBox *box, DFBResult result; IDirectFBSurface *surface = box->surface; LiteTextLine *textline = LITE_TEXTLINE(box); - int cursor_x = 0; + int surface_x, cursor_x = 0; IDirectFBFont *font_interface = NULL; D_ASSERT(box != NULL); @@ -253,7 +253,13 @@ draw_textline(LiteBox *box, /* Draw the text */ surface->SetColor(surface, 0x30, 0x30, 0x30, 0xff); - surface->DrawString(surface, textline->text, -1, 5, 2, DSTF_TOPLEFT); + surface_x = 5; + if (cursor_x > region->x2 - region->x1 - 5) + surface_x = region->x2 - region->x1 - cursor_x - 5; + + surface->DrawString(surface, textline->text, -1, surface_x, 2, DSTF_TOPLEFT); + cursor_x += surface_x - 5; + printf(" -- %d %d\n", cursor_x, surface_x); /* Draw the cursor */ surface->SetDrawingFlags(surface, DSDRAW_BLEND);
_______________________________________________ directfb-dev mailing list directfb-dev@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev