Exemplo n.º 1
0
 private void BindHelpToControl(FrameworkElement element, string helpKey)
 {
     element.MouseEnter += delegate
     {
         ShowHelp?.Invoke(helpKey);
     };
 }
Exemplo n.º 2
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.º 3
0
        public bool Save()
        {
            bool returnValue;

            try
            {
                using (RegistryKey registryKey = OpenRegistryKey())
                {
                    registryKey.SetValue(ANIMATION_SPEED, (int)AnimationSpeed, RegistryValueKind.DWord);
                    registryKey.SetValue(FRAMES_PER_SECOND, FramesPerSecond, RegistryValueKind.DWord);
                    registryKey.SetValue(MAXIMUM_HEARTS, MaximumHearts, RegistryValueKind.DWord);
                    registryKey.SetValue(SCALE, Scale, RegistryValueKind.DWord);
                    registryKey.SetValue(SHOW_HELP, ShowHelp.ToString(), RegistryValueKind.String);
                    registryKey.SetValue(SHOW_STATUS, ShowStatus.ToString(), RegistryValueKind.String);

                    registryKey.Close();
                }

                returnValue = true;
            }
            catch (Exception e)
            {
                Logging.LogException(e);
                returnValue = false;
            }

            return(returnValue);
        }
Exemplo n.º 4
0
        private void PrintVia_Load(object sender, EventArgs e)
        {
            string formText   = LocalizationManager.GetString("ExportThroughPathway.Form.Text", "Set Defaults", "");
            string strDefault = formText.ToString();

            if (!Common.isRightFieldworksVersion())
            {
                var    text    = LocalizationManager.GetString("PrintVia.PrintViaLoad.Message", "Please download and install a Pathway version compatible with your software", "");
                string caption = LocalizationManager.GetString("PrintVia.PrintViaLoad.Caption", "Incompatible Pathway Version", "");
                Utils.MsgBox(text, caption, MessageBoxButtons.OK,
                             MessageBoxIcon.Error);
                DialogResult = DialogResult.Cancel;
                Close();
            }

            if (this.Text != strDefault)
            {
                Param.LoadSettings();
                ValidateXMLVersion(Param.SettingPath);
            }
            Param.SetValue(Param.InputType, InputType);
            Param.LoadSettings();
            ScriptureAdjust();
            LoadBackEnds();
            LoadLayouts();
            SetOkStatus();
            LoadExtraProcessing();
            LoadProperty();
            txtSaveInFolder.Text = Common.GetSaveInFolder(Param.DefaultValue[Param.PublicationLocation], DatabaseName, cmbSelectLayout.Text);
            ShowHelp.ShowHelpTopic(this, _helpTopic, Common.IsUnixOS(), false);
            Common.databaseName = DatabaseName;
        }
Exemplo n.º 5
0
 private void m_btnHelp_Click(object sender, EventArgs e)
 {
     if (m_helpTopicProvider != null)
     {
         ShowHelp.ShowHelpTopic(m_helpTopicProvider, HelpTopic);
     }
 }
Exemplo n.º 6
0
        /// <summary>
        /// Launch the main help file for Flex.
        /// </summary>
        /// <param name="sender"></param>
        /// <returns></returns>
        public bool OnHelpLanguageExplorer(object sender)
        {
            CheckDisposed();

            if (MiscUtils.IsUnix)
            {
                ShowHelp.ShowHelpTopic_Linux(HelpFile, null);
                return(true);
            }

            try
            {
                // When the help window is closed it will return focus to the window that opened it (see MSDN
                // documentation for HtmlHelp()). We don't want to use the main window as the parent, because if
                // a modal dialog is visible, it will still return focus to the main window, allowing the main window
                // to perform some behaviors (such as refresh by pressing F5) while the modal dialog is visible,
                // which can be bad. So, we just create a dummy control and pass that in as the parent.
                Help.ShowHelp(new Control(), HelpFile);
            }
            catch (Exception)
            {
                MessageBox.Show(null, String.Format(LexTextStrings.ksCannotLaunchX, HelpFile),
                                LexTextStrings.ksError);
            }
            return(true);
        }
