Ejemplo n.º 1
0
 private void button1_OnClick(ClickEvent e)
 {
     if (KSPScienceLibrary.drawWindow)
         KSPScienceLibrary.Hide();
     else
         KSPScienceLibrary.Show();
 }
 private void KSPScienceMonitorButton_OnClick(ClickEvent e)
 {
     if (KSPScienceMonitor.drawWindow)
         KSPScienceMonitor.Hide();
     else
         KSPScienceMonitor.Show();
 }
Ejemplo n.º 3
0
 protected override bool OnClick(ClickEvent e)
 {
     Parent.TriggerClick();
     return(base.OnClick(e));
 }
Ejemplo n.º 4
0
 protected override bool OnClick(ClickEvent e) => true;
 protected override bool OnClick(ClickEvent e)
 {
     Action?.Invoke();
     return(true);
 }
Ejemplo n.º 6
0
 public override void Click(ClickEvent cEvent)
 {
     base.Click(cEvent);
     rigidbodyComp.AddForceAtPosition(new Vector3(0.0f, -forceMagnitude, 0.0f), cEvent.position);
 }
Ejemplo n.º 7
0
 protected override bool OnClick(ClickEvent e) => RequestSelection != null;
Ejemplo n.º 8
0
    public void ClickPerso()
    {
        ClickEvent.newClickEvent();

        StartCoroutine(waitForHover()); // très important sinon le code visuel s'execute après le hover
    }
Ejemplo n.º 9
0
        /// <summary>
        /// 接口,返回数据
        /// </summary>
        /// <returns></returns>
        public string MsgResponse()
        {
            string sRespData = string.Empty;

            if (string.IsNullOrEmpty(this._sContent))
            {
                return(sRespData);
            }
            XmlHelper <Stream> xo     = new XmlHelper <Stream>(ConvertDataType.String2Stream(this._sContent, Encoding.UTF8));
            string             sEvent = xo.GetXElementContent("xml.Event");

            switch (sEvent.ToLower())
            {
            //订阅事件
            case "subscribe":
                sRespData = new Subscribe(xo.GetObj <MessageSubscribeEvent>("xml")).MsgResponse();
                break;

            //取消订阅事件
            case "unsubscribe":
                sRespData = new Unsubscribe(xo.GetObj <MessageSubscribeEvent>("xml")).MsgResponse();
                break;

            //上报地理位置事件
            case "location":
                sRespData = new Location(xo.GetObj <MessageLocationEvent>("xml")).MsgResponse();
                break;

            //点击菜单拉取消息的事件推送
            case "click":
                sRespData = new ClickEvent(xo.GetObj <MessageMenuPushEvent>("xml")).MsgResponse();
                break;

            //点击菜单跳转链接的事件推送
            case "view":
                sRespData = new ViewEvent(xo.GetObj <MessageMenuPushEvent>("xml")).MsgResponse();
                break;

            //扫码推事件的事件推送
            case "scancode_push":
                sRespData = new ScancodePush(xo.GetObj <MessageScancodePushEvent>("xml")).MsgResponse();
                break;

            //扫码推事件且弹出“消息接收中”提示框的事件推送
            case "scancode_waitmsg":
                sRespData = new ScancodeWaitmsg(xo.GetObj <MessageScancodePushEvent>("xml")).MsgResponse();
                break;

            //弹出系统拍照发图的事件推送
            case "pic_sysphoto":
                sRespData = new PicSysPhoto(xo.GetObj <MessagePicSysPhotoEvent>("xml")).MsgResponse();
                break;

            //弹出拍照或者相册发图的事件推送
            case "pic_photo_or_album":
                sRespData = new PicPhotoOrAlbum(xo.GetObj <MessagePicSysPhotoEvent>("xml")).MsgResponse();
                break;

            //弹出微信相册发图器的事件推送
            case "pic_weixin":
                sRespData = new PicWeiXin(xo.GetObj <MessagePicSysPhotoEvent>("xml")).MsgResponse();
                break;

            //弹出地理位置选择器的事件推送
            case "location_select":
                sRespData = new LocationSelect(xo.GetObj <MessageLocationSelectEvent>("xml")).MsgResponse();
                break;

            //成员进入应用的事件推送
            case "enter_agent":
                sRespData = new EnterAgent(xo.GetObj <MessageMenuPushEvent>("xml")).MsgResponse();
                break;

            //异步任务完成事件推送
            case "batch_job_result":
                sRespData = new BatchJobResult(xo.GetObj <MessageBatchJobResultEvent>("xml")).MsgResponse();
                break;

            default: break;
            }
            return(sRespData);
        }
 public void Click()
 {
     ClickEvent?.Invoke(this, EventArgs.Empty);
 }
