Ejemplo n.º 1
0
        public Module(Computer computer)
        {
            _computer = computer;

            window = new Window();
            content = Layout.makeVertical();

            isShowing = false;
        }
Ejemplo n.º 2
0
        public static List<Window> requestGui(Connection connection, Window.OnUpdate onUpdate)
        {
            connection.stream.write("gui");
            connection.flush();

            List<Window> windows = new List<gui.Window>();

            int size = connection.stream.readInt();

            for(int i=0;i<size;i++)
            {
                Window newWindow = new Window();
                newWindow.deserialize(connection.stream);

                newWindow.onUpdate = onUpdate;

                windows.Add(newWindow);
            }

            return windows;
        }
Ejemplo n.º 3
0
        public void onSetup(Screen screen)
        {
            _window = new gui.Window();
            _window.area.set(screen.width - 550, 50, 200, 50);

            _window.title     = "BJEB";
            _window.draggable = true;
            _window.skin      = gui.Skin.Window7;

            _window.views.clear();

            _window.views.add(new Button("D")
            {
                area    = new Area(_window.area.width.Value - 60, 5, 20, 20),
                onClick = ((b, m) => {
                    if (_window.draggable)
                    {
                        b.text = "F";
                        _window.draggable = false;
                    }
                    else
                    {
                        b.text = "D";
                        _window.draggable = true;
                    }
                })
            });

            Layout content = Layout.makeVertical();

            _window.views.add(new Button("_")
            {
                area    = new Area(_window.area.width.Value - 40, 5, 20, 20),
                onClick = ((b, m) => {
                    if (content.isShowing)
                    {
                        content.hide();
                        _window.area.height = 50;
                    }
                    else
                    {
                        content.show();
                    }
                })
            });

            _window.views.add(new Button("X")
            {
                area = new Area(_window.area.width.Value - 20, 5, 20, 20)
            });

            _switches.Clear();

            foreach (var module in modules)
            {
                _switches.Add(module, new ModuleSwitch(content, module));
                module.show();
            }

            _window.views.add(content);
            _window.views.add(new Layout());

            foreach (var module in modules)
            {
                module.setup(screen);
            }
        }
Ejemplo n.º 4
0
        public void onSetup(Screen screen)
        {
            _window = new gui.Window();
            _window.area.set(screen.width - 550, 50, 200, 50);

            _window.title = "BJEB";
            _window.draggable = true;
            _window.skin = gui.Skin.Window7;

            _window.views.clear();

            _window.views.add(new Button("D") { area = new Area(_window.area.width.Value - 60, 5, 20, 20),
                        onClick = ((b, m) => {
                                if(_window.draggable)
                                {
                                    b.text = "F";
                                    _window.draggable = false;
                                }
                                else
                                {
                                    b.text = "D";
                                    _window.draggable = true;
                                }}) });

            Layout content = Layout.makeVertical();

            _window.views.add(new Button("_")
                { area = new Area(_window.area.width.Value - 40, 5, 20, 20),
                        onClick = ((b, m) => {
                                if(content.isShowing)
                                {
                                    content.hide();
                                    _window.area.height = 50;
                                }
                                else content.show(); })});

            _window.views.add(new Button("X") { area = new Area(_window.area.width.Value - 20, 5, 20, 20) });

            _switches.Clear();

            foreach(var module in modules)
            {
                _switches.Add(module, new ModuleSwitch(content, module));
                module.show();
            }

            _window.views.add(content);
            _window.views.add(new Layout());

            foreach(var module in modules)
            {
                module.setup(screen);
            }
        }
Ejemplo n.º 5
0
        public static void requestWindowUpdate(Window window, Connection connection)
        {
            connection.stream.write("guiWindowUpdate");

            connection.stream.write(window.id);
            window.views.serializeState(connection.stream);

            connection.flush();
        }