bool textChangedFlag; // True means unsaved changes exist; false means file is up-to-date.

    #endregion Fields

    #region Constructors

    public SimpleWordProcessor()
        : base()
    {
        textbox = new RichTextBox();
        textbox.Parent = this;
        textbox.Dock = DockStyle.Fill;
        textbox.AcceptsTab = true;

        textbox.TextChanged += delegate(object sender, EventArgs args) {
            textChangedFlag = true;
        };

        // Display save prompt if closing with unsaved data.
        this.FormClosing += delegate(object sender, FormClosingEventArgs args) {
            if(!confirmSave())
                args.Cancel = true;
        };

        this.Text = "SimpleWordProcessor";
        this.Width = 600;
        this.Height = 480;

        fDiag = new FontDialog();
        cDiag = new ColorDialog();
        sDiag = new SaveFileDialog();
        oDiag = new OpenFileDialog();

        textChangedFlag = false;

        buildMenu();
    }
Example #2
0
	void ChangeFontButton_Click (object sender, EventArgs e)
	{
		FontDialog dialog = new FontDialog ();
		dialog.ShowDialog ();
		_richTextBox.SelectionFont = dialog.Font;
		_richTextBox.Focus ();
	}
 void OnClicked(object sender, ToolBarButtonClickEventArgs e)
 {
     FontDialog dialog = new FontDialog();
        if (dialog.ShowDialog(this) == DialogResult.OK) {
       text.Font = dialog.Font;
       LocateText();
        }
 }
        private Font ChooseFont(Font previousFont, int minSize, int maxSize)
        {
            var dialog = new FontDialog();

            dialog.Font    = previousFont;
            dialog.MinSize = minSize;
            dialog.MaxSize = maxSize;
            try
            {
                var result = dialog.ShowDialog(this);
                if (result == System.Windows.Forms.DialogResult.OK)
                {
                    return(dialog.Font);
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex);

                MessageBox.Show("This font is not supported.", "Font Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            return(previousFont);
        }
        protected override void RunButton()
        {
            Parent.Focus();

            FontDialog dlg = new FontDialog();

            dlg.Font = (Font)mOwnerPropertyEnum.Property.Value.GetValue();

            if (dlg.ShowDialog() != DialogResult.Cancel)
            {
                mOwnerPropertyEnum.Property.Value.PreviousValue = mOwnerPropertyEnum.Property.Value.GetValue();
                mOwnerPropertyEnum.Property.Value.SetValue(dlg.Font);

                if (mEdit != null)
                {
                    mEdit.Text = mOwnerPropertyEnum.Property.Value.DisplayString;
                }

                mOwnerPropertyEnum.Property.ParentGrid.NotifyPropertyChanged(new PropertyChangedEventArgs(mOwnerPropertyEnum));
            }

            mOwnerPropertyEnum.Property.ParentGrid.OnInPlaceCtrlFinishedEdition();
        }
Example #6
0
        private void textBox_Font_MouseClick(object sender, MouseEventArgs e)
        {
            FontDialog fd = new FontDialog();

            fd.Font    = new Font(_discoveryForm.theme.FontName, _discoveryForm.theme.FontSize);
            fd.MinSize = 4;
            fd.MaxSize = 12;

            if (fd.ShowDialog() == DialogResult.OK)
            {
                if (fd.Font.Style == FontStyle.Regular)
                {
                    _discoveryForm.theme.FontName = fd.Font.Name;
                    _discoveryForm.theme.FontSize = fd.Font.Size;
                    UpdatePatchesEtc();
                    _discoveryForm.ApplyTheme(true);
                }
                else
                {
                    MessageBox.Show("Font does not have regular style");
                }
            }
        }
Example #7
0
        private void fontButton_Click(object sender, System.EventArgs e)
        {
            if (EventsHandlingPaused)
            {
                return;
            }

            if (curRuler == null)
            {
                return;
            }

            FontDialog dialog = new FontDialog();

            dialog.Font = curRuler.TextFontStyle.CreateFont(view.MeasurementUnitConverter);
            if (dialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            curRuler.TextFontStyle = new NFontStyle(dialog.Font);
            view.Refresh();
        }
        private void lnkSelectFont_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            FontDialog fd = new FontDialog();

            if (fd.ShowDialog() == DialogResult.OK)
            {
                var font = fd.Font;
                _text.FontName = $"'{font.Name}'"; //NOXLATE
                if (font.Bold)
                {
                    _text.Bold = font.Bold.ToString();
                }
                if (font.Italic)
                {
                    _text.Italic = font.Italic.ToString();
                }
                if (font.Underline)
                {
                    _text.Underlined = font.Underline.ToString();
                }
                _text.Height = font.Size.ToString();
            }
        }
Example #9
0
        private void OnBtnSelListFont(object sender, EventArgs e)
        {
            FontDialog dlg = UIUtil.CreateFontDialog(false);

            AceFont fOld = Program.Config.UI.StandardFont;

            if (fOld.OverrideUIDefault)
            {
                dlg.Font = fOld.ToFont();
            }
            else
            {
                try { dlg.Font = m_tbUrlOverride.Font; }
                catch (Exception) { Debug.Assert(false); }
            }

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Program.Config.UI.StandardFont = new AceFont(dlg.Font);
                Program.Config.UI.StandardFont.OverrideUIDefault = true;
            }
            dlg.Dispose();
        }
Example #10
0
        private void buttonStateFont_Click(object sender, EventArgs e)
        {
            if (checkBoxLabels.Checked)
            {
                FontDialog fontDialog = new FontDialog();
                fontDialog.ShowColor = true;
                //fontDialog.ShowApply = true;
                fontDialog.ShowEffects = true;
                fontDialog.ShowHelp    = true;
                fontDialog.Font        = Properties.Settings.Default.FontStateLabels;
                fontDialog.Color       = Properties.Settings.Default.FontStateColor;

                DialogResult result = fontDialog.ShowDialog();
                if (result == DialogResult.OK)
                {
                    labelStateFont.Font      = fontDialog.Font;
                    labelStateFont.ForeColor = fontDialog.Color;
                    Properties.Settings.Default.FontStateLabels = fontDialog.Font;
                    Properties.Settings.Default.FontStateColor  = fontDialog.Color;
                    Properties.Settings.Default.Save();
                }
            }
        }
Example #11
0
        /// <summary>
        /// 实例化字体对话框
        /// </summary>
        /// <returns></returns>
        public static object fontDialogMethod(TextBox t)
        {
            Dictionary <string, object> retDic = new Dictionary <string, object>();
            FontDialog fontD = new FontDialog();

            fontD.AllowSimulations  = true;
            fontD.AllowVectorFonts  = true;
            fontD.AllowScriptChange = true;
            fontD.ScriptsOnly       = true;
            fontD.Font        = t.Font;
            fontD.ShowApply   = true;
            fontD.ShowEffects = false;
            if (!retDic.ContainsKey("1"))
            {
                retDic.Add("1", fontD);
            }
            // 判断是否点击了应用
            fontD.Apply += (object sender, EventArgs e) => {
                t.Font = fontD.Font;
                if (!retDic.ContainsKey("2"))
                {
                    retDic.Add("2", DialogResult.OK);
                }
            };
            DialogResult dialogResult = fontD.ShowDialog();

            // 判断是否点击确定
            if (dialogResult == DialogResult.OK)
            {
                t.Font = fontD.Font;
                if (!retDic.ContainsKey("2"))
                {
                    retDic.Add("2", DialogResult.OK);
                }
            }
            return(retDic);
        }
Example #12
0
        private void button_ui_getDefaultFont_Click(object sender, EventArgs e)
        {
            Font font = null;

            if (String.IsNullOrEmpty(this.textBox_ui_defaultFont.Text) == false)
            {
                // Create the FontConverter.
                System.ComponentModel.TypeConverter converter =
                    System.ComponentModel.TypeDescriptor.GetConverter(typeof(Font));

                font = (Font)converter.ConvertFromString(this.textBox_ui_defaultFont.Text);
            }
            else
            {
                font = Control.DefaultFont;
            }

            FontDialog dlg = new FontDialog();

            dlg.ShowColor          = false;
            dlg.Font               = font;
            dlg.ShowApply          = false;
            dlg.ShowHelp           = true;
            dlg.AllowVerticalFonts = false;

            if (dlg.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }
            {
                // Create the FontConverter.
                System.ComponentModel.TypeConverter converter =
                    System.ComponentModel.TypeDescriptor.GetConverter(typeof(Font));

                this.textBox_ui_defaultFont.Text = converter.ConvertToString(dlg.Font);
            }
        }
Example #13
0
        private void 字体_Click(object sender, EventArgs e)
        {
            //  创建字体对话框
            FontDialog dlgFont = new FontDialog();

            dlgFont.ShowColor = true;
            dlgFont.ShowApply = true;
            //  设置字体对框的默认字体,
            //  如果已经有选择文本,则设置为选择文本的字体和颜色
            //  否则设置为全文的字体和姿色
            if (rtbEditor.SelectionLength > 0)
            {
                dlgFont.Font  = rtbEditor.SelectionFont;
                dlgFont.Color = rtbEditor.SelectionColor;
            }
            else
            {
                dlgFont.Font  = rtbEditor.Font;
                dlgFont.Color = rtbEditor.ForeColor;
            }
            //  显示字体对话框,且用户按下了 “确认 ”按钮
            if (dlgFont.ShowDialog() == DialogResult.OK)
            {
                //  如果有选择文件,刚修改选择文本的字体和颜色
                if (rtbEditor.SelectionLength > 0)
                {
                    rtbEditor.SelectionFont  = dlgFont.Font;
                    rtbEditor.SelectionColor = dlgFont.Color;
                }
                //  否则修改整个文本的字体和颜色
                else
                {
                    rtbEditor.Font      = dlgFont.Font;
                    rtbEditor.ForeColor = dlgFont.Color;
                }
            }
        }
Example #14
0
        private void buttonChangeFont_Click(object sender, EventArgs e)
        {
            var dialog = new FontDialog()
            {
                AllowScriptChange    = true
                , AllowSimulations   = true
                , AllowVectorFonts   = true
                , AllowVerticalFonts = true
                , Font          = (LastGdiFont == null) ? Configuration.Main.GdiFont : LastGdiFont
                , FontMustExist = true
                , ShowColor     = false
            };
            var result = dialog.ShowDialog(this);

            if (result != DialogResult.OK)
            {
                return;
            }
            var font = LastGdiFont = dialog.Font;

            Size touse = new Size(0, 0);

            for (char ch = (char)0; ch < (char)255; ++ch)
            {
                if ("\u0001 \t\n\r".Contains(ch))
                {
                    continue;                                                 // annoying outliers
                }
                var m = TextRenderer.MeasureText(ch.ToString(), font, Size.Empty, TextFormatFlags.NoPadding);
                touse.Width  = Math.Max(touse.Width, m.Width);
                touse.Height = Math.Max(touse.Height, m.Height);
            }

            var scf = ShinyConsole.Font.FromGdiFont(font, touse.Width, touse.Height);

            pictureBoxFontPreview.Image = scf.Bitmap;
        }
        private void textBox_Font_MouseClick(object sender, MouseEventArgs e)
        {
            using (FontDialog fd = new FontDialog())
            {
                fd.Font    = BaseUtils.FontLoader.GetFont(Theme.FontName, Theme.FontSize);
                fd.MinSize = 4;
                fd.MaxSize = 36;
                DialogResult result;

                try
                {
                    result = fd.ShowDialog(this);
                }
                catch (ArgumentException ex)
                {
                    MessageBox.Show(ex.Message);
                    return;
                }

                if (result == DialogResult.OK)
                {
                    if (fd.Font.Style == FontStyle.Regular)
                    {
                        Theme.FontName = fd.Font.Name;
                        Theme.FontSize = fd.Font.Size;
                        UpdatePatchesEtc();

                        Theme.SetCustom();
                        ApplyChanges?.Invoke(Theme);
                    }
                    else
                    {
                        ExtendedControls.MessageBoxTheme.Show(this, "Font does not have regular style");
                    }
                }
            }
        }
Example #16
0
        private void buttonConsoleFont_Click(object sender, EventArgs e)
        {
            FontDialog fd = new FontDialog();

            //load the current font

            fd.ShowEffects        = false;
            fd.ShowColor          = false;
            fd.FontMustExist      = true;
            fd.AllowVectorFonts   = false;
            fd.AllowVerticalFonts = false;

            //fd.FixedPitchOnly = true; monospace

            fd.Font = new Font(textConsoleFont.Text, float.Parse(textConsoleFontSize.Text), FontStyle.Regular);
            //capture an error due to this not being a truetype font
            try
            {
                if (fd.ShowDialog() != DialogResult.Cancel && fd.Font.Style == FontStyle.Regular)
                {
                    textConsoleFont.Text     = fd.Font.Name;
                    textConsoleFontSize.Text = fd.Font.Size.ToString();
                    textConsoleFont.Font     = new Font(fd.Font.Name, 10, FontStyle.Regular);
                }
                else
                {
                    if (fd.Font.Style != FontStyle.Regular)
                    {
                        MessageBox.Show("IceChat only supports 'Regular' font styles", "Font Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show("IceChat only supports TrueType fonts", "Font Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Example #17
0
        public static Font SelectFont(Font currentFont)
        {
            using (FontDialog fd = new FontDialog()) {
                fd.Font        = currentFont;
                fd.ShowApply   = false;
                fd.ShowColor   = false;
                fd.ShowEffects = false;
                fd.ShowHelp    = false;
                if (fd.ShowDialog() == DialogResult.OK)
                {
                    Font font = fd.Font;

                    Size sizeM   = TextRenderer.MeasureText("M", font);
                    Size sizeDot = TextRenderer.MeasureText(".", font);

                    if (sizeM != sizeDot)
                    {
                        if (MessageBox.Show("The font you've selected (" + fd.Font.FontFamily.Name.ToString() + ") doesn't appear to be a monospace font. Using anything other than a monospace font will cause display issues in the UI. Are you sure you want to use this font?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                        {
                            return(fd.Font);
                        }
                        else
                        {
                            return(currentFont);
                        }
                    }
                    else
                    {
                        return(fd.Font);
                    }
                }
                else
                {
                    return(currentFont);
                }
            }
        }
Example #18
0
 protected override void OnMouseUp(MouseEventArgs mevent)
 {
     IsDragMode = false;
     base.OnMouseUp(mevent);
     if (mevent.Button == MouseButtons.Right)
     {
         using (ColorDialog cd = new ColorDialog())
         {
             cd.FullOpen = true;
             if (cd.ShowDialog() == DialogResult.OK)
             {
                 this.ForeColor = cd.Color;
             }
         }
         using (FontDialog fd = new FontDialog())
         {
             try
             {
                 fd.AllowScriptChange = false;
                 fd.AllowSimulations  = false;
                 if (fd.ShowDialog() == DialogResult.OK)
                 {
                     this.Font = fd.Font;
                 }
             }
             catch (Exception ex)
             {
                 //Not a truetype font
                 MessageBox.Show(this, ex.Message + Environment.NewLine + "Ўрифт не изменен.", "ќшибка", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             }
         }
         //обновление пол¤
         this.Text += " ";
         this.Select(this.Text.Length, 0);
     }
     Invalidate();
 }
Example #19
0
        /// <summary>
        ///   Edits the value
        /// </summary>
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider,
                                         object value)
        {
            this.value = value;
            if (provider != null)
            {
                var service1 =
                    (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
                if (service1 != null)
                {
                    var fontDialog = new FontDialog();
                    fontDialog.ShowApply          = false;
                    fontDialog.ShowColor          = false;
                    fontDialog.AllowVerticalFonts = false;
                    fontDialog.AllowScriptChange  = false;
                    fontDialog.FixedPitchOnly     = true;
                    fontDialog.ShowEffects        = false;
                    fontDialog.ShowHelp           = false;

                    var font = value as Font;
                    if (font != null)
                    {
                        fontDialog.Font = font;
                    }
                    if (fontDialog.ShowDialog() == DialogResult.OK)
                    {
                        this.value = fontDialog.Font;
                    }

                    fontDialog.Dispose();
                }
            }

            value      = this.value;
            this.value = null;
            return(value);
        }
Example #20
0
        bool size_flag = true; //快捷工具栏-字体大小选中内容发生变化事件响应
        private void 字体ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //新建字体对话框并初始化
            FontDialog fd = new FontDialog();

            fd.Font      = rh.SelectionFont;
            fd.Color     = rh.SelectionColor;
            fd.ShowColor = true;

            //打开字体对话框并进行设置
            if (fd.ShowDialog() == DialogResult.OK)
            {
                rh.SelectionColor = fd.Color;
                rh.SelectionFont  = fd.Font;
            }
            //处理快捷工具栏的字体信息同步设置
            font_flag          = false;
            size_flag          = false;
            ts_color.BackColor = fd.Color;
            tcb_font.Text      = fd.Font.FontFamily.Name;
            //tcb_fontsize.Text = fd.Font.Size.ToString();
            int k = Array.IndexOf(v, fd.Font.Size);

            if (k > -1)//找到了
            {
                tcb_fontsize.Text = d[k];
            }
            else//没找到
            {
                tcb_fontsize.Text = fd.Font.Size.ToString();
            }

            ts_fontbold.Checked      = fd.Font.Bold;
            ts_fontitalics.Checked   = fd.Font.Italic;
            ts_fontunderline.Checked = fd.Font.Underline;
            font_flag = size_flag = true;
        }
Example #21
0
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     this.value = value;
     if ((provider != null) && (((IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService))) != null))
     {
         if (this.fontDialog == null)
         {
             this.fontDialog                    = new FontDialog();
             this.fontDialog.ShowApply          = false;
             this.fontDialog.ShowColor          = false;
             this.fontDialog.AllowVerticalFonts = false;
         }
         Font font = value as Font;
         if (font != null)
         {
             this.fontDialog.Font = font;
         }
         IntPtr focus = System.Drawing.Design.UnsafeNativeMethods.GetFocus();
         try
         {
             if (this.fontDialog.ShowDialog() == DialogResult.OK)
             {
                 this.value = this.fontDialog.Font;
             }
         }
         finally
         {
             if (focus != IntPtr.Zero)
             {
                 System.Drawing.Design.UnsafeNativeMethods.SetFocus(new HandleRef(null, focus));
             }
         }
     }
     value      = this.value;
     this.value = null;
     return(value);
 }
Example #22
0
        /// <summary>
        /// Calls the windows font dialog box. In this case instead of returning a font
        /// in the form of a string such as "Arial,10,N", a font object is returned. The
        /// font object exposes properties such as name, size, style, bold, font-family,
        /// strikeout etc. which we can use to perform better font related manipulations.
        /// <pre>
        /// Example:
        /// //This example demonstrates how all the font attributes can be updated with
        /// //a single line. Note how the current font object is passed as a parameter
        /// MyLabel.Font = VFPToolkit.dialogs.GetFont(MyLabel.Font);
        /// </pre>
        /// </summary>
        /// <RequiredNamespaces>WinForms</RequiredNamespaces>
        /// <param name="oFont"> </param>
        public static System.Drawing.Font GetFont(Font oFont)
        {
            //Create the FontDialog
            FontDialog fd = new FontDialog();

            //Specify a default font for the font dialog
            fd.Font = oFont;

            //These are the VFP defaults which we will ignore and instead of returning a font string
            //we return a system.Drawing.Font object which has all the font properties exposed
            //fd.AllowScriptChange = false;
            //fd.ShowEffects = true;
            //fd.ShowColor = true;

            //Call the Dialog using fd.ShowDialog() which returns a value of type DialogResult
            if (fd.ShowDialog() != DialogResult.Cancel)
            {
                //If the user has selected ok then update our default font object
                oFont = fd.Font;
            }

            //return the font object
            return(oFont);
        }
Example #23
0
        public void OpenTranslationFontDialogCommand_Execute(object parameter)
        {
            FontDialog fontDialog = new FontDialog();

            fontDialog.ShowEffects = false;

            string fontFamily = StaticConfigProvider.TranslationFontType.ToString();
            float  fontSize   = (float)StaticConfigProvider.TranslationFontSize;

            System.Drawing.FontStyle fontStyle = StaticConfigProvider.TranslationFontStyle;

            fontDialog.Font = new System.Drawing.Font(fontFamily, fontSize, fontStyle);

            var result = fontDialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                System.Drawing.Font f = fontDialog.Font;

                StaticConfigProvider.TranslationFontType  = new FontFamily(fontDialog.Font.Name);
                StaticConfigProvider.TranslationFontSize  = fontDialog.Font.Size;
                StaticConfigProvider.TranslationFontStyle = fontDialog.Font.Style;
            }
        }
Example #24
0
        private void btnFont_Click(object sender, EventArgs e)
        {
            FontDialog dlg = new FontDialog()
            {
                ShowColor   = true,
                ShowEffects = true,
                Color       = TextColor,
                Font        = new Font(FontName, FontSize, FontStyle, GraphicsUnit.Point)
            };

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    FontName  = string.IsNullOrEmpty(dlg.Font.Name) ? FontName : dlg.Font.Name;
                    FontSize  = dlg.Font.Size;
                    FontStyle = dlg.Font.Style;
                    DrawSample();
                }
                catch (Exception)
                {
                }
            }
        }
Example #25
0
 private void fontToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (FontDialog fd = new FontDialog()
     {
         ShowHelp = true
     })
     {
         if (fd.ShowDialog() == DialogResult.OK)
         {
             if (richTextBox1.SelectedText != null)
             {
                 richTextBox1.SelectionFont = fd.Font;
             }
             else
             {
                 if (richTextBox1.Text != null)
                 {
                     richTextBox1.SelectAll();
                     richTextBox1.SelectionFont = fd.Font;
                 }
             }
         }
     }
 }
Example #26
0
        private void browseFont_Click(object sender, EventArgs e)
        {
            var dlg = new FontDialog();

            dlg.ScriptsOnly    = true;
            dlg.FixedPitchOnly = !showVariableFontsAsWell.Checked;
            dlg.FontMustExist  = true;
            dlg.Font           = app.inst.font;
            dlg.ShowEffects    = false;
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                var  font          = dlg.Font;
                int  new_font_size = (int)Math.Round(font.Size);
                bool any_change    = app.inst.font_name != font.Name || app.inst.font_size != new_font_size;
                app.inst.font_name = font.Name;
                app.inst.font_size = new_font_size;
                if (any_change)
                {
                    app.inst.save();
                    needs_restart_ = true;
                    DialogResult   = DialogResult.OK;
                }
            }
        }
 private void fontListBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     //sets font
     if (fontListBox.SelectedItem.ToString().Equals("Other"))
     {
         FontDialog fontDialog = new FontDialog();
         if (fontDialog.ShowDialog() == DialogResult.OK && !String.IsNullOrWhiteSpace(textBox.Text))
         {
             formattedRichTextBox.Font = fontDialog.Font;
             changeFontDetails();
             changeColor();
             changeSize();
             formattedRichTextBox.Text = textBox.Text;
         }
     }
     else
     {
         String font = fontListBox.SelectedItem.ToString();
         formattedRichTextBox.Font = new Font(font, sizeSlider.Value + 1);
         changeFontDetails();
         changeColor();
         changeSize();
     }
 }
