Опция "Режим автозавершения кода включен при запуске" в настройках

This commit is contained in:
Mikhalkovich Stanislav 2019-08-03 14:17:02 +03:00
parent aa54a7eadd
commit 3525b7b15e
10 changed files with 156 additions and 119 deletions

View file

@ -240,6 +240,7 @@ namespace VisualPascalABCPlugins
bool HighlightOperatorBrackets { get; set; }
bool UseDllForSystemUnits { get; set; }
bool PABCDllChecked { get; set; }
bool AutoInsertCodeIsEnabledOnStartup { get; set; }
}
public interface IListItem

View file

@ -370,9 +370,9 @@ namespace VisualPascalABC
private void Form1_Load(object sender, EventArgs e)
{
// Автовставка кода по умолчанию включена
tsAutoInsertCode.Checked = true;
mAUTOINSERTToolStripMenuItem.Checked = true;
// Автовставка кода по умолчанию включена. Отключил это - теперь сохраняется в настройках!
//tsAutoInsertCode.Checked = true;
//mAUTOINSERTToolStripMenuItem.Checked = true;
//CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea.KeyEventHandler += TextArea_KeyEventHandler;

View file

@ -78,7 +78,7 @@ namespace VisualPascalABC.OptionsContent
cbConvertTabsToSpaces.Checked = MainForm.UserOptions.ConverTabsToSpaces;
cbEnableMatchOperBrackets.Checked = MainForm.UserOptions.HighlightOperatorBrackets;
nudTabIndent.Value = MainForm.UserOptions.TabIndent;
cbSkipStakTraceItemIfSourceFileInSystemDirectory.Checked = !MainForm.UserOptions.SkipStakTraceItemIfSourceFileInSystemDirectory;
cbSkipStakTraceItemIfSourceFileInSystemDirectory.Checked = !MainForm.UserOptions.SkipStackTraceItemIfSourceFileInSystemDirectory;
//cbErrorPos.Items.Clear();
//AddcbErrorPosItem(SourceLocationAction.GotoBeg, strprefix + "EP_BEGIN");
//AddcbErrorPosItem(SourceLocationAction.GotoEnd, strprefix + "EP_END");
@ -119,7 +119,7 @@ namespace VisualPascalABC.OptionsContent
MainForm.UserOptions.CurrentFontFamily = fcbFont.SelectedItem as string;
}
MainForm.UserOptions.EditorFontSize = Convert.ToInt32(cbEditorFontSize.Text);
MainForm.UserOptions.SkipStakTraceItemIfSourceFileInSystemDirectory = !cbSkipStakTraceItemIfSourceFileInSystemDirectory.Checked;
MainForm.UserOptions.SkipStackTraceItemIfSourceFileInSystemDirectory = !cbSkipStakTraceItemIfSourceFileInSystemDirectory.Checked;
MainForm.UpdateUserOptions();
WorkbenchServiceFactory.OptionsService.SaveOptions();
alreadyShown = false;

View file

@ -35,6 +35,7 @@
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.languageSelect = new System.Windows.Forms.ComboBox();
this.cbAutoInsertCodeIsEnabledOnStartup = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// cbSaveFilesIfComilationOk
@ -71,7 +72,7 @@
this.cbShowDebugPlayPauseButtons.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.cbShowDebugPlayPauseButtons.Checked = true;
this.cbShowDebugPlayPauseButtons.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbShowDebugPlayPauseButtons.Location = new System.Drawing.Point(7, 151);
this.cbShowDebugPlayPauseButtons.Location = new System.Drawing.Point(7, 174);
this.cbShowDebugPlayPauseButtons.Name = "cbShowDebugPlayPauseButtons";
this.cbShowDebugPlayPauseButtons.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.cbShowDebugPlayPauseButtons.Size = new System.Drawing.Size(237, 17);
@ -118,10 +119,23 @@
this.languageSelect.TabIndex = 18;
this.languageSelect.SelectedIndexChanged += new System.EventHandler(this.languageSelect_SelectedIndexChanged);
//
// cbAutoInsertCodeIsEnabledOnStartup
//
this.cbAutoInsertCodeIsEnabledOnStartup.AutoSize = true;
this.cbAutoInsertCodeIsEnabledOnStartup.Checked = true;
this.cbAutoInsertCodeIsEnabledOnStartup.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbAutoInsertCodeIsEnabledOnStartup.Location = new System.Drawing.Point(7, 151);
this.cbAutoInsertCodeIsEnabledOnStartup.Name = "cbAutoInsertCodeIsEnabledOnStartup";
this.cbAutoInsertCodeIsEnabledOnStartup.Size = new System.Drawing.Size(353, 17);
this.cbAutoInsertCodeIsEnabledOnStartup.TabIndex = 26;
this.cbAutoInsertCodeIsEnabledOnStartup.Text = "AUTO_INSERT_CODE_IS_ENABLED_ON_STARTUP";
this.cbAutoInsertCodeIsEnabledOnStartup.UseVisualStyleBackColor = true;
//
// ViewOptionsContent
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.cbAutoInsertCodeIsEnabledOnStartup);
this.Controls.Add(this.cbSaveFilesIfComilationOk);
this.Controls.Add(this.cbPauseInRunModeIfConsole);
this.Controls.Add(this.cbShowDebugPlayPauseButtons);
@ -133,6 +147,7 @@
this.Size = new System.Drawing.Size(495, 246);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
@ -144,5 +159,6 @@
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox languageSelect;
private System.Windows.Forms.CheckBox cbAutoInsertCodeIsEnabledOnStartup;
}
}

