case GD_TYPE_NORMAL_BUTTON:
case GD_TYPE_CHECK_BUTTON:
case GD_TYPE_RADIO_BUTTON:
- BlitBitmap(gd->bitmap, drawto,
- gd->x, gd->y, gi->width, gi->height, gi->x, gi->y);
+ BlitBitmapOnBackground(gd->bitmap, drawto,
+ gd->x, gd->y, gi->width, gi->height,
+ gi->x, gi->y);
if (gi->deco.design.bitmap)
BlitBitmap(gi->deco.design.bitmap, drawto,
gi->deco.design.x, gi->deco.design.y,
char cursor_string[3];
char text[MAX_GADGET_TEXTSIZE + 1];
int font_type = gi->text.font_type;
- int font_width = getFontWidth(FS_SMALL, font_type);
+ int font_width = getFontWidth(font_type);
int border = gi->border.size;
+
strcpy(text, gi->text.value);
strcat(text, " ");
/* left part of gadget */
- BlitBitmap(gd->bitmap, drawto,
- gd->x, gd->y, border, gi->height, gi->x, gi->y);
+ BlitBitmapOnBackground(gd->bitmap, drawto,
+ gd->x, gd->y, border, gi->height, gi->x, gi->y);
/* middle part of gadget */
for (i=0; i<=gi->text.size; i++)
- BlitBitmap(gd->bitmap, drawto,
- gd->x + border, gd->y, font_width, gi->height,
- gi->x + border + i * font_width, gi->y);
+ BlitBitmapOnBackground(gd->bitmap, drawto,
+ gd->x + border, gd->y, font_width, gi->height,
+ gi->x + border + i * font_width, gi->y);
/* right part of gadget */
- BlitBitmap(gd->bitmap, drawto,
- gd->x + gi->border.width - border, gd->y,
- border, gi->height, gi->x + gi->width - border, gi->y);
+ BlitBitmapOnBackground(gd->bitmap, drawto,
+ gd->x + gi->border.width -border, gd->y, border,
+ gi->height, gi->x + gi->width - border, gi->y);
/* gadget text value */
- DrawText(gi->x + border, gi->y + border, text, FS_SMALL, font_type);
+ DrawTextExt(drawto,
+ gi->x + border, gi->y + border, text,
+ font_type, FONT_MASKED);
cursor_letter = gi->text.value[gi->text.cursor_position];
cursor_string[0] = '~';
/* draw cursor, if active */
if (pressed)
- DrawText(gi->x + border + gi->text.cursor_position * font_width,
- gi->y + border, cursor_string, FS_SMALL, font_type);
+ DrawTextExt(drawto,
+ gi->x + border + gi->text.cursor_position * font_width,
+ gi->y + border, cursor_string,
+ font_type, FONT_MASKED);
}
break;
int step_size_remain = size_body - num_steps * design_body;
/* clear scrollbar area */
- ClearRectangle(backbuffer, gi->x, gi->y, gi->width, gi->height);
+ ClearRectangleOnBackground(backbuffer, gi->x, gi->y,
+ gi->width, gi->height);
/* upper part of gadget */
- BlitBitmap(gd->bitmap, drawto,
- gd->x, gd->y,
- gi->width, gi->border.size,
- xpos, ypos);
+ BlitBitmapOnBackground(gd->bitmap, drawto,
+ gd->x, gd->y,
+ gi->width, gi->border.size,
+ xpos, ypos);
/* middle part of gadget */
for (i=0; i<num_steps; i++)
- BlitBitmap(gd->bitmap, drawto,
- gd->x, gd->y + gi->border.size,
- gi->width, design_body,
- xpos, ypos + gi->border.size + i * design_body);
+ BlitBitmapOnBackground(gd->bitmap, drawto,
+ gd->x, gd->y + gi->border.size,
+ gi->width, design_body,
+ xpos,
+ ypos + gi->border.size + i * design_body);
/* remaining middle part of gadget */
if (step_size_remain > 0)
- BlitBitmap(gd->bitmap, drawto,
- gd->x, gd->y + gi->border.size,
- gi->width, step_size_remain,
- xpos, ypos + gi->border.size + num_steps * design_body);
+ BlitBitmapOnBackground(gd->bitmap, drawto,
+ gd->x, gd->y + gi->border.size,
+ gi->width, step_size_remain,
+ xpos,
+ ypos + gi->border.size
+ + num_steps * design_body);
/* lower part of gadget */
- BlitBitmap(gd->bitmap, drawto,
- gd->x, gd->y + design_full - gi->border.size,
- gi->width, gi->border.size,
- xpos, ypos + size_full - gi->border.size);
+ BlitBitmapOnBackground(gd->bitmap, drawto,
+ gd->x, gd->y + design_full - gi->border.size,
+ gi->width, gi->border.size,
+ xpos, ypos + size_full - gi->border.size);
}
break;
int step_size_remain = size_body - num_steps * design_body;
/* clear scrollbar area */
- ClearRectangle(backbuffer, gi->x, gi->y, gi->width, gi->height);
+ ClearRectangleOnBackground(backbuffer, gi->x, gi->y,
+ gi->width, gi->height);
/* left part of gadget */
- BlitBitmap(gd->bitmap, drawto,
- gd->x, gd->y,
- gi->border.size, gi->height,
- xpos, ypos);
+ BlitBitmapOnBackground(gd->bitmap, drawto,
+ gd->x, gd->y,
+ gi->border.size, gi->height,
+ xpos, ypos);
/* middle part of gadget */
for (i=0; i<num_steps; i++)
- BlitBitmap(gd->bitmap, drawto,
- gd->x + gi->border.size, gd->y,
- design_body, gi->height,
- xpos + gi->border.size + i * design_body, ypos);
+ BlitBitmapOnBackground(gd->bitmap, drawto,
+ gd->x + gi->border.size, gd->y,
+ design_body, gi->height,
+ xpos + gi->border.size + i * design_body,
+ ypos);
/* remaining middle part of gadget */
if (step_size_remain > 0)
- BlitBitmap(gd->bitmap, drawto,
- gd->x + gi->border.size, gd->y,
- step_size_remain, gi->height,
- xpos + gi->border.size + num_steps * design_body, ypos);
+ BlitBitmapOnBackground(gd->bitmap, drawto,
+ gd->x + gi->border.size, gd->y,
+ step_size_remain, gi->height,
+ xpos + gi->border.size
+ + num_steps * design_body,
+ ypos);
/* right part of gadget */
- BlitBitmap(gd->bitmap, drawto,
- gd->x + design_full - gi->border.size, gd->y,
- gi->border.size, gi->height,
- xpos + size_full - gi->border.size, ypos);
+ BlitBitmapOnBackground(gd->bitmap, drawto,
+ gd->x + design_full - gi->border.size, gd->y,
+ gi->border.size, gi->height,
+ xpos + size_full - gi->border.size, ypos);
}
break;
if (gi->type & GD_TYPE_TEXTINPUT)
{
- int font_width = getFontWidth(FS_SMALL, gi->text.font_type);
- int font_height = getFontHeight(FS_SMALL, gi->text.font_type);
+ int font_width = getFontWidth(gi->text.font_type);
+ int font_height = getFontHeight(gi->text.font_type);
gi->width = 2 * gi->border.size + (gi->text.size + 1) * font_width;
gi->height = 2 * gi->border.size + font_height;
{
struct GadgetInfo *gi_previous = gadget_list_first_entry;
- while (gi_previous && gi_previous->next != gi)
+ while (gi_previous != NULL && gi_previous->next != gi)
gi_previous = gi_previous->next;
if (gi == gadget_list_first_entry)
if (gi == gadget_list_last_entry)
gadget_list_last_entry = gi_previous;
- if (gi_previous)
+ if (gi_previous != NULL)
gi_previous->next = gi->next;
free(gi);
/* if mouse button pressed inside activated text gadget, set cursor */
gi->text.cursor_position =
(mx - gi->x - gi->border.size) /
- getFontWidth(FS_SMALL, gi->text.font_type);
+ getFontWidth(gi->text.font_type);
if (gi->text.cursor_position < 0)
gi->text.cursor_position = 0;