This commit is contained in:
Бондарев Иван 2018-09-06 22:02:02 +02:00
parent 3892369e38
commit 6fca05683a
4 changed files with 49 additions and 21 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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)

View file

@ -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)