예제 #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// ------------------------------------------------------------------------------------
        void grid_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            try
            {
                PaWordListGrid grid = sender as PaWordListGrid;

                if (e.ColumnIndex != 0 || !DoesGridQualifyForFeature(grid))
                {
                    return;
                }

                if (!grid.Focused)
                {
                    grid.Focus();
                    Application.DoEvents();
                }

                Rectangle rc = grid.GetCellDisplayRectangle(0, -1, false);
                Point     pt = new Point(rc.X, rc.Bottom);
                pt = grid.PointToScreen(pt);

                m_numPhonesCtrl.NumberOfPhones = (grid.SortOptions.AdvSortOrder[0] == 0 ?
                                                  m_numPhonesBefore[grid] : m_numPhonesAfter[grid]);

                m_numPhonesCtrl.Environment = (grid.SortOptions.AdvSortOrder[0] == 0 ?
                                               "before" : "after");

                m_dropDown.Tag = grid;
                m_dropDown.Show(pt);
            }
            catch { }
        }
예제 #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes a wordEntry list grid with the specified cache and adds it to the form.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public void Initialize(WordListCache cache)
        {
            m_cache = cache;

            if (WordListGrid != null)
            {
                WordListGrid.Cache = m_cache;
            }
            else
            {
                WordListGrid                       = new PaWordListGrid(cache, GetType(), false);
                WordListGrid.BorderStyle           = BorderStyle.None;
                WordListGrid.RowHeadersBorderStyle = DataGridViewHeaderBorderStyle.None;
                WordListGrid.TMAdapter             = m_tmAdapter;

                // Even thought the grid is docked, setting it's size here prevents the user
                // from seeing that split second during which time the grid goes from it's
                // small, default size to its docked size.
                WordListGrid.Size = new Size(splitOuter.Panel1.Width, splitOuter.Panel1.Height);

                WordListGrid.Name = Name + "Grid";
                WordListGrid.LoadSettings();
                WordListGrid.RowEnter += m_grid_RowEnter;
                WordListGrid.Visible   = false;
                pnlGrid.Controls.Add(WordListGrid);
                WordListGrid.Visible  = true;
                WordListGrid.TabIndex = 0;
                WordListGrid.Focus();
                WordListGrid.SortOptions           = Project.DataCorpusVwSortOptions;
                WordListGrid.IsCurrentPlaybackGrid = true;
                WordListGrid.UseWaitCursor         = false;
                WordListGrid.Cursor = Cursors.Default;
            }

            // This will enforce an update of the record pane.
            _recView.UpdateRecord(WordListGrid.GetRecord(), true);
        }