Class OverviewControl
The OverviewControl class implements an overview window that provides a perspective view of the diagram model. The OverviewControl is initialized with a diagram model and a view, and upon display renders a view of the diagram that is scaled to the control's bounds.
The control has a Viewport window that is positioned over the diagram display and can be moved and / or resized using the mouse to dynamically change the view transform that maps the diagram's world coordinates onto the view coordinates. The viewport's origin corresponds to the origin of the diagram's view and moving the viewport will shift the view's origin by an equivalent extent. The viewport's size is proportional to the view's magnification and resizing the viewport allows the view to be zoomed in and out.
Origin MagnificationInheritance
Namespace: Syncfusion.Windows.Forms.Diagram.Controls
Assembly: Syncfusion.Diagram.Windows.dll
Syntax
public class OverviewControl : Panel
Constructors
OverviewControl()
Initializes a new instance of the OverviewControl class.
Declaration
public OverviewControl()
OverviewControl(IContainer)
Initializes a new instance of the OverviewControl class.
Declaration
public OverviewControl(IContainer container)
Parameters
| Type | Name | Description |
|---|---|---|
| System.ComponentModel.IContainer | container | The container. |
Fields
bmpBuffer
Declaration
protected Bitmap bmpBuffer
Field Value
| Type |
|---|
| System.Drawing.Bitmap |
bRedrawBuffer
Bitmap Buffer drawing.
Declaration
protected bool bRedrawBuffer
Field Value
| Type |
|---|
| System.Boolean |
bViewportInitiated
Declaration
protected bool bViewportInitiated
Field Value
| Type |
|---|
| System.Boolean |
bZoomSlider
Declaration
protected bool bZoomSlider
Field Value
| Type |
|---|
| System.Boolean |
dgmModel
Declaration
protected Model dgmModel
Field Value
| Type |
|---|
| Model |
dgmView
Declaration
protected View dgmView
Field Value
| Type |
|---|
| View |
dragMarker
Declaration
protected RectMarkers dragMarker
Field Value
| Type |
|---|
| RectMarkers |
m_diagram
Declaration
protected Diagram m_diagram
Field Value
| Type |
|---|
| Diagram |
nMinHeight
Declaration
protected const int nMinHeight = 50
Field Value
| Type |
|---|
| System.Int32 |
nMinWidth
Declaration
protected const int nMinWidth = 50
Field Value
| Type |
|---|
| System.Int32 |
ptDragStart
Viewport dragging.
Declaration
protected Point ptDragStart
Field Value
| Type |
|---|
| System.Drawing.Point |
rcClientArea
Declaration
protected RectangleF rcClientArea
Field Value
| Type |
|---|
| System.Drawing.RectangleF |
rcDisplayArea
Declaration
protected RectangleF rcDisplayArea
Field Value
| Type |
|---|
| System.Drawing.RectangleF |
rcInDragArea
Declaration
protected RectangleF rcInDragArea
Field Value
| Type |
|---|
| System.Drawing.RectangleF |
scaleFactor
Model to Viewport Scaling factor.
Declaration
protected float scaleFactor
Field Value
| Type |
|---|
| System.Single |
vpRenderer
Declaration
protected ViewportRenderer vpRenderer
Field Value
| Type |
|---|
| ViewportRenderer |
Properties
Diagram
Gets or sets the diagram control.
Declaration
public Diagram Diagram { get; set; }
Property Value
| Type | Description |
|---|---|
| Diagram | The diagram. |
Model
Gets or sets the Model that the OverviewControl is initialized with.
Declaration
protected Model Model { get; set; }
Property Value
| Type | Description |
|---|---|
| Model | The model. |
View
Gets or sets the View that the OverviewControl is tied to.
Declaration
protected View View { get; set; }
Property Value
| Type | Description |
|---|---|
| View | The view. |
ViewportBounds
Gets or sets the bounds of the OverviewControl's Viewport window.
Declaration
public RectangleF ViewportBounds { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.RectangleF | The viewport bounds. |
Remarks
The Viewport window location and size relative to the OverviewControl's diagram display determine the Origin and Magnification property values for the diagram's View.
Methods
ApplyViewOriginToViewport()
Applies the view origin to viewport.
Declaration
protected void ApplyViewOriginToViewport()
ApplyViewportOriginToView()
Applies the viewport origin to view.
Declaration
protected void ApplyViewportOriginToView()
ApplyViewportZoomToView()
Applies the viewport zoom to view.
Declaration
protected void ApplyViewportZoomToView()
ApplyViewZoomToViewport()
Applies the view zoom to viewport.
Declaration
protected void ApplyViewZoomToViewport()
DetachDiagram()
Detaches the diagram.
Declaration
public void DetachDiagram()
Dispose(Boolean)
Releases the unmanaged resources used by the System.Windows.Forms.Control and its child controls and optionally releases the managed resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
DrawDocument(Graphics)
Draws the document.
Declaration
protected void DrawDocument(Graphics gfx)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | gfx | Graphics to draw on. |
DrawToBitmapBuffer(Graphics)
Draws to bitmap buffer.
Declaration
protected void DrawToBitmapBuffer(Graphics gfx)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | gfx | The graphics. |
DrawViewport(Graphics)
Draws the OverviewControl's viewport rectangle.
Declaration
protected virtual void DrawViewport(Graphics grfx)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | grfx | A System.Drawing.Graphics object |
OnClick(EventArgs)
Raises the System.Windows.Forms.Control.Click event.
Declaration
protected override void OnClick(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | An System.EventArgs that contains the event data. |
OnModelChildrenChangeComplete(CollectionExEventArgs)
Raises the ModelChildrenChangeComplete event.
Declaration
[EventHandlerPriority(true)]
protected void OnModelChildrenChangeComplete(CollectionExEventArgs evtargs)
Parameters
| Type | Name | Description |
|---|---|---|
| CollectionExEventArgs | evtargs | The CollectionExEventArgs instance containing the event data. |
OnModelDisposed(Object, EventArgs)
Called when model is disposed.
Declaration
protected void OnModelDisposed(object sender, EventArgs evtargs)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender | The sender. |
| System.EventArgs | evtargs | The System.EventArgs instance containing the event data. |
OnModelPropertyChanged(PropertyChangedEventArgs)
Raises the ModelPropertyChanged event.
Declaration
[EventHandlerPriority(true)]
protected void OnModelPropertyChanged(PropertyChangedEventArgs evtArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| PropertyChangedEventArgs | evtArgs | The PropertyChangedEventArgs instance containing the event data. |
OnMouseDown(MouseEventArgs)
Raises the MouseDown event.
Declaration
protected override void OnMouseDown(MouseEventArgs meargs)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.MouseEventArgs | meargs | The System.Windows.Forms.MouseEventArgs instance containing the event data. |
OnMouseMove(MouseEventArgs)
Raises the MouseMove event.
Declaration
protected override void OnMouseMove(MouseEventArgs meargs)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.MouseEventArgs | meargs | The System.Windows.Forms.MouseEventArgs instance containing the event data. |
OnMouseUp(MouseEventArgs)
Raises the MouseUp event.
Declaration
protected override void OnMouseUp(MouseEventArgs meargs)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.MouseEventArgs | meargs | The System.Windows.Forms.MouseEventArgs instance containing the event data. |
OnPaint(PaintEventArgs)
Raises the Paint event.
Declaration
protected override void OnPaint(PaintEventArgs peargs)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.PaintEventArgs | peargs | The System.Windows.Forms.PaintEventArgs instance containing the event data. |
OnViewMagnificationChanged(ViewMagnificationEventArgs)
Raises the ViewMagnificationChanged event.
Declaration
[EventHandlerPriority(true)]
protected void OnViewMagnificationChanged(ViewMagnificationEventArgs evtargs)
Parameters
| Type | Name | Description |
|---|---|---|
| ViewMagnificationEventArgs | evtargs | The ViewMagnificationEventArgs instance containing the event data. |
OnViewOriginChanged(ViewOriginEventArgs)
Raises the ViewOriginChanged event.
Declaration
[EventHandlerPriority(true)]
protected void OnViewOriginChanged(ViewOriginEventArgs evtargs)
Parameters
| Type | Name | Description |
|---|---|---|
| ViewOriginEventArgs | evtargs | The ViewOriginEventArgs instance containing the event data. |
RecalculateOverviewBounds()
Recalculates the overview bounds.
Declaration
protected virtual void RecalculateOverviewBounds()
SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified)
Performs the work of setting the specified bounds of this control.
Declaration
protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | x | The new System.Windows.Forms.Control.Left property value of the control. |
| System.Int32 | y | The new System.Windows.Forms.Control.Top property value of the control. |
| System.Int32 | width | The new System.Windows.Forms.Control.Width property value of the control. |
| System.Int32 | height | The new System.Windows.Forms.Control.Height property value of the control. |
| System.Windows.Forms.BoundsSpecified | specified | A bitwise combination of the System.Windows.Forms.BoundsSpecified values. |
SubscribeDiagramEvents(Boolean)
Subscribes the diagram events.
Declaration
public void SubscribeDiagramEvents(bool subscribe)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | subscribe | if set to |
SubscribeModelEvents(Boolean)
Subscribes the model events.
Declaration
protected void SubscribeModelEvents(bool subscribe)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | subscribe | if set to |
SubscribeViewEvents(Boolean)
Subscribes the view events.
Declaration
protected void SubscribeViewEvents(bool subscribe)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | subscribe | if set to |
Events
ViewPortBoundsChanged
Occurs when view port bounds is changed.
Declaration
public event ViewPortBoundsChangedEventHandler ViewPortBoundsChanged
Event Type
| Type |
|---|
| ViewPortBoundsChangedEventHandler |
ViewPortBoundsChanging
Occurs when view port bounds is changing.
Declaration
public event ViewPortBoundsChangingEventHandler ViewPortBoundsChanging
Event Type
| Type |
|---|
| ViewPortBoundsChangingEventHandler |