Details for need layout events.
Inheritance: System.EventArgs
        private void NeedPaint(NeedLayoutEventArgs e)
        {
            if (e.NeedLayout)
                PerformLayout();

            Invalidate();
        }
示例#2
0
 /// <summary>
 /// Raises the NeedPaint event.
 /// </summary>
 /// <param name="sender">Source of the event.</param>
 /// <param name="e">An NeedLayoutEventArgs containing event data.</param>
 protected virtual void OnNeedPaint(object sender, NeedLayoutEventArgs e)
 {
     if (_needPaint != null)
     {
         _needPaint(this, e);
     }
 }
示例#3
0
 private void OnGroupPanelPaint(object sender, NeedLayoutEventArgs e)
 {
     // If the child panel is layout out but not because we are, then it must be
     // laying out because a child has changed visibility/size/etc. If we are an
     // AutoSize control then we need to ensure we layout as well to change size.
     if (e.NeedLayout && !_layingOut && AutoSize)
     {
         PerformNeedPaint(true);
     }
 }
        private void OnNeedPaint(object sender, NeedLayoutEventArgs e)
        {
            Debug.Assert(e != null);

            // Validate incoming reference
            if (e == null)
            {
                throw new ArgumentNullException(nameof(e));
            }

            // Pass request onto the displaying control if we have one
            VisualContextMenu?.PerformNeedPaint(e.NeedLayout);
        }
示例#5
0
        /// <summary>
        /// Processes a notification from palette storage of a paint and optional layout required.
        /// </summary>
        /// <param name="sender">Source of notification.</param>
        /// <param name="e">An NeedLayoutEventArgs containing event data.</param>
        protected override void OnNeedPaint(object sender, NeedLayoutEventArgs e)
        {
            if (IsInitialized || !e.NeedLayout)
            {
                // As the contained group panel is using our palette storage
                // we also need to pass on any paint request to it as well
                _panel.PerformNeedPaint(e.NeedLayout);
            }
            else
            {
                ForceControlLayout();
            }

            base.OnNeedPaint(sender, e);
        }
示例#6
0
        /// <summary>
        /// Processes a notification from palette storage of a paint and optional layout required.
        /// </summary>
        /// <param name="sender">Source of notification.</param>
        /// <param name="e">An NeedLayoutEventArgs containing event data.</param>
        protected virtual void OnNeedPaint(object sender, NeedLayoutEventArgs e)
        {
            Debug.Assert(e != null);

            // Validate incoming reference
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }

            // Never try and redraw or layout when disposed are trying to dispose
            if (!IsDisposed && !Disposing)
            {
                // Change in setting means we need to evaluate transparent painting
                _evalTransparent = true;

                // If required, layout the control
                if (e.NeedLayout && !_layoutDirty)
                {
                    _layoutDirty = true;
                }

                if (IsHandleCreated && (!_refreshAll || !e.InvalidRect.IsEmpty))
                {
                    // Always request the repaint immediately
                    if (e.InvalidRect.IsEmpty)
                    {
                        _refreshAll = true;
                        Invalidate();
                    }
                    else
                    {
                        Invalidate(e.InvalidRect);
                    }

                    // Do we need to use an Invoke to force repaint?
                    if (!_refresh && EvalInvokePaint)
                    {
                        BeginInvoke(_refreshCall);
                    }

                    // A refresh is outstanding
                    _refresh = true;
                }
            }
        }
示例#7
0
        /// <summary>
        /// Processes a notification from palette storage of a paint and optional layout required.
        /// </summary>
        /// <param name="sender">Source of notification.</param>
        /// <param name="e">An NeedLayoutEventArgs containing event data.</param>
        /// <exception cref="ArgumentNullException"></exception>
        protected virtual void OnNeedPaint(object sender, NeedLayoutEventArgs e)
        {
            Debug.Assert(e != null);

            // Validate incoming reference
            if (e == null)
            {
                throw new ArgumentNullException(nameof(e));
            }

            // If required, layout the control
            if (e.NeedLayout && !_layoutDirty)
            {
                _layoutDirty = true;
            }

            if (IsHandleCreated && (!_refreshAll || !e.InvalidRect.IsEmpty))
            {
                // Always request the repaint immediately
                if (e.InvalidRect.IsEmpty)
                {
                    _refreshAll = true;
                    Invalidate();
                }
                else
                {
                    Invalidate(e.InvalidRect);
                }

                // Do we need to use an Invoke to force repaint?
                if (!_refresh && EvalInvokePaint)
                {
                    BeginInvoke(_refreshCall);
                }

                // A refresh is outstanding
                _refresh = true;
            }
        }
