void ComboBoxEdit_PopupOpened(object sender, RoutedEventArgs e) { ComboBoxEdit edit = sender as ComboBoxEdit; PopupListBox plb = ((PopupListBox)LookUpEditHelper.GetVisualClient(edit).InnerEditor); plb.SelectionChanged += plb_SelectionChanged; e.Handled = true; }
private void cboTipo_QueryCloseUp(object sender, CancelEventArgs e) { PopupListBox list = (sender as IPopupControl).PopupWindow.Controls[0] as PopupListBox; bool isEqualSelected = list.SelectedItem.Equals(selectedConto) && !list.SelectedItem.Equals(SELECT_CONTO); selectedConto = list.SelectedItem.ToString(); if (isEqualSelected) { _presenter.PrepareChooseContropartita(); } e.Cancel = false; }
private void ListBox_MouseMove(object sender, MouseEventArgs e) { PopupListBox listBoxControl = sender as PopupListBox; ComboBoxEdit cmb = listBoxControl.OwnerEdit as ComboBoxEdit; int index = listBoxControl.IndexFromPoint(new Point(e.X, e.Y)); if (index == -1) { toolTipController1.HideHint(); } else { string item = cmb.Properties.Items[index].ToString(); toolTipController1.ShowHint(item, listBoxControl.PointToScreen(new Point(e.X, e.Y))); } }
void plb_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) { PopupListBox plb = sender as PopupListBox; this.commandItem = null; e.Handled = true; CustomComboBoxItem customItem = plb.SelectedItem as CustomComboBoxItem; if (customItem == null) { return; } if (customItem.DisplayValue == "(Custom)") { this.commandItem = customItem; } }
public CustomBaseStyleControlViewInfo(PopupListBox owner) : base(owner) { }
// открытие стандартного редактора в зависимости от типа свойства private void OpenBaseEditor(PropertyInfo property, FastGrid.FastGrid fastGrid, int rowIndex, FastColumn col) { var coords = fastGrid.GetCellCoords(col, rowIndex); var blankRow = new FastPropertyGridRow(); var cellValue = fastGrid.rows[rowIndex].cells[fastGrid.Columns.FindIndex(c => c.PropertyName == blankRow.Property(p => p.Value))].CellValue; var propType = property.PropertyType; if ((propType == typeof (bool) || propType.IsEnum)) { var pop = new PopupListBox(cellValue, rowIndex, col, propType, UpdateObject, fastGrid); pop.ShowOptions(coords.X, coords.Y); return; } if ((propType == typeof (string) || Converter.IsConvertable(propType))) { // редактор подставляется в FastGrid.PopupTextBox try { var pop = new PopupTextBox(cellValue, col.ResultedWidth, fastGrid.CellHeight, rowIndex, col, property, null); pop.OnValueUpdated += UpdateObject; pop.Show(fastGrid, coords); } catch(Exception ex) { Logger.Error("FastPropertyGrid.OpenBaseEditor", ex); } return; } }
public bool ProcessMessage(IntPtr hwnd, UInt32 message, UInt32 wParam, UInt32 lParam, UInt32 time, Int32 xPos, Int32 yPos) { if (!ReadOnly) { switch (message) { case WM_KEYDOWN: case WM_SYSKEYDOWN: { Keys keyPress = CommandHandling.GetMenuShortcutFromVirtualKey(wParam); if (keyPress == Keys.Return) { // Handle <enter> manually because the default handling // appears to fail when we are hosted in a win32 modal dialog IntPtr hwndFind = FindWindowEx(WebBrowser.Handle, IntPtr.Zero, "Shell Embedding", ""); hwndFind = FindWindowEx(hwndFind, IntPtr.Zero, "Shell DocObject View", ""); hwndFind = FindWindowEx(hwndFind, IntPtr.Zero, "Internet Explorer_Server", ""); if (hwndFind != null) { SendMessage(hwndFind, WM_CHAR, VK_RETURN, 0); } return(true); } else if (keyPress != Keys.None) { return(OnDocumentKeyPress(keyPress)); } } break; case WM_CHAR: if ((wParam == '@') && (NeedAttributeValues != null)) { // Can't handle this with WM_KEYDOWN because different // keyboard layouts place '@' in different locations var items = GetPopupListBoxItems(); if (items.Count() > 0) { // Insert the '@' first and select it SelectedHtml = "@"; SelectCharacterAtCaret(false); var popup = new PopupListBox(); popup.ListBox.Items.AddRange(items); popup.ListBox.Font = m_ControlsFont; popup.Closed += new ToolStripDropDownClosedEventHandler(OnAttributeListBoxClosed); var pos = GetPopupListBoxLocation(); popup.Show(pos.X, pos.Y); return(true); // we already added the '@' } } break; } } return(false); }
public MRUComboBoxEditPopupListBoxViewInfo(PopupListBox owner) : base(owner) { }