Exemplo n.º 1
0
        public ImageGeneratorPanel()
            : base(3, 2, false)
        {
            presets = new List<ImageGenerator>(ImageGenerator.Samples.list());
            presetsNames = (from preset in presets select preset.Name).ToList();
            presetComboBox = new ComboBox(presetsNames.ToArray());
            presetComboBox.Changed += delegate
            {
                int active = presetComboBox.Active;
                if (active >= 0) {
                    Generator = presets[active];
                }
            };

            ColumnSpacing = RowSpacing = BorderWidth = 5;

            spotFunctionPanel = new SpotFunctionPanel();

            effectsLabel = new Label() { Xalign = 0.0f };

            Frame spotFunctionFrame = new Frame("Spot function")
            {
                BorderWidth = 5
            };
            spotFunctionFrame.Add(spotFunctionPanel);

            Attach(new Label("Preset:") { Xalign = 0.0f }, 0, 1, 0, 1,
                AttachOptions.Fill,
                AttachOptions.Shrink, 0, 0);
            Attach(presetComboBox, 1, 2, 0, 1,
                AttachOptions.Fill,
                AttachOptions.Shrink, 0, 0);

            Attach(spotFunctionFrame, 0, 2, 1, 2,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Fill | AttachOptions.Expand, 0, 0);

            Attach(new Label("Effects:") { Xalign = 0.0f },
                0, 2, 2, 3,
                AttachOptions.Fill,
                AttachOptions.Shrink, 0, 0);

            Attach(effectsLabel, 0, 2, 3, 4,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Shrink, 0, 0);

            ShowAll();
        }
        public SpotFunctionThresholdFilterDialog(
            SpotFunctionThresholdFilter existingModule)
            : base(existingModule)
        {
            module = modifiedModule as SpotFunctionThresholdFilter;
            if (module == null) {
                modifiedModule = new SpotFunctionThresholdFilter();
                module = modifiedModule as SpotFunctionThresholdFilter;
            }

            spotFunctionPanel = new SpotFunctionPanel();
            spotFunctionPanel.SpotFunc = module.SpotFunc;

            Frame spotFunctionFrame = new Frame("Spot function")
            {
                BorderWidth = 5
            };
            spotFunctionFrame.Add(spotFunctionPanel);

            VBox.PackStart(spotFunctionFrame);
            ShowAll();
        }