private void NeedPaint(NeedLayoutEventArgs e) { if (e.NeedLayout) PerformLayout(); Invalidate(); }
/// <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); } }
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); }
/// <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); }
/// <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> /// <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; } }
/// <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); }
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 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); }
/// <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); }
/// <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; } } }
private void OnButtonSpecPaint(object sender, NeedLayoutEventArgs e) { OnNeedPaint(sender, new NeedLayoutEventArgs(false)); }
/// <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); } }
/// <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); }
private void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e) { NeedPaint(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) { _needPaint?.Invoke(this, e); }
private void OnImageStateChanged(object sender, NeedLayoutEventArgs e) { OnButtonSpecPropertyChanged("Image"); }
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); }
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); }
/// <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; } }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
private void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e) { // Pass request onto the view provided paint delegate if (_viewPaintDelegate != null) _viewPaintDelegate(this, e); }