Esempio n. 1
0
        public static void DrawLayeredOverride(Graph graph)
        /// Drawing override in layers-style (can add, remove or switch)
        /// For graph defaults
        {
            Override ovd = graph.defaults;

            using (Cell.LinePx(0))
                LayersEditor.DrawLayers(
                    ovd.Count,
                    onDraw: n => DrawLayer(ovd, n),
                    onAdd: n => NewOverrideWindow.ShowWindow(ovd, n),
                    onRemove: n => ovd.RemoveAt(n),
                    onMove: (n1, n2) => ovd.Switch(n1, n2));

            using (Cell.LinePx(20))
            {
                using (Cell.Row)
                    if (Draw.Button("Add All Exposed"))
                    {
                        graph.defaults.AddAllExposed(graph.exposed, graph);
                    }

                using (Cell.Row)
                    if (Draw.Button("Remove Unused"))
                    {
                        graph.defaults.RemoveAllUnused(graph.exposed);
                    }
            }
        }