示例#8
0
        /// <summary>
        /// Processes a notification from palette storage of a paint and optional layout required.
        /// </summary>
        /// <param name="sender">Source of notification.</param>
        /// <param name="e">An NeedLayoutEventArgs containing event data.</param>
        protected virtual void OnNeedPaint(object sender, NeedLayoutEventArgs e)
        {
            Debug.Assert(e != null);

            // Validate incoming reference
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }

            if (IsHandleCreated)
            {
                // Always request the repaint immediately
                if (e.InvalidRect.IsEmpty)
                {
                    Invalidate(true);
                }
                else
                {
                    Invalidate(e.InvalidRect, true);
                }
            }
        }
 private void OnImageStateChanged(object sender, NeedLayoutEventArgs e)
 {
     OnButtonSpecChanged(sender, EventArgs.Empty);
 }
示例#10
0
 private void OnGroupPanelPaint(object sender, NeedLayoutEventArgs e)
 {
     // If the child panel is layout out but not because we are, then it must be
     // laying out because a child has changed visibility/size/etc. If we are an
     // AutoSize control then we need to ensure we layout as well to change size.
     if (e.NeedLayout && !_layingOut && AutoSize)
         PerformNeedPaint(true);
 }
示例#11
0
 /// <summary>
 /// Processes a notification from palette of a paint and optional layout required.
 /// </summary>
 /// <param name="sender">Source of notification.</param>
 /// <param name="e">An NeedLayoutEventArgs containing event data.</param>
 protected override void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e)
 {
     _listBox.RefreshItemSizes();
     base.OnPaletteChanged(e);
 }
示例#12
0
        /// <summary>
        /// Processes a notification from palette storage of a paint and optional layout required.
        /// </summary>
        /// <param name="sender">Source of notification.</param>
        /// <param name="e">An NeedLayoutEventArgs containing event data.</param>
        protected virtual void OnNeedPaint(object sender, NeedLayoutEventArgs e)
        {
            Debug.Assert(e != null);

            // Validate incoming reference
            if (e == null) throw new ArgumentNullException("e");

            // Do nothing unless we are applying custom chrome
            if (ApplyCustomChrome)
            {
                // If using composition drawing
                if (ApplyComposition)
                {
                    // Ask the composition element top handle need paint event
                    _compositionElement.CompNeedPaint(e.NeedLayout);
                }
                else
                {
                    // Do we need to recalc the border size as well as invalidate?
                    if (e.NeedLayout)
                        _needLayout = true;

                    InvalidateNonClient();
                }
            }
        }
 /// <summary>
 /// Processes a notification from palette of a paint and optional layout required.
 /// </summary>
 /// <param name="sender">Source of notification.</param>
 /// <param name="e">An NeedLayoutEventArgs containing event data.</param>
 protected virtual void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e)
 {
     // Need to recalculate anything relying on the palette
     OnNeedPaint(sender, e);
 }
示例#14
0
        /// <summary>
        /// Processes a notification from palette storage of a paint and optional layout required.
        /// </summary>
        /// <param name="sender">Source of notification.</param>
        /// <param name="e">An NeedLayoutEventArgs containing event data.</param>
        protected virtual void OnNeedPaint(object sender, NeedLayoutEventArgs e)
        {
            Debug.Assert(e != null);

            // Validate incoming reference
            if (e == null) throw new ArgumentNullException("e");

            if (IsHandleCreated)
            {
                // Always request the repaint immediately
                if (e.InvalidRect.IsEmpty)
                    Invalidate(true);
                else
                    Invalidate(e.InvalidRect, true);
            }
        }
        /// <summary>
        /// Processes a notification from palette storage of a paint and optional layout required.
        /// </summary>
        /// <param name="sender">Source of notification.</param>
        /// <param name="e">An NeedLayoutEventArgs containing event data.</param>
        protected virtual void OnNeedPaint(object sender, NeedLayoutEventArgs e)
        {
            Debug.Assert(e != null);

            // Validate incoming reference
            if (e == null) throw new ArgumentNullException("e");

            // Never try and redraw or layout when disposed are trying to dispose
            if (!IsDisposed && !Disposing)
            {
                // Change in setting means we need to evaluate transparent painting
                _evalTransparent = true;

                // If required, layout the control
                if (e.NeedLayout && !_layoutDirty)
                    _layoutDirty = true;

                if (IsHandleCreated && (!_refreshAll || !e.InvalidRect.IsEmpty))
                {
                    // Always request the repaint immediately
                    if (e.InvalidRect.IsEmpty)
                    {
                        _refreshAll = true;
                        Invalidate();
                    }
                    else
                        Invalidate(e.InvalidRect);

                    // Do we need to use an Invoke to force repaint?
                    if (!_refresh && EvalInvokePaint)
                        BeginInvoke(_refreshCall);

                    // A refresh is outstanding
                    _refresh = true;
                }
            }
        }
