Esempio n. 1
0
        public override string GetToolInfo()
        {
            if (!IsSelectedSource)
            {
                var mouse = NodeMarkupTool.MousePositionScaled;

                if (TurnLeftButton.CheckHover(mouse))
                {
                    return(Localize.Tool_InfoTurnСounterClockwise);
                }
                else if (FlipButton.CheckHover(mouse))
                {
                    return(Localize.Tool_InfoInverseOrder);
                }
                else if (TurnRightButton.CheckHover(mouse))
                {
                    return(Localize.Tool_InfoTurnClockwise);
                }

                else if (ApplyButton.CheckHover(mouse))
                {
                    return(Localize.Tool_InfoPasteApply);
                }
                else if (NotApplyButton.CheckHover(mouse))
                {
                    return(Localize.Tool_infoPasteNotApply);
                }
                else if (ResetButton.CheckHover(mouse))
                {
                    return(Localize.Tool_InfoPasteReset);
                }
            }

            return(base.GetToolInfo());
        }
Esempio n. 2
0
        /// <summary>
        /// Set up images for buttons and set up gesture recognizers
        /// </summary>
        protected void Initialize()
        {
            if (Session != null)
            {
                return;
            }

            FlashOnImage  = Configuration.FlashOnImage ?? UIImage.FromBundle("ic_flash_on");
            FlashOffImage = Configuration.FlashOffImage ?? UIImage.FromBundle("ic_flash_off");
            var flipImage = Configuration.FlipImage ?? UIImage.FromBundle("ic_loop");

            if (Configuration.TintIcons)
            {
                FlashButton.TintColor = Configuration.TintColor;
                FlipButton.TintColor  = Configuration.TintColor;

                FlashOnImage  = FlashOnImage?.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);
                FlashOffImage = FlashOffImage?.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);
                flipImage     = flipImage?.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);
            }

            FlashButton.SetImage(FlashOffImage, UIControlState.Normal);
            FlipButton.SetImage(flipImage, UIControlState.Normal);

            FocusView = new UIView(new CGRect(0, 0, 90, 90));
            var tapRecognizer = new UITapGestureRecognizer(Focus);

            PreviewContainer.AddGestureRecognizer(tapRecognizer);

            Hidden = false;
        }
Esempio n. 3
0
        public async void FlipButton_OnClick(object sender, EventArgs args)
        {
            await FlipButton.Animate(new FlipOutXAnimation());

            await Navigation.PushAsync(new FlipAnimationsPage());

            await Task.Delay(2000);

            FlipButton.ClearTransforms();
        }
Esempio n. 4
0
        public HeadsOrTails()
        {
            InitializeComponent();

            /** =======================================================================
            *
            *  Have the flip button selected because due to tab order, the Heads button
            *  being ahead of the flip button, this allows the accept/enter key to work
            *  from the start of the program.
            *
            *  ======================================================================= **/

            FlipButton.Select();

            // Hide both images
            HeadsImage.Visible = false;
            TailsImage.Visible = false;
        }
Esempio n. 5
0
        public override void OnToolGUI(Event e)
        {
            var uiView    = UIView.GetAView();
            var screenPos = uiView.WorldPointToGUI(Camera.main, Centre) * uiView.inputScale;

            TurnLeftButton.Update(screenPos);
            FlipButton.Update(screenPos);
            TurnRightButton.Update(screenPos);
            ApplyButton.Update(screenPos);
            NotApplyButton.Update(screenPos);
            ResetButton.Update(screenPos);

            TurnLeftButton.OnGUI(e);
            FlipButton.OnGUI(e);
            TurnRightButton.OnGUI(e);
            ApplyButton.OnGUI(e);
            NotApplyButton.OnGUI(e);
            ResetButton.OnGUI(e);
        }
Esempio n. 6
0
        public override void OnPrimaryMouseClicked(Event e)
        {
            base.OnPrimaryMouseClicked(e);

            if (IsHoverSource && HoverSource.Target is TargetEnter)
            {
                Tool.SetMode(ToolModeType.PointsOrder);
            }
            else
            {
                var mouse = NodeMarkupTool.MousePositionScaled;

                TurnLeftButton.CheckClick(mouse);
                FlipButton.CheckClick(mouse);
                TurnRightButton.CheckClick(mouse);
                ApplyButton.CheckClick(mouse);
                NotApplyButton.CheckClick(mouse);
                ResetButton.CheckClick(mouse);
            }
        }
Esempio n. 7
0
        void ReleaseDesignerOutlets()
        {
            if (FlipButton != null)
            {
                FlipButton.Dispose();
                FlipButton = null;
            }

            if (RecordDurationLabel != null)
            {
                RecordDurationLabel.Dispose();
                RecordDurationLabel = null;
            }

            if (RecordVideoButton != null)
            {
                RecordVideoButton.Dispose();
                RecordVideoButton = null;
            }
        }
Esempio n. 8
0
        public override void OnToolGUI(Event e)
        {
            var uiView    = UIView.GetAView();
            var position  = Centre + Tool.CameraDirection * (Radius + (Baskets.Length == 0 ? 1f : 3f) * TargetEnter.Size);
            var screenPos = uiView.WorldPointToGUI(Camera.main, position) * uiView.inputScale;

            TurnLeftButton.Update(screenPos);
            FlipButton.Update(screenPos);
            TurnRightButton.Update(screenPos);
            ApplyButton.Update(screenPos);
            NotApplyButton.Update(screenPos);
            ResetButton.Update(screenPos);

            TurnLeftButton.OnGUI(e);
            FlipButton.OnGUI(e);
            TurnRightButton.OnGUI(e);
            ApplyButton.OnGUI(e);
            NotApplyButton.OnGUI(e);
            ResetButton.OnGUI(e);
        }
Esempio n. 9
0
 public void AddLinkedButton(FlipButton button)
 {
     linkedButtons.Add(button);
 }
Esempio n. 10
0
        void ReleaseDesignerOutlets()
        {
            if (DemoCardSuperview != null)
            {
                DemoCardSuperview.Dispose();
                DemoCardSuperview = null;
            }

            if (DemoCardSuperviewHeightConstraint != null)
            {
                DemoCardSuperviewHeightConstraint.Dispose();
                DemoCardSuperviewHeightConstraint = null;
            }

            if (FlipButton != null)
            {
                FlipButton.Dispose();
                FlipButton = null;
            }

            if (LeftArrowImageView != null)
            {
                LeftArrowImageView.Dispose();
                LeftArrowImageView = null;
            }

            if (NoBackgroundView != null)
            {
                NoBackgroundView.Dispose();
                NoBackgroundView = null;
            }

            if (NoLabel != null)
            {
                NoLabel.Dispose();
                NoLabel = null;
            }

            if (PhoneImageView != null)
            {
                PhoneImageView.Dispose();
                PhoneImageView = null;
            }

            if (RightArrowImageView != null)
            {
                RightArrowImageView.Dispose();
                RightArrowImageView = null;
            }

            if (StatusButton != null)
            {
                StatusButton.Dispose();
                StatusButton = null;
            }

            if (TitleLabel != null)
            {
                TitleLabel.Dispose();
                TitleLabel = null;
            }

            if (YesBackgroundView != null)
            {
                YesBackgroundView.Dispose();
                YesBackgroundView = null;
            }

            if (YesLabel != null)
            {
                YesLabel.Dispose();
                YesLabel = null;
            }
        }