コード例 #1
0
ファイル: Editor.cs プロジェクト: zoombapup/ATF
        // create hover form for module or connection
        private HoverBase CreateHoverForm(HoverEventArgs <object, object> e)
        {
            StringBuilder sb = new StringBuilder();

            //  var hoverItem = e.Object;
            var hoverPart = e.Part;

            if (e.SubPart.Is <GroupPin>())
            {
                sb.Append(e.SubPart.Cast <GroupPin>().Name);
            }
            else if (hoverPart.Is <GroupPin>())
            {
                sb.Append(hoverPart.Cast <GroupPin>().Name);
            }
            HoverBase result = null;

            if (sb.Length > 0) // remove trailing '\n'
            {
                //sb.Length = sb.Length - 1;
                result = new HoverLabel(sb.ToString());
            }

            return(result);
        }
コード例 #2
0
        // create hover form for module or connection
        private HoverBase CreateHoverForm(HoverEventArgs <object, object> e)
        {
            StringBuilder sb = new StringBuilder();

            var hoverItem = e.Object;
            var hoverPart = e.Part;

            string itemName = string.Empty;
            string partName = string.Empty;

            if (e.SubPart.Is <GroupPin>())
            {
                sb.Append(e.SubPart.Cast <GroupPin>().Name);
                partName = CircuitUtil.GetDomNodeName(e.SubPart.Cast <DomNode>());
            }
            else if (e.SubObject.Is <DomNode>())
            {
                itemName = CircuitUtil.GetDomNodeName(e.SubObject.Cast <DomNode>());
            }
            else if (hoverPart.Is <GroupPin>())
            {
                sb.Append(hoverPart.Cast <GroupPin>().Name);
                partName = CircuitUtil.GetDomNodeName(hoverPart.Cast <DomNode>());
            }
            else if (hoverItem.Is <DomNode>())
            {
                itemName = CircuitUtil.GetDomNodeName(hoverItem.Cast <DomNode>());
            }


            //Trace.TraceInformation("hoverItem {0} hoverPart  {1}", itemName, partName);

            //StringBuilder sb = new StringBuilder();
            //ICustomTypeDescriptor customTypeDescriptor = Adapters.As<ICustomTypeDescriptor>(hoverItem);
            //if (customTypeDescriptor != null)
            //{
            //    // Get properties interface
            //    foreach (System.ComponentModel.PropertyDescriptor property in customTypeDescriptor.GetProperties())
            //    {
            //        object value = property.GetValue(hoverItem);
            //        if (value != null)
            //        {
            //            sb.Append(property.Name);
            //            sb.Append(": ");
            //            sb.Append(value.ToString());
            //            sb.Append("\n");
            //        }
            //    }
            //}

            HoverBase result = null;

            if (sb.Length > 0) // remove trailing '\n'
            {
                //sb.Length = sb.Length - 1;
                result = new HoverLabel(sb.ToString());
            }

            return(result);
        }
コード例 #3
0
        public void Hover(HoverEventArgs eventArgs)
        {
            var fieldCoords = TranslateToFieldCoords(eventArgs.ViewCoords);

            var hoverCoords = _map.PointToHexCoords(fieldCoords);

            _uiState.HoverHexCoords = hoverCoords;
            _uiState.HoverTile      = _map.HasHex(hoverCoords) ? _map.GetTileModel(hoverCoords) : null;
        }
コード例 #4
0
ファイル: Sprite.cs プロジェクト: codesmith-fi/smithngine
 protected virtual void OnHover(Vector2 position)
 {
     if (this.BeingHovered != null)
     {
         HoverEventArgs args = new HoverEventArgs();
         args.position = position;
         BeingHovered(this, args);
     }
 }
コード例 #5
0
ファイル: LevelController.cs プロジェクト: kabourneeak/Catch
        public void Hover(HoverEventArgs eventArgs)
        {
            _overlayController.Hover(eventArgs);

            if (!eventArgs.Handled)
            {
                _fieldController.Hover(eventArgs);
            }
        }
コード例 #6
0
 private void hoverTimer_Tick(object sender, EventArgs e)
 {
     StopHover();
     if (m_hoverItem != null)
     {
         m_hovering = true;
         var hoverArgs = new HoverEventArgs <object, object>(m_hoverItem, m_hoverPart, m_hoverSubItem, m_hoverSubPart, AdaptedControl);
         OnHoverStarted(hoverArgs);
         HoverStarted.Raise(this, hoverArgs);
     }
 }
