Docs » Autodocs » texteditor.gadget » GA_TEXTEDITOR_DoubleClickHook
GA_TEXTEDITOR_DoubleClickHook -- [IS.], struct Hook *
If you use the gadget in ReadOnly mode then you may want a special action to take place when the user doubleclick certain words. For example a mail or news client, using this gadget to show mails, may want the user to be able to click on URL's to lookup the link. The hook will be called with A1 pointing to a ClickMessage, and A0 will point to the hook itself. Your hook should return TRUE if it wants to stop the editor from blocking.
/* This hook will test if the user doubleclicked an http address */ BOOL URLHookCode (register __a1 struct ClickMessage *clickmsg) { UWORD pos = clickmsg->ClickPosition; while(pos && *(clickmsg->LineContents+pos-1) != ' ' && *(clickmsg->LineContents+pos-1) != '<') { pos--; } if(strncmp(clickmsg->LineContents+pos, "http:", 5)) { return(FALSE); } LookupURL(clickmsg->LineContents+pos); return(TRUE); }
GA_TEXTEDITOR_ReadOnly(), mui/TextEditor_mcc.h
|