Example #28
0
        Control PickFontWithStartingFont()
        {
            var button = new Button {
                Text = "Pick Font with initial starting font"
            };

            button.Click += delegate
            {
                var dialog = new FontDialog
                {
                    Font = selectedFont
                };
                dialog.FontChanged += delegate
                {
                    // need to handle this event for OS X, where the dialog is a floating window
                    UpdatePreview(dialog.Font);
                    Log.Write(dialog, "FontChanged, Font: {0}", dialog.Font);
                };
                var result = dialog.ShowDialog(ParentWindow);
                // do not get the font here, it may return immediately with a result of DialogResult.None on certain platforms
                Log.Write(dialog, "Result: {0}", result);
            };
            return(button);
        }
Example #29
0
        private void fontMenuItem_Click(object sender, EventArgs e)
        {
            FontDialog f = new FontDialog {
                Font = mLogBox.Font
            };

            if (f.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            bool    saveConfig = false;
            JObject loCfg      = Configuration.GetConfigFile();

            if (loCfg["logFont"] == null)
            {
                loCfg["logFont"] = new JObject();
                saveConfig       = true;
            }
            if (loCfg["logFont"]["family"] == null || !loCfg["logFont"]["family"].ToString().Equals(f.Font.FontFamily.Name))
            {
                loCfg["logFont"]["family"] = f.Font.FontFamily.Name;
                saveConfig = true;
            }
            if (loCfg["logFont"]["size"] == null || Math.Abs((float)loCfg["logFont"]["size"] - f.Font.Size) > 0)
            {
                loCfg["logFont"]["size"] = f.Font.Size;
                saveConfig = true;
            }
            if (saveConfig)
            {
                Configuration.SaveConfigFile(loCfg);
            }

            mLogBox.Font = new Font(f.Font.FontFamily, f.Font.Size, f.Font.Style);
        }
Example #30
0
        private void FontMenu_Click(object sender, RoutedEventArgs e)
        {
            var font = new FontDialog
            {
                AllowVerticalFonts = false,
                ShowColor          = true,
            };

            if (font.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                var clr = new Color
                {
                    A = font.Color.A,
                    R = font.Color.R,
                    G = font.Color.G,
                    B = font.Color.B
                };

                KeyBlock.FontFamily      = NpsBlock.FontFamily = new FontFamily(font.Font.Name);
                KeyBlock.FontStyle       = NpsBlock.FontStyle = font.Font.Italic ? FontStyles.Italic : FontStyles.Normal;
                KeyBlock.TextDecorations = NpsBlock.TextDecorations = font.Font.Underline ? TextDecorations.Underline : null;
                KeyBlock.Foreground      = NpsBlock.Foreground = new SolidColorBrush(clr);
            }
        }
        private void btnCellColor_Click(object sender, EventArgs e)
        {
            FontDialog     fontDialog    = new FontDialog();
            FontConverter  fontConverter = new FontConverter();
            ColorConverter colorCovert   = new ColorConverter();

            fontDialog.ShowEffects = true;
            fontDialog.ShowColor   = true;

            if (lblCellSample.Text != "")
            {
                fontDialog.Font  = fontConverter.ConvertFromString(lblCellSample.Text) as Font;
                fontDialog.Color = lblCellSample.ForeColor;
            }

            if (DialogResult.OK == fontDialog.ShowDialog())
            {
                txtCellFont.Text      = fontConverter.ConvertToString(fontDialog.Font);
                txtCellFontColor.Text = colorCovert.ConvertToString(fontDialog.Color);

                lblCellSample.Font      = fontDialog.Font;
                lblCellSample.ForeColor = fontDialog.Color;
            }
        }
Example #32
0
        private void 字型ZToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FontDialog fontDialog      = new FontDialog();
            FontDialog fontDialog_save = new FontDialog();

            fontDialog.ShowColor = true;
            fontDialog.ShowApply = true;
            try
            {
                fontDialog.Font  = fontDialog_save.Font;
                fontDialog.Color = fontDialog_save.Color;
            }
            catch (Exception)
            {
                throw;
            }
            if (fontDialog.ShowDialog() == DialogResult.OK)
            {
                flowLayoutPanel1.Font      = fontDialog.Font;
                flowLayoutPanel1.ForeColor = fontDialog.Color;
            }
            fontDialog_save.Font  = fontDialog.Font;
            fontDialog_save.Color = fontDialog.Color;
        }
