/// <summary> /// Opens the Animation List Editor. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void mManageAnimationsToolStripButton_Click(object sender, EventArgs e) { ListEditor <GUIAnimation> animSetEditor = new ListEditor <GUIAnimation>(View.Animations.AnimationList); animSetEditor.AddingItem += new ListEditor <GUIAnimation> .ListEditorEventHandler(animSetEditor_AddingItem); animSetEditor.RemovingItem += new ListEditor <GUIAnimation> .ListEditorEventHandler(animSetEditor_RemovingItem); animSetEditor.Text = "Animations"; animSetEditor.ShowDialog(); GUIAnimation animation = View.CurrentAnimation; View.Animations = new GUIAnimationCollection(animSetEditor.List.ToArray()); PopulateAnimations(View.Animations); // We've replaced the entire channel list. See if the timeline control's current channel is still // present. If so, nothing needs to be done. But if it was removed, select the "OnActivate" channel if (!View.Animations.Contains(mTimelineControl.Animation)) { mTimelineControl.Animation = View.Animations["OnActivate"]; mAnimationsToolStripComboBox.SelectedItem = mTimelineControl.Animation; } else { mTimelineControl.Animation = animation; mAnimationsToolStripComboBox.SelectedItem = animation; } }
/// <summary> /// Allows a caller to perform logic on the list inside a lock, and return a modified list. /// Callbacks should be fast, and should reference the IList they are fed, not this SafeList instance. /// Calling methods on the SafeList instance will cause a deadlock. /// </summary> /// <param name="callback"></param> public void ModifyList(ListEditor callback) { lock (writeLock) { items = new ReadOnlyCollection <T>(new List <T>(callback(GetList()))); } FireChanged(); }
public OpenFileAssociations() { InitializeComponent(); rpfFileAssociation.OpenEditorCallback = GetCallback <Color15BppBgr>( PaletteFormatter.Rpf); // MW3 files are exactly like RPF files mw3FileAssociation.OpenEditorCallback = GetCallback <Color15BppBgr>( PaletteFormatter.Mw3); tplFileAssociation.OpenEditorCallback = GetCallback <Color15BppBgr>( PaletteFormatter.Tpl); palFileAssociation.OpenEditorCallback = GetCallback <Color15BppBgr>( PaletteFormatter.Pal); gfxFileAssociation.OpenEditorCallback = GfxEditor.OpenByteFile( GraphicsFormat.Format4BppSnes); OpenEditorCallback GetCallback <T>(IDataFormatter <T> dataFormatter) { return(ListEditor <T> .OpenByteFile( dataFormatter.ToFormattedData)); } }
//private TableEditor parameters; public TemplateEditor() { var groupBox = new GroupBox( new GroupBoxItem { Name = "Attributes", Column = 0, Row = 0, FillWidth = true, FillHeight = true, Widget = attribures = new ListEditor { AccessVisible = true } }, new GroupBoxItem { Name = "Files", Column = 1, Row = 0, FillWidth = true, FillHeight = true, Widget = datas = new TableEditor { TableView = new DBTableView <TemplateData>((QParam)null, DBViewKeys.Empty), OwnerColumn = TemplateData.DBTable.ParseProperty(nameof(TemplateData.TemplateId)), OpenMode = TableEditorMode.Referencing } }) { Name = "GroupBox" }; PackStart(groupBox, true, true); Name = nameof(TemplateEditor); }
public override void LoadPanelContents() { SetupFromXmlStream(GetType().Assembly.GetManifestResourceStream( "ICSharpCode.CppBinding.Resources.LinkerOptions.xfrm")); InitializeHelper(); helper.BindString("libraryPathTextBox", "LibraryPath", TextBoxEditMode.EditRawProperty); Get <Button>("libraryPath").Click += ListEditor.DirectoriesEditor(this, "libraryPath").Event; TextBox additionalLibsTextBox = Get <TextBox>("additionalLibs"); helper.AddBinding(null, new ItemDefinitionGroupBinding <TextBox>(additionalLibsTextBox, "Link", "AdditionalDependencies")); Get <Button>("additionalLibs").Click += ListEditor.SymbolsEditor(this, "additionalLibs").Event; TextBox addModuleTextBox = Get <TextBox>("addModule"); helper.AddBinding(null, new ItemDefinitionGroupBinding <TextBox>(addModuleTextBox, "Link", "AddModuleNamesToAssembly")); Get <Button>("addModule").Click += ListEditor.SymbolsEditor(this, "addModule").Event; CheckBox debugInfoCheckBox = Get <CheckBox>("debugInfo"); helper.AddBinding(null, new CheckBoxItemDefinitionGroupBinding(debugInfoCheckBox, "Link", "GenerateDebugInformation")); TextBox resourceFileTextBox = Get <TextBox>("resourceFile"); helper.AddBinding(null, new ItemDefinitionGroupBinding <TextBox>(resourceFileTextBox, "Link", "EmbedManagedResourceFile")); Get <Button>("resourceFile").Click += ListEditor.SymbolsEditor(this, "resourceFile").Event; TextBox additionalOptionsTextBox = Get <TextBox>("additionalOptions"); helper.AddBinding(null, new ItemDefinitionGroupBinding <TextBox>(additionalOptionsTextBox, "Link", "AdditionalOptions")); }
void Editor_ControlsCreated(object sender, EventArgs e) { ListEditor le = sender as ListEditor; le.ControlsCreated -= Editor_ControlsCreated; CustomizeListEditor(le); }
// 编辑书签——点击事件 public void EditBookmarks_Click(object sender, EventArgs args) { List <string> leftList = new List <string>(bookmarks); List <string> rightList = new List <string>(); ListEditor listEditor = new ListEditor(); listEditor.LeftLabel = "Current Bookmarks"; listEditor.LeftList = leftList; listEditor.RightLabel = "Delete Bookmarks"; listEditor.RightList = rightList; ListEditor listEditor2 = listEditor; if (listEditor2.ShowDialog() == DialogResult.OK) { foreach (string right in listEditor2.RightList) { bookmarks.Remove(right); bookmarkToPath.Remove(right); foreach (ToolStripItem dropDownItem in _bookmarksToolStripMenuItem.DropDownItems) { if (dropDownItem is BookmarkItem && dropDownItem.Text.Equals(right)) { _bookmarksToolStripMenuItem.DropDownItems.Remove(dropDownItem); break; } } } SaveBookmarks(); } }
public void EditBookmarks(object sender, EventArgs args) { List <string> bm = new List <string>(bookmarks); List <string> delete = new List <string>(); ListEditor editor = new ListEditor { LeftLabel = "Current Bookmarks", LeftList = bm, RightLabel = "Delete Bookmarks", RightList = delete }; if (editor.ShowDialog() == DialogResult.OK) { foreach (string toDelete in editor.RightList) { bookmarks.Remove(toDelete); bookmarkToPath.Remove(toDelete); foreach (ToolStripItem item in bookmarksToolStripMenuItem.DropDownItems) { if (item is BookmarkItem && item.Text.Equals(toDelete)) { bookmarksToolStripMenuItem.DropDownItems.Remove(item); break; } } } SaveBookmarks(); } }
public TestWindow() { //DBService.Execute += (e) => //{ // Helper.Logs.Add(new StateInfo( // "DBService", // "Execute" + e.Type, // e.Query, // e.Rezult is Exception ? StatusType.Error : StatusType.Information)); //}; bar.Items[0].InsertBefore(new[] { new ToolItem(FilesClick) { DisplayStyle = ToolItemDisplayStyle.Text, Name = "Files" }, new ToolItem(ListEditorClick) { DisplayStyle = ToolItemDisplayStyle.Text, Name = "List Editor" }, new ToolItem(ORMTestClick) { DisplayStyle = ToolItemDisplayStyle.Text, Name = "ORM Test" }, new ToolItem(TestInvokerClick) { DisplayStyle = ToolItemDisplayStyle.Text, Name = "Test Invoker" }, new ToolItem(LocalizeEditorClick) { DisplayStyle = ToolItemDisplayStyle.Text, Name = "Localize Editor" }, new ToolItem(CalendarClick) { DisplayStyle = ToolItemDisplayStyle.Text, Name = "Calendar" }, new ToolItem(DiffTestClick) { DisplayStyle = ToolItemDisplayStyle.Text, Name = "Diff Test" }, new ToolItem(StyleEditorClick) { DisplayStyle = ToolItemDisplayStyle.Text, Name = "StyleEditor" }, new ToolItem(MonoTextEditorClick) { DisplayStyle = ToolItemDisplayStyle.Text, Name = "MonoTextEditor" }, new ToolItem(ODFClick) { DisplayStyle = ToolItemDisplayStyle.Text, Name = "ODF" } }); var logs = new LogExplorer(); fields = new ListEditor(); Name = "FormTest"; Title = "Test GUI"; }
public ButtonSetup?FindButton(string buttonId) => EnumerableExtensions .MergeAll( ListView?.GetAllButtons(), ListEditor?.GetAllButtons(), NodeView?.GetAllButtons(), NodeEditor?.GetAllButtons()) .FirstOrDefault(x => x.ButtonId == buttonId);
public UserEditor() { //var info = new LayoutFieldInfo(); //info.Columns.Indent = 6; //info.Nodes.Add(new LayoutField("UserType")); //info.Nodes.Add(new LayoutField("Parent")); //info.Nodes.Add(new LayoutField("Position")); //info.Nodes.Add(new LayoutField("Login")); //info.Nodes.Add(new LayoutField("Password")); //info.Nodes.Add(new LayoutField("Name")); //info.Nodes.Add(new LayoutField("EMail")); var f = new LayoutList { AllowCellSize = true, CheckView = false, EditMode = EditModes.ByClick, EditState = EditListState.Edit, Mode = LayoutListMode.Fields, Name = "fields", Text = "Attributes" }; fields = new ListEditor(f); fields.Saving += OnFieldsSaving; groups = new AccessEditor() { Name = "Groups" }; groupAttributes = new GroupBoxItem { Widget = fields, FillWidth = true, FillHeight = true, Name = "Parameters" }; groupGroups = new GroupBoxItem() { Column = 2, Widget = groups, Width = 252, Name = "Groups" }; groupMap = new GroupBox(groupAttributes, groupGroups); Name = "UserEditor"; Text = "User Editor"; ((Box)fields.Bar.Parent).Remove(fields.Bar); PackStart(fields.Bar, false, false); PackStart(groupMap, true, true); Localize(); User.DBTable.RowUpdated += OnRowUpdated; }
/// <summary> /// Called when the channel editing dialog is removing an item /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void animSetEditor_RemovingItem(object sender, ListEditor <GUIAnimation> .ListEditorEventArgs e) { GUIAnimation animation = e.Object as GUIAnimation; if (animation.Name == "OnActivate" || animation.Name == "OnDeactivate") { e.CancelAction = true; } }
//private TableEditor parameters; public StageEditor() { var groupBox = new GroupBox( new GroupBoxItem { Name = "Attributes", Column = 0, Row = 0, Width = 400, FillHeight = true, Widget = attribures = new ListEditor { AccessVisible = true } }, new GroupBoxItem ( new GroupBoxItem { Name = "Relations", Column = 0, Row = 0, RadioGroup = 1, FillWidth = true, FillHeight = true, Widget = relations = new ListEditor { DataSource = new DBTableView <StageReference>(new QParam(StageParam.DBTable.ParseProperty(nameof(StageParam.StageId)), null), DBViewKeys.Empty) } }, new GroupBoxItem { Name = "Procedures", Column = 0, Row = 1, RadioGroup = 1, Expand = false, FillWidth = true, FillHeight = true, Widget = procedures = new ListEditor { DataSource = new DBTableView <StageProcedure>(new QParam(StageParam.DBTable.ParseProperty(nameof(StageParam.StageId)), null), DBViewKeys.Empty) } } ) { Name = "Group", Column = 1, Row = 0, } ) { Name = "GroupBox" }; PackStart(groupBox, true, true); }
private void ListEditorClick(object sender, EventArgs e) { var list = new ListEditor { Text = "List Editor", DataSource = TestClass.Generate(10000) }; dock.Put(list, DockType.Content); }
void DeleteAction_ExecuteCompleted(object sender, ActionBaseEventArgs e) { ListEditor editor = (View as ListView).Editor; XafBootstrapTableEditor tableEditor = editor as XafBootstrapTableEditor; if (tableEditor != null) { tableEditor.Refresh(); } }
protected override void OnViewControlsCreated() { base.OnViewControlsCreated(); if (ListEditor != null) { var gridView = ListEditor.GridView(); if (gridView != null) { gridView.CustomDrawCell += GridViewOnCustomDrawCell; } } }
public override void OnInspectorGUI() { serializedObject.Update(); _target_object.OnAfterDeserialize(); bool dirty = false; string pre_name = _script_name_property.stringValue; EditorGUILayout.DelayedTextField(_script_name_property); if (pre_name != _script_name_property.stringValue || _current_file_name != _script_name_property.stringValue) { if (GetFieldList(_script_name_property.stringValue)) { dirty = true; } else { _script_name_property.stringValue = pre_name; } _current_file_name = _script_name_property.stringValue; } UpdateValidate(); EditorGUI.BeginChangeCheck(); foreach (var item in lst_test) { FiledData data = _lst_info.Find(m => m.filed_name == item.field_name); if (!item.is_arry) { data.obj = EditorGUILayout.ObjectField(item.field_name, data.obj, item.type, true); } else { data.arr = data.arr ?? new List <Object>(); if (!_dic_list_editor.TryGetValue(item.field_name, out ListEditor list)) { list = new ListEditor(data.arr, item.type, item.field_name); _dic_list_editor[item.field_name] = list; } list.DoLayoutList(); } } if (EditorGUI.EndChangeCheck() || dirty) { ApplyModifycation(); } }
private void EditList(string name, IList <string> listToEdit) { ListEditor editor = new ListEditor(name, listToEdit); List <string> original = listToEdit.ToList <string>(); editor.ShowDialog(); int commonCount = listToEdit.Intersect(original).Count <string>(); if (commonCount != listToEdit.Count || commonCount != original.Count) { TitleChanges(null, null); } }
void lpe_FocusedObjectChanged(object sender, EventArgs e) { ListEditor h = sender as ListEditor; if (h != null) { var cur = View.CurrentObject as IMerger <T>; if (cur != null) { cur.WinnerObject = h.FocusedObject as T; } } }
protected override void RemoveSelectedColumn() { var field = ((ListBoxControl)ActiveListBox).SelectedItem as LayoutViewField; if (field != null) { LayoutViewColumnWrapper columnInfo = (from LayoutViewColumn item in _layoutView.Columns where item.FieldName == field.FieldName select ListEditor.FindColumn(GetColumnInfo(item, _layoutView).PropertyName) as LayoutViewColumnWrapper).FirstOrDefault(); if (columnInfo != null) { ListEditor.RemoveColumn(columnInfo); } ((ListBoxControl)ActiveListBox).Items.Remove(field); } }
/// <summary> /// Called when the channel editing dialog is adding a new item /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void animSetEditor_AddingItem(object sender, ListEditor <GUIAnimation> .ListEditorEventArgs e) { ListEditor <GUIAnimation> editor = sender as ListEditor <GUIAnimation>; GUIAnimation animation = e.Object as GUIAnimation; if (editor != null && animation != null) { animation.Name = GetUniqueName("Animation", editor.List); animation.NumFrames = 100; } else { e.CancelAction = true; } }
public static ListEditor Show(DBTableControl.DBEditorTableControl mainTable) { ListEditor hiddencolumnslisteditor = new ListEditor { LeftLabel = "Visible Columns:", RightLabel = "Hidden Columns:", OriginalOrder = mainTable.dbDataGrid.Columns.Select(n => (string)n.Header).ToList <string>(), LeftList = mainTable.CurrentTable.Columns.OfType <DataColumn>() .Where(n => !(bool)n.ExtendedProperties["Hidden"]) .Select(n => n.ColumnName).ToList(), RightList = mainTable.CurrentTable.Columns.OfType <DataColumn>() .Where(n => (bool)n.ExtendedProperties["Hidden"]) .Select(n => n.ColumnName).ToList() }; return(hiddencolumnslisteditor); }
//Manages the ClearFields Action enabled state //void ConfirmRegisterController_ViewEditModeChanged(object sender, EventArgs e) //{ // ConfirmRegister.Enabled.SetItemValue("EditMode", // ((DetailView)View).ViewEditMode == ViewEditMode.Edit); //} private void CheckRegister_Execute(object sender, SimpleActionExecuteEventArgs e) { ListEditor listEditor = ((ListView)View).Editor as ListEditor; if (listEditor != null) { foreach (RegisterDetail regDetail in View.SelectedObjects) { if (regDetail.CheckState.Code == "NOTCHECKED" && regDetail.RegisterState.Code == "BOOKED") { View.ObjectSpace.SetModified(regDetail); regDetail.CheckState = View.ObjectSpace.FindObject <RegisterState>( new BinaryOperator("Code", "CHECKED")); } } View.ObjectSpace.CommitChanges(); } }
//private TableEditor parameters; public WorkEditor() { var groupBox = new GroupBox( new GroupBoxItem { Name = "Attributes", Column = 0, Row = 0, Width = 400, FillHeight = true, Widget = attribures = new ListEditor { AccessVisible = true } }, new GroupBoxItem { Name = "Stages", Column = 1, Row = 0, FillWidth = true, FillHeight = true, Widget = stages = new TableEditor { TableView = new DBTableView <Stage>((QParam)null, DBViewKeys.Empty), OwnerColumn = Stage.DBTable.ParseProperty(nameof(Stage.WorkId)), OpenMode = TableEditorMode.Referencing } }, new GroupBoxItem { Name = "Stage Parameters", Column = 0, Row = 1, FillWidth = true, FillHeight = true, Widget = stageEditor = new StageEditor() }) { Name = "GroupBox" }; stages.SelectionChanged += StagesSelectionChanged; PackStart(groupBox, true, true); }
public override Control GetEditor(object value, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { Control control = null; var iList = value as IList; if (iList != null) { var list = new List <ComboBoxItem>(); foreach (var item in iList) { list.Add(new ComboBoxItem { Display = item.ToString(), Value = item }); } control = new ListEditor(Name, list, ListType, propertyName, body, onChange, onActivate); } return(control); }
//TODO: Implement adding new properties into the customization form. protected override void AddColumn(string propertyName) { IModelColumn columnInfo = FindColumnModelByPropertyName(propertyName); if (columnInfo == null) { columnInfo = ListEditor.Model.Columns.AddNode <IModelColumn>(); columnInfo.Id = propertyName; columnInfo.PropertyName = propertyName; columnInfo.Index = -1; var wrapper = ListEditor.AddColumn(columnInfo) as XafGridColumnWrapper; if (wrapper != null && wrapper.Column is LayoutViewColumn && ((LayoutViewColumn)wrapper.Column).LayoutViewField != null) { ((ListBoxControl)ActiveListBox).Items.Add(((LayoutViewColumn)wrapper.Column).LayoutViewField); } } else { throw new Exception(SystemExceptionLocalizer.GetExceptionMessage(ExceptionId.CannotAddDuplicateProperty, propertyName)); } }
protected override ListEditor CreateListEditorCore(IModelListView modelListView, CollectionSourceBase collectionSource) { ListEditor result = null; if (defaultListEditor != null) { result = defaultListEditor; } else { if (modelListView != null) { result = base.CreateListEditorCore(modelListView, collectionSource); } if (result == null) { result = new TestListEditor(modelListView); } } return(result); }
public async void ViewDocumentsAsync(List <Document> documents) { if (documents.Count == 1) { ShowDocument(documents[0]); } else if (documents.Count > 1) { var list = new DBTableView <Document>((QParam)null, DBViewKeys.Static | DBViewKeys.Empty) { ItemType = documents[0].GetType() }; list.AddRange(documents); var dlist = new ListEditor { DataSource = list }; using (var form = new ToolWindow { Title = "New Documents", Mode = ToolShowMode.Dialog, Size = new Size(800, 600), Target = dlist }) { var command = await form.ShowAsync(this, new Point(1, 1)); if (command == Command.Ok) { foreach (Document document in documents) { await document.Save(); } } } } }
private void CancelRegister_Execute(object sender, SimpleActionExecuteEventArgs e) { ListEditor listEditor = ((ListView)View).Editor as ListEditor; int i = 0; if (listEditor != null) { foreach (RegisterDetail regDetail in View.SelectedObjects) { if (regDetail.RegisterState.Code == "SELECTED") { View.ObjectSpace.SetModified(regDetail); regDetail.Delete(); i++; } } View.ObjectSpace.CommitChanges(); } PopUpMessage ms; DialogController dc; ObjectSpace objectSpace = Application.CreateObjectSpace(); ms = objectSpace.CreateObject <PopUpMessage>(); ms.Title = "Kết quả hủy"; ms.Message = string.Format("Đã hủy chọn {0} nhóm lớp MH!", i); e.ShowViewParameters.CreatedView = Application.CreateDetailView( objectSpace, ms); e.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow; e.ShowViewParameters.CreatedView.Caption = "Thông báo"; dc = Application.CreateController <DialogController>(); dc.AcceptAction.Active.SetItemValue("object", false); dc.CancelAction.Caption = "Đóng"; dc.SaveOnAccept = false; e.ShowViewParameters.Controllers.Add(dc); }
private void EditVisibleLists() { List <string> ignored = new List <string>(Settings.Default.IgnoredColumns(CurrentPackedFile.FullPath)); List <string> all = new List <string>(); EditedFile.CurrentType.Fields.ForEach(f => all.Add(f.Name)); List <string> shown = new List <string>(all); shown.RemoveAll(e => ignored.Contains(e)); ListEditor editor = new ListEditor { OriginalOrder = all, LeftLabel = "Shown Columns", RightLabel = "Hidden Columns", LeftList = shown, RightList = ignored }; if (editor.ShowDialog() == DialogResult.OK) { Settings.Default.ResetIgnores(CurrentPackedFile.FullPath); editor.RightList.ForEach(i => Settings.Default.IgnoreColumn(CurrentPackedFile.FullPath, i)); ApplyColumnVisibility(); } }
public XpandListView(CollectionSourceBase collectionSource, ListEditor listEditor, bool isRoot) : base(collectionSource, listEditor, isRoot) { }
public XpandListView(CollectionSourceBase collectionSource, ListEditor listEditor) : base(collectionSource, listEditor) { }
public XpandListView(CollectionSourceBase collectionSource, ListEditor listEditor, bool isRoot, XafApplication application) : base(collectionSource, listEditor, isRoot, application) { this.UpdateLayoutManager(); }
public XpandListView(CollectionSourceBase collectionSource, ListEditor listEditor) : base(collectionSource, listEditor) { this.UpdateLayoutManager(); }
/// <summary> /// Called when a new item has been created and is about to be entered into the list. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void platformListEditor_AddingItem(object sender, ListEditor<Platform>.ListEditorEventArgs e) { ListEditor<Platform> editor = sender as ListEditor<Platform>; Platform platform = e.Object as Platform; if (editor != null && platform != null) { // This is a new platform. Give it a unique name int cnt = 1; foreach (Platform existingPlatform in editor.List) { if (existingPlatform.Name == ("Platform " + cnt)) cnt++; } platform.Name = ("Platform " + cnt); } else { e.CancelAction = true; } }
private void manageWeaponButton_Click(object sender, EventArgs e) { var x = new ListEditor<Weapon, WeaponEditor>("Weapon", wpl); if (x.ShowDialog() == DialogResult.OK) { wpl = new List<Weapon>(x.Items); weaponBox.Items.Clear(); weaponBox.Items.AddRange(wpl.Map(a => a.Name).ToArray()); UpdateDamage(); } }
/// <summary> /// Called when the channel editing dialog is removing an item /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void animSetEditor_RemovingItem(object sender, ListEditor<GUIAnimation>.ListEditorEventArgs e) { GUIAnimation animation = e.Object as GUIAnimation; if (animation.Name == "OnActivate" || animation.Name == "OnDeactivate") e.CancelAction = true; }
/// <summary> /// Called when the channel editing dialog is adding a new item /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void animSetEditor_AddingItem(object sender, ListEditor<GUIAnimation>.ListEditorEventArgs e) { ListEditor<GUIAnimation> editor = sender as ListEditor<GUIAnimation>; GUIAnimation animation = e.Object as GUIAnimation; if (editor != null && animation != null) { animation.Name = GetUniqueName("Animation", editor.List); animation.NumFrames = 100; } else { e.CancelAction = true; } }
public XpandListView(CollectionSourceBase collectionSource, ListEditor listEditor, bool isRoot, XafApplication application) : base(collectionSource, listEditor, isRoot, application) { }
/// <summary> /// Brings up the font editor /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void mFontsToolStripMenuItem_Click(object sender, EventArgs e) { ListEditor<GUIFont> fontListEditor = new ListEditor<GUIFont>(GUIProject.CurrentProject.Fonts); fontListEditor.AddingItem += new ListEditor<GUIFont>.ListEditorEventHandler(fontListEditor_AddingItem); fontListEditor.Text = "Fonts"; fontListEditor.ShowDialog(); GUIProject.CurrentProject.Fonts = fontListEditor.List; Globals.ProjectView.ProjectModified = true; SceneView sceneView = mDockPanel.ActiveDocument as SceneView; if (sceneView != null) sceneView.RefreshRenderPanel(); }
/// <summary> /// Brings up the Platforms List Editor /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void mPlatformsToolStripMenuItem_Click(object sender, EventArgs e) { ListEditor<Platform> platformListEditor = new ListEditor<Platform>(GUIProject.CurrentProject.Platforms); platformListEditor.AddingItem += new ListEditor<Platform>.ListEditorEventHandler(platformListEditor_AddingItem); platformListEditor.Text = "Platforms"; platformListEditor.ShowDialog(); GUIProject.CurrentProject.Platforms = platformListEditor.List; Globals.ProjectView.ProjectModified = true; foreach (SceneView view in mDockPanel.Documents) { view.SetPlatforms(GUIProject.CurrentProject.Platforms); } }
/// <summary> /// Brings up the Resolutions List Editor /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void mResolutionsToolStripMenuItem_Click(object sender, EventArgs e) { ListEditor<Resolution> resolutionListEditor = new ListEditor<Resolution>(GUIProject.CurrentProject.Resolutions); resolutionListEditor.Text = "Resolutions"; resolutionListEditor.ShowDialog(); GUIProject.CurrentProject.Resolutions = resolutionListEditor.List; Globals.ProjectView.ProjectModified = true; foreach (SceneView view in mDockPanel.Documents) { view.SetResolutions(GUIProject.CurrentProject.Resolutions); } }
private void EditList(string name, IList<string> listToEdit) { ListEditor editor = new ListEditor(name, listToEdit); List<string> original = listToEdit.ToList<string>(); editor.ShowDialog(); int commonCount = listToEdit.Intersect(original).Count<string>(); if (commonCount != listToEdit.Count || commonCount != original.Count) { TitleChanges(null, null); } }
public XpandListView(CollectionSourceBase collectionSource, ListEditor listEditor) : base(collectionSource, listEditor) { UpdateLayoutManager(Application.TypesInfo); }
/// <summary> /// Called when a new item has been created and is about to be entered into the list. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void fontListEditor_AddingItem(object sender, ListEditor<GUIFont>.ListEditorEventArgs e) { ListEditor<GUIFont> editor = sender as ListEditor<GUIFont>; GUIFont font = e.Object as GUIFont; if (editor != null && font != null) { // Save the default font and assign it. This will ensure we don't accidentally add blank fonts. SaveResource("Otter.Editor.res.LiberationSans.ttf", GUIProject.CurrentProject.ProjectDirectory + "/Fonts/LiberationSans.ttf"); // This is a new font. Give it a unique name int cnt = 1; int maxID = 0; foreach (GUIFont existingFont in editor.List) { if (existingFont.Name == ("Font " + cnt)) cnt++; if (existingFont.ID > maxID) maxID = existingFont.ID; } font.Name = ("Font " + cnt); font.ID = maxID + 1; font.Project = GUIProject.CurrentProject; font.Filename = "Fonts/LiberationSans.ttf"; font.AddASCII(); } else { e.CancelAction = true; } }
/// <summary> /// Opens the Animation List Editor. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void mManageAnimationsToolStripButton_Click(object sender, EventArgs e) { ListEditor<GUIAnimation> animSetEditor = new ListEditor<GUIAnimation>(View.Animations.AnimationList); animSetEditor.AddingItem += new ListEditor<GUIAnimation>.ListEditorEventHandler(animSetEditor_AddingItem); animSetEditor.RemovingItem += new ListEditor<GUIAnimation>.ListEditorEventHandler(animSetEditor_RemovingItem); animSetEditor.Text = "Animations"; animSetEditor.ShowDialog(); GUIAnimation animation = View.CurrentAnimation; View.Animations = new GUIAnimationCollection(animSetEditor.List.ToArray()); PopulateAnimations(View.Animations); // We've replaced the entire channel list. See if the timeline control's current channel is still // present. If so, nothing needs to be done. But if it was removed, select the "OnActivate" channel if (!View.Animations.Contains(mTimelineControl.Animation)) { mTimelineControl.Animation = View.Animations["OnActivate"]; mAnimationsToolStripComboBox.SelectedItem = mTimelineControl.Animation; } else { mTimelineControl.Animation = animation; mAnimationsToolStripComboBox.SelectedItem = animation; } }