Exemplo n.º 7
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Handle a click on the Help button
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private void m_btnHelp_Click(object sender, System.EventArgs e)
        {
            switch (m_eExportType)
            {
            case FileType.OXES:
                ShowHelp.ShowHelpTopic(m_helpTopicProvider, "khtpExportXML");
                break;

            case FileType.XHTML:
                ShowHelp.ShowHelpTopic(m_helpTopicProvider, "khtpExportXHTML");
                break;

            case FileType.ODT:
                // TODO: Write ODT help
                ShowHelp.ShowHelpTopic(m_helpTopicProvider, "khtpExportODT");
                break;

            case FileType.PDF:
                // TODO: Write PDF help
                ShowHelp.ShowHelpTopic(m_helpTopicProvider, "khtpExportPDF");
                break;

            default:
                ShowHelp.ShowHelpTopic(m_helpTopicProvider, "khtpExportXML");
                break;
            }
        }
Exemplo n.º 8
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Open the help window when the help button is pressed.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// ------------------------------------------------------------------------------------
        private void btnHelp_Click(object sender, System.EventArgs e)
        {
            string helpTopicKey = null;

            switch (tabOptions.SelectedIndex)
            {
            case kDraftViewTab:
                helpTopicKey = "khtpOptionsDraftView";
                break;

            case kStylesTab:
                helpTopicKey = "khtpOptionsStyle";
                break;

            case kGeneralTab:
                helpTopicKey = "khtpOptionsGeneral";
                break;

            case kInterfaceTab:
                helpTopicKey = "khtpOptionsInterface";
                break;

            case kAdvancedTab:
                helpTopicKey = "khtpOptionsAdvanced";
                break;
            }

            ShowHelp.ShowHelpTopic(m_helpTopicProvider, helpTopicKey);
        }
Exemplo n.º 9
0
        static void Main(string[] args)
        {
            UserInterface.Init();
            var showHelpAction = new ShowHelp(null, null, null, null, 0, "-h", "--help");

            if (args.Length > 0)
            {
                if (showHelpAction.MatchesIdentifier(args[0]))
                {
                    showHelpAction.Run();
                }
                else if (args[0] == "-e" || args[0] == "--export")
                {
                    ExportAction();
                }

                else if ((args[0] == "-s" || args[0] == "--start-work") && args.Length == 2)
                {
                    StartWork(args[1]);
                }
            }
            else
            {
                UserInteraction();
            }

            return;
        }
Exemplo n.º 10
0
 private void m_btnHelp_Click(object sender, EventArgs e)
 {
     if (m_mediator == null)
     {
         return;
     }
     ShowHelp.ShowHelpTopic(m_mediator.HelpTopicProvider, s_helpTopic);
 }
 private void m_bnHelp_Click(object sender, EventArgs e)
 {
     if (m_mediator.PropertyTable.GetStringProperty("currentContentControl", null).Substring(0, 7) == "natural")
     {
         m_helpTopic = "khtpChoose-Phonemes";
     }
     ShowHelp.ShowHelpTopic(m_mediator.HelpTopicProvider, m_helpTopic);
 }
Exemplo n.º 12
0
 private void m_btnHelp_Click(object sender, EventArgs e)
 {
     if (m_mediator == null)
     {
         return;
     }
     ShowHelp.ShowHelpTopic(m_propertyTable.GetValue <IHelpTopicProvider>("HelpTopicProvider"), s_helpTopic);
 }
Exemplo n.º 13
0
 /// <summary>
 /// Registers a help element.
 /// </summary>
 /// <param name="listener">The element to register</param>
 /// <returns>If the element was succesfully registered</returns>
 public bool AddListener(ShowHelp listener)
 {
     if (_helpListeners.Contains(listener))
         return false;
     _helpListeners.Add(listener);
     if (_helpShown)
         listener.Show();
     return true;
 }
Exemplo n.º 14
0
 private void PreviewPrintVia_KeyUp(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.KeyCode == Keys.F1)
         {
             ShowHelp.ShowHelpTopic(this, _helpTopic, Common.IsUnixOS(), true);
         }
     }
     catch { }
 }
Exemplo n.º 15
0
 /// <summary>
 /// Display AnotherClause dialog help here.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void m_helpButton_Click(object sender, EventArgs e)
 {
     if (this.Text.Equals(DiscourseStrings.ksAdvDlgPreposeCaption))
     {
         ShowHelp.ShowHelpTopic(FwApp.App, "khtpAnotherClausePrepose");
     }
     else
     {
         ShowHelp.ShowHelpTopic(FwApp.App, "khtpAnotherClausePostposed");
     }
 }