Example #33
0
        private void fontToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FontDialog fd = new FontDialog();

            fd.FixedPitchOnly = false;
            fd.FontMustExist  = true;
            fd.ShowColor      = false;
            fd.ShowHelp       = false;
            fd.ShowEffects    = false;
            fd.ShowApply      = true;

            if (this.ActiveDocument != null)
            {
                fd.Font = ConfigurationManager.Font ?? this.ActiveDocument.Scintilla.Styles[0].Font;
            }

            fd.Apply += new EventHandler(fontDialog_Apply);

            if (fd.ShowDialog(this) == DialogResult.OK)
            {
                ConfigurationManager.Font = fd.Font;
                SetFont(fd.Font);
            }
        }
Example #34
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(main));
     this.tabControl1 = new System.Windows.Forms.TabControl();
     this.tabPage1 = new System.Windows.Forms.TabPage();
     this.exitButton = new System.Windows.Forms.Button();
     this.cameraButton = new SkimptControls.GlassButton();
     this.hightlightButton = new SkimptControls.GlassButton();
     this.updateMessageLink = new System.Windows.Forms.LinkLabel();
     this.updateMessageLabel = new System.Windows.Forms.Label();
     this.unhookButton = new System.Windows.Forms.Button();
     this.mainProgramMessage = new System.Windows.Forms.TextBox();
     this.tabPage2 = new System.Windows.Forms.TabPage();
     this.groupBox1 = new System.Windows.Forms.GroupBox();
     this.browseButton = new System.Windows.Forms.Button();
     this.fileLocationTextBox = new System.Windows.Forms.TextBox();
     this.label1 = new System.Windows.Forms.Label();
     this.radioButton2 = new System.Windows.Forms.RadioButton();
     this.radioButton1 = new System.Windows.Forms.RadioButton();
     this.saveFileSettingButton = new SkimptControls.GlassButton();
     this.tabPage3 = new System.Windows.Forms.TabPage();
     this.saveFtpSettingButton = new SkimptControls.GlassButton();
     this.ftpTestConnButton = new SkimptControls.GlassButton();
     this.ftpDirTxtBox = new System.Windows.Forms.TextBox();
     this.ftpPortTxtBox = new System.Windows.Forms.TextBox();
     this.ftpPassTxtBox = new System.Windows.Forms.TextBox();
     this.ftpUserTxtBox = new System.Windows.Forms.TextBox();
     this.ftpHostTxtBox = new System.Windows.Forms.TextBox();
     this.label6 = new System.Windows.Forms.Label();
     this.label5 = new System.Windows.Forms.Label();
     this.label4 = new System.Windows.Forms.Label();
     this.label3 = new System.Windows.Forms.Label();
     this.label2 = new System.Windows.Forms.Label();
     this.tabPage4 = new System.Windows.Forms.TabPage();
     this.savePSDasFileCheckbox = new System.Windows.Forms.CheckBox();
     this.groupBox2 = new System.Windows.Forms.GroupBox();
     this.removeContextMenuButton = new SkimptControls.GlassButton();
     this.attachContextMenuButton = new SkimptControls.GlassButton();
     this.ShowMessagesCheckbox = new System.Windows.Forms.CheckBox();
     this.HideUponLaunchCheckbox = new System.Windows.Forms.CheckBox();
     this.startOnWindowsLoadCheckBox = new System.Windows.Forms.CheckBox();
     this.saveGlobalSettingButton = new SkimptControls.GlassButton();
     this.tabPage5 = new System.Windows.Forms.TabPage();
     this.fontDialog1 = new System.Windows.Forms.FontDialog();
     this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
     this.notificationIconContext = new System.Windows.Forms.ContextMenuStrip(this.components);
     this.contextStartCamera = new System.Windows.Forms.ToolStripMenuItem();
     this.contextHighlightMode = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
     this.contextShowMenu = new System.Windows.Forms.ToolStripMenuItem();
     this.contextExitMenu = new System.Windows.Forms.ToolStripMenuItem();
     this.tabControl1.SuspendLayout();
     this.tabPage1.SuspendLayout();
     this.tabPage2.SuspendLayout();
     this.groupBox1.SuspendLayout();
     this.tabPage3.SuspendLayout();
     this.tabPage4.SuspendLayout();
     this.groupBox2.SuspendLayout();
     this.notificationIconContext.SuspendLayout();
     this.SuspendLayout();
     //
     // tabControl1
     //
     this.tabControl1.Controls.Add(this.tabPage1);
     this.tabControl1.Controls.Add(this.tabPage2);
     this.tabControl1.Controls.Add(this.tabPage3);
     this.tabControl1.Controls.Add(this.tabPage4);
     this.tabControl1.Controls.Add(this.tabPage5);
     this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.tabControl1.Font = new System.Drawing.Font("Calibri", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.tabControl1.HotTrack = true;
     this.tabControl1.ItemSize = new System.Drawing.Size(96, 26);
     this.tabControl1.Location = new System.Drawing.Point(0, 0);
     this.tabControl1.Name = "tabControl1";
     this.tabControl1.SelectedIndex = 0;
     this.tabControl1.ShowToolTips = true;
     this.tabControl1.Size = new System.Drawing.Size(483, 250);
     this.tabControl1.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
     this.tabControl1.TabIndex = 0;
     //
     // tabPage1
     //
     this.tabPage1.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
     this.tabPage1.Controls.Add(this.exitButton);
     this.tabPage1.Controls.Add(this.cameraButton);
     this.tabPage1.Controls.Add(this.hightlightButton);
     this.tabPage1.Controls.Add(this.updateMessageLink);
     this.tabPage1.Controls.Add(this.updateMessageLabel);
     this.tabPage1.Controls.Add(this.unhookButton);
     this.tabPage1.Controls.Add(this.mainProgramMessage);
     this.tabPage1.Location = new System.Drawing.Point(4, 30);
     this.tabPage1.Name = "tabPage1";
     this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
     this.tabPage1.Size = new System.Drawing.Size(475, 216);
     this.tabPage1.TabIndex = 0;
     this.tabPage1.Text = "Main";
     this.tabPage1.ToolTipText = "Main screen";
     //
     // exitButton
     //
     this.exitButton.Location = new System.Drawing.Point(13, 178);
     this.exitButton.Name = "exitButton";
     this.exitButton.Size = new System.Drawing.Size(88, 31);
     this.exitButton.TabIndex = 5;
     this.exitButton.Text = "Exit Skimpt";
     this.exitButton.UseVisualStyleBackColor = true;
     this.exitButton.Click += new System.EventHandler(this.exitButton_Click);
     //
     // cameraButton
     //
     this.cameraButton.BackColor = System.Drawing.Color.DarkViolet;
     this.cameraButton.ForeColor = System.Drawing.Color.Black;
     this.cameraButton.Location = new System.Drawing.Point(12, 73);
     this.cameraButton.Name = "cameraButton";
     this.cameraButton.ShineColor = System.Drawing.Color.Thistle;
     this.cameraButton.Size = new System.Drawing.Size(214, 36);
     this.cameraButton.TabIndex = 6;
     this.cameraButton.Text = "Start Camera Mode";
     this.cameraButton.Click += new System.EventHandler(this.cameraButton_Click);
     //
     // hightlightButton
     //
     this.hightlightButton.BackColor = System.Drawing.Color.SteelBlue;
     this.hightlightButton.Location = new System.Drawing.Point(244, 73);
     this.hightlightButton.Name = "hightlightButton";
     this.hightlightButton.ShineColor = System.Drawing.Color.SkyBlue;
     this.hightlightButton.Size = new System.Drawing.Size(214, 36);
     this.hightlightButton.TabIndex = 5;
     this.hightlightButton.Text = "Start Highlight mode";
     this.hightlightButton.Click += new System.EventHandler(this.hightlightButton_Click);
     //
     // updateMessageLink
     //
     this.updateMessageLink.AutoSize = true;
     this.updateMessageLink.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
     this.updateMessageLink.Location = new System.Drawing.Point(184, 151);
     this.updateMessageLink.Name = "updateMessageLink";
     this.updateMessageLink.Size = new System.Drawing.Size(126, 19);
     this.updateMessageLink.TabIndex = 4;
     this.updateMessageLink.TabStop = true;
     this.updateMessageLink.Text = "Skimpt Homepage";
     this.updateMessageLink.Visible = false;
     this.updateMessageLink.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.updateMessageLink_LinkClicked);
     //
     // updateMessageLabel
     //
     this.updateMessageLabel.AutoSize = true;
     this.updateMessageLabel.ForeColor = System.Drawing.Color.Red;
     this.updateMessageLabel.Location = new System.Drawing.Point(15, 151);
     this.updateMessageLabel.Name = "updateMessageLabel";
     this.updateMessageLabel.Size = new System.Drawing.Size(173, 19);
     this.updateMessageLabel.TabIndex = 3;
     this.updateMessageLabel.Text = "New Update Available on";
     this.updateMessageLabel.Visible = false;
     //
     // unhookButton
     //
     this.unhookButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
     this.unhookButton.Location = new System.Drawing.Point(320, 177);
     this.unhookButton.Name = "unhookButton";
     this.unhookButton.Size = new System.Drawing.Size(149, 33);
     this.unhookButton.TabIndex = 1;
     this.unhookButton.Text = "Unhook Print Screen";
     this.unhookButton.UseVisualStyleBackColor = true;
     this.unhookButton.Click += new System.EventHandler(this.unhookButton_Click);
     //
     // mainProgramMessage
     //
     this.mainProgramMessage.Font = new System.Drawing.Font("Calibri", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.mainProgramMessage.ForeColor = System.Drawing.Color.Green;
     this.mainProgramMessage.Location = new System.Drawing.Point(8, 19);
     this.mainProgramMessage.Multiline = true;
     this.mainProgramMessage.Name = "mainProgramMessage";
     this.mainProgramMessage.Size = new System.Drawing.Size(463, 48);
     this.mainProgramMessage.TabIndex = 0;
     this.mainProgramMessage.Text = "Program messages will be displayed here";
     //
     // tabPage2
     //
     this.tabPage2.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
     this.tabPage2.Controls.Add(this.groupBox1);
     this.tabPage2.Controls.Add(this.radioButton2);
     this.tabPage2.Controls.Add(this.radioButton1);
     this.tabPage2.Controls.Add(this.saveFileSettingButton);
     this.tabPage2.Location = new System.Drawing.Point(4, 30);
     this.tabPage2.Name = "tabPage2";
     this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
     this.tabPage2.Size = new System.Drawing.Size(475, 216);
     this.tabPage2.TabIndex = 1;
     this.tabPage2.Text = "File";
     this.tabPage2.ToolTipText = "change file settings including save path";
     //
     // groupBox1
     //
     this.groupBox1.Controls.Add(this.browseButton);
     this.groupBox1.Controls.Add(this.fileLocationTextBox);
     this.groupBox1.Controls.Add(this.label1);
     this.groupBox1.Location = new System.Drawing.Point(6, 74);
     this.groupBox1.Name = "groupBox1";
     this.groupBox1.Size = new System.Drawing.Size(463, 92);
     this.groupBox1.TabIndex = 3;
     this.groupBox1.TabStop = false;
     this.groupBox1.Text = "File Location";
     //
     // browseButton
     //
     this.browseButton.Location = new System.Drawing.Point(416, 49);
     this.browseButton.Name = "browseButton";
     this.browseButton.Size = new System.Drawing.Size(32, 27);
     this.browseButton.TabIndex = 2;
     this.browseButton.Text = "...";
     this.browseButton.UseVisualStyleBackColor = true;
     this.browseButton.Click += new System.EventHandler(this.browseButton_Click);
     //
     // fileLocationTextBox
     //
     this.fileLocationTextBox.Font = new System.Drawing.Font("Calibri", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.fileLocationTextBox.Location = new System.Drawing.Point(17, 50);
     this.fileLocationTextBox.Name = "fileLocationTextBox";
     this.fileLocationTextBox.ReadOnly = true;
     this.fileLocationTextBox.Size = new System.Drawing.Size(393, 27);
     this.fileLocationTextBox.TabIndex = 1;
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Location = new System.Drawing.Point(13, 27);
     this.label1.Name = "label1";
     this.label1.Size = new System.Drawing.Size(191, 19);
     this.label1.TabIndex = 0;
     this.label1.Text = "Save my file to this location:";
     //
     // radioButton2
     //
     this.radioButton2.AutoSize = true;
     this.radioButton2.Location = new System.Drawing.Point(26, 45);
     this.radioButton2.Name = "radioButton2";
     this.radioButton2.Size = new System.Drawing.Size(213, 23);
     this.radioButton2.TabIndex = 1;
     this.radioButton2.Text = "Allow me to specify each file";
     this.radioButton2.UseVisualStyleBackColor = true;
     //
     // radioButton1
     //
     this.radioButton1.AutoSize = true;
     this.radioButton1.Checked = true;
     this.radioButton1.Location = new System.Drawing.Point(26, 16);
     this.radioButton1.Name = "radioButton1";
     this.radioButton1.Size = new System.Drawing.Size(185, 23);
     this.radioButton1.TabIndex = 0;
     this.radioButton1.TabStop = true;
     this.radioButton1.Text = "Randomly name my files";
     this.radioButton1.UseVisualStyleBackColor = true;
     //
     // saveFileSettingButton
     //
     this.saveFileSettingButton.Location = new System.Drawing.Point(155, 172);
     this.saveFileSettingButton.Name = "saveFileSettingButton";
     this.saveFileSettingButton.Size = new System.Drawing.Size(141, 36);
     this.saveFileSettingButton.TabIndex = 5;
     this.saveFileSettingButton.Text = "Save File Settings";
     this.saveFileSettingButton.Click += new System.EventHandler(this.saveFileSettingButton_Click);
     //
     // tabPage3
     //
     this.tabPage3.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
     this.tabPage3.Controls.Add(this.saveFtpSettingButton);
     this.tabPage3.Controls.Add(this.ftpTestConnButton);
     this.tabPage3.Controls.Add(this.ftpDirTxtBox);
     this.tabPage3.Controls.Add(this.ftpPortTxtBox);
     this.tabPage3.Controls.Add(this.ftpPassTxtBox);
     this.tabPage3.Controls.Add(this.ftpUserTxtBox);
     this.tabPage3.Controls.Add(this.ftpHostTxtBox);
     this.tabPage3.Controls.Add(this.label6);
     this.tabPage3.Controls.Add(this.label5);
     this.tabPage3.Controls.Add(this.label4);
     this.tabPage3.Controls.Add(this.label3);
     this.tabPage3.Controls.Add(this.label2);
     this.tabPage3.Location = new System.Drawing.Point(4, 30);
     this.tabPage3.Name = "tabPage3";
     this.tabPage3.Size = new System.Drawing.Size(475, 216);
     this.tabPage3.TabIndex = 2;
     this.tabPage3.Text = "Upload";
     this.tabPage3.ToolTipText = "Set upload settings to remote server";
     //
     // saveFtpSettingButton
     //
     this.saveFtpSettingButton.BackColor = System.Drawing.Color.DarkSlateBlue;
     this.saveFtpSettingButton.Location = new System.Drawing.Point(332, 173);
     this.saveFtpSettingButton.Name = "saveFtpSettingButton";
     this.saveFtpSettingButton.ShineColor = System.Drawing.Color.SlateBlue;
     this.saveFtpSettingButton.Size = new System.Drawing.Size(135, 35);
     this.saveFtpSettingButton.TabIndex = 13;
     this.saveFtpSettingButton.Text = "Save FTP Settings";
     this.saveFtpSettingButton.Click += new System.EventHandler(this.saveFtpSettingButton_Click);
     //
     // ftpTestConnButton
     //
     this.ftpTestConnButton.BackColor = System.Drawing.Color.Crimson;
     this.ftpTestConnButton.Location = new System.Drawing.Point(191, 173);
     this.ftpTestConnButton.Name = "ftpTestConnButton";
     this.ftpTestConnButton.ShineColor = System.Drawing.Color.Pink;
     this.ftpTestConnButton.Size = new System.Drawing.Size(135, 35);
     this.ftpTestConnButton.TabIndex = 12;
     this.ftpTestConnButton.Text = "Test Connection";
     this.ftpTestConnButton.Click += new System.EventHandler(this.ftpTestConnButton_Click);
     //
     // ftpDirTxtBox
     //
     this.ftpDirTxtBox.Location = new System.Drawing.Point(163, 140);
     this.ftpDirTxtBox.Name = "ftpDirTxtBox";
     this.ftpDirTxtBox.Size = new System.Drawing.Size(307, 27);
     this.ftpDirTxtBox.TabIndex = 11;
     //
     // ftpPortTxtBox
     //
     this.ftpPortTxtBox.Location = new System.Drawing.Point(163, 107);
     this.ftpPortTxtBox.Name = "ftpPortTxtBox";
     this.ftpPortTxtBox.Size = new System.Drawing.Size(307, 27);
     this.ftpPortTxtBox.TabIndex = 10;
     this.ftpPortTxtBox.Text = "21";
     //
     // ftpPassTxtBox
     //
     this.ftpPassTxtBox.Location = new System.Drawing.Point(163, 74);
     this.ftpPassTxtBox.Name = "ftpPassTxtBox";
     this.ftpPassTxtBox.Size = new System.Drawing.Size(307, 27);
     this.ftpPassTxtBox.TabIndex = 9;
     this.ftpPassTxtBox.UseSystemPasswordChar = true;
     //
     // ftpUserTxtBox
     //
     this.ftpUserTxtBox.Location = new System.Drawing.Point(163, 41);
     this.ftpUserTxtBox.Name = "ftpUserTxtBox";
     this.ftpUserTxtBox.Size = new System.Drawing.Size(307, 27);
     this.ftpUserTxtBox.TabIndex = 8;
     //
     // ftpHostTxtBox
     //
     this.ftpHostTxtBox.Location = new System.Drawing.Point(163, 11);
     this.ftpHostTxtBox.Name = "ftpHostTxtBox";
     this.ftpHostTxtBox.Size = new System.Drawing.Size(307, 27);
     this.ftpHostTxtBox.TabIndex = 5;
     //
     // label6
     //
     this.label6.AutoSize = true;
     this.label6.Location = new System.Drawing.Point(24, 143);
     this.label6.Name = "label6";
     this.label6.Size = new System.Drawing.Size(133, 19);
     this.label6.TabIndex = 4;
     this.label6.Text = "Initial Directory (./)";
     //
     // label5
     //
     this.label5.AutoSize = true;
     this.label5.Location = new System.Drawing.Point(64, 110);
     this.label5.Name = "label5";
     this.label5.Size = new System.Drawing.Size(93, 19);
     this.label5.TabIndex = 3;
     this.label5.Text = "Remote Port:";
     //
     // label4
     //
     this.label4.AutoSize = true;
     this.label4.Location = new System.Drawing.Point(28, 77);
     this.label4.Name = "label4";
     this.label4.Size = new System.Drawing.Size(129, 19);
     this.label4.TabIndex = 2;
     this.label4.Text = "Remote Password:"******"label3";
     this.label3.Size = new System.Drawing.Size(133, 19);
     this.label3.TabIndex = 1;
     this.label3.Text = "Remote Username:"******"label2";
     this.label2.Size = new System.Drawing.Size(139, 19);
     this.label2.TabIndex = 0;
     this.label2.Text = "Remote Host Name:";
     //
     // tabPage4
     //
     this.tabPage4.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
     this.tabPage4.Controls.Add(this.savePSDasFileCheckbox);
     this.tabPage4.Controls.Add(this.groupBox2);
     this.tabPage4.Controls.Add(this.ShowMessagesCheckbox);
     this.tabPage4.Controls.Add(this.HideUponLaunchCheckbox);
     this.tabPage4.Controls.Add(this.startOnWindowsLoadCheckBox);
     this.tabPage4.Controls.Add(this.saveGlobalSettingButton);
     this.tabPage4.Location = new System.Drawing.Point(4, 30);
     this.tabPage4.Name = "tabPage4";
     this.tabPage4.Size = new System.Drawing.Size(475, 216);
     this.tabPage4.TabIndex = 3;
     this.tabPage4.Text = "Settings";
     this.tabPage4.ToolTipText = "Set global application settings";
     //
     // savePSDasFileCheckbox
     //
     this.savePSDasFileCheckbox.AutoSize = true;
     this.savePSDasFileCheckbox.Location = new System.Drawing.Point(25, 90);
     this.savePSDasFileCheckbox.Name = "savePSDasFileCheckbox";
     this.savePSDasFileCheckbox.Size = new System.Drawing.Size(191, 23);
     this.savePSDasFileCheckbox.TabIndex = 15;
     this.savePSDasFileCheckbox.Text = "Save a JPEG of a PSD file.";
     this.savePSDasFileCheckbox.UseVisualStyleBackColor = true;
     //
     // groupBox2
     //
     this.groupBox2.Controls.Add(this.removeContextMenuButton);
     this.groupBox2.Controls.Add(this.attachContextMenuButton);
     this.groupBox2.Location = new System.Drawing.Point(25, 119);
     this.groupBox2.Name = "groupBox2";
     this.groupBox2.Size = new System.Drawing.Size(428, 62);
     this.groupBox2.TabIndex = 14;
     this.groupBox2.TabStop = false;
     this.groupBox2.Text = "Windows Context Menu";
     //
     // removeContextMenuButton
     //
     this.removeContextMenuButton.BackColor = System.Drawing.Color.Crimson;
     this.removeContextMenuButton.Location = new System.Drawing.Point(220, 21);
     this.removeContextMenuButton.Name = "removeContextMenuButton";
     this.removeContextMenuButton.ShineColor = System.Drawing.Color.Pink;
     this.removeContextMenuButton.Size = new System.Drawing.Size(198, 35);
     this.removeContextMenuButton.TabIndex = 14;
     this.removeContextMenuButton.Text = " Remove";
     this.removeContextMenuButton.Click += new System.EventHandler(this.removeContextMenuButton_Click);
     //
     // attachContextMenuButton
     //
     this.attachContextMenuButton.BackColor = System.Drawing.Color.Crimson;
     this.attachContextMenuButton.Location = new System.Drawing.Point(16, 21);
     this.attachContextMenuButton.Name = "attachContextMenuButton";
     this.attachContextMenuButton.ShineColor = System.Drawing.Color.Pink;
     this.attachContextMenuButton.Size = new System.Drawing.Size(198, 35);
     this.attachContextMenuButton.TabIndex = 13;
     this.attachContextMenuButton.Text = "Attach ";
     this.attachContextMenuButton.Click += new System.EventHandler(this.attachToWindowsButton_Click);
     //
     // ShowMessagesCheckbox
     //
     this.ShowMessagesCheckbox.AutoSize = true;
     this.ShowMessagesCheckbox.Location = new System.Drawing.Point(25, 61);
     this.ShowMessagesCheckbox.Name = "ShowMessagesCheckbox";
     this.ShowMessagesCheckbox.Size = new System.Drawing.Size(306, 23);
     this.ShowMessagesCheckbox.TabIndex = 3;
     this.ShowMessagesCheckbox.Text = "Show program messages in a message box";
     this.ShowMessagesCheckbox.UseVisualStyleBackColor = true;
     //
     // HideUponLaunchCheckbox
     //
     this.HideUponLaunchCheckbox.AutoSize = true;
     this.HideUponLaunchCheckbox.Location = new System.Drawing.Point(25, 32);
     this.HideUponLaunchCheckbox.Name = "HideUponLaunchCheckbox";
     this.HideUponLaunchCheckbox.Size = new System.Drawing.Size(284, 23);
     this.HideUponLaunchCheckbox.TabIndex = 1;
     this.HideUponLaunchCheckbox.Text = "Hide instantly upon launch of program. ";
     this.HideUponLaunchCheckbox.UseVisualStyleBackColor = true;
     //
     // startOnWindowsLoadCheckBox
     //
     this.startOnWindowsLoadCheckBox.AutoSize = true;
     this.startOnWindowsLoadCheckBox.Location = new System.Drawing.Point(25, 3);
     this.startOnWindowsLoadCheckBox.Name = "startOnWindowsLoadCheckBox";
     this.startOnWindowsLoadCheckBox.Size = new System.Drawing.Size(307, 23);
     this.startOnWindowsLoadCheckBox.TabIndex = 0;
     this.startOnWindowsLoadCheckBox.Text = "Start this program when Windows boots up";
     this.startOnWindowsLoadCheckBox.UseVisualStyleBackColor = true;
     //
     // saveGlobalSettingButton
     //
     this.saveGlobalSettingButton.BackColor = System.Drawing.Color.Chocolate;
     this.saveGlobalSettingButton.Location = new System.Drawing.Point(158, 186);
     this.saveGlobalSettingButton.Name = "saveGlobalSettingButton";
     this.saveGlobalSettingButton.OuterBorderColor = System.Drawing.Color.LightSalmon;
     this.saveGlobalSettingButton.Size = new System.Drawing.Size(161, 27);
     this.saveGlobalSettingButton.TabIndex = 6;
     this.saveGlobalSettingButton.Text = "Save Program Settings";
     this.saveGlobalSettingButton.Click += new System.EventHandler(this.saveGlobalSettingButton_Click);
     //
     // tabPage5
     //
     this.tabPage5.Location = new System.Drawing.Point(4, 30);
     this.tabPage5.Name = "tabPage5";
     this.tabPage5.Size = new System.Drawing.Size(475, 216);
     this.tabPage5.TabIndex = 4;
     this.tabPage5.Text = "Log";
     this.tabPage5.ToolTipText = "Check log files";
     this.tabPage5.UseVisualStyleBackColor = true;
     //
     // notifyIcon
     //
     this.notifyIcon.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info;
     this.notifyIcon.BalloonTipText = "Program Status: Running";
     this.notifyIcon.BalloonTipTitle = "Skimpt v1.01";
     this.notifyIcon.ContextMenuStrip = this.notificationIconContext;
     this.notifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon.Icon")));
     this.notifyIcon.Text = "Skimpt v1.01\r\nProgram Status: Running";
     this.notifyIcon.Visible = true;
     this.notifyIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon_MouseDoubleClick);
     //
     // notificationIconContext
     //
     this.notificationIconContext.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.contextStartCamera,
         this.contextHighlightMode,
         this.toolStripSeparator1,
         this.contextShowMenu,
         this.contextExitMenu});
     this.notificationIconContext.Name = "notificationIconContext";
     this.notificationIconContext.Size = new System.Drawing.Size(172, 98);
     //
     // contextStartCamera
     //
     this.contextStartCamera.Name = "contextStartCamera";
     this.contextStartCamera.Size = new System.Drawing.Size(171, 22);
     this.contextStartCamera.Text = "Start Camera Mode";
     this.contextStartCamera.Click += new System.EventHandler(this.contextStartCamera_Click);
     //
     // contextHighlightMode
     //
     this.contextHighlightMode.Name = "contextHighlightMode";
     this.contextHighlightMode.Size = new System.Drawing.Size(171, 22);
     this.contextHighlightMode.Text = "Start Highlight Mode";
     this.contextHighlightMode.Click += new System.EventHandler(this.contextHighlightMode_Click);
     //
     // toolStripSeparator1
     //
     this.toolStripSeparator1.Name = "toolStripSeparator1";
     this.toolStripSeparator1.Size = new System.Drawing.Size(168, 6);
     //
     // contextShowMenu
     //
     this.contextShowMenu.Name = "contextShowMenu";
     this.contextShowMenu.Size = new System.Drawing.Size(171, 22);
     this.contextShowMenu.Text = "Show Main Window";
     this.contextShowMenu.Click += new System.EventHandler(this.contextShowMenu_Click);
     //
     // contextExitMenu
     //
     this.contextExitMenu.Name = "contextExitMenu";
     this.contextExitMenu.Size = new System.Drawing.Size(171, 22);
     this.contextExitMenu.Text = "Exit Skimpt";
     this.contextExitMenu.Click += new System.EventHandler(this.contextExitMenu_Click);
     //
     // main
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.AutoSize = true;
     this.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
     this.ClientSize = new System.Drawing.Size(483, 250);
     this.Controls.Add(this.tabControl1);
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
     this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.MaximizeBox = false;
     this.MinimizeBox = false;
     this.Name = "main";
     this.Opacity = 0.9;
     this.ShowIcon = false;
     this.ShowInTaskbar = false;
     this.Text = "Skimpt v 1.01";
     this.TopMost = true;
     this.Load += new System.EventHandler(this.main_Load);
     this.Shown += new System.EventHandler(this.main_Shown);
     this.Closing += new System.ComponentModel.CancelEventHandler(this.main_Closing);
     this.tabControl1.ResumeLayout(false);
     this.tabPage1.ResumeLayout(false);
     this.tabPage1.PerformLayout();
     this.tabPage2.ResumeLayout(false);
     this.tabPage2.PerformLayout();
     this.groupBox1.ResumeLayout(false);
     this.groupBox1.PerformLayout();
     this.tabPage3.ResumeLayout(false);
     this.tabPage3.PerformLayout();
     this.tabPage4.ResumeLayout(false);
     this.tabPage4.PerformLayout();
     this.groupBox2.ResumeLayout(false);
     this.notificationIconContext.ResumeLayout(false);
     this.ResumeLayout(false);
 }
 private void InitializeComponent()
 {
     this.icontainer_0 = new Container();
     this.richTextBox1 = new RichTextBox();
     this.timer_0 = new System.Windows.Forms.Timer(this.icontainer_0);
     this.menuStrip1 = new MenuStrip();
     this.logOptionsToolStripMenuItem = new ToolStripMenuItem();
     this.stopTheServerLogToolStripMenuItem = new ToolStripMenuItem();
     this.stopTheClientLogToolStripMenuItem = new ToolStripMenuItem();
     this.clearLogToolStripMenuItem = new ToolStripMenuItem();
     this.toolsToolStripMenuItem = new ToolStripMenuItem();
     this.saveHabboswfToolStripMenuItem = new ToolStripMenuItem();
     this.saveLogToolStripMenuItem = new ToolStripMenuItem();
     this.txtSearch = new TextBox();
     this.txtInject = new TextBox();
     this.fontDialog_0 = new FontDialog();
     this.fontStyleToolStripMenuItem = new ToolStripMenuItem();
     this.backgroundColorToolStripMenuItem = new ToolStripMenuItem();
     this.fontColorsToolStripMenuItem = new ToolStripMenuItem();
     this.clientToolStripMenuItem = new ToolStripMenuItem();
     this.serverToolStripMenuItem = new ToolStripMenuItem();
     this.fontFamilyToolStripMenuItem = new ToolStripMenuItem();
     this.colorDialog_0 = new ColorDialog();
     this.menuStrip1.SuspendLayout();
     base.SuspendLayout();
     this.richTextBox1.BackColor = Color.FromArgb(0x40, 0x40, 0x40);
     this.richTextBox1.BorderStyle = BorderStyle.None;
     this.richTextBox1.Dock = DockStyle.Fill;
     this.richTextBox1.ForeColor = Color.PaleGreen;
     this.richTextBox1.Location = new Point(0, 0x21);
     this.richTextBox1.Name = "richTextBox1";
     this.richTextBox1.Size = new Size(0x38d, 0x20e);
     this.richTextBox1.TabIndex = 0;
     this.richTextBox1.Text = "";
     this.richTextBox1.SizeChanged += new EventHandler(this.richTextBox1_SizeChanged);
     this.richTextBox1.TextChanged += new EventHandler(this.richTextBox1_TextChanged);
     this.richTextBox1.KeyDown += new KeyEventHandler(this.Packetlogger_KeyDown);
     this.richTextBox1.KeyPress += new KeyPressEventHandler(this.Packetlogger_KeyPress);
     this.timer_0.Enabled = true;
     this.timer_0.Tick += new EventHandler(this.timer_0_Tick);
     this.menuStrip1.Font = new Font("Segoe UI", 14f);
     this.menuStrip1.Items.AddRange(new ToolStripItem[] { this.logOptionsToolStripMenuItem, this.toolsToolStripMenuItem });
     this.menuStrip1.Location = new Point(0, 0);
     this.menuStrip1.Name = "menuStrip1";
     this.menuStrip1.Size = new Size(0x38d, 0x21);
     this.menuStrip1.TabIndex = 2;
     this.menuStrip1.Text = "menuStrip1";
     this.logOptionsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { this.fontStyleToolStripMenuItem, this.stopTheServerLogToolStripMenuItem, this.stopTheClientLogToolStripMenuItem, this.clearLogToolStripMenuItem });
     this.logOptionsToolStripMenuItem.Name = "logOptionsToolStripMenuItem";
     this.logOptionsToolStripMenuItem.Size = new Size(0x7e, 0x1d);
     this.logOptionsToolStripMenuItem.Text = "Log Options";
     this.stopTheServerLogToolStripMenuItem.Name = "stopTheServerLogToolStripMenuItem";
     this.stopTheServerLogToolStripMenuItem.Size = new Size(0xf2, 30);
     this.stopTheServerLogToolStripMenuItem.Text = "Stop the server log";
     this.stopTheServerLogToolStripMenuItem.Click += new EventHandler(this.stopTheServerLogToolStripMenuItem_Click);
     this.stopTheClientLogToolStripMenuItem.Name = "stopTheClientLogToolStripMenuItem";
     this.stopTheClientLogToolStripMenuItem.Size = new Size(0xf2, 30);
     this.stopTheClientLogToolStripMenuItem.Text = "Stop the client log";
     this.stopTheClientLogToolStripMenuItem.Click += new EventHandler(this.stopTheClientLogToolStripMenuItem_Click);
     this.clearLogToolStripMenuItem.Name = "clearLogToolStripMenuItem";
     this.clearLogToolStripMenuItem.Size = new Size(0xf2, 30);
     this.clearLogToolStripMenuItem.Text = "Clear log";
     this.clearLogToolStripMenuItem.Click += new EventHandler(this.clearLogToolStripMenuItem_Click);
     this.toolsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { this.saveHabboswfToolStripMenuItem, this.saveLogToolStripMenuItem });
     this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
     this.toolsToolStripMenuItem.Size = new Size(0x45, 0x1d);
     this.toolsToolStripMenuItem.Text = "Tools";
     this.saveHabboswfToolStripMenuItem.Name = "saveHabboswfToolStripMenuItem";
     this.saveHabboswfToolStripMenuItem.Size = new Size(0xd8, 30);
     this.saveHabboswfToolStripMenuItem.Text = "Save Habbo.swf";
     this.saveHabboswfToolStripMenuItem.Click += new EventHandler(this.saveHabboswfToolStripMenuItem_Click);
     this.saveLogToolStripMenuItem.Name = "saveLogToolStripMenuItem";
     this.saveLogToolStripMenuItem.Size = new Size(0xd8, 30);
     this.saveLogToolStripMenuItem.Text = "Save log";
     this.saveLogToolStripMenuItem.Click += new EventHandler(this.saveLogToolStripMenuItem_Click);
     this.txtSearch.BackColor = Color.Silver;
     this.txtSearch.BorderStyle = BorderStyle.FixedSingle;
     this.txtSearch.Dock = DockStyle.Bottom;
     this.txtSearch.Location = new Point(0, 0x204);
     this.txtSearch.Name = "txtSearch";
     this.txtSearch.Size = new Size(0x38d, 0x2b);
     this.txtSearch.TabIndex = 3;
     this.txtSearch.Visible = false;
     this.txtSearch.TextChanged += new EventHandler(this.txtSearch_TextChanged);
     this.txtSearch.KeyDown += new KeyEventHandler(this.Packetlogger_KeyDown);
     this.txtInject.BackColor = Color.Silver;
     this.txtInject.BorderStyle = BorderStyle.FixedSingle;
     this.txtInject.Dock = DockStyle.Bottom;
     this.txtInject.Location = new Point(0, 0x1d9);
     this.txtInject.Name = "txtInject";
     this.txtInject.Size = new Size(0x38d, 0x2b);
     this.txtInject.TabIndex = 4;
     this.txtInject.Visible = false;
     this.txtInject.TextChanged += new EventHandler(this.txtInject_TextChanged);
     this.txtInject.KeyDown += new KeyEventHandler(this.txtInject_KeyDown);
     this.fontDialog_0.Color = SystemColors.ControlText;
     this.fontDialog_0.Apply += new EventHandler(this.fontDialog_0_Apply);
     this.fontStyleToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { this.backgroundColorToolStripMenuItem, this.fontColorsToolStripMenuItem, this.fontFamilyToolStripMenuItem });
     this.fontStyleToolStripMenuItem.Name = "fontStyleToolStripMenuItem";
     this.fontStyleToolStripMenuItem.Size = new Size(0xf2, 30);
     this.fontStyleToolStripMenuItem.Text = "Font Style";
     this.fontStyleToolStripMenuItem.Click += new EventHandler(this.fontStyleToolStripMenuItem_Click);
     this.backgroundColorToolStripMenuItem.Name = "backgroundColorToolStripMenuItem";
     this.backgroundColorToolStripMenuItem.Size = new Size(0xe9, 30);
     this.backgroundColorToolStripMenuItem.Text = "Background color";
     this.backgroundColorToolStripMenuItem.Click += new EventHandler(this.backgroundColorToolStripMenuItem_Click);
     this.fontColorsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { this.clientToolStripMenuItem, this.serverToolStripMenuItem });
     this.fontColorsToolStripMenuItem.Name = "fontColorsToolStripMenuItem";
     this.fontColorsToolStripMenuItem.Size = new Size(0xe9, 30);
     this.fontColorsToolStripMenuItem.Text = "Font colors";
     this.clientToolStripMenuItem.Name = "clientToolStripMenuItem";
     this.clientToolStripMenuItem.Size = new Size(0x98, 30);
     this.clientToolStripMenuItem.Text = "Client";
     this.clientToolStripMenuItem.Click += new EventHandler(this.clientToolStripMenuItem_Click);
     this.serverToolStripMenuItem.Name = "serverToolStripMenuItem";
     this.serverToolStripMenuItem.Size = new Size(0x98, 30);
     this.serverToolStripMenuItem.Text = "Server";
     this.serverToolStripMenuItem.Click += new EventHandler(this.serverToolStripMenuItem_Click);
     this.fontFamilyToolStripMenuItem.Name = "fontFamilyToolStripMenuItem";
     this.fontFamilyToolStripMenuItem.Size = new Size(0xe9, 30);
     this.fontFamilyToolStripMenuItem.Text = "Font Family";
     this.fontFamilyToolStripMenuItem.Click += new EventHandler(this.fontFamilyToolStripMenuItem_Click);
     base.AutoScaleDimensions = new SizeF(15f, 37f);
     base.AutoScaleMode = AutoScaleMode.Font;
     this.BackColor = Color.FromArgb(0x40, 0x40, 0x40);
     base.ClientSize = new Size(0x38d, 0x22f);
     base.Controls.Add(this.txtInject);
     base.Controls.Add(this.txtSearch);
     base.Controls.Add(this.richTextBox1);
     base.Controls.Add(this.menuStrip1);
     this.Font = new Font("Segoe UI", 20f);
     this.ForeColor = Color.LimeGreen;
     base.MainMenuStrip = this.menuStrip1;
     base.Margin = new Padding(8, 9, 8, 9);
     base.Name = "Packetlogger";
     this.Text = "Packetlogger";
     base.FormClosed += new FormClosedEventHandler(this.Packetlogger_FormClosed);
     base.Load += new EventHandler(this.Packetlogger_Load);
     base.SizeChanged += new EventHandler(this.Packetlogger_SizeChanged);
     base.KeyDown += new KeyEventHandler(this.Packetlogger_KeyDown);
     base.KeyPress += new KeyPressEventHandler(this.Packetlogger_KeyPress);
     base.Resize += new EventHandler(this.Packetlogger_Resize);
     this.menuStrip1.ResumeLayout(false);
     this.menuStrip1.PerformLayout();
     base.ResumeLayout(false);
     base.PerformLayout();
 }