Ejemplo n.º 11
0
 protected override bool OnClick(ClickEvent e)
 {
     this.ShowPopover();
     return(true);
 }
Ejemplo n.º 12
0
 public void OnPointerClick(PointerEventData eventData)
 {
     ClickEvent?.Invoke(eventData.position);
 }
Ejemplo n.º 13
0
 protected override bool OnClick(ClickEvent e)
 {
     sampleClick?.Play();
     return(base.OnClick(e));
 }
Ejemplo n.º 14
0
 remove => this.RemoveHandler(ClickEvent, value);
Ejemplo n.º 15
0
 add => this.AddHandler(ClickEvent, value);
 void OnToolbarButtonClick(ClickEvent ev)
 {
     StockToolbarButtonClick();
 }
Ejemplo n.º 17
0
 public MouseEvent(int x, int y, ClickEvent clickEvent)
 {
     X = x;
     Y = y;
     ClickEvent = clickEvent;
 }
Ejemplo n.º 18
0
 protected override bool OnClick(ClickEvent e)
 {
     ToggleMaximisationState(this);
     return(true);
 }
Ejemplo n.º 19
0
        private void buttonClick(object sender, EventArgs e)
        {
            ButtonItem button = (ButtonItem)sender;

            label14.Text = button.Text;
            lastButton = button;
            lastClickEvent = buttonClick;                            

            //The following code is to dynamically generate a class from a string
            //Then it dynamically compiles a block of code to pass that object to "SetGraph"
            String name = Assembly.CreateQualifiedName("Genetibase.UI.NuGenMeters.Full", ButtonMeterMap.GetGraph(button));
            Type t = Type.GetType(name);

            SetGraph((NuGenGraphGeneric)Activator.CreateInstance(t));

            uiTab1.SelectedIndex = 1;
        }
 protected override bool OnClick(ClickEvent e) => false; // Clicks aren't handled by this type of button
Ejemplo n.º 21
0
 protected override bool OnClick(ClickEvent e)
 {
     Items.First().State.Value = CarouselItemState.Selected;
     return(true);
 }
Ejemplo n.º 22
0
    public EventExam1()
    {
        ExampleClass obj = new ExampleClass();

        ExamEvent += new ClickEvent(obj.OnClick);
    }
Ejemplo n.º 23
0
 protected override bool OnClick(ClickEvent e)
 {
     dismiss();
     return(true);
 }
Ejemplo n.º 24
0
 void Start()
 {
     cManager = GetComponent <CountManager>();
     clEvent  = GetComponent <ClickEvent>();
 }
Ejemplo n.º 25
0
 protected override bool OnClick(ClickEvent e)
 {
     Debug.Assert(SetInfo.OnlineBeatmapSetID != null);
     beatmapSetOverlay?.FetchAndShowBeatmapSet(SetInfo.OnlineBeatmapSetID.Value);
     return(true);
 }
Ejemplo n.º 26
0
 protected override bool OnClick(ClickEvent e)
 {
     Hide();
     return(true);
 }
Ejemplo n.º 27
0
 protected override bool OnClick(ClickEvent e)
 {
     State = Visibility.Hidden;
     return(true);
 }
Ejemplo n.º 28
0
 protected override bool OnClick(ClickEvent e)
 {
     displayLocked.Toggle();
     return(true);
 }
Ejemplo n.º 29
0
 protected override bool OnClick(ClickEvent e)
 {
     trigger();
     return(true);
 }
Ejemplo n.º 30
0
 protected override bool OnClick(ClickEvent e)
 {
     RequestPlacement?.Invoke(component.GetType());
     return(true);
 }
Ejemplo n.º 31
0
 protected override bool OnClick(ClickEvent e)
 {
     Checked.Value = !Checked.Value;
     return(true);
 }
 protected override bool OnClick(ClickEvent e)
 {
     this.MoveToOffset(new Vector2(100, 0)).Then().MoveToOffset(new Vector2(-100, 0), 1000, Easing.In);
     return(true);
 }
Ejemplo n.º 33
0
        private MouseEvent OnMouseEvent(MouseEventArgs e, ClickEvent clickEvent)
        {
            Point mousePosition = e.GetPosition(this);
            Point middlePoint = WindowMiddle;
            Point difference = CalculateDifference(middlePoint, mousePosition);
            difference.X += 8;
            difference.Y += 30;

            Cooridnate.Content = string.Format("WindowPos: {0}|{1}   Middle: {2}|{3}   Diff: {4}|{5}  Click: {6}" , Left, Top,
                                               middlePoint.X, middlePoint.Y, difference.X, difference.Y, clickEvent);

            MouseEvent mEvent = new MouseEvent((int)difference.X, (int)difference.Y, clickEvent);
            SetMousePosition((int)(Left + middlePoint.X), (int)(Top + middlePoint.Y));

            return mEvent;
        }
