Exemplo n.º 1
0
        // Command Handlers ------------------------------------------------------------------
        #region Cmd: cmdLoad
        private void cmdLoad(object sender, EventArgs e)
        {
            LocDB.Localize(this, null);     // Form Controls
            ShowHelp.ShowHelpTopic(this, "Localization.htm", Common.IsUnixOS(), false);

            // Populate the Filter Combo
            FilterCombo.Items.Add(c_ShowAll);
            FilterCombo.Items.Add(c_ThoseNeedingAttention);
            FilterCombo.Items.Add(c_TranslatorItems);
            FilterCombo.Items.Add(c_TranslatorItemsNeedingAttention);
            FilterCombo.Items.Add(c_AdvisorItems);
            FilterCombo.Items.Add(c_AdvisorItemsNeedingAttention);
            FilterCombo.Text = c_ShowAll;

            // Populate the Language Combo
            PopulateLanguageCombo();

            // Populate the Tree
            PopulateTree();

            // Populate the Shortcut Key Combo
            for (int i = 0; i < 26; i++)
            {
                m_comboShortcutKey.Items.Add("Ctrl+" + ((char)((int)'A' + i)).ToString());
            }

            // Initialize the form to the first item
            if (Tree.Nodes.Count > 0)
            {
                Tree.SelectedNode = Tree.Nodes[0];
            }
        }
Exemplo n.º 2
0
        private void PublicationTask_Load(object sender, EventArgs e)
        {
            LocDB.Localize(this, null);
            Param.SetupHelp(this);
            try
            {
                if (Param.Value.ContainsKey(Param.InputType))
                {
                    Param.SetValue(Param.InputType, "");
                }
                Param.LoadSettings();
                ScreenAdjustment();
                BtConfigure.Visible = Param.UserRole != "Output User";

                if (Param.Value.ContainsKey(Param.InputType))
                {
                    Param.SetValue(Param.InputType, InputType);
                }
                Param.LoadSettings();
                TaskAdjustment();

                DoLoad();
            }
            catch (InvalidStyleSettingsException err)
            {
                var msg = new[] { err.FullFilePath };
                LocDB.Message("errNotValidXml", err.ToString(), msg, LocDB.MessageTypes.Warning, LocDB.MessageDefault.First);
                return;
            }
        }
Exemplo n.º 3
0
        private void ExportDlg_Load(object sender, EventArgs e)
        {
            LocDB.Localize(this, null);     // Form Controls
            _helpTopic = "Exporting.htm";
            ShowHelp.ShowHelpTopic(this, _helpTopic, Common.IsUnixOS(), false);
            ArrayList exportType = Backend.GetExportType(ExportType);

            if (exportType.Count > 0)
            {
                foreach (string item in exportType)
                {
                    cmbExportType.Items.Add(item);
                }
                cmbExportType.SelectedIndex = 0;
            }
            else
            {
                var msg = new[] { "Please Install the Plugin Backends" };
                LocDB.Message("defErrMsg", "Please Install the Plugin Backends", msg, LocDB.MessageTypes.Error, LocDB.MessageDefault.First);
                this.Close();
            }
        }
Exemplo n.º 4
0
        private void StyleCategories_Load(object sender, EventArgs e)
        {
            LocDB.Localize(this, null);
            Param.SetupHelp(this);
            var cats = Param.GetItems("categories/category/item");

            DgStyleCategories.ColumnCount          = cats.Count;
            DgStyleCategories.ColumnHeadersVisible = true;
            var hdrStyle = new DataGridViewCellStyle
            {
                BackColor = Color.Gray,
                Font      = new Font("Charis SIL", 8, FontStyle.Bold),
                WrapMode  = DataGridViewTriState.True,
                Alignment = DataGridViewContentAlignment.MiddleCenter
            };

            DgStyleCategories.ColumnHeadersDefaultCellStyle = hdrStyle;
            for (var i = 0; i < cats.Count; i++)
            {
                DgStyleCategories.Columns[i].Name = string.Format("{1}: {0}", cats[i].Attributes["name"].Value, cats[i].ParentNode.Attributes["name"].Value);
            }
            var styles = Param.GetItems("styles/paper/style");

            DgStyleCategories.RowCount          = styles.Count;
            DgStyleCategories.RowHeadersVisible = true;
            var rhdrStyle = new DataGridViewCellStyle
            {
                BackColor = Color.Gray,
                Font      = new Font("Charis SIL", 8, FontStyle.Bold)
            };

            DgStyleCategories.RowHeadersDefaultCellStyle = rhdrStyle;
            for (var i = 0; i < styles.Count; i++)
            {
                DgStyleCategories.Rows[i].HeaderCell.Value = styles[i].Attributes["name"].Value;
            }
            DgStyleCategories.AutoResizeRowHeadersWidth(DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders);

            var windings     = new Font("Wingdings", 10);
            var middleCenter = DataGridViewContentAlignment.MiddleCenter;

            DgStyleCategories.DefaultCellStyle.Font                = windings;
            DgStyleCategories.DefaultCellStyle.Alignment           = middleCenter;
            DgStyleCategories.RowHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
            DataGridViewCell cell;

            for (var r = 0; r < styles.Count; r++)
            {
                for (var c = 0; c < cats.Count; c++)
                {
                    cell = DgStyleCategories.Rows[r].Cells[c];
                    if (cell.Value == null)
                    {
                        continue;
                    }

                    cell.Value           = Param.LoadStyleCategories(Param.Name(styles[r]), Param.Name(cats[c].ParentNode), Param.Name(cats[c]));
                    cell.Style.ForeColor = (string)cell.Value == YES ? Color.Green : Color.Red;
                }
            }
        }