/// <summary>process browser events</summary> /// <param name = "guiMgCtrl">browser control</param> /// <param name = "evt">the event code from InternalInterface</param> /// <param name = "text">the text of the event</param> internal void processBrowserEvent(GuiMgControl guiMgCtrl, int evt, String text) { var browserCtrl = (MgControl)guiMgCtrl; var rtEvt = new RunTimeEvent(browserCtrl, browserCtrl.getDisplayLine(false), true); rtEvt.setInternal(evt); var argsList = new GuiExpressionEvaluator.ExpVal[1]; //create the string for the blob string blobString = BlobType.createFromString(text, BlobType.CONTENT_TYPE_UNICODE); argsList[0] = new GuiExpressionEvaluator.ExpVal(StorageAttribute.BLOB, false, blobString); var args = new ArgumentsList(argsList); rtEvt.setArgList(args); ClientManager.Instance.EventsManager.addToTail(rtEvt); }
/// <summary> Add Open Context Menu event on right click on form.</summary> /// <param name = "guiMgControl">control </param> /// <param name = "guiMgForm">code of internal event </param> /// <param name = "left">code of internal event </param> /// <param name = "top">code of internal event </param> /// <param name = "line">code of internal event </param> public void AddOpenContextMenuEvent(GuiMgControl guiMgControl, GuiMgForm guiMgForm, int left, int top, int line) { MgControl ctrl = null; Task task = null; if (guiMgControl != null) { if (guiMgControl is MgControl) { ctrl = (MgControl)guiMgControl; if (ctrl.Type == MgControlType.CTRL_TYPE_SUBFORM) { task = (Task)ctrl.GetSubformMgForm().getTask(); } else { task = (Task)((MgControlBase)guiMgControl).getForm().getTask(); } } } else { task = (Task)((MgFormBase)guiMgForm).getTask(); } // Prepare event for MG_ACT_CONTEXT_MENU to open context menu. var rtEvt = new RunTimeEvent(task); rtEvt.setInternal(InternalInterface.MG_ACT_CONTEXT_MENU); rtEvt.setCtrl(ctrl); //Prepare an argument list for left and top co-ordinate. var argsList = new GuiExpressionEvaluator.ExpVal[3]; argsList[0] = new GuiExpressionEvaluator.ExpVal(StorageAttribute.ALPHA, false, left.ToString()); argsList[1] = new GuiExpressionEvaluator.ExpVal(StorageAttribute.ALPHA, false, top.ToString()); argsList[2] = new GuiExpressionEvaluator.ExpVal(StorageAttribute.ALPHA, false, line.ToString()); var args = new ArgumentsList(argsList); rtEvt.setArgList(args); ClientManager.Instance.EventsManager.addToTail(rtEvt); }