/// <summary> /// Добавить в меню пункты по выбору способа выделения ячеек /// </summary> /// <param name="menu">Меню</param> /// <param name="selectCustom">Метод для обработки случая выборки нескольких ячеек</param> /// <param name="selectRow">Метод для обработки случая выборки нескольких строк</param> /// <param name="selectRows">Метод для обработки случая выборки одной строки</param> public static void DXCreateSelectSelectionMenu(DXPopupMenu menu, EventHandler selectCustom, EventHandler selectRow, EventHandler selectRows) { var dxsmiSelect = new DXSubMenuItem("Способы выделения ячеек") { Image = Resources.table_select }; var dxmiSelectRows = new DXMenuItem("Колонка для выделения") { Image = Resources.check_box_list }; var dxmiSelectCustom = new DXMenuItem("Выделение нескольких ячеек") { Image = Resources.table_select_group }; var dxmiSelectRow = new DXMenuItem("Выделение строк") { Image = Resources.table_select_row }; dxmiSelectCustom.Click += selectCustom; dxmiSelectRow.Click += selectRow; dxmiSelectRows.Click += selectRows; dxsmiSelect.Items.Add(dxmiSelectRow); dxsmiSelect.Items.Add(dxmiSelectRows); dxsmiSelect.Items.Add(dxmiSelectCustom); menu.Items.Add(dxsmiSelect); }
private void bgWorker_DoWork(object sender, DoWorkEventArgs e) { if (!this.splashScreenManager.IsSplashFormVisible) { this.splashScreenManager.ShowWaitForm(); } WorkerArg arg = (WorkerArg)e.Argument; if (arg.WorkerType == WorkerTypeEnum.LOAD_SERVER_RES || arg.WorkerType == WorkerTypeEnum.LOAD_CLIENT_RES) { this._currentWork = arg.WorkerType; this._exportMenu = null; this.LoadResDir(arg.WorkerType, arg.WorkerType == WorkerTypeEnum.LOAD_SERVER_RES ? txtServerRes.Text : txtClientRes.Text); } else if (arg.WorkerType == WorkerTypeEnum.LOAD_RES) { this.LoadResData(arg.ArgValue.ToString()); this.CreateGridMenu(); // Prevent export data to txt HQTrans for server if (this._currentWork == WorkerTypeEnum.LOAD_SERVER_RES && _exportMenu.Items.Count > 0) { _exportMenu.Items.RemoveAt(_exportMenu.Items.Count - 1); } } else if (arg.WorkerType == WorkerTypeEnum.SAVE_RES) { this.SaveResData(); } if (this.splashScreenManager.IsSplashFormVisible) { this.splashScreenManager.CloseWaitForm(); } }
private DXPopupMenu CreateDXPopupMenu() { DXPopupMenu menu = new DXPopupMenu(); menu.Items.Add(new DXMenuItem("Genie", OnItemClick)); menu.Items.Add(new DXMenuItem("Medical Director", OnItemClick)); return menu; }
public void PupulateListBoxControl(DXPopupMenu menu) { foreach (DXMenuItem item in menu.Items) { imageListBoxControl1.Items.Add(new DXMenuItemWrapper(item), GetImageIndex(item)); } }
void InitializeExportButton() { DXPopupMenu popup = new DXPopupMenu(); DXMenuItem item = new DXMenuItem(ExportFormat.Image.ToString(), exportPopupItem_Click); exportHashtable.Add(item, ExportFormat.Image); popup.Items.Add(item); item = new DXMenuItem(ExportFormat.Mht.ToString(), exportPopupItem_Click); exportHashtable.Add(item, ExportFormat.Mht); popup.Items.Add(item); item = new DXMenuItem(ExportFormat.Pdf.ToString(), exportPopupItem_Click); exportHashtable.Add(item, ExportFormat.Pdf); popup.Items.Add(item); item = new DXMenuItem(ExportFormat.Xls.ToString(), exportPopupItem_Click); exportHashtable.Add(item, ExportFormat.Xls); popup.Items.Add(item); item = new DXMenuItem(ExportFormat.Xlsx.ToString(), exportPopupItem_Click); exportHashtable.Add(item, ExportFormat.Xlsx); popup.Items.Add(item); ddbExport.DropDownControl = popup; ddbExport.Text = exportButtonTextBase + exportFormat.ToString(); }
protected virtual void OnActiveFilesButtonClick(object sender, ActiveFilesButtonClickEventArgs e) { Form parentForm = this.MdiParent; if (parentForm == null) { return; } DXPopupMenu activeFilesPopupMenu = CreateActiveFilesPopupMenu(); foreach (XtraMdiTabPage page in this.Pages) { if (!page.PageVisible || !page.PageEnabled) { continue; } DXMenuItem menuItem = CreateMenuItem(page); menuItem.Click += new EventHandler(OnActiveFilesButtonMenuItemClick); activeFilesPopupMenu.Items.Add(menuItem); } IXtraTab xtraTabIntf = this as IXtraTab; if (xtraTabIntf == null) { return; } Point menuPos = new Point(e.ButtonInfo.Bounds.X, e.ButtonInfo.Bounds.Bottom); MenuManagerHelper.GetMenuManager(xtraTabIntf.LookAndFeel).ShowPopupMenu(activeFilesPopupMenu, parentForm, menuPos); }
private void CreateFavoritesMenu(DXPopupMenu menu) { for (int i = menu.Items.Count - 1; i >= 0; i--) { if (!object.Equals(menu.Items[i].Tag, StringId.TextEditMenuPaste)) { menu.Items.RemoveAt(i); } } if (_favorites != null && _favorites.Count > 0) { for (int i = 0; i < _favorites.Count; i++) { DXMenuItem menuItem = new DXMenuItem() { Tag = _favorites[i], Caption = _favorites[i].Content.Substring(0, Math.Min(_favorites[i].Content.Length, 50)), BeginGroup = (i == 0) }; menuItem.Click += (s, e) => ChangeMessage((s as DXMenuItem).Tag as WndMessage); menu.Items.Add(menuItem); } } }
public MyPopupForm(DXPopupMenu menu) { InitializeComponent(); PupulateListBoxControl(menu); imageListBoxControl1.Click += new EventHandler(listBoxControl1_Click); _appObject.Font = new Font(AppearanceObject.DefaultFont.FontFamily, 8); }
public void CreateConnectPopup() { DXPopupMenu popupMenu = new DXPopupMenu(); popupMenu.Items.Add(new DXMenuItem("Log Out", ResetLogin)); ConnectBTN.DropDownControl = popupMenu; }
void ShowPopup(DXPopupMenu menu) { Control parentControl = memberTiles; Point pt = parentControl.PointToClient(Control.MousePosition); ((IDXDropDownControl)menu).Show(StandardMenuManager.Default, parentControl, pt); }
public override void Update(HaloPlugins.Objects.MetaNode node) { // Check to see if the new node is of the correct type. if (node.FieldType != HaloPlugins.Objects.FieldType.Enum) { throw new Exception("Tried to bind an incompatible MetaNode object to Enum control!"); } // Bind to the new MetaNode object. this.enumerator = (HaloPlugins.Objects.Data.Enum)node; // Get the drop down menu control from the combo box button. DXPopupMenu menu = (DXPopupMenu)dropDownButton1.DropDownControl; // Check to see if the select enum option is within range of the options list. if (this.enumerator.Value < this.enumerator.Options.Length) { // Set the text of the drop down button to the select option name. this.dropDownButton1.Text = this.enumerator.Options[this.enumerator.Value].Replace("_", " ").Replace("OP", ""); this.dropDownButton1.Tag = this.enumerator.Value; } else { // Set the drop down button selection to default values. this.dropDownButton1.Text = ""; this.dropDownButton1.Tag = this.enumerator.Value; } }
protected override DXPopupMenu CreateMenu() { DXPopupMenu dXPopupMenu = base.CreateMenu(); string localizedString = Localizer.Active.GetLocalizedString(StringId.TextEditMenuDelete); foreach (DXMenuItem dXMenuItem in dXPopupMenu.Items) { if (dXMenuItem is TextEdit.DXMenuItemTextEdit && dXMenuItem.Caption == localizedString) { TextEdit.DXMenuItemTextEdit dXMenuItemTextEdit = (TextEdit.DXMenuItemTextEdit)dXMenuItem; dXMenuItemTextEdit.UpdateElement = new TextEdit.MenuItemUpdateElement(dXMenuItemTextEdit, new TextEdit.MenuItemUpdateHandler(this.UpdateDeleteMenuItem)); } } Image image = ImageLoader.Instance.GetImageInfo("MenuBar_Open").Image; TextEdit.DXMenuItemTextEdit dXMenuItemTextEdit2 = new TextEdit.DXMenuItemTextEdit(StringId.PictureEditOpenFileTitle, new EventHandler(this.OnOpenMenuItemSelected), image); dXMenuItemTextEdit2.Caption = CaptionHelper.GetLocalizedText("FileAttachments", "Editor_Open"); dXMenuItemTextEdit2.UpdateElement = new TextEdit.MenuItemUpdateElement(dXMenuItemTextEdit2, new TextEdit.MenuItemUpdateHandler(this.UpdateSaveOpenMenuItem)); dXMenuItemTextEdit2.BeginGroup = true; dXPopupMenu.Items.Add(dXMenuItemTextEdit2); image = ImageLoader.Instance.GetImageInfo("MenuBar_SaveTo").Image; dXMenuItemTextEdit2 = new TextEdit.DXMenuItemTextEdit(StringId.PictureEditSaveFileTitle, new EventHandler(this.OnSaveMenuItemSelected), image); dXMenuItemTextEdit2.Caption = CaptionHelper.GetLocalizedText("FileAttachments", "Editor_Save"); dXMenuItemTextEdit2.UpdateElement = new TextEdit.MenuItemUpdateElement(dXMenuItemTextEdit2, new TextEdit.MenuItemUpdateHandler(this.UpdateSaveOpenMenuItem)); dXPopupMenu.Items.Add(dXMenuItemTextEdit2); image = ImageLoader.Instance.GetImageInfo("MenuBar_Clear").Image; dXMenuItemTextEdit2 = new TextEdit.DXMenuItemTextEdit(StringId.DateEditClear, new EventHandler(this.OnClearMenuItemSelected), image); dXMenuItemTextEdit2.Caption = CaptionHelper.GetLocalizedText("FileAttachments", "Editor_Clear"); dXMenuItemTextEdit2.UpdateElement = new TextEdit.MenuItemUpdateElement(dXMenuItemTextEdit2, new TextEdit.MenuItemUpdateHandler(this.UpdateClearMenuItem)); dXPopupMenu.Items.Add(dXMenuItemTextEdit2); return(dXPopupMenu); }
private void BuildPopUpMenu() { DXPopupMenu menu = new DXPopupMenu(); menu.Items.Add(new DXMenuItem("High Priority Holds", filterMenuItem_Clicked)); menu.Items.Add(new DXMenuItem("Multiple High Priority Captures", filterMenuItem_Clicked)); findHoldsButton.DropDownControl = menu; }
private void TabContentClear() { this.lbRes.DataSource = null; this.gridControl1.DataSource = null; this.lbRes.Items.Clear(); this.gridView1.Columns.Clear(); this._exportMenu = null; }
public UxDropDownButton() { DropDownArrowStyle = DropDownArrowStyle.Show; ImageLocation = ImageLocation.MiddleLeft; _popupMenu = new DXPopupMenu(); DropDownControl = _popupMenu; }
protected DXPopupMenu CreateMenu() { DXPopupMenu menu = new DXPopupMenu(); menu.Items.Add(CreateSetBookmarkMenu()); menu.Items.Add(CreateGotoBookmarkMenu()); return(menu); }
public Enum(HaloPlugins.Objects.Data.Enum enumerator) { // Initialize form controls. InitializeComponent(); // Set a custom OnDefaultWidthChanged handler. this.DefaultWidthChanged += new DefaultWidthChangedHandler(Enum_DefaultWidthChanged); // Save our enum object. this.enumerator = enumerator; // Suspend the layout while we setup the controls. this.SuspendLayout(); // Setup the name label. label1.Text = this.enumerator.Name; /* * We need to create a custom drop down menu, that * handles scrolling and looks nice and shit. */ // Create a new drop down menu for the enum options list. DXPopupMenu menu = new DXPopupMenu(); // Loop through the enum options and add them all to the drop down menu. menu.Items.BeginUpdate(); for (int i = 0; i < this.enumerator.Options.Length; i++) { // Check if this option is unused. if (this.enumerator.Options[i] != "") { // Note: We need to make sure itemIndex is actually the index of the menu item, and not some other bs value. int itemIndex = menu.Items.Add(new DXMenuItem(this.enumerator.Options[i].Replace("_", " ").Replace("OP", ""), Enum_Click)); menu.Items[itemIndex].Tag = i; } } menu.Items.EndUpdate(); // Set the combo box to use the drop down menu we just created. dropDownButton1.DropDownControl = menu; // Check to see if the select enum option is within range of the options list. if (this.enumerator.Value < this.enumerator.Options.Length) { // Set the text of the drop down button to the select option name. this.dropDownButton1.Text = this.enumerator.Options[this.enumerator.Value].Replace("_", " ").Replace("OP", ""); this.dropDownButton1.Tag = this.enumerator.Value; } else { // Set the drop down button selection to default values. this.dropDownButton1.Text = ""; this.dropDownButton1.Tag = this.enumerator.Value; } }
/// <summary> /// 添加播放器选择 /// </summary> /// <returns></returns> private DXPopupMenu CreateDXPopupMenu() { DXPopupMenu menu = new DXPopupMenu(); foreach (var item in AppSettings.Paths) { menu.Items.Add(new DXMenuItem(item, OnItemClick)); } return(menu); }
private DXPopupMenu CreateDXPopupMenu() { DXPopupMenu menu = new DXPopupMenu(); for (int info = 1; info <= Convert.ToInt32(ProDefine.g_SMExpermentParam.YBNumber); info++) { menu.Items.Add(new DXMenuItem("样本" + info.ToString(), OnItemClick)); } return(menu); }
private void CreateContextMenu() { menu = new DXPopupMenu(); menu.MenuViewType = MenuViewType.Menu; menu.Items.Add(new DXMenuItem("Open file", OpenFile)); menu.Items.Add(new DXMenuItem("Rename/Move to ... file", RenameFile)); menu.Items.Add(new DXMenuItem("Copy file", CopyFile)); menu.Items.Add(new DXMenuItem("Delete file", DeleteFile)); SetMenuItemEnabledMode(false); }
public static DXMenuItem GetItemByStringId(DXPopupMenu menu, GridStringId id) { foreach (DXMenuItem item in menu.Items) { if (item.Caption == GridLocalizer.Active.GetLocalizedString(id)) { return(item); } } return(null); }
/// <summary> /// Скрыть стандартные кнопки из меню Грида /// </summary> public static void HideCustomizationColumns(DXPopupMenu menu) { var showColumns = menu.Items .Cast <DXMenuItem>() .FirstOrDefault(i => i.Tag is GridStringId && (GridStringId)i.Tag == GridStringId.MenuColumnColumnCustomization); if (showColumns != null) { showColumns.Visible = false; } }
public override bool SaveChanges() { // Get the drop down menu control from the combo box button. DXPopupMenu menu = (DXPopupMenu)dropDownButton1.DropDownControl; // Save the selected index to the enum object. this.enumerator.Value = (int)this.dropDownButton1.Tag; // Changes saved successfully. return(true); }
public UxDropDownButton(string caption, ApplicationIcon icon = null, SuperToolTip superTip = null) { Text = caption; Image = imageFrom(icon); SuperTip = superTip; DropDownArrowStyle = DropDownArrowStyle.Show; ImageLocation = ImageLocation.MiddleLeft; _popupMenu = new DXPopupMenu(); DropDownControl = _popupMenu; }
private void CreateGridMenu() { if (_exportMenu == null) { _exportMenu = new DXPopupMenu(); _exportMenu.Caption = "Export data"; DXMenuItem toCsv = new DXMenuItem("-> to CSV"); DXMenuItem toTxtPlain = new DXMenuItem("-> to plain text"); DXMenuItem toTxtTrans = new DXMenuItem("-> to text for HQTranslation"); toCsv.Click += (o, args) => { if (this.xtraSaveFileDialog.ShowDialog() != DialogResult.OK) { return; } if (!string.IsNullOrEmpty(this.xtraSaveFileDialog.FileName) && this._dataTable[lbRes.SelectedItem.ToString().ToLower()] != null) { string filename = this.xtraSaveFileDialog.FileName; this._dataTable[lbRes.SelectedItem.ToString().ToLower()].ToCSV(filename); XtraMessageBox.Show("Data exported"); } }; toTxtPlain.Click += (o, args) => { if (this.xtraSaveFileDialog.ShowDialog() != DialogResult.OK) { return; } if (!string.IsNullOrEmpty(this.xtraSaveFileDialog.FileName) && this._dataTable[lbRes.SelectedItem.ToString().ToLower()] != null) { string filename = this.xtraSaveFileDialog.FileName; this._dataTable[lbRes.SelectedItem.ToString().ToLower()].ToTxtPlain(filename); XtraMessageBox.Show("Data exported"); } }; toTxtTrans.Click += (o, args) => { if (this.xtraSaveFileDialog.ShowDialog() != DialogResult.OK) { return; } if (!string.IsNullOrEmpty(this.xtraSaveFileDialog.FileName) && this._dataTable[lbRes.SelectedItem.ToString().ToLower()] != null) { string filename = this.xtraSaveFileDialog.FileName; this._dataTable[lbRes.SelectedItem.ToString().ToLower()].ToTxtTrans(filename); XtraMessageBox.Show("Data exported"); } }; _exportMenu.Items.Add(toCsv); _exportMenu.Items.Add(toTxtPlain); _exportMenu.Items.Add(toTxtTrans); } }
/// <summary> /// Создать настройки меню для сохранения и загрузки информации о внешнем виде таблиц и деревьев /// </summary> /// <param name="_editor">Таблица или дерево</param> /// <param name="_menu">Меню</param> public static void DXCreateLayoutMenuItems(EditorContainer _editor, ref DXPopupMenu _menu) { var layoutWorker = _editor as IShowLayoutWorkMenu; if (layoutWorker != null && !layoutWorker.GetShowLayoutWorkMenu()) { return; } var instance = new DXCustomMenuCreator(_editor, ref _menu); instance.DXCreateLayoutMenuItems(); }
protected void CreateMenuUnits(T identifier, DXPopupMenu menu) { menu.Items.Clear(); var allAvailableUnits = _presenter.AvailableUnitsFor(identifier).ToList(); if (allAvailableUnits.Count <= 1) { return; } allAvailableUnits.Each(unit => menu.Items.Add(createUnitMenuItem(identifier, unit))); }
private void ShowMyCustomMenu(DXPopupMenu menu, Control control, Point pos) { MyPopupForm popupForm = new MyPopupForm(menu); int maxHeight = Screen.GetWorkingArea(control).Bottom - pos.Y; popupForm.Show(); popupForm.Location = control.PointToScreen(pos); Size size = popupForm.BestSize; popupForm.Height = Math.Min(maxHeight, size.Height); popupForm.Width = size.Width;; }
void setDropDownvenders() { DXPopupMenu menu = new DXPopupMenu(); goodstypeTableAdapter1.Fill(dataSet1.GOODSTYPE); DataSet1.GOODSTYPEDataTable goodstypeDataTable = goodstypeTableAdapter1.GetData(); foreach (DataRow data in goodstypeDataTable.Rows) { menu.Items.Add(new DXMenuItem(data["gdstype_desc"] as string)); menu.Items[menu.Items.Count - 1].Click += ActionDropDownVenders; } drbtn_vendor.DropDownControl = menu; }
void setDropDownShelves() { DXPopupMenu menu = new DXPopupMenu(); shelvesTableAdapter1.Fill(dataSet1.SHELVES); DataSet1.SHELVESDataTable shelvesDataTable = shelvesTableAdapter1.GetData(); foreach (DataRow data in shelvesDataTable.Rows) { menu.Items.Add(new DXMenuItem(data["slvs_desc"] as string)); menu.Items[menu.Items.Count - 1].Click += ActionDropDownShelves; } drbtn_slvs.DropDownControl = menu; }
private void Feedback_Load(object sender, EventArgs e) { // Add a Menu to the combobox DXPopupMenu menu = new DXPopupMenu(); menu.Items.Add(new DXMenuItem("Comment", menu_click)); menu.Items.Add(new DXMenuItem("Bug", menu_click)); dropDownButton1.DropDownControl = menu; dropDownButton1.Text = menu.Items[FeedbackType].Caption; // Alias txtAlias.Text = Global.Application.Instance.UserAccount.UserName; }
public EntryForm() { InitializeComponent(); UpdateSummary(); personSelector.Properties.Buttons.Add(recentButton = new EditorButton { Caption = "Recent", ImageLocation = ImageLocation.MiddleRight, Kind = ButtonPredefines.DropDown, Shortcut = new KeyShortcut(Keys.Control | Keys.R), SuperTip = Utilities.CreateSuperTip(title: "Recent people", body: "Shows people whom you've already selected in this session."), Visible = false }); recentMenu = new DXPopupMenu(); }
public ReportExportControl() { InitializeComponent(); SelectedExport = ExportTarget.Pdf; menuExport = new DXPopupMenu(); AddExportTarget(ExportTarget.Pdf); AddExportTarget(ExportTarget.Html); AddExportTarget(ExportTarget.Mht); AddExportTarget(ExportTarget.Rtf); AddExportTarget(ExportTarget.Xls); AddExportTarget(ExportTarget.Xlsx); AddExportTarget(ExportTarget.Csv); AddExportTarget(ExportTarget.Text); AddExportTarget(ExportTarget.Image); btnExport.DropDownControl = menuExport; menuExport.BeforePopup += menuExport_BeforePopup; moduleLayout.BackColor = ColorHelper.GetControlColor(LookAndFeel); LookAndFeel.StyleChanged += LookAndFeel_StyleChanged; }
private DXCustomMenuCreator(EditorContainer _editor, ref DXPopupMenu _menu) { editor = _editor; menu = _menu; controlForm = editor.FindForm(); dxsmiSaved = new DXSubMenuItem("Сохраненные состояния") { Image = Resources.layout_save }; bbiDeleteStates = new DXMenuItem("Удалить выбранные") { Image = Resources.Remove }; dxsmiRemove = new DXSubMenuItem("Удалить состояния") { Image = Resources.layout_delete }; }
private void CreateSelectLayoutSubmenu(DXPopupMenu menu) { DXCustomMenuCreator.DXCreateLayoutMenuItems(this, ref menu); }
public void CreateConnectPopup() { DXPopupMenu popupMenu = new DXPopupMenu(); popupMenu.Items.Add(new DXMenuItem("Log Out", ResetLogin)); ConnectBTN.DropDownControl = popupMenu; }
/// <summary> /// Скрыть стандартные кнопки из меню Грида /// </summary> public static void HideCustomizationColumns(DXPopupMenu menu) { var showColumns = menu.Items .Cast<DXMenuItem>() .FirstOrDefault(i => i.Tag is GridStringId && (GridStringId)i.Tag == GridStringId.MenuColumnColumnCustomization); if (showColumns != null) showColumns.Visible = false; }
/// <summary> /// Добавить в меню пункты по выбору способа выделения ячеек /// </summary> /// <param name="menu">Меню</param> /// <param name="selectCustom">Метод для обработки случая выборки нескольких ячеек</param> /// <param name="selectRow">Метод для обработки случая выборки нескольких строк</param> /// <param name="selectRows">Метод для обработки случая выборки одной строки</param> public static void DXCreateSelectSelectionMenu(DXPopupMenu menu, EventHandler selectCustom, EventHandler selectRow, EventHandler selectRows) { var dxsmiSelect = new DXSubMenuItem("Способы выделения ячеек") { Image = Resources.table_select }; var dxmiSelectRows = new DXMenuItem("Колонка для выделения") { Image = Resources.check_box_list }; var dxmiSelectCustom = new DXMenuItem("Выделение нескольких ячеек") { Image = Resources.table_select_group }; var dxmiSelectRow = new DXMenuItem("Выделение строк") { Image = Resources.table_select_row }; dxmiSelectCustom.Click += selectCustom; dxmiSelectRow.Click += selectRow; dxmiSelectRows.Click += selectRows; dxsmiSelect.Items.Add(dxmiSelectRow); dxsmiSelect.Items.Add(dxmiSelectRows); dxsmiSelect.Items.Add(dxmiSelectCustom); menu.Items.Add(dxsmiSelect); }
/// <summary> /// Создать настройки меню для сохранения и загрузки информации о внешнем виде таблиц и деревьев /// </summary> /// <param name="_editor">Таблица или дерево</param> /// <param name="_menu">Меню</param> public static void DXCreateLayoutMenuItems(EditorContainer _editor, ref DXPopupMenu _menu) { var layoutWorker = _editor as IShowLayoutWorkMenu; if (layoutWorker != null && !layoutWorker.GetShowLayoutWorkMenu()) { return; } var instance = new DXCustomMenuCreator(_editor, ref _menu); instance.DXCreateLayoutMenuItems(); }
void IDXMenuManager.ShowPopupMenu(DXPopupMenu menu, Control control, Point pos) { MenuManagerHelper.ShowMenu(menu, LookAndFeel, fMenuManager, control, pos); }
private void paymentMenuEdit_ButtonClick(object sender, ButtonPressedEventArgs e) { var pledge = (Pledge)pledgesView.GetFocusedRow(); var menu = new DXPopupMenu(); foreach (var method in Names.PaymentMethods) { if (method == "Credit Card") continue; // Credit card payments should not be created by hand. menu.Items.Add(new DXMenuItem(method, delegate { if (payments.Rows.Any(p => p.Person == pledge.Person)) { if (!Dialog.Warn("You already entered a payment for " + pledge.Person.VeryFullName + ".\r\nAre you sure you want to add another payment?")) return; } var payment = ad.Row.CreatePayment(); payment.Method = method; payment.Person = pledge.Person; payment.Amount = pledge.Amount; Program.Table<Payment>().Rows.Add(payment); Program.Table<PledgeLink>().Rows.Add(new PledgeLink { Pledge = pledge, Payment = payment, Amount = pledge.Amount }); var rowHandle = paymentsView.GetRowHandle(payments.Rows.IndexOf(payment)); paymentsView.SetSelection(rowHandle, makeVisible: true); if (payment.Method == "Check") { ShowColumnTooltip(colCheckNumber, new ToolTipControllerShowEventArgs { Rounded = true, ShowBeak = true, IconType = ToolTipIconType.Question, ToolTipType = ToolTipType.Standard, Title = "Add Check", ToolTip = "Please enter the check number and the date on the check", }); } })); } var control = (Control)sender; new SkinMenuManager(LookAndFeel).ShowPopupMenu(menu, control, control.PointToClient(MousePosition)); }