Beispiel #1
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);
     }
 }
Beispiel #2
0
        private void NeedPaint(NeedLayoutEventArgs e)
        {
            if (e.NeedLayout)
            {
                PerformLayout();
            }

            Invalidate();
        }
 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);
     }
 }
        /// <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);
        }
Beispiel #5
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);
            }
        }
Beispiel #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;
                }
            }
        }
        /// <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);
                }
            }
        }
Beispiel #8
0
 private void OnImageStateChanged(object sender, NeedLayoutEventArgs e)
 {
     OnButtonSpecChanged(sender, EventArgs.Empty);
 }
Beispiel #9
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
     DirtyPaletteCounter++;
     OnNeedPaint(sender, e);
 }
Beispiel #10
0
 private void OnNeedPaint(object sender, NeedLayoutEventArgs e)
 {
     PerformNeedPaint(e.NeedLayout);
 }
Beispiel #11
0
 private void OnImageStateChanged(object sender, NeedLayoutEventArgs e)
 {
     OnButtonSpecPropertyChanged("Image");
 }
Beispiel #12
0
 private void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e)
 {
     NeedPaint(e);
 }