Exemplo n.º 16
0
 private void PreviewPrintVia_Load(object sender, EventArgs e)
 {
     _isUnixOs = Common.IsUnixOS();
     CreateColumn();
     LoadGridValues(sender);
     ShowHelp.ShowHelpTopic(this, _helpTopic, _isUnixOs, false);
     CreateToolTip();
     btnEdit.Visible     = _showEdit;
     btnPrevious.Visible = false;
     btnNext.Visible     = false;
     ShowPreview(1);
 }
Exemplo n.º 17
0
        private void FormHelpClick(object sender, EventArgs e)
        {
            // grab the correct help topic for each tab and use it
            string helpTopic = "khtpProjectProperties_WritingSystem";

            switch (_tabControl.SelectedIndex)
            {
            case 0:
            {
                helpTopic = "khtpWsGeneral";
                break;
            }

            case 1:
            {
                helpTopic = "khtpWsFonts";
                break;
            }

            case 2:
            {
                helpTopic = "khtpWsKeyboard";
                break;
            }

            case 3:
            {
                helpTopic = "khtpWsSorting";
                break;
            }

            case 4:
            {
                helpTopic = "khtpWsPUACharacters";
                break;
            }

            case 5:
            {
                helpTopic = "khtpWsNumbers";
                break;
            }

            case 6:
            {
                helpTopic = "khtpWsConverters";
                break;
            }
            }
            ShowHelp.ShowHelpTopic(_helpTopicProvider, "UserHelpFile", helpTopic);
        }
Exemplo n.º 18
0
 public ConsoleRun(string[] args, ShowHelp showHelp)
 {
     Args                    = args;
     this.showHelp           = showHelp;
     pattern.ContainCode     = true;
     pattern.SplitString     = " ";
     pattern.CodeSplitString = ",";
     pattern.CodeSplitType   = BuildType.None;
     pattern.Sort            = new List <int> {
         2, 1, 3
     };
     pattern.ContainRank = false;
     LoadImeList();
 }
Exemplo n.º 19
0
        private void ShowHelpTopic(object sender, EventArgs e)
        {
            CheckDisposed();
            string areaName = m_mediator.PropertyTable.GetStringProperty("areaChoice", null);

            if (areaName == "textsWords")
            {
                ShowHelp.ShowHelpTopic(m_mediator.HelpTopicProvider, "khtpField-notebookEdit-InterlinearEdit-RnGenericRec-Participants");
            }
            else
            {
                ShowHelp.ShowHelpTopic(m_mediator.HelpTopicProvider, "khtpField-notebookEdit-CustomSlice-RnGenericRec-Participants");
            }
        }
Exemplo n.º 20
0
 protected override void HandleChooser()
 {
     Debug.Assert(m_obj.ClassID == LexEntryTags.kClassId);
     using (LinkEntryOrSenseDlg dlg = new LinkEntryOrSenseDlg())
     {
         ILexEntry le = m_obj as ILexEntry;
         dlg.SetDlgInfo(m_obj.Cache, m_mediator, le);
         String str = ShowHelp.RemoveSpaces(this.Slice.Label);
         dlg.SetHelpTopic("khtpChooseLexicalEntryOrSense-" + str);
         if (dlg.ShowDialog(FindForm()) == DialogResult.OK)
         {
             AddItem(dlg.SelectedObject);
         }
     }
 }
Exemplo n.º 21
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Handles the Click event of the m_btnHelp control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event
        /// data.</param>
        /// ------------------------------------------------------------------------------------
        private void m_btnHelp_Click(object sender, EventArgs e)
        {
            string helpTopic;

            if (sender == helpToolStripMenuItem)
            {
                helpTopic = string.Format("style:{0}", m_lstStyles.SelectedItem);
            }
            else
            {
                helpTopic = "kstidApplyStyleDialog";
            }

            ShowHelp.ShowHelpTopic(m_helpTopicProvider, helpTopic);
        }
