コード例 #1
0
        private void hideTaskBarcheckBox_Click(object sender, EventArgs e)
        {
            MainForm.TaskBar.Visible = hideTaskBarCheckBox.Checked ? false : true;

            //show status bar
            StylesClass.SaveSetting("Settings/UserSettings/General/HideTaskBar", hideTaskBarCheckBox.Checked.ToString());
        }
コード例 #2
0
        private void showStatusBarCheckBox_Click(object sender, EventArgs e)
        {
            MainForm.StatusBar.Visible = showStatusBarCheckBox.Checked ? true : false;

            //show status bar
            StylesClass.SaveSetting("Settings/UserSettings/General/ShowStatusBar", showStatusBarCheckBox.Checked.ToString());
        }
コード例 #3
0
        private void themeRadioButton_CheckedChanged(object sender, EventArgs e)
        {
            if ((sender as RadioButton).Checked == false)
            {
                return;
            }
            switch ((sender as RadioButton).Name)
            {
            case "defaultThemeRadioButton":
            {
                foreach (TabPage tabpage in TabControlClass.TabControl.TabPages)
                {
                    TextArea textArea = (tabpage.Controls[0] as MyRichTextBox).TextArea;
                    textArea.DefaultLanguageColor = Color.Black;
                    textArea.BackColor            = Color.White;
                    textArea.TriggerTextAreaStyle(textArea.Language);
                }


                StylesClass.SaveSetting("Settings/UserSettings/General/Theme", "Default");
                break;
            }

            case "darkThemeRadioButton":
            {
                foreach (TabPage tabpage in TabControlClass.TabControl.TabPages)
                {
                    TextArea textArea = (tabpage.Controls[0] as MyRichTextBox).TextArea;
                    textArea.DefaultLanguageColor = Color.White;
                    textArea.BackColor            = Color.Black;
                    textArea.TriggerTextAreaStyle(textArea.Language);
                }


                StylesClass.SaveSetting("Settings/UserSettings/General/Theme", "Dark");
                break;
            }

            case "customThemeRadioButton":
            {
                foreach (TabPage tabpage in TabControlClass.TabControl.TabPages)
                {
                    TextArea textArea = (tabpage.Controls[0] as MyRichTextBox).TextArea;
                    textArea.DefaultLanguageColor = defaultLanguageColorButton.BackColor;
                    textArea.ClearBackColor(backColorButton.BackColor);
                    textArea.BackColor = backColorButton.BackColor;
                    textArea.TriggerTextAreaStyle(textArea.Language);
                }


                StylesClass.SaveSetting("Settings/UserSettings/General/Theme", "Custom");
                break;
            }
            }
        }
コード例 #4
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            //get controls
            StatusBar            = statusStrip;
            TaskBar              = toolStrip;
            NewButton            = newToolStripButton;
            SaveButton           = saveToolStripButton;
            OpenButton           = openToolStripButton;
            FindButton           = findToolStripButton;
            FontButton           = fontToolStripButton;
            BoldButton           = boldToolStripButton;
            ItalicButton         = italicToolStripButton;
            UnderLineButton      = underlineToolStripButton;
            CopyButton           = copyToolStripButton;
            CutButton            = cutToolStripButton;
            PasteButton          = pasteToolStripButton;
            FindAndReplaceButton = findAndReplaceToolStripButton;
            MapButton            = documentMapToolStripButton;
            ToUpperButton        = upperToolStripButton;
            VersionsButton       = versionsToolStripButton;


            //set up Task bar
            StylesClass.GetAllStylesIntoProperties();
            toolStrip.Visible                     = !StylesClass.HideTaskBar;
            statusStrip.Visible                   = StylesClass.ShowStatusBar;
            newToolStripButton.Visible            = StylesClass.ShowNewIcon;
            openToolStripButton.Visible           = StylesClass.ShowOpenIcon;
            saveToolStripButton.Visible           = StylesClass.ShowSaveIcon;
            documentMapToolStripButton.Visible    = StylesClass.ShowDocumentMapIcon;
            findToolStripButton.Visible           = StylesClass.ShowFindIcon;
            findAndReplaceToolStripButton.Visible = StylesClass.ShowFindAndReplaceIcon;
            upperToolStripButton.Visible          = StylesClass.ShowToUpperIcon;
            versionsToolStripButton.Visible       = StylesClass.ShowVersionsIcon;
            copyToolStripButton.Visible           = StylesClass.ShowCopyIcon;
            cutToolStripButton.Visible            = StylesClass.ShowCutIcon;
            pasteToolStripButton.Visible          = StylesClass.ShowPasteIcon;
            fontToolStripButton.Visible           = StylesClass.ShowFontIcon;
            boldToolStripButton.Visible           = StylesClass.ShowBoldIcon;
            italicToolStripButton.Visible         = StylesClass.ShowItalicIcon;
            underlineToolStripButton.Visible      = StylesClass.ShowUnderLineIcon;

            //Setup Tab Control
            TabControlClass.SetupTabControl(tabControl);

            //just create a new tab page
            TabControlClass.CreateNewTabPage("New Tab 1");


            textLengthStatusLabel.Text = "TextLength: 0";
            lineNumberStatusLabel.Text = "LineNumber: 0";

            SetupLanguageToolStripMenuItem(StylesClass.DefaultLanguage);
        }