示例#16
0
 private void OnButtonSpecPaint(object sender, NeedLayoutEventArgs e)
 {
     OnNeedPaint(sender, new NeedLayoutEventArgs(false));
 }
示例#17
0
 /// <summary>
 /// Processes the need for a repaint for the enabled palette values.
 /// </summary>
 /// <param name="sender">Source of the event.</param>
 /// <param name="e">An NeedLayoutEventArgs containing event data.</param>
 protected virtual void OnNeedNormalPaint(object sender, NeedLayoutEventArgs e)
 {
     if (Enabled)
     {
         OnAppearancePropertyChanged("Palette");
         OnNeedPaint(this, e);
     }
 }
示例#18
0
 /// <summary>
 /// Processes a notification from palette of a paint and optional layout required.
 /// </summary>
 /// <param name="sender">Source of notification.</param>
 /// <param name="e">An NeedLayoutEventArgs containing event data.</param>
 protected override void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e)
 {
     UpdateItemHeight();
     base.OnPaletteChanged(e);
 }
 private void OnIntegratedNeedPaint(object sender, NeedLayoutEventArgs e)
 {
     // If we have integrated the button into the custom chrome caption area
     if (_integrated)
         _kryptonForm.PerformNeedPaint(e.NeedLayout);
 }
示例#20
0
 private void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e)
 {
     NeedPaint(e);
 }
示例#21
0
        private void NeedPaint(NeedLayoutEventArgs e)
        {
            if (e.NeedLayout)
                PerformLayout();

            Invalidate();
        }
示例#22
0
 /// <summary>
 /// Raises the NeedPaint event.
 /// </summary>
 /// <param name="sender">Source of the event.</param>
 /// <param name="e">An NeedLayoutEventArgs containing event data.</param>
 protected virtual void OnNeedPaint(object sender, NeedLayoutEventArgs e)
 {
     _needPaint?.Invoke(this, e);
 }
示例#23
0
 private void OnImageStateChanged(object sender, NeedLayoutEventArgs e)
 {
     OnButtonSpecPropertyChanged("Image");
 }
示例#24
0
 private void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e)
 {
     NeedPaint(e);
 }
示例#25
0
 private void OnNeedPaint(object sender, NeedLayoutEventArgs e)
 {
     PerformNeedPaint(e.NeedLayout);
 }
        private void OnAppButtonNeedPaint(object sender, NeedLayoutEventArgs e)
        {
            // Redraw the ribbon control to show change
            PerformNeedPaint(e.NeedLayout);
            _ribbon.Refresh();

            // If we have integrated the button into the custom chrome caption area
            if (_integrated)
                _kryptonForm.PerformNeedPaint(e.NeedLayout);
        }
示例#27
0
        private void OnNeedPaint(object sender, NeedLayoutEventArgs e)
        {
            Debug.Assert(e != null);

            // Validate incoming reference
            if (e == null) throw new ArgumentNullException("e");

            // Pass request onto the displaying control if we have one
            if (_contextMenu != null)
                _contextMenu.PerformNeedPaint(e.NeedLayout);
        }
