Exemplo n.º 1
0
        protected void ScreenChange(SceneData screen, params object[] options)
        {
            f.Remove(current);
            current.Destroy();
            current = screen.CreateInstance(options);
            f.Put(current, 0, 0);

            f.Remove(side);
            side.Destroy();
            side = new MySideBar();
            f.Put(side, 0, 20);
            side.Show();

            if (currentScene == "Logger")
            {
                var logScreen = current as LoggerWindow;
                if (logScreen != null)
                {
                    side.ExpandEvent += (sender, e) => {
                        logScreen.tv.Visible = false;
                        logScreen.tv.QueueDraw();
                    };

                    side.CollapseEvent += (sender, e) => {
                        logScreen.tv.Visible = true;
                        logScreen.tv.QueueDraw();
                    };
                }
            }
            else if (currentScene == "Alarms")
            {
                var alarmScreen = current as AlarmWindow;
                if (alarmScreen != null)
                {
                    side.ExpandEvent += (sender, e) => {
                        alarmScreen.tv.Visible = false;
                        alarmScreen.tv.QueueDraw();
                    };

                    side.CollapseEvent += (sender, e) => {
                        alarmScreen.tv.Visible = true;
                        alarmScreen.tv.QueueDraw();
                    };
                }
            }

            f.Remove(notification);
            notification = new MyNotificationBar();
            f.Put(notification, 0, 0);
            notification.Show();

            QueueDraw();
        }
Exemplo n.º 2
0
        public MenuWindow(params object[] options) : base()
        {
            sceneTitle = "Menu";

            List <string> screenNames = new List <string> ();

            foreach (var screen in AquaPicGui.AquaPicUserInterface.scenes.Keys)
            {
                screenNames.Add(screen);
            }

            screenNames.Sort();

            int x = 60;
            int y = 80;

            foreach (var name in screenNames)
            {
                SceneData screen = AquaPicGui.AquaPicUserInterface.scenes[name];
                if (screen.showInMenu)
                {
                    var b = new TouchButton();
                    b.SetSizeRequest(220, 50);
                    b.text                = screen.name;
                    b.textColor           = "black";
                    b.ButtonReleaseEvent += OnButtonClick;
                    Put(b, x, y);

                    x += 230;
                    if (x >= 690)
                    {
                        x  = 60;
                        y += 60;
                    }
                }
            }

            ShowAll();
        }