diff --git a/VisualPascalABCNET/OptionsContent/OptionsContentEngine.cs b/VisualPascalABCNET/OptionsContent/OptionsContentEngine.cs index ff619483d..d57c89427 100644 --- a/VisualPascalABCNET/OptionsContent/OptionsContentEngine.cs +++ b/VisualPascalABCNET/OptionsContent/OptionsContentEngine.cs @@ -37,6 +37,11 @@ namespace VisualPascalABC.OptionsContent } optionsWindow.ShowDialog(); } + public void UpdateOptionsForm() + { + if (optionsWindow != null) + optionsWindow.UpdateOptionsForm(); + } internal void Action(IOptionsContent content, OptionsContentAction action) { content.Action(action); diff --git a/VisualPascalABCNET/OptionsContent/OptionsForm.cs b/VisualPascalABCNET/OptionsContent/OptionsForm.cs index c23d2dad9..f48d7998b 100644 --- a/VisualPascalABCNET/OptionsContent/OptionsForm.cs +++ b/VisualPascalABCNET/OptionsContent/OptionsForm.cs @@ -45,6 +45,17 @@ namespace VisualPascalABC.OptionsContent } } + public void UpdateOptionsForm() + { + int i = 0; + foreach (IOptionsContent content in contentEngine.ContentList) + { + tvContentList.Nodes[i].Text = content.ContentName; + i++; + } + PascalABCCompiler.StringResources.SetTextForAllObjects(this, strprefix); + } + private void tvContentList_AfterSelect(object sender, TreeViewEventArgs e) { IOptionsContent cont; diff --git a/VisualPascalABCNET/OptionsContent/ViewOptionsContent.cs b/VisualPascalABCNET/OptionsContent/ViewOptionsContent.cs index cbcdf7826..cc5a47970 100644 --- a/VisualPascalABCNET/OptionsContent/ViewOptionsContent.cs +++ b/VisualPascalABCNET/OptionsContent/ViewOptionsContent.cs @@ -62,27 +62,7 @@ namespace VisualPascalABC.OptionsContent languageSelect.SelectedItem = PascalABCCompiler.StringResourcesLanguage.CurrentLanguageName; cbSaveFilesIfComilationOk.Checked = MainForm.UserOptions.SaveSourceFilesIfComilationOk; cbPauseInRunModeIfConsole.Checked = MainForm.UserOptions.PauseInRunModeIfConsole; - - - cbErrorsStrategy.Items.Clear(); - //cbErrorsStrategy.Items.Add(PascalABCCompiler.StringResources.Get(strprefix + "ES_ALL")); - cbErrorsStrategy.Items.Add(PascalABCCompiler.StringResources.Get(strprefix + "ES_FIRSTONLY")); - cbErrorsStrategy.Items.Add(PascalABCCompiler.StringResources.Get(strprefix + "ES_FIRSTSEMANTICANDSYNTAX")); - switch (MainForm.ErrorsManager.Strategy) - { - /*case ErrorsStrategy.All: - cbErrorsStrategy.SelectedItem = cbErrorsStrategy.Items[1]; - break;*/ - case ErrorsStrategy.FirstOnly: - cbErrorsStrategy.SelectedItem = cbErrorsStrategy.Items[0]; - break; - case ErrorsStrategy.FirstSemanticAndSyntax: - cbErrorsStrategy.SelectedItem = cbErrorsStrategy.Items[1]; - break; - default: - cbErrorsStrategy.SelectedItem = cbErrorsStrategy.Items[1]; - break; - } + addErrorStrategyComboBox(); cbShowDebugPlayPauseButtons.Checked = MainForm.PlayPauseButtonsVisibleInPanel; alreadyShown = true; @@ -129,10 +109,36 @@ namespace VisualPascalABC.OptionsContent } #endregion + private void addErrorStrategyComboBox() + { + cbErrorsStrategy.Items.Clear(); + //cbErrorsStrategy.Items.Add(PascalABCCompiler.StringResources.Get(strprefix + "ES_ALL")); + cbErrorsStrategy.Items.Add(PascalABCCompiler.StringResources.Get(strprefix + "ES_FIRSTONLY")); + cbErrorsStrategy.Items.Add(PascalABCCompiler.StringResources.Get(strprefix + "ES_FIRSTSEMANTICANDSYNTAX")); + switch (MainForm.ErrorsManager.Strategy) + { + /*case ErrorsStrategy.All: + cbErrorsStrategy.SelectedItem = cbErrorsStrategy.Items[1]; + break;*/ + case ErrorsStrategy.FirstOnly: + cbErrorsStrategy.SelectedItem = cbErrorsStrategy.Items[0]; + break; + case ErrorsStrategy.FirstSemanticAndSyntax: + cbErrorsStrategy.SelectedItem = cbErrorsStrategy.Items[1]; + break; + default: + cbErrorsStrategy.SelectedItem = cbErrorsStrategy.Items[1]; + break; + } + } + private void languageSelect_SelectedIndexChanged(object sender, EventArgs e) { PascalABCCompiler.StringResourcesLanguage.CurrentLanguageName = (string)languageSelect.SelectedItem; CodeCompletionParserController.CurrentTwoLetterISO = PascalABCCompiler.StringResourcesLanguage.CurrentTwoLetterISO; + PascalABCCompiler.StringResources.SetTextForAllObjects(this, strprefix); + addErrorStrategyComboBox(); + MainForm.UpdateOptionsForm(); } private void cbShowDebugPlayPauseButtons_CheckedChanged(object sender, EventArgs e) diff --git a/VisualPascalABCNET/Workbench/WindowOperations.cs b/VisualPascalABCNET/Workbench/WindowOperations.cs index 492a62807..3ce0a5766 100644 --- a/VisualPascalABCNET/Workbench/WindowOperations.cs +++ b/VisualPascalABCNET/Workbench/WindowOperations.cs @@ -125,6 +125,12 @@ namespace VisualPascalABC optionsContentEngine.AddContent(new IntelliseseOptionsContent(this)); } + public void UpdateOptionsForm() + { + if (optionsContentEngine != null) + optionsContentEngine.UpdateOptionsForm(); + } + void AddWindowToDockPanel(DockContent dc, DockPanel dp, DockStyle dockStyle, DockState dockState, bool isFloat, DockPane dockToPane, int ind) { if (dc.Visible && dc.Pane != null)