コード例 #5
0
        private void bookmarkMarginBackColorButton_Click(object sender, EventArgs e)
        {
            ShowColorDialog((Button)sender);
            foreach (TabPage tabPage in TabControlClass.TabControl.TabPages)
            {
                TextArea textArea = (tabPage.Controls[0] as MyRichTextBox).TextArea;
                textArea.BookMarkMargin.BackColor = bookmarkMarginBackColorButton.BackColor;
            }

            //save to xml
            StylesClass.SaveSetting("Settings/UserSettings//BookmarkMargin/BackColor", (sender as Button).BackColor.ToArgb().ToString());
        }
コード例 #6
0
        private void commentBlocksColorButton_Click(object sender, EventArgs e)
        {
            ShowColorDialog((Button)sender);
            foreach (TabPage tabPage in TabControlClass.TabControl.TabPages)
            {
                TextArea textArea = (tabPage.Controls[0] as MyRichTextBox).TextArea;
                textArea.CommentBlocksColor = commentBlocksColorButton.BackColor;
                textArea.TriggerTextAreaStyle(textArea.Language);
            }

            //save to xml
            StylesClass.SaveSetting("Settings/UserSettings/TextArea/CommentBlocksColor", (sender as Button).BackColor.ToArgb().ToString());
        }
コード例 #7
0
        private void numberMarginForeColorButton_Click(object sender, EventArgs e)
        {
            ShowColorDialog((Button)sender);
            foreach (TabPage tabPage in TabControlClass.TabControl.TabPages)
            {
                TextArea textArea = (tabPage.Controls[0] as MyRichTextBox).TextArea;
                textArea.NumberMargin.NumberBrush = new SolidBrush(numberMarginForeColorButton.BackColor);
                textArea.NumberMargin.Refresh();
            }

            //save to xml
            StylesClass.SaveSetting("Settings/UserSettings/NumberMargin/ForeColor", (sender as Button).BackColor.ToArgb().ToString());
        }
コード例 #8
0
        private void backColorDialogButton_Click(object sender, EventArgs e)
        {
            ShowColorDialog((Button)sender);
            //if (customThemeRadioButton.Checked == false) return;
            foreach (TabPage tabPage in TabControlClass.TabControl.TabPages)
            {
                TextArea textArea = (tabPage.Controls[0] as MyRichTextBox).TextArea;
                textArea.BackColor = backColorButton.BackColor;
                textArea.ClearBackColor(backColorButton.BackColor);
            }

            //save to xml
            StylesClass.SaveSetting("Settings/UserSettings/General/BackColor", backColorButton.BackColor.ToArgb().ToString());
        }
コード例 #9
0
        /// <summary>
        /// Init all stuffs
        /// </summary>
        /// <param name="textBox"></param>
        public static void InitAllStuffs(MyRichTextBox textBox, TabControl tabControl)
        {
            StylesClass.GetAllStylesIntoProperties();

            //init basic text area color
            textBox.TextArea.Language             = StylesClass.DefaultLanguage;
            textBox.TextArea.DefaultLanguageColor = StylesClass.DefaultLanguageColor;
            textBox.TextArea.StringsColor         = StylesClass.StringsColor;
            textBox.TextArea.KeyWordsColor        = StylesClass.KeywordsColor;
            textBox.TextArea.CommentLinesColor    = StylesClass.CommentLinesColor;
            textBox.TextArea.CommentBlocksColor   = StylesClass.CommentBlocksColor;
            if (StylesClass.Theme == "Default")
            {
                textBox.TextArea.DefaultLanguageColor = Color.Black;
                textBox.TextArea.BackColor            = Color.White;
            }
            else
            {
                if (StylesClass.Theme == "Dark")
                {
                    textBox.TextArea.DefaultLanguageColor = Color.White;
                    textBox.TextArea.BackColor            = Color.Black;
                }
                else
                {
                    textBox.TextArea.BackColor = StylesClass.BackColor;
                }
            }

            //init auto numbering
            textBox.NumberMargin.AutoNumbering(true);

            //init book mark
            textBox.BookMarkMargin.AutoBookMark(true);

            textBox.DocumentMap.AutoDocumentMap(false);
            //textBox.DocumentMap.AutoDocumentMap(true);

            //Allow drap and drop file into text area
            InitDragDropFile(textBox, tabControl);

            //mark a "*" in a tab page if the text in text area changed
            //this will allow us to know whether this tab page is saved or not
            MarkTabPageOnTextChange(textBox, tabControl);
        }