コード例 #7
0
ファイル: Editor.cs プロジェクト: zoombapup/ATF
        private HoverBase GetHoverForm(HoverEventArgs <object, object> e)
        {
            HoverBase result = CreateHoverForm(e);

            if (result != null)
            {
                Point p = Control.MousePosition;
                result.Location = new Point(p.X - (result.Width + 12), p.Y + 12);
                result.ShowWithoutFocus();
            }
            return(result);
        }
コード例 #8
0
ファイル: MainForm.cs プロジェクト: XiaoHeitu/ZPlayer
        private void sldProgress_Hover(object sender, HoverEventArgs e)
        {
            if (this._mediaPlayer.State != VLCState.Playing && this._mediaPlayer.State != VLCState.Paused)
            {
                return;
            }
            ZControl c = (ZControl)sender;

            this.pPreviewHost.Location = new Point((this.zContainer1.Location.X + c.Location.X + e.MouseLocation.X - this.pPreviewHost.Size.Width / 2), (this.zContainer1.Location.Y + c.Location.Y - this.pPreviewHost.Size.Height + 2));
            this._preview.Position     = e.HoverValue;
            this._preview.Play();
            this.pPreviewHost.Visible = true;
        }
コード例 #9
0
        // <summary>Event handle which goes through every registered sound when the view is hovered and activates respectively.</summary>
        void OnHoverEventSound(object sender, HoverEventArgs e)
        {
            foreach (KeyValuePair <int, SoundTrigger> trigger in this.soundTriggers)
            {
                int          soundId      = trigger.Key;
                SoundTrigger soundTrigger = trigger.Value;

                // If isn't for hover event.
                if (soundTrigger != SoundTrigger.OnHover)
                {
                    continue;
                }
                // Passive Start just incase null.
                appWrapper.GetSound(soundId)?.Start();
            }
        }
コード例 #10
0
        // Callback for View Hover signal
        private bool OnHoverEvent(IntPtr view, IntPtr hoverEvent)
        {
            if (hoverEvent == global::System.IntPtr.Zero)
            {
                NUILog.Error("hoverEvent should not be null!");
                return(true);
            }

            HoverEventArgs e = new HoverEventArgs();

            e.Hover = Tizen.NUI.Hover.GetHoverFromPtr(hoverEvent);

            if (_hoverEventHandler != null)
            {
                return(_hoverEventHandler(this, e));
            }
            return(false);
        }
コード例 #11
0
        public void Hover(HoverEventArgs eventArgs)
        {
            // we are still hovering over the same coordinates as last time,
            // nothing to do
            if (_lastHover.Equals(_uiState.HoverHexCoords))
            {
                return;
            }

            // remove previous indicator
            _lastHoverTile?.Indicators.Remove(_hoverTileIndicator);

            // add new indicator
            _lastHover     = _uiState.HoverHexCoords;
            _lastHoverTile = _uiState.HoverTile;

            if (_lastHoverTile != null)
            {
                _hoverTileIndicator.Position = _lastHoverTile.Position;
                _lastHoverTile.Indicators.Add(_hoverTileIndicator);
            }
        }
コード例 #12
0
        private HoverBase GetHoverForm(HoverEventArgs <object, object> e)
        {
            HoverBase result = null;

            // handle sub-circuit instance
            SubCircuitInstance subCircuitInstance = Adapters.As <SubCircuitInstance>(e.Object);

            if (subCircuitInstance != null)
            {
                result = CreateHoverForm(subCircuitInstance);
            }
            else
            {
                result = CreateHoverForm(e);
            }

            if (result != null)
            {
                Point p = Control.MousePosition;
                result.Location = new Point(p.X - (result.Width + 12), p.Y + 12);
                result.ShowWithoutFocus();
            }
            return(result);
        }
