Exemple #1
0
        public void LoadDropPanel(ParamValueEditorBase control, BfresShaderParam param)
        {
            STDropDownPanel panel = new STDropDownPanel();

            panel.SuspendLayout();
            panel.PanelName      = param.Name;
            panel.PanelValueName = GetValueString(param);
            panel.Controls.Add(control);
            panel.Height     = control.Height;
            panel.IsExpanded = false;

            control.BackColor = FormThemes.BaseTheme.DropdownPanelBackColor;
            control.Anchor    = AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Left;
            control.Width     = panel.Width;
            control.LoadAction(OnValueChanged); //To update value test

            if (control is vector4SliderPanel)
            {
                panel.SetIconColor = ((vector4SliderPanel)control).GetColor();
            }
            if (control is vector4SliderPanel)
            {
                panel.SetIconAlphaColor = ((vector4SliderPanel)control).GetAlphaColor();
            }
            if (control is vector3SliderPanel)
            {
                panel.SetIconColor = ((vector3SliderPanel)control).GetColor();
            }

            panel.ResumeLayout();

            stFlowLayoutPanel1.Controls.Add(panel);
        }
        public void LoadDialogDropPanel(ParamValueDialog control, BfresShaderParam param)
        {
            ParamValueEditorBase panel = new ParamValueEditorBase();

            switch (param.Type)
            {
            case ShaderParamType.Float: panel = new vector1SliderPanel(param.ValueFloat, param); break;

            case ShaderParamType.Float2: panel = new vector2SliderPanel(param.ValueFloat, param); break;

            case ShaderParamType.Float3: panel = new vector3SliderPanel(param.Name, param.ValueFloat, param); break;

            case ShaderParamType.Float4: panel = new vector4SliderPanel(param.Name, param.ValueFloat, param); break;

            case ShaderParamType.Int: panel = new vector1SliderPanel(param.ValueInt, param); break;

            case ShaderParamType.Int2: panel = new vector2SliderPanel(param.ValueInt, param); break;

            case ShaderParamType.Int3: panel = new vector3SliderPanel(param.Name, param.ValueInt, param); break;

            case ShaderParamType.Int4: panel = new vector4SliderPanel(param.Name, param.ValueInt, param); break;

            case ShaderParamType.UInt: panel = new vector1SliderPanel(param.ValueUint, param); break;

            case ShaderParamType.UInt2: panel = new vector2SliderPanel(param.ValueUint, param); break;

            case ShaderParamType.UInt3: panel = new vector3SliderPanel(param.Name, param.ValueUint, param); break;

            case ShaderParamType.UInt4: panel = new vector4SliderPanel(param.Name, param.ValueUint, param); break;

            case ShaderParamType.TexSrt: panel = new TexSrtPanel(param.ValueTexSrt, param); break;

            case ShaderParamType.TexSrtEx: panel = new TexSrtPanel(param.ValueTexSrtEx, param); break;

            case ShaderParamType.Srt2D: panel = new TexSrtPanel2D(param.ValueSrt2D, param); break;

            case ShaderParamType.Bool: panel = new booleanPanel(param.ValueBool, param); break;

            case ShaderParamType.Bool2: panel = new booleanPanel(param.ValueBool, param); break;

            case ShaderParamType.Bool3: panel = new booleanPanel(param.ValueBool, param); break;

            case ShaderParamType.Bool4: panel = new booleanPanel(param.ValueBool, param); break;
            }
            control.Width     = panel.Width;
            control.Height    = panel.Height + 70;
            control.CanResize = false;
            control.BackColor = FormThemes.BaseTheme.DropdownPanelBackColor;
            control.AddControl(panel);
        }