return gi;
}
-static int getNewGadgetID()
+static int getNewGadgetID(void)
{
int id = next_free_gadget_id++;
}
}
-void UnmapAllGadgets()
+void UnmapAllGadgets(void)
{
MultiMapGadgets(MULTIMAP_ALL | MULTIMAP_UNMAP);
}
-void RemapAllGadgets()
+void RemapAllGadgets(void)
{
MultiMapGadgets(MULTIMAP_ALL | MULTIMAP_REMAP);
}
-boolean anyTextInputGadgetActive()
+boolean anyTextInputGadgetActive(void)
{
return (last_gi && (last_gi->type & GD_TYPE_TEXT_INPUT) && last_gi->mapped);
}
-boolean anyTextAreaGadgetActive()
+boolean anyTextAreaGadgetActive(void)
{
return (last_gi && (last_gi->type & GD_TYPE_TEXT_AREA) && last_gi->mapped);
}
-boolean anySelectboxGadgetActive()
+boolean anySelectboxGadgetActive(void)
{
return (last_gi && (last_gi->type & GD_TYPE_SELECTBOX) && last_gi->mapped);
}
-boolean anyScrollbarGadgetActive()
+boolean anyScrollbarGadgetActive(void)
{
return (last_gi && (last_gi->type & GD_TYPE_SCROLLBAR) && last_gi->mapped);
}
-boolean anyTextGadgetActive()
+boolean anyTextGadgetActive(void)
{
return (anyTextInputGadgetActive() ||
anyTextAreaGadgetActive() ||
if (button_status)
HandleGadgets(-1, -1, 0);
+ int x = gi->x;
+ int y = gi->y;
+
+ /* set cursor position to the end of the text for text input gadgets */
+ if (gi->type & GD_TYPE_TEXT_INPUT)
+ x = gi->x + gi->width - 1;
+
/* simulate pressing mouse button over specified gadget */
- HandleGadgets(gi->x, gi->y, button);
+ HandleGadgets(x, y, button);
/* simulate releasing mouse button over specified gadget */
- HandleGadgets(gi->x, gi->y, 0);
+ HandleGadgets(x, y, 0);
}
boolean HandleGadgets(int mx, int my, int button)
return TRUE;
}
-void DumpGadgetIdentifiers()
+void DumpGadgetIdentifiers(void)
{
struct GadgetInfo *gi;