Skip to content

SimpleEffectDialog Reference

Cameron White edited this page Jun 22, 2013 · 11 revisions

The SimpleEffectDialog class will automatically generate a dialog for your effect based on the fields in the effect's EffectData.

Captions

TODO

Default Values

TODO

Common Attributes

TODO

Integer/Double Slider

For int or double properties, a slider widget will be created. You can use the MinimumValue and MaximumValue attributes to control the range of the slider, and the IncrementValue attribute to specify the step size of the slider. For double, you can also use the DigitsValue attribute to control the number of decimal places.

public class MyEffectData : EffectData
{
    [MinimumValue(1), MaximumValue(5)]
    public int IntegerValue = 2;

    [DigitsValue(3), IncrementValue(0.1)]
    public double DoubleValue = 1.0;
};

Sliders

Random Seed

If an int property is named "Seed", it will create a "Reseed" button instead of a slider. Use this if your effect requires a random value.

public class MyEffectData : EffectData
{
    public int Seed;
};

Reseed Button

Angle Picker

If a double property is named "Angle" or "Rotation", an angle picker will be created instead of a slider.

public class MyEffectData : EffectData
{
    public double Angle;
    public double Rotation;
};

Angle Picker Widget

Checkbox

For bool properties, a checkbox will be created.

public class MyEffectData : EffectData
{
    public bool Invert;
};

Checkbox Widget

Point Picker

For Gdk.Point properties, a widget will be created that allows the user to specify the coordinates of a point on the canvas.

public class MyEffectData : EffectData
{
    public Gdk.Point Point;
};

Point Picker Widget

Offset Picker

For Cairo.PointD properties, a widget will be created that allows the user to specify an offset from the center of the canvas. The coordinates will be normalized, so that (-1, -1) is the top left corner and (1, 1) is the bottom right corner.

public class MyEffectData : EffectData
{
    public Cairo.PointD Offset;
};

Offset Picker Widget

Combo Box

TODO