示例#28
0
        /// <summary>
        /// Processes a notification from palette storage of a paint and optional layout required.
        /// </summary>
        /// <param name="sender">Source of notification.</param>
        /// <param name="e">An NeedLayoutEventArgs containing event data.</param>
        protected virtual void OnNeedPaint(object sender, NeedLayoutEventArgs e)
        {
            Debug.Assert(e != null);

            // Validate incoming reference
            if (e == null) throw new ArgumentNullException("e");

            // If required, layout the control
            if (e.NeedLayout && !_layoutDirty)
                _layoutDirty = true;

            if (IsHandleCreated && (!_refreshAll || !e.InvalidRect.IsEmpty))
            {
                // Always request the repaint immediately
                if (e.InvalidRect.IsEmpty)
                {
                    _refreshAll = true;
                    Invalidate();
                }
                else
                    Invalidate(e.InvalidRect);

                // Do we need to use an Invoke to force repaint?
                if (!_refresh && EvalInvokePaint)
                    BeginInvoke(_refreshCall);

                // A refresh is outstanding
                _refresh = true;
            }
        }
示例#29
0
        /// <summary>
        /// Processes a notification from palette storage of a paint and optional layout required.
        /// </summary>
        /// <param name="sender">Source of notification.</param>
        /// <param name="e">An NeedLayoutEventArgs containing event data.</param>
        protected override void OnNeedPaint(object sender, NeedLayoutEventArgs e)
        {
            if (IsInitialized || !e.NeedLayout)
            {
                // As the contained group panel is using our palette storage
                // we also need to pass on any paint request to it as well
                _panel.PerformNeedPaint(e.NeedLayout);
            }
            else
                ForceControlLayout();

            base.OnNeedPaint(sender, e);
        }
示例#30
0
 /// <summary>
 /// Processes a notification from palette of a paint and optional layout required.
 /// </summary>
 /// <param name="sender">Source of notification.</param>
 /// <param name="e">An NeedLayoutEventArgs containing event data.</param>
 protected virtual void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e)
 {
     // Need to recalculate anything relying on the palette
     OnNeedPaint(sender, e);
 }
 private void OnImageStateChanged(object sender, NeedLayoutEventArgs e)
 {
     OnButtonSpecChanged(sender, EventArgs.Empty);
 }
示例#32
0
        /// <summary>
        /// Processes a notification from palette storage of a paint and optional layout required.
        /// </summary>
        /// <param name="sender">Source of notification.</param>
        /// <param name="e">An NeedLayoutEventArgs containing event data.</param>
        protected override void OnNeedPaint(object sender, NeedLayoutEventArgs e)
        {
            if (IsHandleCreated && !e.NeedLayout)
                _listBox.Invalidate();
            else
                ForceControlLayout();

            // Update palette to reflect latest state
            UpdateStateAndPalettes();
            base.OnNeedPaint(sender, e);
        }
示例#33
0
        /// <summary>
        /// Processes a notification from palette storage of a paint and optional layout required.
        /// </summary>
        /// <param name="sender">Source of notification.</param>
        /// <param name="e">An NeedLayoutEventArgs containing event data.</param>
        protected override void OnNeedPaint(object sender, NeedLayoutEventArgs e)
        {
            if (IsHandleCreated)
                UpdateStateAndPalettes();

            base.OnNeedPaint(sender, e);
        }
示例#34
0
        /// <summary>
        /// Processes a notification from palette storage of a paint and optional layout required that involves the selected page.
        /// </summary>
        /// <param name="sender">Source of notification.</param>
        /// <param name="e">An NeedLayoutEventArgs containing event data.</param>
        protected virtual void OnNeedPagePaint(object sender, NeedLayoutEventArgs e)
        {
            // Is there a selected page?
            if (SelectedPage != null)
            {
                // Then need to repaint the page as well
                SelectedPage.Invalidate();
            }

            // Pass request onto standard handler
            OnNeedPaint(sender, e);
        }
 /// <summary>
 /// Raises the NeedPaint event.
 /// </summary>
 /// <param name="sender">Source of the event.</param>
 /// <param name="e">An NeedLayoutEventArgs containing event data.</param>
 protected virtual void OnNeedPaint(object sender, NeedLayoutEventArgs e)
 {
     if (_needPaint != null)
         _needPaint(this, e);
 }
示例#36
0
 private void OnNeedPaint(object sender, NeedLayoutEventArgs e)
 {
     PerformNeedPaint(e.NeedLayout);
 }
 private void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e)
 {
     // Pass request onto the view provided paint delegate
     if (_viewPaintDelegate != null)
         _viewPaintDelegate(this, e);
 }
示例#38
0
 private void OnImageStateChanged(object sender, NeedLayoutEventArgs e)
 {
     OnButtonSpecPropertyChanged("Image");
 }