TrakBar SetRange


Node Information
Sets minimum and maximum of the TrackBar.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Set IN RUN MULTIPLE FALSE FALSE
TrackBar IN TrackBar ONE FALSE FALSE
Min IN Int32 ONE FALSE FALSE
Max IN Int32 ONE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.UI.TrackBar
{
    [IsNode("Set Range")]
    public class TrackBarSetRange : Node
    {
        Port run = new Port(PortType.IN, typeof(RUN), AcceptsLinks.MULTIPLE, "Set");
        Port min = new Port(PortType.IN, typeof(int), AcceptsLinks.ONE, "Min");
        Port max = new Port(PortType.IN, typeof(int), AcceptsLinks.ONE, "Max");
        Port control = new Port(PortType.IN, typeof(Korduene.Designer.Standard.TrackBar), AcceptsLinks.ONE, "TrackBar");
        public int Max
        {
            set { max.Value = value.ToString(); }
            get { return GetRuntimeValue(max); }
        }
        public int Min
        {
            set { min.Value = value.ToString(); }
            get { return GetRuntimeValue(min); }
        }
        public TrackBarSetRange()
        {
            this.Name = "TrakBar SetRange";
            this.NodeType = KGraph.NodeType.Method;
            min.Value = "0";
            max.Value = "10";
            AddPort(run);
            AddPort(control);
            AddPort(min);
            AddPort(max);
            Information = "Sets minimum and maximum of the TrackBar.";
        }
        public override string Code()
        {
            return GetValue(control) + ".SetRange(" + GetValue(min) + "," + GetValue(max) + ");";
        }
    }
}