コード例 #13
0
        // create hover form for module or connection
        private HoverBase CreateHoverForm(HoverEventArgs <object, object> e)
        {
            StringBuilder sb = new StringBuilder();

            var hoverItem = e.Object;
            var hoverPart = e.Part;

            if (e.SubPart.Is <ScriptGroupSocket>())
            {
                sb.Append(e.SubPart.Cast <ScriptGroupSocket>().Name);
                CircuitUtil.GetDomNodeName(e.SubPart.Cast <DomNode>());
            }
            else if (e.SubObject.Is <DomNode>())
            {
                CircuitUtil.GetDomNodeName(e.SubObject.Cast <DomNode>());
            }
            else if (hoverPart.Is <ScriptGroupSocket>())
            {
                sb.Append(hoverPart.Cast <ScriptGroupSocket>().Name);
                CircuitUtil.GetDomNodeName(hoverPart.Cast <DomNode>());
            }
            else if (hoverItem.Is <DomNode>())
            {
                CircuitUtil.GetDomNodeName(hoverItem.Cast <DomNode>());
            }

            HoverBase result = null;

            if (sb.Length > 0) // remove trailing '\n'
            {
                //sb.Length = sb.Length - 1;
                result = new HoverLabel(sb.ToString());
            }

            return(result);
        }
コード例 #14
0
 // create hover form for module or connection
 private HoverBase CreateHoverForm(HoverEventArgs <object, object> e)
 {
     // StringBuilder sb = new StringBuilder();
     //
     // var hoverItem = e.Object;
     // var hoverPart = e.Part;
     //
     // if (e.SubPart.Is<GroupPin>())
     // {
     //     sb.Append(e.SubPart.Cast<GroupPin>().Name);
     //     CircuitUtil.GetDomNodeName(e.SubPart.Cast<DomNode>());
     // }
     // else if (e.SubObject.Is<DomNode>())
     // {
     //     CircuitUtil.GetDomNodeName(e.SubObject.Cast<DomNode>());
     // }
     // else if (hoverPart.Is<GroupPin>())
     // {
     //     sb.Append(hoverPart.Cast<GroupPin>().Name);
     //     CircuitUtil.GetDomNodeName(hoverPart.Cast<DomNode>());
     // }
     // else if (hoverItem.Is<DomNode>())
     // {
     //     CircuitUtil.GetDomNodeName(hoverItem.Cast<DomNode>());
     // }
     //
     // HoverBase result = null;
     // if (sb.Length > 0) // remove trailing '\n'
     // {
     //     //sb.Length = sb.Length - 1;
     //     result = new HoverLabel(sb.ToString());
     // }
     //
     // return result;
     return(null);
 }
コード例 #15
0
ファイル: Editor.cs プロジェクト: zoombapup/ATF
 private void control_HoverStarted(object sender, HoverEventArgs <object, object> e)
 {
     m_hoverForm = GetHoverForm(e);
 }
コード例 #16
0
 void OnHovering(object sender, HoverEventArgs e)
 {
     GestureStatus.Text = $"Hovering: {e.State}";
 }
コード例 #17
0
ファイル: Editor.cs プロジェクト: sbambach/ATF
        // create hover form for module or connection
        private HoverBase CreateHoverForm(HoverEventArgs<object, object> e)
        {
            StringBuilder sb = new StringBuilder();

            var hoverItem = e.Object;
            var hoverPart = e.Part;

            if (e.SubPart.Is<GroupPin>())
            {
                sb.Append(e.SubPart.Cast<GroupPin>().Name);
                CircuitUtil.GetDomNodeName(e.SubPart.Cast<DomNode>());
            }
            else if (e.SubObject.Is<DomNode>())
            {
                CircuitUtil.GetDomNodeName(e.SubObject.Cast<DomNode>());
            }
            else if (hoverPart.Is<GroupPin>())
            {
                sb.Append(hoverPart.Cast<GroupPin>().Name);
                CircuitUtil.GetDomNodeName(hoverPart.Cast<DomNode>());
            }
            else if (hoverItem.Is<DomNode>())
            {
                CircuitUtil.GetDomNodeName(hoverItem.Cast<DomNode>());
            }

            HoverBase result = null;
            if (sb.Length > 0) // remove trailing '\n'
            {
                //sb.Length = sb.Length - 1;
                result = new HoverLabel(sb.ToString());
            }

            return result;
        }
コード例 #18
0
ファイル: Editor.cs プロジェクト: sbambach/ATF
        private HoverBase GetHoverForm(HoverEventArgs<object, object> e)
        {
            HoverBase result = CreateHoverForm(e);

            if (result != null)
            {
                Point p = Control.MousePosition;
                result.Location = new Point(p.X - (result.Width + 12), p.Y + 12);
                result.ShowWithoutFocus();
            }
            return result;
        }