Ejemplo n.º 34
0
		void ProcessClick(int x, int y, bool rightMouse, ClickEvent clickEvent)
		{
			int nodeFromTop = -1;
			int height = ItemHeight;
			using(Graphics g = CreateGraphics())
			{
				// Iterate through all the nodes, looking for the bounds that match.
				TreeView.NodeEnumerator nodes = new TreeView.NodeEnumerator(this.nodes);
				while (nodes.MoveNext())
				{
					if (nodes.currentNode == topNode)
					{
						// We are now at the top of the control.
						nodeFromTop = 0;
					}
					if (nodeFromTop > -1)
					{
						// Check if the y matches this node.
						if (y < height * (nodeFromTop + 1))
						{							
							bool allowEdit = false;
							bool allowSelect = true;
							// Raise click or double click when called from MouseUp
							if(clickEvent == ClickEvent.Click)
							{
								OnClick(EventArgs.Empty);
							}
							else if(clickEvent == ClickEvent.DoubleClick)
							{
								OnDoubleClick(EventArgs.Empty);
							}
							// Clicking the image can be used to select.
							if (imageList == null || !GetImageBounds(nodeFromTop, nodes.level).Contains(x, y))
							{
								// Clicking the text can be used to edit and select.
								// if false then the hierarchy marker must have been clicked.
								if (GetTextBounds(g, nodes.currentNode, nodeFromTop, nodes.level).Contains(x, y))
								{
									allowEdit = true;
								}
								else
								{
									allowSelect = false;
								}
							}
							if (SelectedNode == nodes.Current && mouseClickTimer != null && mouseClickTimer.Enabled && (allowEdit || allowSelect))
							{
								mouseClickTimer.Stop();
								nodeToEdit = null;
								nodes.currentNode.Toggle();
								return;
							}
							if (allowSelect || rightMouse)
							{
								if (selectedNode == nodes.Current)
								{
									if (labelEdit && allowEdit && !rightMouse)
									{
										nodeToEdit = nodes.currentNode;
									}
								}
								else
								{
									nodeToEdit = null;
									// Do the events.
									TreeViewCancelEventArgs eventArgs = new TreeViewCancelEventArgs(nodes.currentNode, false, TreeViewAction.ByMouse);
									OnBeforeSelect(eventArgs);
									if (!eventArgs.Cancel)
									{
										SelectedNode = nodes.currentNode;
										OnAfterSelect(new TreeViewEventArgs(nodes.currentNode));
										Focus();
									}
								}
								if (rightMouse)
								{
									return;
								}
								if (mouseClickTimer == null)
								{
									mouseClickTimer = new Timer();
									mouseClickTimer.Tick +=new EventHandler(mouseClickTimer_Tick);
									mouseClickTimer.Interval = mouseEditTimeout;
								}
								mouseClickTimer.Start();
								break;
							}
						}
						nodeFromTop++;
					}
				}
			}
		}
Ejemplo n.º 35
0
		/// <summary>
		/// Initializes a new instance of the <see cref="MDLN.MGTools.TextBox"/> class.
		/// </summary>
		/// <param name="GraphDev">Connection to Graph device.</param>
		/// <param name="Background">Background texture</param>
		/// <param name="Top">Top coordinate of control</param>
		/// <param name="Left">Left coordinate of control</param>
		/// <param name="Height">Height of control</param>
		/// <param name="Width">Width of control</param>
		public TextBox(GraphicsDevice GraphDev, Texture2D Background, int Top , int Left, int Height, int Width) : base(GraphDev, Background, Top, Left, Height, Width) {
			Click += new ClickEvent(ControlClicked);
			cCursorOn = false;
		}
Ejemplo n.º 36
0
 protected override bool OnClick(ClickEvent e)
 {
     OnSelect?.Invoke(BeatmapSetInfo);
     return(true);
 }
Ejemplo n.º 37
0
 protected override bool OnClick(ClickEvent e)
 {
     ToggleVisibility();
     return(true);
 }
Ejemplo n.º 38
0
		protected internal override void ToolkitMouseDown(MouseButtons buttons, Keys modifiers, int clicks, int x, int y, int delta)
		{
			// We need to prevent the focus messages happening. These happen automatically in Controls ToolkitMouseDown.
			// We manually set the focus after the node is selected to make sure the events happen in the order ms does.
			if (Enabled)
			{
				OnMouseDown(new MouseEventArgs(buttons, clicks, x, y, delta));
			}
			// Set event to be raised on mouse up
			clickEvent = (clicks == 1) ? ClickEvent.Click : ClickEvent.DoubleClick;
		}