Beispiel #1
0
        protected override ControlInfo OnCreateConfigUI(PropertyCollection props)
        {
            ControlInfo configUI = CreateDefaultConfigUI(props);

            configUI.SetPropertyControlValue(PropertyNames.Scale, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("CloudsEffect.ConfigDialog.ScaleLabel"));

            configUI.SetPropertyControlValue(PropertyNames.Power, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("CloudsEffect.ConfigDialog.RoughnessLabel"));
            configUI.SetPropertyControlValue(PropertyNames.Power, ControlInfoPropertyNames.SliderLargeChange, 0.25);
            configUI.SetPropertyControlValue(PropertyNames.Power, ControlInfoPropertyNames.SliderSmallChange, 0.05);
            configUI.SetPropertyControlValue(PropertyNames.Power, ControlInfoPropertyNames.UpDownIncrement, 0.01);

            PropertyControlInfo blendOpControl = configUI.FindControlForPropertyName(PropertyNames.BlendOp);

            blendOpControl.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = PdnResources.GetString("CloudsEffect.ConfigDialog.BlendModeHeader.Text");

            Type[] blendOpTypes = UserBlendOps.GetBlendOps();
            foreach (Type blendOpType in blendOpTypes)
            {
                string blendOpDisplayName = UserBlendOps.GetBlendOpFriendlyName(blendOpType);
                blendOpControl.SetValueDisplayName(blendOpType, blendOpDisplayName);
            }

            configUI.SetPropertyControlType(PropertyNames.Seed, PropertyControlType.IncrementButton);
            configUI.SetPropertyControlValue(PropertyNames.Seed, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("CloudsEffect.ConfigDialog.SeedHeader.Text"));
            configUI.SetPropertyControlValue(PropertyNames.Seed, ControlInfoPropertyNames.ButtonText, PdnResources.GetString("CloudsEffect.ConfigDialog.ReseedButton.Text"));
            configUI.SetPropertyControlValue(PropertyNames.Seed, ControlInfoPropertyNames.Description, PdnResources.GetString("CloudsEffect.ConfigDialog.UsageLabel"));

            return(configUI);
        }
        public CloudsEffectConfigDialog()
        {
            // Required for Windows Form Designer support
            InitializeComponent();

            this.Text = CloudsEffect.StaticName;

            this.Amount1Label   = PdnResources.GetString("CloudsEffect.ConfigDialog.ScaleLabel");
            this.Amount1Minimum = 2;
            this.Amount1Maximum = 1000;
            this.Amount1Default = 250;

            this.Amount2Label   = PdnResources.GetString("CloudsEffect.ConfigDialog.RoughnessLabel");
            this.Amount2Minimum = 0;
            this.Amount2Maximum = 100;
            this.Amount2Default = 50;

            this.Icon = Utility.ImageToIcon(CloudsEffect.StaticImage);

            this.seedHeader.Text      = PdnResources.GetString("CloudsEffect.ConfigDialog.SeedHeader.Text");
            this.headerBlendMode.Text = PdnResources.GetString("CloudsEffect.ConfigDialog.BlendModeHeader.Text");
            this.reseedButton.Text    = PdnResources.GetString("CloudsEffect.ConfigDialog.ReseedButton.Text");
            this.usageLabel.Text      = PdnResources.GetString("CloudsEffect.ConfigDialog.UsageLabel");

            // populate the blendOpComboBox with all the blend modes they're allowed to use
            foreach (Type type in UserBlendOps.GetBlendOps())
            {
                this.comboBlendModes.Items.Add(UserBlendOps.CreateBlendOp(type));
            }
        }
Beispiel #3
0
			static CloudsData ()
			{
				Type[] blendOpTypes = UserBlendOps.GetBlendOps ();
				BlendOps = new Dictionary<string, object> ();

				foreach (Type myType in blendOpTypes)
				{
					string blendOpDisplayName = UserBlendOps.GetBlendOpFriendlyName (myType);
					BlendOps.Add (blendOpDisplayName, myType);
				}
	            defaultBlendOp = UserBlendOps.GetBlendOpFriendlyName (UserBlendOps.GetDefaultBlendOp ());
			}
        public BitmapLayerPropertiesDialog()
        {
            // This call is required by the Windows Form Designer.
            InitializeComponent();

            this._blendingHeader.Text = PdnResources.GetString("BitmapLayerPropertiesDialog.BlendingHeader.Text");
            this.blendModeLabel.Text  = PdnResources.GetString("BitmapLayerPropertiesDialog.BlendModeLabel.Text");
            this.opacityLabel.Text    = PdnResources.GetString("BitmapLayerPropertiesDialog.OpacityLabel.Text");

            // populate the blendOpComboBox with all the blend modes they're allowed to use
            foreach (Type type in UserBlendOps.GetBlendOps())
            {
                blendOpComboBox.Items.Add(UserBlendOps.CreateBlendOp(type));
            }
        }
Beispiel #5
0
        protected override PropertyCollection OnCreatePropertyCollection()
        {
            List <Property> props = new List <Property>();

            props.Add(new Int32Property(PropertyNames.Scale, 250, 2, 1000));
            props.Add(new DoubleProperty(PropertyNames.Power, 0.5, 0.0, 1.0));

            Type[] blendOpTypes        = UserBlendOps.GetBlendOps();
            int    defaultBlendOpIndex = Array.IndexOf(blendOpTypes, UserBlendOps.GetDefaultBlendOp());

            props.Add(new StaticListChoiceProperty(PropertyNames.BlendOp, blendOpTypes, 0, false));

            props.Add(new Int32Property(PropertyNames.Seed, 0, 0, 255));

            return(new PropertyCollection(props));
        }