コード例 #10
0
 private void defaultLaguageComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     StylesClass.SaveSetting("Settings/UserSettings/TextArea/DefaultLanguage", defaultLaguageComboBox.SelectedItem.ToString());
 }
コード例 #11
0
 private void copyCheckBox_Click(object sender, EventArgs e)
 {
     MainForm.CopyButton.Visible = copyCheckBox.Checked ? true : false;
     StylesClass.SaveSetting("Settings/UserSettings/General/Copy", copyCheckBox.Checked.ToString());
 }
コード例 #12
0
        private void openCheckBox_Click(object sender, EventArgs e)
        {
            MainForm.OpenButton.Visible = openCheckBox.Checked ? true : false;

            StylesClass.SaveSetting("Settings/UserSettings/General/Open", openCheckBox.Checked.ToString());
        }
コード例 #13
0
        private void newCheckBox_Click(object sender, EventArgs e)
        {
            MainForm.NewButton.Visible = newCheckBox.Checked ? true : false;

            StylesClass.SaveSetting("Settings/UserSettings/General/New", newCheckBox.Checked.ToString());
        }
コード例 #14
0
 private void underlineCheckBox_CheckedChanged(object sender, EventArgs e)
 {
     MainForm.UnderLineButton.Visible = underlineCheckBox.Checked ? true : false;
     StylesClass.SaveSetting("Settings/UserSettings/General/Underline", underlineCheckBox.Checked.ToString());
 }
コード例 #15
0
 private void documentMapCheckBox_Click(object sender, EventArgs e)
 {
     MainForm.MapButton.Visible = documentMapCheckBox.Checked ? true : false;
     StylesClass.SaveSetting("Settings/UserSettings/General/DocumentMap", documentMapCheckBox.Checked.ToString());
 }
コード例 #16
0
 private void boldCheckBox_Click(object sender, EventArgs e)
 {
     MainForm.BoldButton.Visible = boldCheckBox.Checked ? true : false;
     StylesClass.SaveSetting("Settings/UserSettings/General/Bold", boldCheckBox.Checked.ToString());
 }
コード例 #17
0
 private void italicCheckBox_Click(object sender, EventArgs e)
 {
     MainForm.ItalicButton.Visible = italicCheckBox.Checked ? true : false;
     StylesClass.SaveSetting("Settings/UserSettings/General/Italic", italicCheckBox.Checked.ToString());
 }
コード例 #18
0
 private void fontCheckBox_Click(object sender, EventArgs e)
 {
     MainForm.FontButton.Visible = fontCheckBox.Checked ? true : false;
     StylesClass.SaveSetting("Settings/UserSettings/General/Font", fontCheckBox.Checked.ToString());
 }
コード例 #19
0
 private void pasteCheckBox_Click(object sender, EventArgs e)
 {
     MainForm.PasteButton.Visible = pasteCheckBox.Checked ? true : false;
     StylesClass.SaveSetting("Settings/UserSettings/General/Paste", pasteCheckBox.Checked.ToString());
 }
コード例 #20
0
        private void findAndReplaceCheckBox_Click(object sender, EventArgs e)
        {
            MainForm.FindAndReplaceButton.Visible = findAndReplaceCheckBox.Checked ? true : false;

            StylesClass.SaveSetting("Settings/UserSettings/General/FindAndReplace", findAndReplaceCheckBox.Checked.ToString());
        }
コード例 #21
0
 private void versionsCheckBox_Click(object sender, EventArgs e)
 {
     MainForm.VersionsButton.Visible = versionsCheckBox.Checked ? true : false;
     StylesClass.SaveSetting("Settings/UserSettings/General/Versions", versionsCheckBox.Checked.ToString());
 }
コード例 #22
0
 private void upperCheckBox_Click(object sender, EventArgs e)
 {
     MainForm.ToUpperButton.Visible = upperCheckBox.Checked ? true : false;
     StylesClass.SaveSetting("Settings/UserSettings/General/ToUpper", upperCheckBox.Checked.ToString());
 }