Example #36
0
    private void ChangeFont_Click(object sender, EventArgs e)
    {
        FontDialog dialog = new FontDialog();
            dialog.Font = menuBar.Font;

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                menuBar.Font = dialog.Font;
                toolBar.Font = dialog.Font;
            }
    }
Example #37
0
        private void ButtonFont_Click(object sender, RoutedEventArgs e)
        {
            FontDialog fd = new FontDialog();
            FontFamily fontFamily = fd.ShowDialog();

            if (fontFamily != null && selectElement != null)
            {
                MyUITextBlock myUi = selectElement.Tag as MyUITextBlock;
                myUi.FontFamily = fontFamily;

                TextBlock textBlock = selectElement.Child as TextBlock;
                textBlock.FontFamily = fontFamily;
            }
        }
Example #38
0
 // Handle font menu
 protected void Font_Click(Object sender, EventArgs e)
 {
     FontDialog f = new FontDialog();
     if(f.ShowDialog() == DialogResult.OK)
       text.Font = f.Font;
 }
Example #39
0
    public void CreateMySettingsForm()
    {
        buttonOk 				= new Button();
        buttonCancel 			= new Button();
        buttonChangeFont 		= new Button();
        buttonApply				= new Button();
        buttonLineColor			= new Button();
        buttonLineMore			= new Button();
        buttonLineLess			= new Button();
        buttonArrowMore			= new Button();
        buttonArrowLess			= new Button();
        buttonHorizontalMore	= new Button();
        buttonHorizontalLess	= new Button();
        buttonVerticalMore		= new Button();
        buttonVerticalLess		= new Button();
        buttonSymbolSizeLess	= new Button();
        buttonSymbolSizeMore	= new Button();
        buttonRestoreDefault	= new Button();
        labelFont				= new Label();
        labelLineColor			= new Label();
        labelGapHeight			= new Label();
        labelGapWidth 			= new Label();
        labelLineThickness		= new Label();
        labelArrowSize			= new Label();
        labelSymbolSize			= new Label();
        fontDialog1				= new FontDialog();
        colorDialog1			= new ColorDialog();
        tabPageFont				= new TabPage();
        tabPageLine				= new TabPage();
        tabPageDimensions		= new TabPage();
        tabPageOptimization		= new TabPage();
        tabControl 				= new TabControl();
        groupBoxTandNT			= new GroupBox();
        groupBoxThickness		= new GroupBox();
        groupBoxArrow			= new GroupBox();
        groupBoxLineColor		= new GroupBox();
        groupBoxHorizontal		= new GroupBox();
        groupBoxVertical		= new GroupBox();
        groupBoxSymbolSize		= new GroupBox();
        groupBoxOptimization	= new GroupBox();
        checkBoxOptimization	= new CheckBox();

           form1.Text 				= "Settings";
           form1.FormBorderStyle 	= FormBorderStyle.FixedDialog;
           form1.MaximizeBox 		= false;
           form1.MinimizeBox 		= false;
           form1.AcceptButton 		= buttonOk;
           form1.CancelButton 		= buttonCancel;
           form1.StartPosition 		= FormStartPosition.CenterScreen;

           checkBoxOptimization.Checked = Node.OptimizeGraph;

           buttonCancel.Text 		= "Cancel";
           buttonOk.Text 			= "OK";
           buttonChangeFont.Text	= "Change font...";
           buttonApply.Text			= "Apply";
           buttonLineMore.Text		= ">";
           buttonLineLess.Text		= "<";
           buttonArrowMore.Text		= ">";
           buttonArrowLess.Text		= "<";
           buttonHorizontalMore.Text= ">";
           buttonHorizontalLess.Text= "<";
           buttonVerticalMore.Text	= ">";
           buttonVerticalLess.Text	= "<";
           buttonSymbolSizeMore.Text= ">";
           buttonSymbolSizeLess.Text= "<";
           buttonLineColor.Text		= "Change color...";
           buttonRestoreDefault.Text= "Restore default settings";
           labelFont.Text			= Node.CharFont.Name;
           labelGapHeight.Text		= Convert.ToString(Node.ComponentGapHeight);
           labelGapWidth.Text		= Convert.ToString(Node.ComponentGapWidth-26);
           tabPageFont.Text			= "Font";
           tabPageLine.Text			= "Line";
           tabPageDimensions.Text	= "Dimensions";
           tabPageOptimization.Text = "Optimizations";
           groupBoxTandNT.Text		= "Terminal and nonterminal symbols";
           groupBoxThickness.Text	= "Thickness";
           groupBoxArrow.Text		= "Size of Arrow";
           groupBoxLineColor.Text	= "Color";
           groupBoxHorizontal.Text	= "Horizontal";
           groupBoxVertical.Text	= "Vertical";
           groupBoxSymbolSize.Text	= "Gap between symbolline and font (vertical)";
           groupBoxOptimization.Text= "Optimization";
           labelLineThickness.Text  = Convert.ToString(Node.LinePen.Width);
           labelArrowSize.Text  	= Convert.ToString(Node.ArrowSize);
           labelSymbolSize.Text		= Convert.ToString(Node.SymbolGapHeight);
           checkBoxOptimization.Text= "Enable optimizations (reload required)";

           labelFont.Font			= Node.CharFont;
           labelFont.ForeColor		= Node.CharColor;
           labelFont.BackColor		= Color.White;
           labelFont.TextAlign		= ContentAlignment.MiddleCenter;

           if(Node.LinePen.Width<=1)		buttonLineLess.Enabled 		 	= false;
           if(Node.SymbolGapHeight<=0)		buttonSymbolSizeLess.Enabled 	= false;
           if(Node.ArrowSize<=1)			buttonArrowLess.Enabled  	 	= false;
           if(Node.ComponentGapHeight<=0)	buttonVerticalLess.Enabled 		= false;
           if(Node.ComponentGapWidth<=26)	buttonHorizontalLess.Enabled	= false;

           labelLineThickness.Font		= new Font("Times",12);
           labelLineThickness.TextAlign	= ContentAlignment.MiddleCenter;

           labelArrowSize.Font			= new Font("Times",12);
           labelArrowSize.TextAlign		= ContentAlignment.MiddleCenter;

           labelGapHeight.Font			= new Font("Times",12);
           labelGapHeight.TextAlign		= ContentAlignment.MiddleCenter;

           labelGapWidth.Font			= new Font("Times",12);
           labelGapWidth.TextAlign		= ContentAlignment.MiddleCenter;

           labelSymbolSize.Font			= new Font("Times",12);
           labelSymbolSize.TextAlign	= ContentAlignment.MiddleCenter;

           labelLineColor.BackColor=Node.LinePen.Color;

           buttonLineColor.Size 	= new Size(100,20);
           buttonLineMore.Size		= new Size(20,20);
           buttonLineLess.Size		= new Size(20,20);
           buttonArrowMore.Size		= new Size(20,20);
           buttonArrowLess.Size		= new Size(20,20);
           buttonHorizontalMore.Size= new Size(20,20);
           buttonHorizontalLess.Size= new Size(20,20);
           buttonVerticalMore.Size	= new Size(20,20);
           buttonVerticalLess.Size	= new Size(20,20);
           buttonSymbolSizeMore.Size= new Size(20,20);
           buttonSymbolSizeLess.Size= new Size(20,20);
           buttonChangeFont.Size	= new Size(90,20);
           buttonRestoreDefault.Size= new Size(150,20);
           tabControl.Size			= new Size(form1.Size.Width-15, form1.Size.Height-150);
           groupBoxTandNT.Size		= new Size(tabControl.Size.Width-30, groupBoxTandNT.Size.Height);
           groupBoxThickness.Size	= new Size(100, 50);
           groupBoxArrow.Size		= new Size(100, 50);
           groupBoxHorizontal.Size	= new Size(100, 50);
           groupBoxVertical.Size	= new Size(100, 50);
           groupBoxOptimization.Size= new Size(tabControl.Size.Width-30, 50);
           groupBoxLineColor.Size   = new Size(155, 50);
           groupBoxSymbolSize.Size	= new Size(tabControl.Size.Width-30, 50);
           labelLineColor.Size		= new Size(20,20);
           labelFont.Size			= new Size(groupBoxTandNT.Size.Width-20,40);
           checkBoxOptimization.Size= new Size(220, 20);

           groupBoxTandNT.Location			= new Point (10,10);
           groupBoxThickness.Location		= new Point (10,10);
           groupBoxArrow.Location			= new Point (10,groupBoxThickness.Height+10);
           groupBoxLineColor.Location		= new Point (110,10);
           groupBoxHorizontal.Location		= new Point (10,10);
           groupBoxVertical.Location		= new Point (110,10);
           groupBoxOptimization.Location	= new Point (10,10);
           groupBoxSymbolSize.Location		= new Point (10,groupBoxVertical.Height+10);
           labelFont.Location 				= new Point (10,20);
           buttonOk.Location				= new Point (20, 220);
           buttonApply.Location				= new Point (buttonOk.Left+buttonOk.Width+10, 220);
           buttonCancel.Location 			= new Point (buttonApply.Left+buttonApply.Width+20, 220);
           tabControl.Location				= new Point (5,5);
           buttonChangeFont.Location		= new Point (tabControl.Right-buttonChangeFont.Size.Width-45,labelFont.Top+labelFont.Height+10);
           buttonLineLess.Location			= new Point (10,20);
           buttonLineMore.Location			= new Point (buttonLineLess.Right+40, buttonLineLess.Top);
           buttonArrowLess.Location			= new Point (10,20);
           buttonArrowMore.Location			= new Point (buttonLineLess.Right+40, buttonLineLess.Top);
           buttonHorizontalLess.Location	= new Point (10,20);
           buttonHorizontalMore.Location	= new Point (buttonHorizontalLess.Right+40, buttonHorizontalLess.Top);
           buttonVerticalLess.Location		= new Point (10,20);
           buttonVerticalMore.Location		= new Point (buttonVerticalLess.Right+40, buttonVerticalLess.Top);
           buttonSymbolSizeLess.Location	= new Point (10,20);
           buttonSymbolSizeMore.Location	= new Point (buttonSymbolSizeLess.Right+40, buttonSymbolSizeLess.Top);
           buttonRestoreDefault.Location	= new Point ((tabControl.Size.Width-buttonRestoreDefault.Size.Width)/2, tabControl.Bottom+20);
           labelLineThickness.Location		= new Point (buttonLineLess.Right,buttonLineLess.Top);
           labelArrowSize.Location			= new Point (buttonArrowLess.Right,buttonArrowLess.Top);
           labelGapHeight.Location			= new Point (buttonHorizontalLess.Right,buttonHorizontalLess.Top);
           labelGapWidth.Location			= new Point (buttonVerticalLess.Right,buttonVerticalLess.Top);
           labelSymbolSize.Location			= new Point (buttonSymbolSizeLess.Right,buttonSymbolSizeLess.Top);
           labelLineColor.Location			= new Point (10,20);
           buttonLineColor.Location			= new Point (labelLineColor.Right+10,20);
           checkBoxOptimization.Location	= new Point (10,20);

           labelLineThickness.Size			= new Size  (buttonLineMore.Left-buttonLineLess.Right,buttonLineLess.Height);
           labelArrowSize.Size				= new Size  (buttonArrowMore.Left-buttonArrowLess.Right,buttonArrowLess.Height);
           labelGapHeight.Size				= new Size  (buttonHorizontalMore.Left-buttonHorizontalLess.Right,buttonHorizontalLess.Height);
           labelGapWidth.Size				= new Size  (buttonVerticalMore.Left-buttonVerticalLess.Right,buttonVerticalLess.Height);
           labelSymbolSize.Size				= new Size  (buttonSymbolSizeMore.Left-buttonSymbolSizeLess.Right,buttonSymbolSizeLess.Height);

           groupBoxTandNT.Controls.Add(buttonChangeFont);
           groupBoxTandNT.Controls.Add(labelFont);
           groupBoxHorizontal.Controls.Add(labelGapWidth);
           groupBoxVertical.Controls.Add(labelGapHeight);
           groupBoxThickness.Controls.Add(buttonLineMore);
           groupBoxThickness.Controls.Add(buttonLineLess);
           groupBoxThickness.Controls.Add(labelLineThickness);
           groupBoxLineColor.Controls.Add(buttonLineColor);
           groupBoxLineColor.Controls.Add(labelLineColor);
           groupBoxArrow.Controls.Add(buttonArrowMore);
           groupBoxArrow.Controls.Add(buttonArrowLess);
           groupBoxArrow.Controls.Add(labelArrowSize);
           groupBoxHorizontal.Controls.Add(buttonHorizontalLess);
           groupBoxHorizontal.Controls.Add(buttonHorizontalMore);
           groupBoxVertical.Controls.Add(buttonVerticalLess);
           groupBoxVertical.Controls.Add(buttonVerticalMore);
           groupBoxSymbolSize.Controls.Add(buttonSymbolSizeMore);
           groupBoxSymbolSize.Controls.Add(buttonSymbolSizeLess);
           groupBoxSymbolSize.Controls.Add(labelSymbolSize);
           groupBoxOptimization.Controls.Add(checkBoxOptimization);

           tabPageFont.Controls.Add(groupBoxTandNT);
           tabPageLine.Controls.Add(groupBoxThickness);
           tabPageLine.Controls.Add(groupBoxLineColor);
           tabPageLine.Controls.Add(groupBoxArrow);
           tabPageDimensions.Controls.Add(groupBoxSymbolSize);
           tabPageDimensions.Controls.Add(groupBoxHorizontal);
           tabPageDimensions.Controls.Add(groupBoxVertical);
           tabPageOptimization.Controls.Add(groupBoxOptimization);

           tabControl.Controls.Add(this.tabPageFont);
           tabControl.Controls.Add(this.tabPageLine);
           tabControl.Controls.Add(this.tabPageDimensions);
           tabControl.Controls.Add(this.tabPageOptimization);

           form1.Controls.Add(this.tabControl);
           form1.Controls.Add(buttonOk);
           form1.Controls.Add(buttonCancel);
           form1.Controls.Add(buttonApply);
           form1.Controls.Add(buttonRestoreDefault);

           buttonOk.Click				+= new System.EventHandler(this.buttonOk_Click);
           buttonChangeFont.Click		+= new System.EventHandler(this.buttonChangeFont_Click);
           buttonApply.Click			+= new System.EventHandler(this.buttonApply_Click);
           buttonLineColor.Click		+= new System.EventHandler(this.buttonLineColor_Click);
           buttonLineMore.Click			+= new System.EventHandler(this.buttonLineMore_Click);
           buttonLineLess.Click			+= new System.EventHandler(this.buttonLineLess_Click);
           buttonArrowMore.Click		+= new System.EventHandler(this.buttonArrowMore_Click);
           buttonArrowLess.Click		+= new System.EventHandler(this.buttonArrowLess_Click);
           buttonHorizontalMore.Click	+= new System.EventHandler(this.buttonHorizontalMore_Click);
           buttonHorizontalLess.Click	+= new System.EventHandler(this.buttonHorizontalLess_Click);
           buttonVerticalMore.Click		+= new System.EventHandler(this.buttonVerticalMore_Click);
           buttonVerticalLess.Click		+= new System.EventHandler(this.buttonVerticalLess_Click);
           buttonSymbolSizeMore.Click	+= new System.EventHandler(this.buttonSymbolSizeMore_Click);
           buttonSymbolSizeLess.Click	+= new System.EventHandler(this.buttonSymbolSizeLess_Click);
           buttonCancel.Click			+= new System.EventHandler(this.buttonCancel_Click);
           buttonRestoreDefault.Click	+= new System.EventHandler(this.buttonRestoreDefault_Click);

           form1.ShowDialog();
    }
Example #40
0
 public void SetFont()
 {
     FontDialog dlgFont=new FontDialog();
     dlgFont.Font=txtCPad.Font;
     dlgFont.ShowColor=true;
     dlgFont.Color=txtCPad.ForeColor;
     if(dlgFont.ShowDialog()==DialogResult.OK)
     {
         txtCPad.Font=dlgFont.Font;
         txtCPad.ForeColor=dlgFont.Color;
     }
 }