Пример #1
0
        public void SendClick(WButton button, Point pos)
        {
            int LParam = MakeLParam(pos.X, pos.Y), btnDown = 0, btnUp = 0;

            switch (button)
            {
            case WButton.Left:
                btnDown = (int)WMessages.WM_LBUTTONDOWN;
                btnUp   = (int)WMessages.WM_LBUTTONUP;
                break;

            case WButton.Right:
                btnDown = (int)WMessages.WM_RBUTTONDOWN;
                btnUp   = (int)WMessages.WM_RBUTTONUP;
                break;

            case WButton.Middle:
                btnDown = (int)WMessages.WM_MBUTTONDOWN;
                btnUp   = (int)WMessages.WM_MBUTTONUP;
                break;
            }
            _SendMessage(process, btnDown, 0, LParam);
            Thread.Sleep(10);
            _SendMessage(process, btnUp, 0, LParam);
        }
Пример #2
0
        public void SendMultiClick(WButton button, Point pos, int numberClick, int interval = 1)
        {
            int LParam = MakeLParam(pos.X, pos.Y), btnDown = 0, btnUp = 0;

            switch (button)
            {
            case WButton.Left:
                btnDown = (int)WMessages.WM_LBUTTONDOWN;
                btnUp   = (int)WMessages.WM_LBUTTONUP;
                break;

            case WButton.Right:
                btnDown = (int)WMessages.WM_RBUTTONDOWN;
                btnUp   = (int)WMessages.WM_RBUTTONUP;
                break;

            case WButton.Middle:
                btnDown = (int)WMessages.WM_MBUTTONDOWN;
                btnUp   = (int)WMessages.WM_MBUTTONUP;
                break;
            }
            for (int i = 0; i < numberClick; i++)
            {
                _SendMessage(process, btnDown, 0, LParam);
                _SendMessage(process, btnUp, 0, LParam);
                if (numberClick > 1)
                {
                    Thread.Sleep(interval);
                }
            }
        }
Пример #3
0
        public void SendClick(WButton button, Point pos, bool doubleclick = false)
        {
            int LParam = MakeLParam(pos.X, pos.Y), btnDown = 0, btnUp = 0;

            switch (button)
            {
            case WButton.Left:
                btnDown = (int)WMessages.WM_LBUTTONDOWN;
                btnUp   = (int)WMessages.WM_LBUTTONUP;
                break;

            case WButton.Right:
                btnDown = (int)WMessages.WM_RBUTTONDOWN;
                btnUp   = (int)WMessages.WM_RBUTTONUP;
                break;

            case WButton.Middle:
                btnDown = (int)WMessages.WM_MBUTTONDOWN;
                btnUp   = (int)WMessages.WM_MBUTTONUP;
                break;
            }
            if (doubleclick)
            {
                _SendMessage(process, btnDown, 0, LParam);
                _SendMessage(process, btnUp, 0, LParam);
                _SendMessage(process, btnDown, 0, LParam);
                _SendMessage(process, btnUp, 0, LParam);
            }
            else
            {
                _SendMessage(process, btnDown, 0, LParam);
                _SendMessage(process, btnUp, 0, LParam);
            }
        }
Пример #4
0
        void SetPadding(WButton view)
        {
            var pxLeft   = FDroidUtils.Dp((int)view.Padding.Left);
            var pxTop    = FDroidUtils.Dp((int)view.Padding.Top);
            var pxRight  = FDroidUtils.Dp((int)view.Padding.Right);
            var pxBottom = FDroidUtils.Dp((int)view.Padding.Bottom);

            Control.SetPadding(pxLeft, pxTop, pxRight, pxBottom);
        }
Пример #5
0
    public int AddBtn(WButton a_btn)
    {
        if (null == mBtnList)
        {
            mBtnList = new List <WButton>();
        }
        mBtnList.Add(a_btn);

        return(mBtnList.Count);
    }
Пример #6
0
        void SetHorizontalTextAlignment(WButton view)
        {
            // I need to implement because I will override the vertical align.
            switch (view.HorizontalTextAlignment)
            {
            case Xamarin.Forms.TextAlignment.Start:
                Control.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
                break;

            case Xamarin.Forms.TextAlignment.Center:
                Control.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
                break;

            case Xamarin.Forms.TextAlignment.End:
                Control.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
                break;
            }
        }
Пример #7
0
        void SetHorizontalTextAlignment(WButton view)
        {
            // I need to implement because I will override the vertical align.
            switch (view.HorizontalTextAlignment)
            {
            case Xamarin.Forms.TextAlignment.Start:
                Control.Gravity = GravityFlags.Left | GravityFlags.CenterVertical;
                break;

            case Xamarin.Forms.TextAlignment.Center:
                Control.Gravity = GravityFlags.Center | GravityFlags.CenterVertical;
                break;

            case Xamarin.Forms.TextAlignment.End:
                Control.Gravity = GravityFlags.Right | GravityFlags.CenterVertical;
                break;
            }
        }
Пример #8
0
    public void SetOnIndex(int index)
    {
        WButton nowOnBtn = null;

        if (m_curOnIndex >= 0 && m_curOnIndex < mBtnList.Count)
        {
            nowOnBtn = mBtnList[m_curOnIndex];
        }
        if (null != nowOnBtn && null != mOnBlurButton)
        {
            mOnBlurButton(nowOnBtn);
        }

        index -= 1;
        if (index >= 0 && index < mBtnList.Count)
        {
            m_curOnIndex = index;
            RefreshTabView();
            if (null != mOnIndex)
            {
                mOnIndex(index, mBtnList[index]);
            }
        }
    }
Пример #9
0
 public ContentPageBase()
 {
     var button = new WButton();
 }
Пример #10
0
 void SetPadding(WButton view)
 {
     Control.TitleEdgeInsets = new UIEdgeInsets((nfloat)view.Padding.Top, (nfloat)view.Padding.Left, (nfloat)view.Padding.Bottom, (nfloat)view.Padding.Right);
 }