Beispiel #1
0
        /// ------------------------------------------------------------------------------------
        private void AddColumnsToWhereGrid()
        {
            m_gridWhere.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None;

            DataGridViewColumn col = SilGrid.CreateTextBoxColumn("word");

            col.DefaultCellStyle.Font   = App.PhoneticFont;
            col.CellTemplate.Style.Font = App.PhoneticFont;
            m_gridWhere.Columns.Add(col);
            col.HeaderText = LocalizationManager.GetString(
                "DialogBoxes.UndefinedPhoneticCharactersDlg.WhereFoundGrid.ColumnHeadings.Transcription",
                "Transcription", null, col);

            // Add the reference column.
            col = SilGrid.CreateTextBoxColumn("reference");
            m_gridWhere.Columns.Add(col);
            col.HeaderText = LocalizationManager.GetString(
                "DialogBoxes.UndefinedPhoneticCharactersDlg.WhereFoundGrid.ColumnHeadings.Reference",
                "Reference", null, col);

            // Add the data source column.
            col = SilGrid.CreateTextBoxColumn("datasource");
            m_gridWhere.Columns.Add(col);
            col.HeaderText = LocalizationManager.GetString(
                "DialogBoxes.UndefinedPhoneticCharactersDlg.WhereFoundGrid.ColumnHeadings.DataSource",
                "Data Source", null, col);

            m_gridWhere.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            m_gridWhere.AutoResizeColumnHeadersHeight();
            m_gridWhere.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;
            m_gridWhere.Name = Name + "WhereGrid";
            App.SetGridSelectionColors(m_gridWhere, false);
        }
Beispiel #2
0
        /// ------------------------------------------------------------------------------------
        private void AddColumnsToCharsGrid()
        {
            // Add the Unicode number column.
            DataGridViewColumn col = SilGrid.CreateTextBoxColumn("codepoint");

            col.SortMode = DataGridViewColumnSortMode.Automatic;
            m_gridChars.Columns.Add(col);
            col.HeaderText = LocalizationManager.GetString(
                "DialogBoxes.UndefinedPhoneticCharactersDlg.SymbolsGrid.ColumnHeadings.UnicodeNumber",
                "Unicode\nNumber", null, col);

            // Add the sample column.
            col = SilGrid.CreateTextBoxColumn("char");
            col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            col.DefaultCellStyle.Font      = App.PhoneticFont;
            col.CellTemplate.Style.Font    = App.PhoneticFont;
            m_gridChars.Columns.Add(col);
            col.HeaderText = LocalizationManager.GetString(
                "DialogBoxes.UndefinedPhoneticCharactersDlg.SymbolsGrid.ColumnHeadings.Character",
                "Character", null, col);

            // Add the count number column.
            col = SilGrid.CreateTextBoxColumn("count");
            col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
            col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            m_gridChars.Columns.Add(col);
            col.HeaderText = LocalizationManager.GetString(
                "DialogBoxes.UndefinedPhoneticCharactersDlg.SymbolsGrid.ColumnHeadings.Count",
                "Count", null, col);

            m_gridChars.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCellsExceptHeaders;
            m_gridChars.AutoResizeColumnHeadersHeight();
            m_gridChars.Name = Name + "CharsGrid";
            App.SetGridSelectionColors(m_gridChars, false);
        }
