Exemplo n.º 1
0
        public static Layout makeHorizontal()
        {
            Layout ret = new Layout();
            ret.isVertical = false;

            return ret;
        }
Exemplo n.º 2
0
            public ModuleSwitch(Layout layout, Module module)
            {
                _toggle = new Toggle(module.name, false);

                _toggle.onSwitch = (m =>
                        {
                            if(m.toggled)
                                module.show();
                            else
                                module.hide();
                        });

                layout.views.add(_toggle);
            }
Exemplo n.º 3
0
 public InfoModule(Computer computer)
     : base(computer)
 {
     _stats = new List<StatLabel>();
     _statsLayout = Layout.makeVertical();
 }
Exemplo n.º 4
0
        public StatLabel(string name, UpdateHandler onUpdate)
        {
            _layout = Layout.makeHorizontal();

            Label nameLabel = new Label(name);
            nameLabel.area.widthExpandable = true;
            nameLabel.font.alignment = Alignment.UpperLeft;
            nameLabel.font.normal = Color.white;
            nameLabel.font.style = FontStyle.Bold;

            _layout.views.add(nameLabel);

            _valueLabel = new Label();
            _valueLabel.area.width = 150;

            _layout.views.add(_valueLabel);

            _updateHandler = onUpdate;
        }