コード例 #19
0
ファイル: Editor.cs プロジェクト: sbambach/ATF
 private void control_HoverStarted(object sender, HoverEventArgs<object, object> e)
 {
     m_hoverForm = GetHoverForm(e);
 }
コード例 #20
0
ファイル: Editor.cs プロジェクト: vincenthamm/ATF
        private HoverBase GetHoverForm(HoverEventArgs<object, object> e)
        {
            HoverBase result = null;

            // handle sub-circuit instance
            SubCircuitInstance subCircuitInstance = Adapters.As<SubCircuitInstance>(e.Object);
            if (subCircuitInstance != null)
            {
                result = CreateHoverForm(subCircuitInstance);
            }
            else
            {
                result = CreateHoverForm(e);
            }

            if (result != null)
            {
                Point p = Control.MousePosition;
                result.Location = new Point(p.X - (result.Width + 12), p.Y + 12);
                result.ShowWithoutFocus();
            }
            return result;
        }
コード例 #21
0
ファイル: HoverAdapter.cs プロジェクト: sbambach/ATF
 /// <summary>
 /// Performs actions after hover started</summary>
 /// <param name="e">Event args</param>
 protected virtual void OnHoverStarted(HoverEventArgs<object, object> e)
 {
 }
コード例 #22
0
ファイル: Editor.cs プロジェクト: vincenthamm/ATF
        // create hover form for module or connection
        private HoverBase CreateHoverForm(HoverEventArgs<object, object> e)
        {
            StringBuilder sb = new StringBuilder();

            var hoverItem = e.Object;
            var hoverPart = e.Part;

            string itemName= string.Empty;
            string partName= string.Empty;

            if (e.SubPart.Is<GroupPin>())
            {
                sb.Append(e.SubPart.Cast<GroupPin>().Name);
                partName = CircuitUtil.GetDomNodeName(e.SubPart.Cast<DomNode>());
            }
            else if (e.SubObject.Is<DomNode>())
            {
                itemName = CircuitUtil.GetDomNodeName(e.SubObject.Cast<DomNode>());
            }
            else if (hoverPart.Is<GroupPin>())
            {
                sb.Append(hoverPart.Cast<GroupPin>().Name);
                partName = CircuitUtil.GetDomNodeName(hoverPart.Cast<DomNode>());
            }
            else if (hoverItem.Is<DomNode>())
            {
                itemName = CircuitUtil.GetDomNodeName(hoverItem.Cast<DomNode>());
            }
           

            //Trace.TraceInformation("hoverItem {0} hoverPart  {1}", itemName, partName);

            //StringBuilder sb = new StringBuilder();
            //ICustomTypeDescriptor customTypeDescriptor = Adapters.As<ICustomTypeDescriptor>(hoverItem);
            //if (customTypeDescriptor != null)
            //{
            //    // Get properties interface
            //    foreach (System.ComponentModel.PropertyDescriptor property in customTypeDescriptor.GetProperties())
            //    {
            //        object value = property.GetValue(hoverItem);
            //        if (value != null)
            //        {
            //            sb.Append(property.Name);
            //            sb.Append(": ");
            //            sb.Append(value.ToString());
            //            sb.Append("\n");
            //        }
            //    }
            //}

            HoverBase result = null;
            if (sb.Length > 0) // remove trailing '\n'
            {
                //sb.Length = sb.Length - 1;
                result = new HoverLabel(sb.ToString());
            }

            return result;
        }
コード例 #23
0
 /// <summary>
 /// Performs actions after hover started</summary>
 /// <param name="e">Event args</param>
 protected virtual void OnHoverStarted(HoverEventArgs <object, object> e)
 {
 }
コード例 #24
0
ファイル: HoverAdapter.cs プロジェクト: sbambach/ATF
 private void hoverTimer_Tick(object sender, EventArgs e)
 {
     StopHover();
     if (m_hoverItem != null)
     {
         m_hovering = true;
         var hoverArgs = new HoverEventArgs<object, object>(m_hoverItem, m_hoverPart, m_hoverSubItem, m_hoverSubPart, AdaptedControl);
         OnHoverStarted(hoverArgs);
         HoverStarted.Raise(this, hoverArgs);
     }
 }
コード例 #25
0
 void OnFrameHovering(object sender, HoverEventArgs e)
 {
     HoveringStatus.Text = $"Hovering: {e.State}";
 }