/// ------------------------------------------------------------------------------------
 /// <summary>
 /// Paint a faint line between the source translation and the source tooltip and
 /// shortcut keys text boxes.
 /// </summary>
 /// ------------------------------------------------------------------------------------
 private void HandleGroupSrcTranslationPaint(object sender, PaintEventArgs e)
 {
     using (var pen = new Pen(PaintingHelper.CalculateColor(Color.Black, Color.White, 45)))
     {
         e.Graphics.DrawLine(pen, _textBoxSrcTranslation.Left, _textBoxSrcTranslation.Bottom + 5,
                             _textBoxSrcTranslation.Right - 1, _textBoxSrcTranslation.Bottom + 5);
     }
 }
        /// ------------------------------------------------------------------------------------
        private void InitializeColorsAndFonts()
        {
            _textBoxSrcTranslation.BackColor  = PaintingHelper.CalculateColor(SystemColors.Control, Color.White, 140);
            _textBoxSrcToolTip.BackColor      = _textBoxSrcTranslation.BackColor;
            _textBoxSrcShortcutKeys.BackColor = _textBoxSrcTranslation.BackColor;
            btnCopyText.BackColor             = _textBoxSrcTranslation.BackColor;
            btnCopyToolTip.BackColor          = _textBoxSrcTranslation.BackColor;
            btnCopyShortcutKeys.BackColor     = _textBoxSrcTranslation.BackColor;

            _grid.Font = DefaultDisplayFont;
            _grid.ColumnHeadersDefaultCellStyle.Font = DefaultDisplayFont;
            _shortcutKeysDropDown.Font           = DefaultDisplayFont;
            _textBoxSrcTranslation.Font          = DefaultDisplayFont;
            _colSrcToolTip.DefaultCellStyle.Font = DefaultDisplayFont;
            _colTgtToolTip.DefaultCellStyle.Font = DefaultDisplayFont;
            _treeView.Font          = DefaultDisplayFont;
            _textBoxSrcToolTip.Font = new Font(DefaultDisplayFont.FontFamily,
                                               _textBoxSrcToolTip.Font.SizeInPoints, FontStyle.Regular);
        }
Exemple #3
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Paints the background of the OK and Reset buttons.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private bool HandleDrawButtonBackground(XButton btn, PaintEventArgs e, PaintState state)
        {
            if (state == PaintState.Hot || state == PaintState.HotDown)
            {
                return(false);
            }

            var   rc  = btn.ClientRectangle;
            Color clr = PaintingHelper.CalculateColor(Color.White, BackColor, 100);

            using (SolidBrush br = new SolidBrush(clr))
                e.Graphics.FillRectangle(br, rc);

            rc.Width--;
            rc.Height--;
            clr = PaintingHelper.CalculateColor(Color.Black, BackColor, 70);
            using (Pen pen = new Pen(clr))
                e.Graphics.DrawRectangle(pen, rc);

            //btn.DrawText(e);
            return(true);
        }