Beispiel #3
0
        /// ------------------------------------------------------------------------------------
        private void BuildGrid()
        {
            _grid.Name = Name + "AmbigGrid";
            _grid.AutoGenerateColumns      = false;
            _grid.AllowUserToAddRows       = true;
            _grid.AllowUserToDeleteRows    = true;
            _grid.AllowUserToOrderColumns  = false;
            _grid.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Raised;
            _grid.Font = FontHelper.UIFont;
            App.SetGridSelectionColors(_grid, true);

            DataGridViewColumn col = SilGrid.CreateTextBoxColumn("seq");

            col.Width = 90;
            col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            col.DefaultCellStyle.Font      = App.PhoneticFont;
            col.CellTemplate.Style.Font    = App.PhoneticFont;
            _grid.Columns.Add(col);
            col.HeaderText = LocalizationManager.GetString(
                "DialogBoxes.AmbiguousSequencesDlg.ColumnHeadings.Sequence", "Sequence", null, col);

            col       = SilGrid.CreateCheckBoxColumn("convert");
            col.Width = 75;
            col.CellTemplate.ValueType = typeof(bool);
            _grid.Columns.Add(col);
            col.HeaderText = LocalizationManager.GetString(
                "DialogBoxes.AmbiguousSequencesDlg.ColumnHeadings.TreatAsUnit", "Treat as one unit?", null, col);

            col       = SilGrid.CreateTextBoxColumn("base");
            col.Width = 75;
            col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            col.DefaultCellStyle.Font      = App.PhoneticFont;
            col.CellTemplate.Style.Font    = App.PhoneticFont;
            _grid.Columns.Add(col);
            col.HeaderText = LocalizationManager.GetString(
                "DialogBoxes.AmbiguousSequencesDlg.ColumnHeadings.BaseChar", "Base Character", null, col);

            col          = SilGrid.CreateTextBoxColumn("cvpattern");
            col.ReadOnly = true;
            col.Width    = 70;
            col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            col.DefaultCellStyle.Font      = App.PhoneticFont;
            col.CellTemplate.Style.Font    = App.PhoneticFont;
            _grid.Columns.Add(col);
            col.HeaderText = LocalizationManager.GetString(
                "DialogBoxes.AmbiguousSequencesDlg.ColumnHeadings.CVPattern", "CV Pattern", null, col);

            col         = SilGrid.CreateCheckBoxColumn("generated");
            col.Visible = false;
            _grid.Columns.Add(col);
        }
        /// ------------------------------------------------------------------------------------
        protected virtual void BuildPhoneGrid()
        {
            _gridPhones.Name = Name + "PhoneGrid";
            _gridPhones.AutoGenerateColumns = false;
            _gridPhones.Font             = FontHelper.UIFont;
            _gridPhones.VirtualMode      = true;
            _gridPhones.CellValueNeeded += HandlePhoneGridCellValueNeeded;
            _gridPhones.BackgroundColor  = Color.White;
            _gridPhones.ForeColor        = Color.Black;

            DataGridViewColumn col = SilGrid.CreateTextBoxColumn("phone");

            col.ReadOnly = true;
            col.Width    = 55;
            col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
            col.DefaultCellStyle.Padding   = new Padding(8, 0, 0, 0);
            col.DefaultCellStyle.Font      = App.PhoneticFont;
            col.CellTemplate.Style.Font    = App.PhoneticFont;
            _gridPhones.Columns.Add(col);
            col.HeaderText = LocalizationManager.GetString(
                "DialogBoxes.FeaturesDlgBase.PhoneListGrid.ColumnHeadings.Phone", "Phone", null, col);

            col          = SilGrid.CreateTextBoxColumn("count");
            col.ReadOnly = true;
            col.Width    = 55;
            col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
            col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            col.DefaultCellStyle.Padding   = new Padding(0, 0, 5, 0);
            _gridPhones.Columns.Add(col);
            col.HeaderText = LocalizationManager.GetString(
                "DialogBoxes.FeaturesDlgBase.PhoneListGrid.ColumnHeadings.Count", "Count", null, col);

            _gridPhones.Rows.Clear();
            _gridPhones.RowCount = _viewModel.PhoneCount;

            if (_gridPhones.RowCount > 0)
            {
                _gridPhones.CurrentCell = _gridPhones[0, 0];
            }

            _gridPhones.AutoResizeColumnHeadersHeight();
            _gridPhones.ColumnHeadersHeight += 8;

            _gridPhones.IsDirty = false;

            _gridPhones.DefaultCellStyle.SelectionForeColor = Color.Black;
        }
Beispiel #5
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private void BuildGrid()
        {
            m_grid      = new SilGrid();
            m_grid.Name = Name + "Grid";
            m_grid.AutoGenerateColumns = false;
            m_grid.Dock = DockStyle.Fill;
            m_grid.Font = FontHelper.UIFont;
            m_grid.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Raised;
            //			m_grid.RowEnter += new DataGridViewCellEventHandler(m_grid_RowEnter);

            DataGridViewColumn col = SilGrid.CreateTextBoxColumn("phone");

            col.ReadOnly = true;
            col.Width    = 55;
            col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            col.DefaultCellStyle.Font      = FontHelper.PhoneticFont;
            col.CellTemplate.Style.Font    = FontHelper.PhoneticFont;
            col.HeaderText = "Phone";
            m_grid.Columns.Add(col);

            col          = SilGrid.CreateTextBoxColumn("count");
            col.ReadOnly = true;
            col.Width    = 55;
            col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
            col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            col.HeaderText = "Count";
            m_grid.Columns.Add(col);

            col            = SilGrid.CreateSilButtonColumn("features");
            col.ReadOnly   = true;
            col.Width      = 300;
            col.HeaderText = "Features";
            ((SilButtonColumn)col).ButtonWidth = 23;
            ((SilButtonColumn)col).DrawTextWithEllipsisPath = true;
            ((SilButtonColumn)col).ButtonFont     = new Font("Marlett", 9);
            ((SilButtonColumn)col).ButtonText     = "6";
            ((SilButtonColumn)col).ButtonClicked += HandleFeaturesListClick;
            m_grid.Columns.Add(col);

            PaApp.SettingsHandler.LoadGridProperties(m_grid);
            Controls.Add(m_grid);
            m_grid.BringToFront();
        }
