Exemplo n.º 1
0
        public override void AddWidget(string name, PanelWidget widget)
        {
            Panels.Add(widget);

            Slider.Max = Panels.Count - 1;

            base.AddWidget(name, widget);
        }
Exemplo n.º 2
0
        private void DoVisitWebsiteClicked(PanelWidget widget)
        {
#if WINDOWS
            System.Diagnostics.Process.Start(Preferences.WebsiteURL);
#endif
        }
Exemplo n.º 3
0
 private void DoReloadClicked(PanelWidget widget)
 {
     NotifyReloadAsked();
 }
Exemplo n.º 4
0
        private bool HoverTitleWidgets(Circle circle)
        {
            foreach (var w in TitleBarWidgets)
                if (w.DoHover(circle))
                {
                    LastHoverWidget = w;
                    return true;
                }

            return false;
        }
Exemplo n.º 5
0
        protected virtual bool HoverWidgets(Circle circle)
        {
            foreach (var w in Widgets)
                if (w.Value.DoHover(circle))
                {
                    LastHoverWidget = w.Value;
                    return true;
                }

            return false;
        }
Exemplo n.º 6
0
        private bool ClickTitleWidgets(Circle circle)
        {
            foreach (var w in TitleBarWidgets)
                if (w.DoClick(circle))
                {
                    LastClickedWidget = w;
                    return true;
                }

            return false;
        }
Exemplo n.º 7
0
        protected override bool Hover(Circle circle)
        {
            if (ShowCloseButton && CloseButton.DoHover(circle))
            {
                LastHoverWidget = CloseButton;
                return true;
            }

            if (HoverTitleWidgets(circle))
                return true;

            if (HoverWidgets(circle))
                return true;

            return false;
        }
Exemplo n.º 8
0
        protected virtual bool ClickWidgets(Circle circle)
        {
            foreach (var w in Widgets)
                if (w.Value.DoClick(circle))
                {
                    LastClickedWidget = w.Value;
                    return true;
                }

            return false;
        }
Exemplo n.º 9
0
        protected override bool Click(Circle circle)
        {
            if (ShowCloseButton && CloseButton.DoClick(circle))
            {
                LastClickedWidget = CloseButton;
                return true;
            }

            if (ClickTitleWidgets(circle))
                return true;

            if (ClickWidgets(circle))
                return true;

            return false;
        }
Exemplo n.º 10
0
        public virtual void ClearWidgets()
        {
            Widgets.Clear();

            LastClickedWidget = null;
            LastHoverWidget = null;

            RecomputePositions = true;
        }
Exemplo n.º 11
0
        public virtual void RemoveWidget(string name)
        {
            for (int i = Widgets.Count - 1; i > -1; i--)
                if (Widgets[i].Key == name)
                {
                    if (Widgets[i].Value == LastClickedWidget)
                        LastClickedWidget = null;

                    if (Widgets[i].Value == LastHoverWidget)
                        LastHoverWidget = null;

                    Widgets.RemoveAt(i);
                    break;
                }

            RecomputePositions = true;
        }
Exemplo n.º 12
0
        public void AddTitleBarWidget(PanelWidget widget)
        {
            widget.Scene = Scene;
            widget.Initialize();
            widget.VisualPriority = VisualPriority;
            widget.Alpha = Alpha;

            TitleBarWidgets.Add(widget);

            RecomputePositions = true;
        }
Exemplo n.º 13
0
        public virtual void AddWidget(string name, PanelWidget widget)
        {
            widget.Name = name;
            widget.Scene = Scene;
            widget.Initialize();
            widget.VisualPriority = VisualPriority;
            widget.Alpha = Alpha;

            Widgets.Add(new KeyValuePair<string, PanelWidget>(name, widget));

            RecomputePositions = true;
        }