// ------------------------------
        // protected
        // ------------------------------
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            ControlPaintUtil.DrawBorder(
                e.Graphics,
                _linkTargetListBox.Bounds,
                SystemColors.ControlDark,
                SystemColors.Window,
                1
                );
        }
Exemple #2
0
        // ------------------------------
        // private
        // ------------------------------
        private void TagEditForm_Load(object sender, EventArgs e)
        {
            _newTagToolStripButton.Click    += HandleNewTagToolStripButton;
            _removeTagToolStripButton.Click += HandleRemoveTagToolStripButton;
            _renameTagToolStripButton.Click += HandleRenameTagToolStripButton;

            _tagTreeView.AfterSelect += HandleTagTreeViewAfterSelect;

            _mainToolStripContainer.ContentPanel.Paint += (ps, pe) => {
                ControlPaintUtil.DrawBorder(
                    pe.Graphics, _tagTreeView, SystemColors.ControlDark, _tagTreeView.BackColor, 3
                    );
            };
        }
Exemple #3
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            ControlPaintUtil.DrawBorder(
                e.Graphics, _pageSelectorListBox, SystemColors.ControlDark, _pageSelectorListBox.BackColor, ItemPadding
                );

            if (_currentPage == null || _currentPage.NeedBorder)
            {
                ControlPaint.DrawBorder(
                    e.Graphics, GetPageBounds(), SystemColors.ControlDark, ButtonBorderStyle.Solid
                    );
            }
        }
        // ========================================
        // constructor
        // ========================================
        public LinkSelectForm()
        {
            _facade = MemopadApplication.Instance;

            InitializeComponent();

            _workspaceView.PanelPadding = new Padding(0);

            var theme = _facade.Theme;

            _workspaceView.Theme = theme;
            _memoListView.Theme  = theme;

            Font                  = theme.CaptionFont;
            _okButton.Font        = theme.CaptionFont;
            _cancelButton.Font    = theme.CaptionFont;
            _linkTargetLabel.Font = theme.CaptionFont;
            _titleTextLabel.Font  = theme.CaptionFont;
            _addressLabel.Font    = theme.CaptionFont;

            _linkTargetListBox.Font = theme.InputFont;
            _titleTextTextBox.Font  = theme.InputFont;
            _addressTextBox.Font    = theme.InputFont;

            _inited = false;


            _memoLinkPanel.Paint += (s, e) => {
                ControlPaintUtil.DrawBorder(
                    e.Graphics,
                    _workspaceView.Bounds,
                    SystemColors.ControlDark,
                    SystemColors.Window,
                    1
                    );
                ControlPaintUtil.DrawBorder(
                    e.Graphics,
                    _memoListView.Bounds,
                    SystemColors.ControlDark,
                    SystemColors.Window,
                    1
                    );
            };
        }
Exemple #5
0
        // ========================================
        // constructor
        // ========================================
        public TagSelectForm()
        {
            _facade = MemopadApplication.Instance;

            InitializeComponent();

            var theme = _facade.Theme;

            Font = theme.CaptionFont;

            _anyRadioButton.Checked = true;
            _allRadioButton.Checked = false;

            _tagTree.IsUntaggedEnabled = true;
            _tagTree.IsAllTagsEnabled  = false;
            _tagTree.UpdateTags();
            _tagTree.TagRootNode.ExpandAll();

            _tagTreePanel.Paint += (ps, pe) => {
                ControlPaintUtil.DrawBorder(
                    pe.Graphics, _tagTree, SystemColors.ControlDark, _tagTree.BackColor, 1
                    );
            };
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            var g = e.Graphics;
            var r = new Rectangle(0, 0, Width - 1, Height - 1);

            using (
                var brush = new LinearGradientBrush(
                    r, SystemColors.ControlLightLight, SystemColors.Control, LinearGradientMode.Vertical
                    )
                ) {
                g.FillRectangle(brush, r);
            }

            var borderColor = KryptonManager.CurrentGlobalPalette.GetBorderColor1(
                PaletteBorderStyle.ControlClient,
                PaletteState.Normal
                );
            var backColor = SystemColors.Window;

            ControlPaintUtil.DrawBorder(g, _searchTextBox, borderColor, backColor, ItemPadding);
            ControlPaintUtil.DrawBorder(g, _replaceTextBox, borderColor, _replaceTextBox.Enabled ? backColor : SystemColors.Control, ItemPadding);
        }
Exemple #7
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            var g           = e.Graphics;
            var borderColor = SystemColors.ControlDark;
            var backColor   = SystemColors.Window;

            if (_isCompact)
            {
                ControlPaint.DrawBorder(g, ClientRectangle, borderColor, ButtonBorderStyle.Solid);
                return;
            }

            var y  = _editorCanvas.Top - 1;
            var y2 = _titleTextBox.Top - ItemPadding;
            var r  = new Rectangle(0, 0, Width, y);

            using (var brush = new SolidBrush(_theme.DarkBackColor))
                using (var pen = new Pen(Color.FromArgb(160, 170, 200), 1)) {
                    //g.FillRectangle(brush1, r1);
                    //g.FillRectangle(brush2, r2);
                    g.FillRectangle(brush, r);
                    g.DrawLine(pen, new Point(0, y), new Point(Width, y));
                }
            if (_inMemoSearcher.Visible)
            {
                using (var pen = new Pen(_borderColor)) {
                    g.DrawLine(pen, new Point(0, _inMemoSearcher.Top - 1), new Point(Width, _inMemoSearcher.Top - 1));
                }
            }

            ControlPaintUtil.DrawBorder(g, _titleTextBox, borderColor, backColor, ItemPadding);
            ControlPaintUtil.DrawBorder(g, _tagTextBox, borderColor, backColor, ItemPadding);

            if (_isSubInfoShown)
            {
                using (var pen = new Pen(Color.Silver)) {
                    pen.DashStyle = DashStyle.Dash;
                    var lineY = (_tagTextBox.Top + _sourceTextBox.Bottom) / 2;
                    g.DrawLine(pen, new Point(ItemSpace, lineY), new Point(Width - ItemSpace - 1, lineY));
                }
                ControlPaintUtil.DrawBorder(g, _sourceTextBox, borderColor, backColor, ItemPadding);

                /// mark
                if (_memo != null)
                {
                    var marks      = _memo.Marks;
                    var markCount  = marks.Count;
                    var markImages = new List <Image>();
                    for (int i = 0; i < markCount; ++i)
                    {
                        var def = MemoMarkUtil.GetMarkDefinition(marks[i]);
                        markImages.Add(def.Image);
                    }

                    if (markImages.Count > 0)
                    {
                        var top   = _sourceLabel.Bottom + ItemPadding + ((y - (_sourceLabel.Bottom + ItemPadding)) - markImages[0].Height) / 2;
                        var cLeft = _titleTextBox.Left - ItemPadding;
                        for (int i = 0; i < markCount; ++i)
                        {
                            var image = markImages[i];
                            g.DrawImage(image, new Point(cLeft, top));
                            cLeft += image.Width + ItemPadding;
                        }
                    }
                }
            }

            ControlPaint.DrawBorder(g, ClientRectangle, _borderColor, ButtonBorderStyle.Solid);
        }