public StyleEditor() { list.Name = "listEditor1"; list.DataSource = GuiEnvironment.Theme; list.ReadOnly = false; list.List.SelectionChanged += ListItemSelect; details.EditMode = EditModes.ByClick; var smap = new GroupBoxItem(map) { Row = 1 }; smap.Add(new GroupBoxItem() { Widget = details, Text = "Detail", FillWidth = true, Width = 230, Height = 60 }); smap.Add(new GroupBoxItem() { Widget = preview, Text = "Preview", FillWidth = true, Width = 230, Height = 60 }); map.Add(new GroupBoxItem() { Widget = list, Text = "Slyles", FillHeight = true, FillWidth = true }); map.Add(smap); Name = "StyleEditor"; Text = "Style Editor"; PackStart(map, true, true); Localize(); }
public GroupBox() { items = new GroupBoxItem(this) { CalcHeight = CalcHeight }; }
public void Add(GroupBoxItem item) { if (item.Map == null) { items.Add(item); } if (item.Count == 0) { if (item.Widget != null && item.Widget.Parent != this) { if (!Children.Contains(item.Widget)) { base.AddChild(item.Widget); } } } else { item.GroupBox = this; if (item.GroupBox != null && item.GroupBox != this) { if (!Children.Contains(item.GroupBox)) { base.AddChild(item.GroupBox); } } else { item.CalcHeight = CalcHeight; foreach (var sitem in item) { Add(sitem); } } } }
public LayoutInfoEditor() { CellCopy = new ToolItem(OnMenuCellCopyClick) { Name = "Copy", Glyph = GlyphType.CopyAlias }; CellCheck = new ToolItem(OnMenuCellCheckClick) { Name = "Check All", Glyph = GlyphType.CheckSquare }; ViewMode = new ToolItem(OnMenuViewModeClick) { Name = "Grid View", Glyph = GlyphType.PhotoAlias }; Reset = new ToolItem(OnMenuResetColumnsClick) { Name = "Reset", Glyph = GlyphType.Refresh }; Print = new ToolItem() { Glyph = GlyphType.Print }; toolSort = new ToolItem(ToolSortClick) { Name = "Sort", CheckOnClick = true, Glyph = GlyphType.SortAlphaAsc }; toolGroup = new ToolItem(ToolGroupClick) { Name = "Group", CheckOnClick = true, Glyph = GlyphType.PlusSquareO }; bar = new Toolsbar( ViewMode, Reset, Print, toolGroup, toolSort, new ToolSeparator(), CellCopy, CellCheck) { Name = "PListContext" }; options = new LayoutList() { EditMode = EditModes.ByClick }; columns = new ListEditor(new LayoutList { GenerateColumns = false, GenerateToString = false, EditMode = EditModes.ByClick, ListInfo = new LayoutListInfo( new LayoutColumn { Name = nameof(LayoutColumn.ToString), Editable = false, Width = 180 }, new LayoutColumn { Name = nameof(LayoutColumn.Text), FillWidth = true }, new LayoutColumn { Name = nameof(LayoutColumn.Visible), Width = 50 }, new LayoutColumn { Name = nameof(LayoutColumn.Format) }) { HeaderVisible = false, LevelIndent = 5, Tree = true } }); columns.List.SelectionChanged += ColumnsItemSelect; columns.List.ItemRemoved += OnColumnRemoved; ToolInsert.ItemClick += ToolInsertItemClick; fields = new ListEditor(new LayoutList { GenerateColumns = false, GenerateToString = false, EditMode = EditModes.ByClick, ListInfo = new LayoutListInfo( new LayoutColumn { Name = nameof(LayoutField.ToString), Editable = false }, new LayoutColumn { Name = nameof(LayoutField.Text), FillWidth = true }, new LayoutColumn { Name = nameof(LayoutField.Visible), Width = 50 }, new LayoutColumn { Name = nameof(LayoutField.Format) }) }); sorts = new ListEditor(new LayoutList { GenerateColumns = false, GenerateToString = false, EditMode = EditModes.ByClick, ListInfo = new LayoutListInfo( new LayoutColumn { Name = nameof(LayoutSort.Column), FillWidth = true }, new LayoutColumn { Name = nameof(LayoutSort.Direction) }, new LayoutColumn { Name = nameof(LayoutSort.IsGroup) }) }); gColumns = new GroupBoxItem() { Name = "columns", Widget = columns, Text = "Columns", FillHeight = true, FillWidth = true }; gFields = new GroupBoxItem() { Name = "fields", Widget = fields, Text = "Fields", Row = 1, FillHeight = true, FillWidth = true }; gSorters = new GroupBoxItem() { Name = "sorts", Widget = sorts, Text = "Sort", Row = 2, FillHeight = true, FillWidth = true, Expand = false }; var mColumns = new GroupBoxItem(gColumns, gFields, gSorters) { Column = 1 }; gOptions = new GroupBoxItem() { Name = "properties", Widget = options, Text = "Properties", FillHeight = true, Width = 340 }; map = new GroupBox(gOptions, mColumns); PackStart(bar, false, false); PackStart(map, true, true); //BackgroundColor = GuiEnvironment.Theme["Page"].BaseColor; }