Exemplo n.º 1
0
 /// ------------------------------------------------------------------------------------
 public void Add(PickerPopupItem item)
 {
     if (!_items.Contains(item))
     {
         item.CheckedChanged += HandleItemCheckedChanged;
         item.Disposed       += HandleItemDisposed;
         _items.Add(item);
     }
 }
Exemplo n.º 2
0
 /// ------------------------------------------------------------------------------------
 protected override void HandleItemCheckChanged(object sender, PickerPopupItem item)
 {
     if (_displayedMatches != null)
     {
         AutoCompleteTextBox.InsertWord(Popup.GetCheckedItemsString());
         ClosePopup();
     }
     else
     {
         base.HandleItemCheckChanged(sender, item);
     }
 }
Exemplo n.º 3
0
        /// ------------------------------------------------------------------------------------
        private void HandleItemCheckedChanged(PickerPopupItem item,
                                              PickerPopupItem.ItemSelectMode selectMode)
        {
            if (ItemCheckChanged != null)
            {
                ItemCheckChanged(this, item);
            }

            if (selectMode == PickerPopupItem.ItemSelectMode.Mouse)
            {
                ClosePopup();
            }
        }
Exemplo n.º 4
0
        /// ------------------------------------------------------------------------------------
        protected virtual void HandleColChooserItemCheckChanged(object sender, PickerPopupItem item)
        {
            var col = item.Tag as DataGridViewColumn;

            // Check if the column is being hidden.
            if (!item.Checked)
            {
                if (_grid.Columns.Cast <DataGridViewColumn>().Where(c => c.Visible).Count() == 1)
                {
                    ColChooserPopup.ItemCheckChanged -= HandleColChooserItemCheckChanged;
                    item.Checked = true;
                    ColChooserPopup.ItemCheckChanged += HandleColChooserItemCheckChanged;

                    if (_msgWindow == null)
                    {
                        _msgWindow = new FadingMessageWindow();
                    }

                    var msg = LocalizationManager.GetString("CommonToMultipleViews.ElementList.OneColumnMustBeVisibleMsg",
                                                            "One column must be visible.",
                                                            "Displayed when user clears all columns for display in sessions or people list");

                    var pt = PointToScreen(new Point(Width / 2, Height / 3));
                    _msgWindow.Show(msg, pt);

                    SystemSounds.Beep.Play();
                    return;
                }

                // If the column is the current column, then change the current column
                // before hiding it. Otherwise, the current column becomes indeterminate.
                if (_grid is BetterGrid && _grid.CurrentCellAddress.X == col.Index)
                {
                    ((BetterGrid)_grid).SelectAdjacentVisibleColumn(true);
                }
            }

            _grid.SuspendLayout();
            col.Visible = item.Checked;
            _grid.ResumeLayout();
        }
Exemplo n.º 5
0
 /// ------------------------------------------------------------------------------------
 protected virtual void HandleItemCheckChanged(object sender, PickerPopupItem item)
 {
     Text = Popup.GetCheckedItemsString();
 }
Exemplo n.º 6
0
 /// ------------------------------------------------------------------------------------
 protected override void HandleItemCheckChanged(object sender, PickerPopupItem item)
 {
     base.HandleItemCheckChanged(sender, item);
     TextBox.SelectAll();
 }