Exemplo n.º 22
0
 public void OnHelp(object sender, EventArgs args)
 {
     CheckDisposed();
     if (HelpId == "LexSenseReferences")
     {
         ShowHelp.ShowHelpTopic(m_mediator.HelpTopicProvider, "khtpFieldLexSenseLexicalRelations");
     }
     else if (HelpId == "LexEntryReferences")
     {
         ShowHelp.ShowHelpTopic(m_mediator.HelpTopicProvider, "khtpFieldLexEntryCrossReference");
     }
     else
     {
         Debug.Assert(false, "Tried to show help for a LexReferenceMultiSlice that does not have an associated Help Topic ID");
     }
 }
Exemplo n.º 23
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Open the help window when the help button is pressed.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// ------------------------------------------------------------------------------------
        private void m_btnHelp_Click(object sender, System.EventArgs e)
        {
            string helpTopicKey = null;

            switch (tabControl1.SelectedIndex)
            {
            case kChapterVerseNumTab:
                helpTopicKey = "khtpScrProp-ChapterVerseNum";
                break;

            case kFootnotesTab:
                helpTopicKey = "khtpScrProp-Footnotes";
                break;
            }

            ShowHelp.ShowHelpTopic(m_helpTopicProvider, helpTopicKey);
        }
Exemplo n.º 24
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Handle Help button click. Show Help.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// ------------------------------------------------------------------------------------
        private void m_btnHelp_Click(object sender, EventArgs e)
        {
            string topicKey = null;

            switch (m_tabControl.SelectedIndex)
            {
            case kGeneralTab:
                topicKey = "khtpProjectProperties_General";
                break;

            case kExternalLinksTab:
                topicKey = "khtpProjectProperties_ExternalLinks";
                break;

            case kSharingTab:
                topicKey = "khtpProjectProperties_Sharing";
                break;
            }

            ShowHelp.ShowHelpTopic(m_helpTopicProvider, "UserHelpFile", topicKey);
        }
Exemplo n.º 25
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();
            }
        }
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Handles the Click event of the btnHelp control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
 /// ------------------------------------------------------------------------------------
 private void btnHelp_Click(object sender, EventArgs e)
 {
     ShowHelp.ShowHelpTopic(m_helpTopicProvider, "khtpAnnotationForIgnoredInconsistency");
 }
Exemplo n.º 27
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Display Help
 /// </summary>
 /// ------------------------------------------------------------------------------------
 protected virtual void btnHelp_Click(object sender, System.EventArgs e)
 {
     ShowHelp.ShowHelpTopic(m_helptopicProvider, m_helpTopicKey);
 }
Exemplo n.º 28
0
 /// <summary>
 /// Unregisters a help element.
 /// </summary>
 /// <param name="listener">The element to unregister</param>
 /// <returns>If the element was succesfully unregistered</returns>
 public bool RemoveListener(ShowHelp listener)
 {
     if (!_helpListeners.Contains(listener))
         return false;
     _helpListeners.Remove(listener);
     if (!_helpShown)
         listener.Hide();
     return true;
 }
Exemplo n.º 29
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Handles the Click event of the btnHelp control.
 /// </summary>
 /// ------------------------------------------------------------------------------------
 private void btnHelp_Click(object sender, EventArgs e)
 {
     ShowHelp.ShowHelpTopic(m_helpTopicProvider, "khtpScrProp-FootnoteSequenceOptions");
 }
Exemplo n.º 30
0
 private void m_btnHelp_Click(object sender, System.EventArgs e)
 {
     ShowHelp.ShowHelpTopic(m_helpTopicProvider, sHelpTopic);
 }
