private void view_MouseDownEvent(object sender, EditorEventArgs e) { firstPos.X = e.X; firstPos.Y = e.Y; currentPos.X = e.X; currentPos.Y = e.Y; if (e.IndeciesCount == 0) { if (mouseInteraction is DefaultInter) { view.SceneBox.Refresh(); Func <SceneObject, bool> condition = (sceneobject) => (firstPos.X > sceneobject.X && firstPos.X < (sceneobject.X + sceneobject.ScaleX)) && (firstPos.Y > sceneobject.Y && firstPos.Y < (sceneobject.Y + sceneobject.ScaleY)); SceneObject obj = model.GetObjectsQuery(condition).LastOrDefault(); if (obj != null) { view.PropertyGrid.SelectedObject = obj; } else { view.PropertyGrid.SelectedObject = null; } } } }
private void EditorRemoved(object sender, EditorEventArgs e) { var form = EditorForms[e.Editor]; EditorForms.Remove(e.Editor); FormEditors.Remove(form); }
/// <summary> /// This event is fired when the save button is clicked /// </summary> /// <param name="e">Event Args</param> protected virtual void OnEditorHTMLSaved(EditorEventArgs e) { if (EditorHTMLSaved != null) { EditorHTMLSaved(this, e); } }
private void view_ClearClick(object sender, EditorEventArgs e) { model.ClearObjects(); view.PropertyGrid.SelectedObject = null; view.SceneBox.Refresh(); view.UpdateSceneObjectsData(model.SceneObjects); }
private void view_MouseMoveEvent(object sender, EditorEventArgs e) { const int xOffset = 10; const int yOffset = 10; if (e.X >= e.SceneObject.X - xOffset && e.X <= e.SceneObject.X + xOffset && e.Y >= e.SceneObject.Y - yOffset && e.Y <= e.SceneObject.Y + yOffset) { mouseInteraction = interactions[4]; view.ChangeCursor(Cursors.SizeAll); } else if (e.X >= e.SceneObject.X + e.SceneObject.ScaleX - xOffset && e.X <= e.SceneObject.X + e.SceneObject.ScaleX + xOffset && e.Y >= e.SceneObject.Y + e.SceneObject.ScaleY - yOffset && e.Y <= e.SceneObject.Y + e.SceneObject.ScaleY + yOffset) { mouseInteraction = interactions[3]; view.ChangeCursor(Cursors.SizeNWSE); } else if (e.X >= e.SceneObject.X + e.SceneObject.ScaleX - xOffset && e.X <= e.SceneObject.X + e.SceneObject.ScaleX + xOffset && e.Y >= e.SceneObject.Y - yOffset && e.Y <= e.SceneObject.Y + e.SceneObject.ScaleY + yOffset) { mouseInteraction = interactions[1]; view.ChangeCursor(Cursors.SizeWE); } else if (e.Y >= e.SceneObject.Y + e.SceneObject.ScaleY - yOffset && e.Y <= e.SceneObject.Y + e.SceneObject.ScaleY + yOffset && e.X >= e.SceneObject.X - xOffset && e.X <= e.SceneObject.X + e.SceneObject.ScaleX + xOffset) { mouseInteraction = interactions[2]; view.ChangeCursor(Cursors.SizeNS); } else { mouseInteraction = interactions[0]; } }
/// <summary>Handles the SaveEditorChoice event of the View control.</summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EditorEventArgs"/> instance containing the event data.</param> private void View_SaveEditorChoice(object sender, EditorEventArgs e) { this.SaveEditorInConfiguration(e.Editor); this.View.Editor.Controls.Clear(); this.View.Editor.Controls.Add(this.LoadCurrentEditor()); this.View.Model.SelectedEditor = e.Editor; }
/// <summary> /// Handles the events when save image is clicked /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e) { this.HTMLValue = Page.Request.Params["HTMLContent"]; EditorEventArgs editorEventArgs = new EditorEventArgs(); editorEventArgs.EditorHTMLValue = Page.Request.Params["HTMLContent"]; OnEditorHTMLSaved(editorEventArgs); }
/// <summary> /// Method for raising the EditorEnter event. /// </summary> public virtual void OnEditorEnter(EditorMainForm form) { if (EditorEnter != null) { EditorEventArgs evt = new EditorEventArgs(form); EditorEnter(this, evt); } }
public void TableVieHiddenEditor(object sender, EditorEventArgs e) { if (Editor == null) { return; } Editor.ItemsSource = Functions; Editor = null; }
private void EditorAdded(object sender, EditorEventArgs e) { e.Editor.WriteDataComplete += Editor_StateChanged; e.Editor.PasteComplete += Editor_StateChanged; e.Editor.RedoComplete += Editor_StateChanged; e.Editor.UndoComplete += Editor_StateChanged; e.Editor.CutComplete += Editor_StateChanged; e.Editor.DeleteComplete += Editor_StateChanged; }
private void view_DeleteObjectClick(object sender, EditorEventArgs e) { if (view.PropertyGrid.SelectedObject != null) { model.SceneObjects.Remove((SceneObject)view.PropertyGrid.SelectedObject); view.SceneBox.Refresh(); view.UpdateSceneObjectsData(model.SceneObjects); view.PropertyGrid.SelectedObject = null; } }
protected override void OnEditorOpened(EditorEventArgs e) { if (e.Editor.FileName != null) { _fileRecentItems.Add(e.Editor.FileName); _fileRecentItems.Update(_recentFiles); } base.OnEditorOpened(e); }
private void TableView_ShownEditor(object sender, EditorEventArgs e) { Dispatcher.BeginInvoke(new Action(() => { if (e.Editor is TextEdit && ((TextEdit)e.Editor).SelectAllOnGotFocus) { ((TextEdit)e.Editor).SelectAll(); } }), DispatcherPriority.Input); }
private void CardView_ShownEditor(object sender, EditorEventArgs e) { var cardView = (sender as CardView); BaseEdit activeEditor = cardView.ActiveEditor; if (SpellChecker.SpellCheckMode == DevExpress.XtraSpellChecker.SpellCheckMode.OnDemand) { CheckActiveEditor(activeEditor); } }
/// <summary> /// Editor is opening /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void Game_EditorEnter(object sender, EditorEventArgs e) { // Add a new button ToolStripButton button = new ToolStripButton(); button.Text = "Load Party"; button.Click += new EventHandler(LoadParty_Click); // Add button to the editor toolbar e.Form.ToolBarHandle.Items.Add(button); }
private void view_OpenFromXMLClick(object sender, EditorEventArgs e) { if (view.OpenFileDialog.ShowDialog() == DialogResult.Cancel) { return; } string filename = view.OpenFileDialog.FileName; model.ClearObjects(); model.LoadXmlFile(filename); view.SceneBox.Refresh(); }
private void GrdView_ShownEditor(object sender, EditorEventArgs e) { Dispatcher.BeginInvoke((Action)(() => { if (this.grdView.ActiveEditor != null) { this.grdView.ActiveEditor.SelectAll(); } else { ((TableView)grdItens.View).ShowEditor(); } }), DispatcherPriority.Render); }
public void OnTableViewShownEditor(object sender, EditorEventArgs e) { if (e.Column.FieldName != "FunctId") { return; } Editor = e.Editor as LookUpEditBase; if (Editor == null) { return; } TableView view = (TableView)sender; int deptId = (int)view.Grid.GetCellValue(e.RowHandle, "DeptId"); Editor.ItemsSource = Functions.Where(function => function.DeptId == deptId).ToList(); }
void OnTableViewShownEditor(object sender, EditorEventArgs e) { if (e.Column.FieldName != "CityId") { return; } LookUpEditBase editor = e.Editor as LookUpEditBase; if (editor == null) { return; } TableView view = (TableView)e.Source; int countryId = (int)view.Grid.GetCellValue(e.RowHandle, "CountryId"); editor.ItemsSource = Cities.Where(city => city.CountryId == countryId).ToList(); }
private void view_PressedMouseMoveEvent(object sender, EditorEventArgs e) { view.SceneBox.Refresh(); currentPos.X = e.X; currentPos.Y = e.Y; mouseInteraction.Interact(view, new Point(e.X, e.Y), e.SceneObject, firstPos); if (mouseInteraction is CreateObjInter) { Overlay.DrawingObject = e.SceneObject; } if (e.SceneObject != null) { Overlay.SelectedObject = e.SceneObject; } }
private void view_MouseUpEvent(object sender, EditorEventArgs e) { if (e.IndeciesCount != 0) { var sceneObject = e.ListViewItemCollection[0].Tag as SceneObject; sceneObject.X = firstPos.X; sceneObject.Y = firstPos.Y; var cloned = sceneObject.Clone() as SceneObject; cloned.Name = GetUnicalName(cloned.Name); model.AddNewObject(cloned); Overlay.DrawingObject = null; } else { mouseInteraction = interactions[0]; } view.SceneBox.Refresh(); view.UpdateSceneObjectsData(model.SceneObjects); }
private void TableView_ShownEditor(object sender, EditorEventArgs e) { TableView view = sender as TableView; UserRole userRole = e.Row as UserRole; ComboBoxEdit edit = view.ActiveEditor as ComboBoxEdit; if (userRole != null) { if (e.Column.FieldName == "IDRole") { edit.ItemsSource = viewModel.Roles.Where(r => (viewModel.SelectedUser.UserRoles.Any(ur => ur.IDDivision == userRole.IDDivision && ur.IDRole == r.ID) == false) || r.ID == userRole.IDRole); } else if (e.Column.FieldName == "IDDivision") { edit.ItemsSource = viewModel.Divisions.Where(d => (viewModel.SelectedUser.UserRoles.Any(ur => ur.IDDivision == d.ID && ur.IDRole == userRole.IDRole) == false) || d.ID == userRole.IDDivision); } } else { if (e.Column.FieldName == "IDRole") { edit.ItemsSource = viewModel.Roles; } else if (e.Column.FieldName == "IDDivision") { edit.ItemsSource = viewModel.Divisions; } } }
private void view_DuplicateObjectClick(object sender, EditorEventArgs e) { }
private void CurrentEditorChanged(object sender, EditorEventArgs e) { UpdateMenuEnabled(); }
private void view_PropertyValueChanged(object sender, EditorEventArgs e) { view.SceneBox.Refresh(); view.UpdateSceneObjectsData(model.SceneObjects); }
private void TableView_ShownEditor(object sender, EditorEventArgs e) { if (e.Column.FieldName == "IDBrandAxe") { ComboBoxEdit edit = e.Editor as ComboBoxEdit; if (edit != null && e.Row != null) { AnimationProduct ap = e.Row as AnimationProduct; if (ap.IDSignature.HasValue && ap.IDSignature.Value != Guid.Empty) { // (e.Column.EditSettings as LookupComboBoxEditSettings).OriginalItemsSource = null; (e.Column.EditSettings as ComboBoxEditSettings).ItemsSource = null; DbDataContext Db = DbDataContext.GetInstance(); edit.ItemsSource = new BrandAxe[] { new BrandAxe() }.Union(BrandAxeManager.Instance.GetAllForAllocation(ap.IDSignature.Value)); } } else { this.cboBrandAxes.ItemsSource = null; } } else if (e.Column.FieldName == "IDMultipleNormal" || e.Column.FieldName == "IDMultipleWarehouse") { ComboBoxEditSettings settings = e.Column.FieldName == "IDMultipleNormal" ? cboNormalMultiple : cboWarehouseMultiple; ComboBoxEdit edit = e.Editor as ComboBoxEdit; if (edit != null && e.Row != null) { AnimationProduct ap = e.Row as AnimationProduct; if (ap.Product != null) { // (settings as LookupComboBoxEditSettings).OriginalItemsSource = null; (settings as ComboBoxEditSettings).ItemsSource = null; IEnumerable<Multiple> multiples = new Multiple[]{new Multiple()}.Union(MultipleManager.Instance.MultipleGetToProduct(ap.Product.ID)); edit.ItemsSource = multiples; } else settings.ItemsSource = null; } else settings.ItemsSource = null; } else if (e.Column.FieldName == "MaterialCode") { ComboBoxEdit edit = e.Editor as ComboBoxEdit; if (edit != null) { if (e.Value == null) edit.ItemsSource = ProductManager.Instance.GetMaterialCodes(); else edit.ItemsSource = ProductManager.Instance.GetMaterialCodes(e.Value.ToString()); } } else if (e.Column.FieldName == "Description") { ComboBoxEdit edit = e.Editor as ComboBoxEdit; if (edit != null) { if (e.Value == null) edit.ItemsSource = ProductManager.Instance.GetDescriptions(); else edit.ItemsSource = ProductManager.Instance.GetDescriptions(e.Value.ToString()); } } else if (e.Column.FieldName == "ConfirmedMadMonthString") { ComboBoxEdit edit = e.Editor as ComboBoxEdit; if (edit != null) { if (e.Value == null) edit.ItemsSource = madMonths; else edit.ItemsSource = madMonths.Where(m => m.Contains(e.Value.ToString())); } } }
void View_HiddenEditor(object sender, EditorEventArgs e) { SetItemsSourceForFiltering(e.Column.FieldName); }
/// <summary>Handles the Editor was changed event of the View control.</summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EditorEventArgs"/> instance containing the event data.</param> private void View_EditorChanged(object sender, EditorEventArgs e) { this.View.Editor.Controls.Clear(); this.View.Editor.Controls.Add(this.LoadCurrentEditor(e.Editor)); this.View.Model.SelectedEditor = e.Editor; }
private void EditorRemoved(object sender, EditorEventArgs e) { UpdateMenuEnabled(); }
private void EditorAdded(object sender, EditorEventArgs e) { AddEditor(e.Editor); }
private void CurrentEditorChanged(object sender, EditorEventArgs e) { var form = EditorForms[e.Editor]; form.Focus(); }
/// <summary> /// Handles the events when save image is clicked /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e) { this.HTMLValue= Page.Request.Params["HTMLContent"]; EditorEventArgs editorEventArgs = new EditorEventArgs(); editorEventArgs.EditorHTMLValue = Page.Request.Params["HTMLContent"]; OnEditorHTMLSaved(editorEventArgs); }
/// <summary> /// When the user hovers, save the tile and present a menu of options /// </summary> /// <param name="ea"></param> private void PlugIn1_EditorMouseHover(EditorEventArgs ea) { Tile tile = ea.TextView.ActiveTile; ShowTestPopupMenu(ea.TextView, tile); }
protected virtual void OnEditorSaved(EditorEventArgs e) { EditorSaved?.Invoke(this, e); }
/// <summary> /// Editor is opening /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void Game_EditorEnter(object sender, EditorEventArgs e) { // Add a new button ToolStripButton button = new ToolStripButton(); button.Text = "Load Party"; button.Click += new EventHandler(LoadParty_Click); // Add button to the editor toolbar e.Form.ToolBarHandle.Items.Add(button); }
/// <summary>Handles the Editor was changed event of the View control.</summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EditorEventArgs"/> instance containing the event data.</param> private void View_EditorChanged(object sender, EditorEventArgs e) { this.View.Editor.Controls.Clear(); this.View.Model.SelectedEditor = e.Editor; this.View.Model.CanSave = true; }
/// <summary> /// This event is fired when the save button is clicked /// </summary> /// <param name="e">Event Args</param> protected virtual void OnEditorHTMLSaved(EditorEventArgs e) { if (EditorHTMLSaved !=null) EditorHTMLSaved(this,e); }