public ConsoleButtonControl()
		{
			Container = new Canvas { Width = Width, Height = Height };

			ButtonConsole = new TiledImageButtonControl(
				"assets/ScriptCoreLib.Avalon.TiledImageButton/console.png".ToSource(),
				 Width, Height,
				 new TiledImageButtonControl.StateSelector
				 {
					 AsDisabled = s => s[0, 2],
					 AsEnabled = s => s[0, 0],
					 AsHot = s => s[0, 1],
					 AsPressed = s => s[0, 3]
				 }
			);
			ButtonConsole.Container.AttachTo(Container);


			ButtonConsole.Overlay.MouseLeftButtonUp +=
				delegate
				{
					if (!this.ButtonConsole.Enabled)
						return;

					if (this.Console != null)
						this.Console();
				};
		}
Example #2
0
        public FullscreenButtonControl()
        {
            Container = new Canvas {
                Width = Width, Height = Height
            };

            ButtonGoFullscreen = new TiledImageButtonControl(
                "assets/ScriptCoreLib.Avalon.TiledImageButton/fullscreen.png".ToSource(),
                Width, Height,
                new TiledImageButtonControl.StateSelector
            {
                AsDisabled = s => s[0, 2],
                AsEnabled  = s => s[0, 0],
                AsHot      = s => s[0, 1],
                AsPressed  = s => s[0, 4]
            }
                );
            ButtonGoFullscreen.Container.AttachTo(Container);


            ButtonGoFullscreen.Overlay.MouseLeftButtonUp +=
                delegate
            {
                if (!this.ButtonGoFullscreen.Enabled)
                {
                    return;
                }

                if (this.GoFullscreen != null)
                {
                    this.GoFullscreen();
                }
            };
        }
		public AeroNavigationBar()
		{
			Container = new Canvas { Width = Width, Height = Height };

			Background = new Image
			{
				Source = "assets/ScriptCoreLib.Avalon.TiledImageButton/backMenuPic.png".ToSource(),
				Clip = new RectangleGeometry
				{
					Rect = new Rect { X = 0, Y = 0, Width = 27 * 2 + 6, Height = 27 + 4 }
				}
			}.MoveTo(-1, 0).AttachTo(Container);

			ButtonGoBack = new TiledImageButtonControl(
				"assets/ScriptCoreLib.Avalon.TiledImageButton/back-forward-large.png".ToSource(),
				 27, 27,
				 new TiledImageButtonControl.StateSelector
				 {
					 AsDisabled = s => s[0, 0],
					 AsEnabled = s => s[0, 1],
					 AsHot = s => s[0, 2],
					 AsPressed = s => s[0, 3]
				 }
			 );

			ButtonGoBack.Overlay.MouseLeftButtonUp +=
				delegate
				{
					if (!this.ButtonGoBack.Enabled)
						return;

					if (this.GoBack != null)
						this.GoBack();
				};

			ButtonGoBack.Container.MoveTo(0, 0).AttachTo(Container);

			ButtonGoForward = new TiledImageButtonControl(
				"assets/ScriptCoreLib.Avalon.TiledImageButton/back-forward-large.png".ToSource(),
				27, 27,
				 new TiledImageButtonControl.StateSelector
				 {
					 AsDisabled = s => s[1, 0],
					 AsEnabled = s => s[1, 1],
					 AsHot = s => s[1, 2],
					 AsPressed = s => s[1, 3]
				 }
			);

			ButtonGoForward.Overlay.MouseLeftButtonUp +=
				delegate
				{
					if (!this.ButtonGoForward.Enabled)
						return;

					if (this.GoForward != null)
						this.GoForward();
				};

			ButtonGoForward.Enabled = false;
			ButtonGoForward.Container.MoveTo(27, 0).AttachTo(Container);

			this.History = new HistoryInfo(this);
		}
        public AeroNavigationBar()
        {
            Container = new Canvas {
                Width = Width, Height = Height
            };

            Background = new Image
            {
                Source = "assets/ScriptCoreLib.Avalon.TiledImageButton/backMenuPic.png".ToSource(),
                Clip   = new RectangleGeometry
                {
                    Rect = new Rect {
                        X = 0, Y = 0, Width = 27 * 2 + 6, Height = 27 + 4
                    }
                }
            }.MoveTo(-1, 0).AttachTo(Container);

            ButtonGoBack = new TiledImageButtonControl(
                "assets/ScriptCoreLib.Avalon.TiledImageButton/back-forward-large.png".ToSource(),
                27, 27,
                new TiledImageButtonControl.StateSelector
            {
                AsDisabled = s => s[0, 0],
                AsEnabled  = s => s[0, 1],
                AsHot      = s => s[0, 2],
                AsPressed  = s => s[0, 3]
            }
                );

            ButtonGoBack.Overlay.MouseLeftButtonUp +=
                delegate
            {
                if (!this.ButtonGoBack.Enabled)
                {
                    return;
                }

                if (this.GoBack != null)
                {
                    this.GoBack();
                }
            };

            ButtonGoBack.Container.MoveTo(0, 0).AttachTo(Container);

            ButtonGoForward = new TiledImageButtonControl(
                "assets/ScriptCoreLib.Avalon.TiledImageButton/back-forward-large.png".ToSource(),
                27, 27,
                new TiledImageButtonControl.StateSelector
            {
                AsDisabled = s => s[1, 0],
                AsEnabled  = s => s[1, 1],
                AsHot      = s => s[1, 2],
                AsPressed  = s => s[1, 3]
            }
                );

            ButtonGoForward.Overlay.MouseLeftButtonUp +=
                delegate
            {
                if (!this.ButtonGoForward.Enabled)
                {
                    return;
                }

                if (this.GoForward != null)
                {
                    this.GoForward();
                }
            };

            ButtonGoForward.Enabled = false;
            ButtonGoForward.Container.MoveTo(27, 0).AttachTo(Container);

            this.History = new HistoryInfo(this);
        }