Beispiel #6
0
        /// ------------------------------------------------------------------------------------
        private void BuildGrid()
        {
            // Create the column for the ascending check box.
            DataGridViewColumn col = SilGrid.CreateCheckBoxColumn("include");

            col.HeaderText   = string.Empty;
            col.DividerWidth = 0;
            m_sortingGrid.Columns.Add(col);

            // Create the column for the column name.
            col          = SilGrid.CreateTextBoxColumn("column");
            col.ReadOnly = true;
            m_sortingGrid.Columns.Add(col);
            App.RegisterForLocalization(m_sortingGrid.Columns["column"],
                                        "OptionsDlg.SortingTab.SortOrderColumnColumnHeadingText", "Column");

            // Create the column for the ascending check box.
            col = SilGrid.CreateCheckBoxColumn("direction");
            m_sortingGrid.Columns.Add(col);
            App.RegisterForLocalization(m_sortingGrid.Columns["direction"],
                                        "OptionsDlg.SortingTab.SortOrderDirectionColumnHeadingText", "Ascending?");
        }
Beispiel #7
0
        /// ------------------------------------------------------------------------------------
        private void BuildGrid()
        {
            // Create the column for the ascending check box.
            DataGridViewColumn col = SilGrid.CreateCheckBoxColumn("include");

            col.HeaderText   = string.Empty;
            col.DividerWidth = 0;
            m_sortingGrid.Columns.Add(col);

            // Create the column for the column name.
            col          = SilGrid.CreateTextBoxColumn("column");
            col.ReadOnly = true;
            m_sortingGrid.Columns.Add(col);
            col.HeaderText = LocalizationManager.GetString(
                "DialogBoxes.OptionsDlg.SortingTab.SortOrderGrid.ColumnHeadings.Column",
                "Column", null, col);

            // Create the column for the ascending check box.
            col = SilGrid.CreateCheckBoxColumn("direction");
            m_sortingGrid.Columns.Add(col);
            col.HeaderText = LocalizationManager.GetString(
                "DialogBoxes.OptionsDlg.SortingTab.SortOrderGrid.ColumnHeadings.Direction",
                "Ascending?", null, col);
        }
        /// ------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private void FillCVInEnvironment(IPACharacterType charType, string environment, int colIndex)
        {
            m_chartHasBeenAutoFilled = true;

            // Save the original environment pattern.
            m_origEnvironments[colIndex] = environment;

            int    startIndex = colIndex;
            string fmt        = environment.Replace((charType == IPACharacterType.Consonant ?
                                                     kAutoFillConMarker : kAutoFillVowMarker), "{0}");

            // Get a phone list sorted by MOA
            List <string> phoneList = GetSortedPhones(charType == IPACharacterType.Consonant ?
                                                      IPACharacterType.Consonant : IPACharacterType.Vowel);

            SearchQuery query = m_xyGrid.Columns[colIndex].Tag as SearchQuery;

            foreach (string phone in phoneList)
            {
                if (colIndex == startIndex)
                {
                    query.Pattern = string.Format(fmt, phone);
                }
                else
                {
                    m_xyGrid.Columns.Insert(colIndex, SilGrid.CreateTextBoxColumn(string.Empty));
                    m_xyGrid[colIndex, 0].Value = string.Format(fmt, phone);
                    SearchQuery newQuery = query.Clone();
                    newQuery.Pattern = m_xyGrid[colIndex, 0].Value as string;
                    m_xyGrid.Columns[colIndex].Tag = newQuery;
                    m_addedColumns.Add(m_xyGrid.Columns[colIndex]);
                }

                m_xyGrid[colIndex++, 0].Value = string.Format(fmt, phone);
            }
        }
        /// ------------------------------------------------------------------------------------
        private void BuildGrid()
        {
            m_grid.Name = Name + "Grid";
            m_grid.AutoGenerateColumns = false;
            m_grid.MultiSelect         = true;
            m_grid.Font = FontHelper.UIFont;
            m_grid.CurrentRowChanged += HandleCurrentRowChanged;
            App.SetGridSelectionColors(m_grid, false);

            DataGridViewColumn col = SilGrid.CreateCheckBoxColumn("skip");

            m_grid.Columns.Add(col);
            col.HeaderText = LocalizationManager.GetString(
                "DialogBoxes.ProjectSettingsDlg.DataSourceGrid.ColumnHeadings.Load", "Load", null, col);

            col          = SilGrid.CreateTextBoxColumn("sourcefiles");
            col.ReadOnly = true;
            col.Width    = 250;
            m_grid.Columns.Add(col);
            col.HeaderText = LocalizationManager.GetString(
                "DialogBoxes.ProjectSettingsDlg.DataSourceGrid.ColumnHeadings.Source", "Source", null, col);

            col          = SilGrid.CreateTextBoxColumn("type");
            col.ReadOnly = true;
            col.Width    = 75;
            m_grid.Columns.Add(col);
            col.HeaderText = LocalizationManager.GetString(
                "DialogBoxes.ProjectSettingsDlg.DataSourceGrid.ColumnHeadings.Type", "Type", null, col);

            col          = SilGrid.CreateTextBoxColumn("Phonetic_Source");
            col.ReadOnly = true;
            col.Width    = 100;
            m_grid.Columns.Add(col);
            col.HeaderText = LocalizationManager.GetString(
                "DialogBoxes.ProjectSettingsDlg.DataSourceGrid.ColumnHeadings.Phonetic_Source", "Phonetic Source", null, col);

            col          = SilGrid.CreateSilButtonColumn("xslt");
            col.ReadOnly = true;
            col.Width    = 170;
            ((SilButtonColumn)col).ButtonWidth = 20;
            ((SilButtonColumn)col).DrawTextWithEllipsisPath = true;
            ((SilButtonColumn)col).ButtonClicked           += HandleSpecifyXSLTClick;
            ((SilButtonColumn)col).ButtonText = LocalizationManager.GetString("DialogBoxes.ProjectSettingsDlg.XsltColButtonText",
                                                                              "...", "Text on the button in the XSLT column in the project settings dialog");

            ((SilButtonColumn)col).ButtonToolTip = LocalizationManager.GetString("DialogBoxes.ProjectSettingsDlg.XsltColButtonToolTip",
                                                                                 "Specify XSLT", "Tooltip for the button in the XSLTe column in the project settings dialog");

            m_grid.Columns.Add(col);
            col.HeaderText = LocalizationManager.GetString(
                "DialogBoxes.ProjectSettingsDlg.DataSourceGrid.ColumnHeadings.XSLT", "XSLT", null, col);

            m_grid.AutoResizeColumn(0, DataGridViewAutoSizeColumnMode.ColumnHeader);

            if (Properties.Settings.Default.ProjectSettingsDlgGrid != null)
            {
                Properties.Settings.Default.ProjectSettingsDlgGrid.InitializeGrid(m_grid);
            }

            m_grid.Columns["skip"].Visible = Properties.Settings.Default.ShowLoadColumnInProjectSettingsDlg;

            // When xslt transforms are supported when reading data, then this should become visible.
            m_grid.Columns["xslt"].Visible = false;

            m_grid.CurrentCellChanged += HandleGridsCurrentCellChanged;
            m_grid.CellClick          += delegate { UpdateButtonStates(); };
        }
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Add columns to grid.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private void AddColumns()
        {
            // Add the HexIpa field column.
            DataGridViewColumn col = SilGrid.CreateTextBoxColumn(kHexadecimal);

            col.HeaderText = Utils.ConvertLiteralNewLines(Properties.Resources.kstidIpaGridHexIpa);
            col.SortMode   = DataGridViewColumnSortMode.Programmatic;
            col.ReadOnly   = true;
            col.Frozen     = true;
            col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            col.DefaultCellStyle.BackColor = ColorHelper.CalculateColor(Color.Black, SystemColors.Window, 15);
            Grid.Columns.Add(col);

            // Add the IpaChar field column.
            col            = SilGrid.CreateTextBoxColumn(kLiteral);
            col.HeaderText = Utils.ConvertLiteralNewLines(Properties.Resources.kstidIpaGridIpaChar);
            col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            col.DefaultCellStyle.Font      = App.PhoneticFont;
            col.CellTemplate.Style.Font    = App.PhoneticFont;
            col.DefaultCellStyle.BackColor = ColorHelper.CalculateColor(Color.Black, SystemColors.Window, 15);
            col.SortMode = DataGridViewColumnSortMode.Programmatic;
            col.ReadOnly = true;
            col.Frozen   = true;
            Grid.Columns.Add(col);

            // Add the Name field column.
            col            = SilGrid.CreateTextBoxColumn(kName);
            col.HeaderText = Properties.Resources.kstidIpaGridName;
            col.SortMode   = DataGridViewColumnSortMode.Programmatic;
            Grid.Columns.Add(col);

            // Add the Description field column.
            col            = SilGrid.CreateTextBoxColumn(kDescription);
            col.HeaderText = Properties.Resources.kstidIpaGridDesc;
            col.SortMode   = DataGridViewColumnSortMode.Programmatic;
            Grid.Columns.Add(col);

            // Add the CharType drop down list combo box column.
            col = SilGrid.CreateDropDownListComboBoxColumn(
                kType, Enum.GetNames(typeof(IPASymbolType)).Cast <object>());
            col.HeaderText = Properties.Resources.kstidIpaGridCharType;
            col.SortMode   = DataGridViewColumnSortMode.Programmatic;
            Grid.Columns.Add(col);

            // Add the CharSubType drop down list combo box column.
            col = SilGrid.CreateDropDownListComboBoxColumn(
                kSubType, Enum.GetNames(typeof(IPASymbolSubType)).Cast <object>());
            col.HeaderText = Properties.Resources.kstidIpaGridCharSubType;
            col.SortMode   = DataGridViewColumnSortMode.Programmatic;
            Grid.Columns.Add(col);

            // Add the CharIgnoreType drop down list combo box column.
            col = SilGrid.CreateDropDownListComboBoxColumn(
                kIgnoreType, Enum.GetNames(typeof(IPASymbolIgnoreType)).Cast <object>());
            col.HeaderText = Properties.Resources.kstidIpaGridCharIgnoreType;
            col.SortMode   = DataGridViewColumnSortMode.Programmatic;
            Grid.Columns.Add(col);

            // Add the IsBaseChar check box column.
            col            = SilGrid.CreateCheckBoxColumn(kIsBase);
            col.HeaderText = Properties.Resources.kstidIpaGridIsBase;
            col.SortMode   = DataGridViewColumnSortMode.Programmatic;
            col.ValueType  = typeof(bool);
            Grid.Columns.Add(col);

            // Add the Can preceed base character check box column.
            col            = SilGrid.CreateCheckBoxColumn(kCanPrecedeBase);
            col.HeaderText = Utils.ConvertLiteralNewLines(Properties.Resources.kstidIpaGridCanPreceedBase);
            col.SortMode   = DataGridViewColumnSortMode.Programmatic;
            col.ValueType  = typeof(bool);
            Grid.Columns.Add(col);

            // Add the DisplayWDottedCircle check box column.
            col            = SilGrid.CreateCheckBoxColumn(kDisplayWithDottedCircle);
            col.HeaderText = Utils.ConvertLiteralNewLines(Properties.Resources.kstidIpaGridWDotCircle);
            col.SortMode   = DataGridViewColumnSortMode.Programmatic;
            col.ValueType  = typeof(bool);
            Grid.Columns.Add(col);

            //// Add the MOA column.
            //col = SilGrid.CreateTextBoxColumn(kMOA);
            //col.HeaderText = Properties.Resources.kstidIpaGridMOA;
            //col.SortMode = DataGridViewColumnSortMode.Automatic;
            //col.ValueType = typeof(int);
            //if (!m_amTesting)
            //    col.Visible = false;
            //Grid.Columns.Add(col);

            //// Add the POA column.
            //col = SilGrid.CreateTextBoxColumn(kPOA);
            //col.HeaderText = Properties.Resources.kstidIpaGridPOA;
            //col.SortMode = DataGridViewColumnSortMode.Automatic;
            //col.ValueType = typeof(int);
            //if (!m_amTesting)
            //    col.Visible = false;
            //Grid.Columns.Add(col);

            // Add the articulatory Mask field.
            col            = SilGrid.CreateTextBoxColumn(kAFeatures);
            col.HeaderText = Properties.Resources.kstidAfeaturesHdg;
            col.SortMode   = DataGridViewColumnSortMode.Programmatic;
            col.ReadOnly   = true;
            Grid.Columns.Add(col);

            // Add the binary Mask field.
            col            = SilGrid.CreateTextBoxColumn(kBFeatures);
            col.HeaderText = Properties.Resources.kstidBFeaturesHdg;
            col.SortMode   = DataGridViewColumnSortMode.Programmatic;
            col.ReadOnly   = true;
            Grid.Columns.Add(col);
        }