Merged revisions 8059-8359 via svnmerge from

svn://svn.netsurf-browser.org/branches/paulblokus/textinput

........
  r8337 | paulblokus | 2009-07-06 00:38:21 +0100 (Mon, 06 Jul 2009) | 2 lines
  
  added textarea_set_position
........

svn path=/trunk/netsurf/; revision=8360
This commit is contained in:
John Mark Bell 2009-07-06 23:47:50 +00:00
parent d98ec423b1
commit 68aeb65cdf
2 changed files with 24 additions and 0 deletions

View File

@ -193,6 +193,25 @@ struct text_area *textarea_create(int x, int y, int width, int height,
}
/**
* Change the position of a textarea. The text area is redrawn
*
* \param ta the textarea to change position of
* \param x X coordinate of the the new position
* \param y Y coordinate of the the new position
*/
void textarea_set_position(struct text_area *ta, int x, int y)
{
ta->x = x;
ta->y = y;
ta->redraw_start_callback(ta->data);
textarea_redraw(ta, ta->x, ta->y, ta->x + ta->vis_width,
ta->y + ta->vis_height);
textarea_set_caret(ta, textarea_get_caret(ta));
ta->redraw_start_callback(ta->data);
}
/**
* Destroy a text area
*
@ -710,6 +729,10 @@ bool textarea_reflow(struct text_area *ta, unsigned int line)
* Handle redraw requests for text areas
*
* \param redraw Redraw request block
* \param x0 left X coordinate of redraw area
* \param y0 top Y coordinate of redraw area
* \param x1 right X coordinate of redraw area
* \param y1 bottom Y coordinate of redraw area
*/
void textarea_redraw(struct text_area *ta, int x0, int y0, int x1, int y1)
{

View File

@ -42,6 +42,7 @@ struct text_area *textarea_create(int x, int y, int width, int height,
unsigned int flags, const struct css_style *style,
textarea_start_redraw_callback redraw_start_callback,
textarea_end_redraw_callback redraw_end_callback, void *data);
void textarea_set_position(struct text_area *ta, int x, int y);
void textarea_destroy(struct text_area *ta);
bool textarea_set_text(struct text_area *ta, const char *text);
int textarea_get_text(struct text_area *ta, char *buf, unsigned int len);