示例#1
0
        /// <summary>
        /// Opens FontStyle Dialog and updates application settings and
        /// font style area when new font style is choosen.
        /// </summary>
        /// <param name="fsa">A <see cref="FontStyleArea"/> that visualizes the changed font.</param>
        /// <param name="colorToSet">Out. An Application Setting Font <see cref="Color"/>.</param>
        /// <param name="fontToSet">Out. An Application Setting <see cref="Font"/>.</param>
        /// <returns><strong>True</strong>, if style should be applied to settings,
        /// otherwise <strong>false</strong> (User cancelled dialog)</returns>
        private bool btnFontStyleClicked(
            FontStyleArea fsa,
            out Color colorToSet,
            out Font fontToSet)
        {
            FontStyleDlg dlgStyle = new FontStyleDlg();

            dlgStyle.Text             = "Set font style...";
            dlgStyle.CurrentFont      = fsa.Font;
            dlgStyle.CurrentFontColor = fsa.FontColor;
            dlgStyle.Icon             = Properties.Resources.AOIFontIcon;
            if (dlgStyle.ShowDialog() == DialogResult.OK)
            {
                fsa.Font      = dlgStyle.CurrentFont;
                fsa.FontColor = dlgStyle.CurrentFontColor;
                fsa.Refresh();
                colorToSet = dlgStyle.CurrentFontColor;
                fontToSet  = dlgStyle.CurrentFont;
                return(true);
            }
            else
            {
                colorToSet = Color.Empty;
                fontToSet  = SystemInformation.MenuFont;
                return(false);
            }
        }
示例#2
0
 /// <summary>
 /// The <see cref="Control.Click"/> event handler for
 /// the <see cref="Button"/> <see cref="btnNumbersStyle"/>.
 /// Updates the colorization property of the selected subject or group
 /// with the changes made in the <see cref="PenStyleDlg"/> for
 /// the fixation number font.
 /// </summary>
 /// <param name="sender">Source of the event.</param>
 /// <param name="e">An empty <see cref="EventArgs"/></param>
 private void btnNumbersStyle_Click(object sender, EventArgs e)
 {
     if (this.trvSubjects.SelectedNode != null)
     {
         FontStyleDlg dlg = new FontStyleDlg();
         dlg.CurrentFontColor = this.selectedFontColor;
         dlg.CurrentFont      = this.selectedFont;
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             this.selectedFontColor = dlg.CurrentFontColor;
             this.selectedFont      = dlg.CurrentFont;
             this.SubmitStyleToSubjectOrCategory();
         }
     }
 }
示例#3
0
        /// <summary>
        /// <see cref="Control.Click"/> event handler
        /// for the <see cref="Button"/> <see cref="btnFont"/>
        /// Raises a <see cref="BrushStyleDlg"/>.
        /// </summary>
        /// <param name="sender">Source of the event.</param>
        /// <param name="e">A empty <see cref="EventArgs"/></param>
        private void btnFont_Click(object sender, EventArgs e)
        {
            FontStyleDlg dlgStyle = new FontStyleDlg();

            dlgStyle.Text                 = "Set font style for the elements name ...";
            dlgStyle.CurrentFont          = btnFont.Font;
            dlgStyle.CurrentFontColor     = txbName.ForeColor;
            dlgStyle.CurrentFontAlignment = this.textAlignment;
            if (dlgStyle.ShowDialog() == DialogResult.OK)
            {
                btnFont.Font       = dlgStyle.CurrentFont;
                txbName.ForeColor  = dlgStyle.CurrentFontColor;
                this.textAlignment = dlgStyle.CurrentFontAlignment;
                OnShapePropertiesChanged(new ShapePropertiesChangedEventArgs(GetDrawAction(),
                                                                             this.NewPen, this.NewBrush, this.NewFont, this.NewFontColor, this.NewName, this.textAlignment));
            }
        }