Ejemplo n.º 1
0
        protected override void OnStyleChanged(UIStyle style)
        {
            base.OnStyleChanged(style);

            TextStyle.ValueFor(this).Update(PeerDropdown.captionText, DefaultTextStyle);
            Background.ValueFor(this).Update(PeerImage, DefaultBackground);
            ArrowImage.ValueFor(this).Update(PeerArrow, DefaultArrowImage);

            PeerScrollPanel.Background = PopupBackground.Merge(DefaultPopupBackground);
            PeerToggle.Checkbox        = ItemBackground.Merge(DefaultItemBackgroundSet);
            PeerToggle.TextStyle       = ItemTextStyle.Merge(DefaultItemTextStyleSet);
        }
Ejemplo n.º 2
0
        private void ToggleSelectorExpanded()
        {
            if (_selectorExpanded)
            {
                ArrowImage.RotateTo(0, 100);
                SelectorLayout.IsVisible = false;
            }
            else
            {
                SelectorLayout.IsVisible = true;
                ArrowImage.RotateTo(90, 100);
            }

            _selectorExpanded = !_selectorExpanded;
        }
Ejemplo n.º 3
0
            /// <inheritdoc />
            public override void Draw()
            {
                // Cache data
                var   clientRect      = new Rectangle(Vector2.Zero, Size);
                float margin          = clientRect.Height * 0.2f;
                float boxSize         = clientRect.Height - margin * 2;
                bool  isOpened        = IsPopupOpened;
                bool  enabled         = EnabledInHierarchy;
                Color backgroundColor = BackgroundColor;
                Color borderColor     = BorderColor;
                Color arrowColor      = ArrowColor;

                if (!enabled)
                {
                    backgroundColor *= 0.5f;
                    arrowColor      *= 0.7f;
                }
                else if (isOpened || _mouseDown)
                {
                    backgroundColor = BackgroundColorSelected;
                    borderColor     = BorderColorSelected;
                    arrowColor      = ArrowColorSelected;
                }
                else if (IsMouseOver)
                {
                    backgroundColor = BackgroundColorHighlighted;
                    borderColor     = BorderColorHighlighted;
                    arrowColor      = ArrowColorHighlighted;
                }

                // Background
                Render2D.FillRectangle(clientRect, backgroundColor);
                Render2D.DrawRectangle(clientRect, borderColor);

                // Draw text
                float textScale = Height / DefaultHeight;
                var   textRect  = new Rectangle(margin, 0, clientRect.Width - boxSize - 2.0f * margin, clientRect.Height);

                Render2D.PushClip(textRect);
                var textColor = TextColor;

                Render2D.DrawText(Font.GetFont(), "View", textRect, enabled ? textColor : textColor * 0.5f, TextAlignment.Near, TextAlignment.Center, TextWrapping.NoWrap, 1.0f, textScale);
                Render2D.PopClip();

                // Arrow
                ArrowImage?.Draw(new Rectangle(clientRect.Width - margin - boxSize, margin, boxSize, boxSize), arrowColor);
            }
Ejemplo n.º 4
0
        public void Handle_Tapped(object sender, EventArgs e)
        {
            uint animationMs = 125;
            var  isShowing   = !RowImage.IsVisible;

            // Do a quick little animation to transition things
            if (isShowing)
            {
                // If it was originally hidden then now we're showing it
                RowImage.IsVisible = RowDescription.IsVisible = true;
                ArrowImage.RotateTo(90, animationMs);
            }
            else
            {
                // If it was originally showing then now we're hiding it
                ArrowImage.RotateTo(-90, animationMs);
                RowImage.IsVisible = RowDescription.IsVisible = false;
            }
        }
Ejemplo n.º 5
0
        void ReleaseDesignerOutlets()
        {
            if (ArrowImage != null)
            {
                ArrowImage.Dispose();
                ArrowImage = null;
            }

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

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

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

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

            if (ProjectLabel != null)
            {
                ProjectLabel.Dispose();
                ProjectLabel = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (ArrowImage != null)
            {
                ArrowImage.Dispose();
                ArrowImage = null;
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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