public LocalizeEditor() { toolLoadImages = new ToolItem(ToolLoadImagesClick) { DisplayStyle = ToolItemDisplayStyle.Text, Name = "toolLoadImages", Text = "Load Images" }; toolSave = new ToolItem() { DisplayStyle = ToolItemDisplayStyle.Text, Name = "toolSave", Text = "Save" }; Editor.Bar.Items.Add(new ToolSeparator()); Editor.Bar.Items.Add(toolSave); Editor.Bar.Items.Add(toolLoadImages); Editor.ReadOnly = false; Editor.List.RetriveCellEditor += (object listItem, object value, ILayoutCell cell) => { if (cell.GetEditor(listItem) == null) { if (Equals(cell.Name, "ImageKey")) { return(new CellEditorLocalizeImage()); } else if (Equals(cell.Name, "Glyph")) { return(new CellEditorGlyph()); } } return(null); }; DataSource = Locale.Instance; var images = new ListEditor(); images.List.ListInfo.ColumnsVisible = false; images.List.ListInfo.HeaderVisible = false; images.DataSource = Locale.Instance.Images; Name = "LocalizeEditor"; }
public ListExplorer(ListEditor dataEditor) { Editor = dataEditor; Editor.List.HideEmpty = false; Editor.List.EditMode = EditModes.ByClick; Editor.List.ReadOnly = false; Editor.Name = "fields"; Editor.List.SelectionChanged += ListOnSelectionChanged; Editor.ItemSelect += OnEditorItemSelect; Editor.GetCellEditor += OnGetCellEditor; toolTree = new ToolFieldEditor() { FillWidth = true, Editor = new CellEditorList() }; toolTree.Field.BindData(Selection, nameof(ListExplorerCursor.Current)); toolPrev = new ToolItem(ToolPrevClick) { Glyph = GlyphType.ArrowLeft }; toolNext = new ToolItem(ToolNextClick) { Glyph = GlyphType.ArrowRight }; var group = new ToolItem { Column = 0, Row = 0 }; group.Add(toolPrev); group.Add(toolNext); group.Add(toolTree); Bar.Items.Insert(group, true); PackStart(Editor, true, true); Name = "OptionEditor"; Tree = ((CellEditorList)toolTree.Editor).DropDown.Target as LayoutList; Tree.Mode = LayoutListMode.Tree; Tree.SelectionChanged += OnTreeAfterSelect; }
public ToolsbarEditor() { details = new LayoutList(); toolList = new ListEditor(new LayoutList() { GenerateColumns = false, GenerateToString = false, ListInfo = new LayoutListInfo( new LayoutColumn { Name = nameof(ToolItem.ToString), Editable = false }, new LayoutColumn { Name = nameof(ToolItem.Text), FillWidth = true }, new LayoutColumn { Name = nameof(ToolItem.Visible), Width = 50 }, new LayoutColumn { Name = nameof(ToolItem.Glyph) }) { } }); toolList.List.Bind(details, nameof(LayoutList.FieldSource), nameof(LayoutList.SelectedItem)); var map = new GroupBox( new GroupBoxItem { Name = "Items", Widget = toolList, FillWidth = true, FillHeight = true }, new GroupBoxItem { Name = "Details", Widget = details, FillWidth = true, FillHeight = true, Row = 1 }); PackStart(map, true, true); }
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; }