예제 #1
0
        public StatusMapPanel()
        {
            var panel = downPanel();

            model   = new StatusTreeMap(this);
            treeMap = new QTreeMap(model);
            Content = panel;
            var controlGrid = new QGrid();

            ResizingPanel.SetResizeHeight(controlGrid, 23);
            controlGrid.addColumn(1, GridUnitType.Star);
            controlGrid.addColumn(1, GridUnitType.Star);
            controlGrid.addColumn(7, GridUnitType.Star);
            controlGrid.add(new QCheckBox("Equal Size Boxes", true, selected => { model.setIsEqualSizes(selected); treeMap.updateGuiNodes(); })
            {
                VerticalAlignment = VerticalAlignment.Center
            }, 0);
            var refershBox = new QComboBox("5", refreshRate => treeMap.setRefreshRate(int.Parse(refreshRate) * 1000))
            {
                Height = 20
            };

            controlGrid.add(withLabel("Refresh Rate (sec): ", refershBox), 1);
            refershBox.populateWithFirst("1", O.list("3", "5", "10", "30", "60"), false);
            panel.Children.Add(controlGrid);
            panel.Children.Add(treeMap);
            refreshContextMenus();
        }
예제 #2
0
 void refreshContextMenus()
 {
     treeMap.refreshContextMenus();
     treeMap.addContextMenuItems(new MenuItem("Kill", (e, unused) => StatusTreeMap.kill(treeMap.selected())));
     launchers.each(launcher => treeMap.addContextMenuItems(new MenuItem("Kill everywhere and Restart on " + launcher, (e, unused) => model.killAndRestart(treeMap.selected(), launcher))));
 }