View file

@ -62,6 +62,7 @@ namespace VisualPascalABC.OptionsContent
languageSelect.SelectedItem = PascalABCCompiler.StringResourcesLanguage.CurrentLanguageName;
cbSaveFilesIfComilationOk.Checked = MainForm.UserOptions.SaveSourceFilesIfComilationOk;
cbPauseInRunModeIfConsole.Checked = MainForm.UserOptions.PauseInRunModeIfConsole;
cbAutoInsertCodeIsEnabledOnStartup.Checked = MainForm.UserOptions.AutoInsertCodeIsEnabledOnStartup;
addErrorStrategyComboBox();
cbShowDebugPlayPauseButtons.Checked = MainForm.PlayPauseButtonsVisibleInPanel;
@ -71,6 +72,7 @@ namespace VisualPascalABC.OptionsContent
case OptionsContentAction.Ok:
UserOptions UsOpt = MainForm.UserOptions;
UsOpt.SaveSourceFilesIfComilationOk = cbSaveFilesIfComilationOk.Checked;
UsOpt.AutoInsertCodeIsEnabledOnStartup = cbAutoInsertCodeIsEnabledOnStartup.Checked;
MainForm.ErrorsManager.Strategy = (ErrorsStrategy)cbErrorsStrategy.Items.IndexOf(cbErrorsStrategy.SelectedItem);
switch (cbErrorsStrategy.Items.IndexOf(cbErrorsStrategy.SelectedItem))
{

View file

@ -112,9 +112,9 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -32,12 +32,13 @@ namespace VisualPascalABC
public bool EnableSmartIntellisense = false;
public bool ShowQuickClassBrowserPanel = false;
public bool AllowCodeFormatting = false;
public bool SkipStakTraceItemIfSourceFileInSystemDirectory = true;
public bool SkipStackTraceItemIfSourceFileInSystemDirectory = true;
public bool AlwaysAttachDebuggerAtStart = false;
public string CurrentFontFamily = "Courier New";
public bool HighlightOperatorBrackets=true;
public bool UseDllForSystemUnits = true;
public bool PABCDllChecked = false;
public bool AutoInsertCodeIsEnabledOnStartup = true;
public bool DeleteEXEAfterExecute
{
@ -195,6 +196,12 @@ namespace VisualPascalABC
set { SaveSourceFilesIfComilationOk = value; }
}
bool VisualPascalABCPlugins.IUserOptions.AutoInsertCodeIsEnabledOnStartup
{
get { return AutoInsertCodeIsEnabledOnStartup; }
set { AutoInsertCodeIsEnabledOnStartup = value; }
}
bool VisualPascalABCPlugins.IUserOptions.ShowCompletionInfoByGroup
{
get { return ShowCompletionInfoByGroup; }
@ -221,8 +228,8 @@ namespace VisualPascalABC
bool VisualPascalABCPlugins.IUserOptions.SkipStakTraceItemIfSourceFileInSystemDirectory
{
get { return SkipStakTraceItemIfSourceFileInSystemDirectory; }
set { SkipStakTraceItemIfSourceFileInSystemDirectory = value; }
get { return SkipStackTraceItemIfSourceFileInSystemDirectory; }
set { SkipStackTraceItemIfSourceFileInSystemDirectory = value; }
}
int VisualPascalABCPlugins.IUserOptions.TabIndent

View file

@ -58,12 +58,13 @@ namespace VisualPascalABC
private string OptionsItemNameDockLeftPortion = "DockLeftPortion";
private string OptionsItemNameDockRightPortion = "DockRightPortion";
private string OptionsItemNameShowQuickClassBrowserPanel = "ShowQuickClassBrowserPanel";
private string OptionsItemNameSkipStakTraceItemIfSourceFileInSystemDirectory = "SkipStakTraceItemIfSourceFileInSystemDirectory";
private string OptionsItemNameSkipStackTraceItemIfSourceFileInSystemDirectory = "SkipStakTraceItemIfSourceFileInSystemDirectory";
private string OptionsItemNameShowFoundedNamesTab = "ShowFoundedNamesTab";
private string OptionsItemNameShowWatchTab = "ShowWatchTab";
private string OptionsItemNameShowLocalVarsTab = "ShowLocalVarsTab";
private string OptionsItemUseDllForSystemModules = "UseDllForSystemModules";
private string OptionsItemPABCDllChecked = "PABCDllChecked";
private string OptionsItemNameAutoInsertCode = "AutoInsertCodeIsEnabledOnStartup";
bool _mainFormWindowStateMaximized = false;
@ -155,6 +156,13 @@ namespace VisualPascalABC
UserOptions.EnableFolding = Convert.ToBoolean(value);
if ((value = (string)Options[OptionsItemNameSaveSourceFilesIfComilationOk]) != null)
UserOptions.SaveSourceFilesIfComilationOk = Convert.ToBoolean(value);
if ((value = (string)Options[OptionsItemNameAutoInsertCode]) != null)
{
UserOptions.AutoInsertCodeIsEnabledOnStartup = Convert.ToBoolean(value);
tsAutoInsertCode.Checked = UserOptions.AutoInsertCodeIsEnabledOnStartup;
mAUTOINSERTToolStripMenuItem.Checked = UserOptions.AutoInsertCodeIsEnabledOnStartup;
}
if ((value = (string)Options[OptionsItemNameMainFormTitle]) != null)
MainFormText = value;
if ((value = (string)Options[OptionsItemNameDeleteEXEAfterExecute]) != null)
@ -215,8 +223,8 @@ namespace VisualPascalABC
UserOptions.DefaultSourceFileNameFormat = value;
if ((value = (string)Options[OptionsItemNameAllowCodeCompletion]) != null)
UserOptions.AllowCodeCompletion = Convert.ToBoolean(value);
if ((value = (string)Options[OptionsItemNameSkipStakTraceItemIfSourceFileInSystemDirectory]) != null)
UserOptions.SkipStakTraceItemIfSourceFileInSystemDirectory = Convert.ToBoolean(value);
if ((value = (string)Options[OptionsItemNameSkipStackTraceItemIfSourceFileInSystemDirectory]) != null)
UserOptions.SkipStackTraceItemIfSourceFileInSystemDirectory = Convert.ToBoolean(value);
if ((value = (string)Options[OptionsItemNameCodeCompletionNamespaceVisibleRange]) != null)
UserOptions.CodeCompletionNamespaceVisibleRange = Convert.ToInt32(value);
if ((value = (string)Options[OptionsItemNameDockBottomPortion]) != null)
@ -278,7 +286,8 @@ namespace VisualPascalABC
Options.Add(OptionsItemNameCodeCompletionNamespaceVisibleRange, UserOptions.CodeCompletionNamespaceVisibleRange);
Options.Add(OptionsItemNameSaveSourceFilesIfComilationOk, UserOptions.SaveSourceFilesIfComilationOk);
Options.Add(OptionsItemNameShowQuickClassBrowserPanel, UserOptions.ShowQuickClassBrowserPanel);
Options.Add(OptionsItemNameSkipStakTraceItemIfSourceFileInSystemDirectory, UserOptions.SkipStakTraceItemIfSourceFileInSystemDirectory);
Options.Add(OptionsItemNameSkipStackTraceItemIfSourceFileInSystemDirectory, UserOptions.SkipStackTraceItemIfSourceFileInSystemDirectory);
Options.Add(OptionsItemNameAutoInsertCode, UserOptions.AutoInsertCodeIsEnabledOnStartup);
Options.Add(OptionsItemNameConvertTabsToSpaces, UserOptions.ConverTabsToSpaces);
Options.Add(OptionsItemNameTabIdent, UserOptions.TabIndent);

View file

@ -364,6 +364,7 @@ EDITOR_OPTIONS=Editor
SHOW_DEBUG_PLAY_PAUSE_BUTTONS=Show additional debug buttons
PASUSE_IN_RUNMODE_IF_CONSOLE=Make pause after a console program ends execution
SAVE_FILES_IF_COMPILATOIN_OK=Save files if compilation was successful
AUTO_INSERT_CODE_IS_ENABLED_ON_STARTUP=Code completion mode is enabled on startup
%PREFIX%=VP_OC_EDITOROPTIONS_
NAME=Text Editor

View file

@ -364,6 +364,7 @@ EDITOR_OPTIONS=Редактор
SHOW_DEBUG_PLAY_PAUSE_BUTTONS=Показывать дополнительные кнопки управления отладкой
PASUSE_IN_RUNMODE_IF_CONSOLE=Делать паузу после завершения консольной программы
SAVE_FILES_IF_COMPILATOIN_OK=Сохранять файлы если компиляция прошла успешно
AUTO_INSERT_CODE_IS_ENABLED_ON_STARTUP=Режим автозавершения кода включён при запуске
%PREFIX%=VP_OC_EDITOROPTIONS_
NAME=Редактор