Ejemplo n.º 1
0
        public void TestContainsWithIntegerValues()
        {
            var s = new QRectF();

            s.X      = 50;
            s.Y      = 150;
            s.Width  = 500;
            s.Height = 600;

            var n = s.Contains(275, 375);

            Assert.IsTrue(n);
        }
Ejemplo n.º 2
0
 protected override void MouseReleaseEvent(Qyoto.QGraphicsSceneMouseEvent arg1)
 {
     if (arg1.Button() == Qt.MouseButton.LeftButton)
     {
         m_LeftButtonDown = false;
         var pos  = arg1.Pos();
         var pos1 = arg1.ButtonDownPos(Qt.MouseButton.LeftButton);
         if (pos != null && pos1 != null && m_ArrowRect.Contains(pos1) && pos.Y() < m_Grid.HeaderHeight && pos1.Equals(pos))
         {
             this.IsExpanded = !this.IsExpanded;
             m_Grid.ResizeAndRepositionGroups();
         }
     }
 }
Ejemplo n.º 3
0
        public void TestContainsWithQRectF()
        {
            var s = new QRectF();

            s.X      = 50;
            s.Y      = 150;
            s.Width  = 500;
            s.Height = 600;

            var p = new QRectF(275, 375, 50, 50);
            var n = s.Contains(p);

            Assert.IsTrue(n);
        }
Ejemplo n.º 4
0
        public void TestContainsWithQRectF()
        {
            var s = new QRectF();
            s.X = 50;
            s.Y = 150;
            s.Width = 500;
            s.Height = 600;

            var p = new QRectF(275, 375, 50, 50);
            var n = s.Contains(p);

            Assert.IsTrue(n);
        }
Ejemplo n.º 5
0
        public void TestContainsWithIntegerValues()
        {
            var s = new QRectF();
            s.X = 50;
            s.Y = 150;
            s.Width = 500;
            s.Height = 600;

            var n = s.Contains(275, 375);

            Assert.IsTrue(n);
        }
Ejemplo n.º 6
0
        void UpdateHoverItem()
        {
            var oldItem = m_HoverItem;

            var pos  = this.MapFromGlobal(QCursor.Pos());
            var item = this.ItemAt(pos);

            // Since we map the point to scene coords, we could accidently
            // focus items outside the visible viewport.
            if (m_SuppressTooltips || !this.Viewport().Geometry.Contains(pos) || !this.IsVisible())
            {
                m_TooltipTimer.Stop();
                m_HoverItem      = null;
                m_InfoPopup.Item = null;
            }
            else
            {
                if (item is RosterItem <T> )
                {
                    m_HoverItem = (RosterItem <T>)item;
                    m_HoverItem.Update();

                    if (m_InfoPopup.Item != m_HoverItem)
                    {
                        if (m_InfoPopup.IsVisible())
                        {
                            m_InfoPopup.Item = m_HoverItem;
                        }
                        else
                        {
                            m_TooltipTimer.Stop();
                            m_InfoPopup.Item = m_HoverItem;
                            m_TooltipTimer.Start();
                        }
                    }
                }
                else
                {
                    m_TooltipTimer.Stop();
                    m_HoverItem = null;

                    // Allow a buffer around the active item so that the tooltip
                    // can change items without having to be closed/re-opened.
                    if (m_InfoPopup.Item != null)
                    {
                        var    itemRect = m_InfoPopup.Item.SceneBoundingRect();
                        var    itemPos  = this.MapFromScene(itemRect.X(), itemRect.Y());
                        QRectF rect     = new QRectF(itemPos.X() - IconPadding,
                                                     itemPos.Y() - IconPadding,
                                                     itemRect.Width() + IconPadding + IconPadding,
                                                     itemRect.Height() + IconPadding + IconPadding);
                        if (!rect.Contains(pos))
                        {
                            m_InfoPopup.Item = null;
                        }
                    }
                }
            }

            if (oldItem != null && oldItem != m_HoverItem)
            {
                oldItem.Update();
            }
        }