Esempio n. 1
0
        protected override void TouchDownMessage(object sender, point point, ref bool handled)
        {
            if (_titlebar.Contains(point))
            {
                if (_rClose.Contains(point))
                {
                    _bClose = true;
                    return;
                }

                if (_rMin.Contains(point))
                {
                    _bMin = true;
                    return;
                }

                if (_rMax.Contains(point))
                {
                    _bMax = true;
                    return;
                }

                _ptDown = point;
                _drag   = true;
                return;
            }

            _pnl.SendTouchDown(this, point);
        }
Esempio n. 2
0
        protected override void TouchDownMessage(object sender, point point, ref bool handled)
        {
            if (_elliRect.Contains(point))
            {
                //_eDown = true;
                //handled = true;
                return;
            }

            int i;

            if (_icons != null)
            {
                for (i = 0; i < _icons.Length; i++)
                {
                    if (_icons[i].HitTest(point))
                    {
                        _icons[i].SendTouchDown(this, point);
                        //handled = true;
                        return;
                    }
                }
            }

            if (_expanded)
            {
                if (!_scrollArea.Contains(point))
                {
                    return;
                }

                _sDown = true;

                for (i = 0; i < _menus.Length; i++)
                {
                    if (_menus[i].HitTest(point))
                    {
                        _menus[i].SendTouchDown(this, point);
                        //handled = true;
                        Invalidate();
                        return;
                    }
                }
            }
        }
Esempio n. 3
0
        protected override void TouchDownMessage(object sender, point point, ref bool handled)
        {
            if (_decRect.Contains(point))
            {
                Value   = _val - _sml;
                _chgVal = -_sml;
                if (_auto)
                {
                    _changer = new Thread(AutoIncDec)
                    {
                        Priority = ThreadPriority.AboveNormal
                    };
                    _changer.Start();
                }
                return;
            }

            if (_incRect.Contains(point))
            {
                Value   = _val + _sml;
                _chgVal = _sml;
                if (_auto)
                {
                    _changer = new Thread(AutoIncDec)
                    {
                        Priority = ThreadPriority.AboveNormal
                    };
                    _changer.Start();
                }
                return;
            }

            if (_grpRect.Contains(point))
            {
                _mX    = point.X;
                _mY    = point.Y;
                _gDown = true;
                return;
            }

            if (_orientation == Orientation.Horizontal)
            {
                Value = _val + ((point.X < _grpRect.X) ? -_lrg : _lrg);
            }
            else
            {
                Value = _val + ((point.Y < _grpRect.Y) ? -_lrg : _lrg);
            }
        }
Esempio n. 4
0
        protected override void TouchUpMessage(object sender, point point, ref bool handled)
        {
            if (_nodes != null)
            {
                // Get Selected Node
                TreeviewNode node    = NodeFromPoint(point);
                int          icoSize = _font.Height;
                if (node != null)
                {
                    var ecRect = new rect(node.Bounds.X, node.Bounds.Y, icoSize, icoSize);
                    if (ecRect.Contains(point) && node.PenDown)
                    {
                        /*node.Expanded = !node._expanded;
                         * if (!node._expanded)
                         * ResetChildrenBounds(node);*/
                        node.Expanded = !node.Expanded;
                        if (!node.Expanded)
                        {
                            ResetChildrenBounds(node);
                        }

                        Invalidate();
                    }
                    else
                    {
                        // Reset States
                        if (!node.Selected && node.PenDown)
                        {
                            for (int i = 0; i < _nodes.Length; i++)
                            {
                                ResetNodesState(_nodes[i]);
                            }
                            node.Selected = true;
                            _selNode      = node;
                            Invalidate();
                        }
                        OnNodeTap(node, point);
                    }
                }

                // Reset Pen States
                for (int i = 0; i < _nodes.Length; i++)
                {
                    SetChildrenPen(_nodes[i]);
                }
            }
            base.TouchUpMessage(sender, point, ref handled);
        }
Esempio n. 5
0
        protected override void TouchDownMessage(object sender, point point, ref bool handled)
        {
            if (_grpRect.Contains(point))
            {
                //_mX = e.X;
                //_mY = e.Y;
                _gDown = true;
                return;
            }

            if (_orientation == Orientation.Horizontal)
            {
                Value = _val + ((point.X < _grpRect.X) ? -_lrg : _lrg);
            }
            else
            {
                Value = _val + ((point.Y < _grpRect.Y) ? -_lrg : _lrg);
            }
        }
Esempio n. 6
0
        protected override void TouchDownMessage(object sender, point point, ref bool handled)
        {
            point.X -= Left;
            point.Y -= Top;

            if (_cols != null && point.Y < _header.Height + 9)
            {
                point.X--;
                for (int i = 0; i < _cols.Length; i++)
                {
                    var bounds = new rect(_cols[i].X, 1, _cols[i].W, _header.Height + 8);
                    if (bounds.Contains(point))
                    {
                        //_colDown = i;
                        return;
                    }
                }

                //_colDown = -1;
                return;
            }

            _rowDown = (point.Y - 9 - _header.Height + _scrollY) / (_item.Height + 8);
        }