In This Topic
The Nevron Stroke Style Editor provides complete visual editing for the properties, which get or set an instance of the
NStrokeStyle class. It is exposed by the
NStrokeStyleTypeEditor class.
Applying the Editor to a Property
The following example demonstrates how to apply the stroke style editor to a property:
C# |
Copy Code
|
// Stroke style property edited by the stroke style editor
[Editor(typeof(NStrokeStyleTypeEditor), typeof(UITypeEditor))]
public NStrokeStyle StrokeStyle
{
get
{
return m_StrokStyle;
}
set
{
m_StrokStyle = value;
}
}
|
Visual Basic |
Copy Code
|
` Stroke style property edited by the stroke style editor
<Editor(GetType(NStrokeStyleTypeEditor), GetType(UITypeEditor))> _
Public Property StrokeStyle() As Nevron.GraphicsCore.NStrokeStyle
Get
Return m_StrokeStyle
End Get
Set(ByVal Value As Nevron.GraphicsCore.NStrokeStyle)
m_StrokeStyle = Value
End Set
End Property
|
Showing the Editor from Code
The NStrokeStyleTypeEditor can also be used to show the Stroke Style Editor via the Edit static method. For example:
C# |
Copy Code
|
NStrokeStyle inStrokeStyle = new NStrokeStyle();
NStrokeStyle resultStrokeStyle ;
bool okPressed = NStrokeStyleTypeEditor.Edit(inStrokeStyle, out resultStrokeStyle);
|
Visual Basic |
Copy Code
|
Dim inStrokeStyle As NStrokeStyle = New NStrokeStyle()
Dim resultStrokeStyle As NStrokeStyle
Dim okPressed As Boolean = NStrokeStyleTypeEditor.Edit(inStrokeStyle, false, resultStrokeStyle)
|
This method returns a boolean value, which indicates whether the user pressed OK button.
Stroke Style Editor User Interface
-
Use automatic check - the stroke style editor can optionally have its Use automatic check enabled. If it is enabled the initial state of the check indicates whether the currently edited stroke style belonged to the object exposing the edited stroke style property, or was automatically obtained from the framework (via style inheritance or other property inheritance mechanism). If you check the Use automatic check and click on the OK button the resulting stroke style will be null.
-
Color button - selects the color of the stroke.
-
Width selector - sets the width of the stroke (measured in a unit from one of the four predefined measurement systems).
-
Dash style - you can choose between several predefined dash styles, or you can create a custom one. If the dash style is a broken line, the Factor numeric updown specifies a per dash pixel multiplier.
-
Dash cap combo- if the dash style is a broken line, the dash cap specifies the shape of the caps for each dash. They can be Flat, Round or Triangle.
-
Line join combo - specifies the way in which two straight line segments must be joined.
See Also