Polling guiIsClicked

bool guiIsClicked(int gui_id, int handle);
  • Call from OnCalculate / OnTick.
  • Edge-triggered: first poll after a click returns true, then clears until the next click.
  • Supported types: button, checkbox, radio, link, edit (focus click), menu, dropdown (selection / list open).
  • On false, call guiGetLastError to distinguish "not clicked" from an error.

The DLL posts a synthetic chart tick on most clicks so a quiet chart still runs your indicator code.

Live Edit Text

guiObjectGetString(gui_id, edit_handle, GUI_OBJPROP_TEXT) reads the live edit field, not only the last value set from MQL. Typing also posts a synthetic tick.

After guiIsClicked returns true for a dropdown (or on any tick following a selection change):

int sel = guiObjectGetInteger(gui_id, dd_handle, GUI_OBJPROP_DROPDOWN_SEL);
if(guiGetLastError(gui_id) == GUI_ERR_NO_ERROR && sel >= 0)
   Print("Selected row: ", sel);