/* gadget text value */
DrawTextToTextArea(gi->x + border_x, gi->y + border_y,
- gi->textarea.value, font_nr,
- gi->textarea.xsize, gi->textarea.ysize);
+ gi->textarea.value, font_nr, gi->textarea.xsize,
+ gi->textarea.xsize, gi->textarea.ysize,
+ BLIT_ON_BACKGROUND);
cursor_letter = gi->textarea.value[gi->textarea.cursor_position];
cursor_string[0] = (cursor_letter != '\0' ? cursor_letter : ' ');
xpos, ypos);
/* middle part of gadget */
- for (i=0; i<num_steps; i++)
+ for (i=0; i < num_steps; i++)
BlitBitmapOnBackground(gd->bitmap, drawto,
gd->x, gd->y + gi->border.ysize,
gi->width, design_body,
xpos, ypos);
/* middle part of gadget */
- for (i=0; i<num_steps; i++)
+ for (i=0; i < num_steps; i++)
BlitBitmapOnBackground(gd->bitmap, drawto,
gd->x + gi->border.xsize, gd->y,
design_body, gi->height,
HandleGadgets(gi->x, gi->y, 0);
}
-void HandleGadgets(int mx, int my, int button)
+boolean HandleGadgets(int mx, int my, int button)
{
static struct GadgetInfo *last_info_gi = NULL;
static unsigned long pressed_delay = 0;
/* check if there are any gadgets defined */
if (gadget_list_first_entry == NULL)
- return;
+ return FALSE;
/* simulated release of mouse button over last gadget */
if (mx == -1 && my == -1 && button == 0)
/* don't handle this scrollbar anymore while mouse button pressed */
last_gi = NULL;
- return;
+ return TRUE;
}
}
/* handle gadgets unmapped/mapped between pressing and releasing */
if (release_event && !gadget_released && new_gi)
new_gi->state = GD_BUTTON_UNPRESSED;
+
+ return (gadget_pressed || gadget_pressed_repeated ||
+ gadget_released || gadget_moving);
}
static void insertCharIntoTextArea(struct GadgetInfo *gi, char c)
setTextAreaCursorPosition(gi, gi->textarea.cursor_position + 1);
}
-void HandleGadgetsKeyInput(Key key)
+boolean HandleGadgetsKeyInput(Key key)
{
struct GadgetInfo *gi = last_gi;
!(gi->type & GD_TYPE_TEXT_INPUT ||
gi->type & GD_TYPE_TEXT_AREA ||
gi->type & GD_TYPE_SELECTBOX))
- return;
+ return FALSE;
if (key == KSYM_Return) /* valid for both text input and selectbox */
{
DrawGadget(gi, DG_PRESSED, gi->direct_draw);
}
}
+
+ return TRUE;
}