Exemplo n.º 31
0
        /// <summary>
        /// Override method to handle launching of a chooser for selecting lexical entries or senses.
        /// </summary>
        protected override void HandleChooser()
        {
            if (m_flid == LexEntryRefTags.kflidComponentLexemes)
            {
                using (LinkEntryOrSenseDlg dlg = new LinkEntryOrSenseDlg())
                {
                    ILexEntry le = null;
                    if (m_obj.ClassID == LexEntryTags.kClassId)
                    {
                        // filter this entry from the list.
                        le = m_obj as ILexEntry;
                    }
                    else
                    {
                        // assume the owner is the entry (e.g. owner of LexEntryRef)
                        le = m_obj.OwnerOfClass <ILexEntry>();
                    }
                    dlg.SetDlgInfo(m_cache, m_mediator, m_propertyTable, le);
                    String str = ShowHelp.RemoveSpaces(this.Slice.Label);
                    dlg.SetHelpTopic("khtpChooseLexicalEntryOrSense-" + str);
                    if (dlg.ShowDialog(FindForm()) == DialogResult.OK)
                    {
                        AddItem(dlg.SelectedObject);
                    }
                }
            }
            else if (m_flid == LexEntryRefTags.kflidPrimaryLexemes)
            {
                string displayWs = "analysis vernacular";
                if (m_configurationNode != null)
                {
                    XmlNode node = m_configurationNode.SelectSingleNode("deParams");
                    if (node != null)
                    {
                        displayWs = XmlUtils.GetAttributeValue(node, "ws", "analysis vernacular").ToLower();
                    }
                }
                ILexEntryRef ler = m_obj as ILexEntryRef;
                Debug.Assert(ler != null);
                var labels = ObjectLabel.CreateObjectLabels(m_cache, ler.ComponentLexemesRS.Cast <ICmObject>(),
                                                            m_displayNameProperty, displayWs);
                using (ReallySimpleListChooser chooser = new ReallySimpleListChooser(null,
                                                                                     labels, "PrimaryLexemes", m_cache, ler.PrimaryLexemesRS.Cast <ICmObject>(),
                                                                                     false, m_propertyTable.GetValue <IHelpTopicProvider>("HelpTopicProvider")))
                {
                    chooser.HideDisplayUsageCheckBox();
                    chooser.SetObjectAndFlid(m_obj.Hvo, m_flid);                        // may set TextParamHvo
                    chooser.Text = LexEdStrings.ksChooseWhereToShowSubentry;
                    chooser.SetHelpTopic(Slice.GetChooserHelpTopicID());
                    chooser.InitializeExtras(null, Mediator, m_propertyTable);
                    chooser.AddLink(LexEdStrings.ksAddAComponent, ReallySimpleListChooser.LinkType.kDialogLink,
                                    new AddPrimaryLexemeChooserCommand(m_cache, false, null, m_mediator, m_propertyTable, m_obj, FindForm()));
                    DialogResult res = chooser.ShowDialog();
                    if (DialogResult.Cancel == res)
                    {
                        return;
                    }
                    if (chooser.ChosenObjects != null)
                    {
                        SetItems(chooser.ChosenObjects);
                    }
                }
            }
            else
            {
                string fieldName = m_obj.Cache.MetaDataCacheAccessor.GetFieldName(m_flid);
                Debug.Assert(m_obj is ILexEntry || m_obj is ILexSense);
                switch (fieldName)
                {
                case "ComplexFormEntries":
                    using (var dlg = new EntryGoDlg())
                    {
                        dlg.StartingEntry = m_obj as ILexEntry ?? (m_obj as ILexSense).Entry;
                        dlg.SetDlgInfo(m_cache, null, m_mediator, m_propertyTable);
                        String str = ShowHelp.RemoveSpaces(Slice.Label);
                        dlg.SetHelpTopic("khtpChooseComplexFormEntryOrSense-" + str);
                        dlg.SetOkButtonText(LexEdStrings.ksMakeComponentOf);
                        if (dlg.ShowDialog(FindForm()) == DialogResult.OK)
                        {
                            try
                            {
                                UndoableUnitOfWorkHelper.Do(LexEdStrings.ksUndoAddComplexForm, LexEdStrings.ksRedoAddComplexForm,
                                                            m_obj.Cache.ActionHandlerAccessor,
                                                            () => ((ILexEntry)dlg.SelectedObject).AddComponent(m_obj));
                            }
                            catch (ArgumentException)
                            {
                                MessageBoxes.ReportLexEntryCircularReference(dlg.SelectedObject, m_obj, false);
                            }
                        }
                    }
                    break;

                case "VisibleComplexFormEntries":                         // obsolete?
                case "Subentries":
                    HandleChooserForBackRefs(fieldName, false);
                    break;

                case "VisibleComplexFormBackRefs":
                    HandleChooserForBackRefs(fieldName, true);
                    break;

                default:
                    Debug.Fail("EntrySequenceReferenceLauncher should only be used for variants, components, or complex forms");
                    break;
                }
            }
        }
Exemplo n.º 32
0
 private void m_bnHelp_Click(object sender, System.EventArgs e)
 {
     ShowHelp.ShowHelpTopic(FwApp.App, m_helpTopic);
 }