X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fgadgets.c;h=fcfd235e509fa07a37a8ade24c17a3e2e6c90f81;hb=e567cb7fd1d4e5b41778326253f736f6f30f14c5;hp=c961021a3e2a56e855ed93d9096f270a5823ba63;hpb=f0a36d142c51c8936afa8f9e7bbcf10946c8170a;p=rocksndiamonds.git diff --git a/src/libgame/gadgets.c b/src/libgame/gadgets.c index c961021a..fcfd235e 100644 --- a/src/libgame/gadgets.c +++ b/src/libgame/gadgets.c @@ -423,9 +423,9 @@ static void DrawGadget(struct GadgetInfo *gi, boolean pressed, boolean direct) gi->height - 2 * border_y); // gadget text value - DrawTextBuffer(gi->x + border_x, gi->y + border_y, gi->textarea.value, - font_nr, gi->textarea.xsize, -1, gi->textarea.ysize, 0, - BLIT_ON_BACKGROUND, FALSE, FALSE, FALSE); + DrawTextArea(gi->x + border_x, gi->y + border_y, gi->textarea.value, + font_nr, gi->textarea.xsize, -1, gi->textarea.ysize, 0, + BLIT_ON_BACKGROUND, FALSE, FALSE, FALSE); cursor_letter = gi->textarea.value[gi->textarea.cursor_position]; cursor_string[0] = (cursor_letter != '\0' ? cursor_letter : ' '); @@ -879,7 +879,7 @@ static void HandleGadgetTags(struct GadgetInfo *gi, int first_tag, va_list ap) { int tag = first_tag; - if (gi == NULL || gi->deactivated) + if (gi == NULL) return; while (tag != GDI_END) @@ -1711,7 +1711,7 @@ boolean HandleGadgets(int mx, int my, int button) struct GadgetInfo *gi = last_gi; boolean gadget_changed = ((gi->event_mask & GD_EVENT_TEXT_LEAVING) != 0); - // check if text gadget has changed its value + // check if text input gadget has changed its value if (gi->type & GD_TYPE_TEXT_INPUT) { CheckRangeOfNumericInputGadget(gi); @@ -1722,6 +1722,15 @@ boolean HandleGadgets(int mx, int my, int button) gadget_changed = FALSE; } + // check if text area gadget has changed its value + if (gi->type & GD_TYPE_TEXT_AREA) + { + if (!strEqual(gi->textarea.last_value, gi->textarea.value)) + strcpy(gi->textarea.last_value, gi->textarea.value); + else + gadget_changed = FALSE; + } + // selectbox does not change its value when closed by clicking outside if (gi->type & GD_TYPE_SELECTBOX) gadget_changed = FALSE; @@ -1925,7 +1934,7 @@ boolean HandleGadgets(int mx, int my, int button) if (gadget_pressed) // gadget pressed the first time { // initialize delay counter - DelayReached(&pressed_delay, 0); + ResetDelayCounter(&pressed_delay); // start gadget delay with longer delay after first click on gadget pressed_delay_value = GADGET_FRAME_DELAY_FIRST;