Ejemplo n.º 1
0
        public WindowSetting(string nameSetting, ProgrammArgumentsValue values)
        {
            Width       = 300;
            Height      = 400;
            config      = new GraphicInterfaceConfig();
            this.values = values;
            var settingName = new Label()
            {
                Font = new Font(FontFamily.GenericSansSerif, 14),
                Text = nameSetting
            };

            settingName.Bounds = new Rectangle(75, 20, 250, 30);
            Controls.Add(settingName);
        }
Ejemplo n.º 2
0
        public void BuildTagCloud(ProgrammArgumentsValue values)
        {
            var img = Program.StartTagCloud(values.Width, values.Heigth, values.Count, values.Color, values.MaxSizeWord,
                                            values.MinSizeWord, values.FontStyle, values.TextFileName, values.FileNameWithPicture);

            pb.Image = img;
            Height   = pb.Image.Height;
            Width    = pb.Image.Width;
            var saveButton = new Button()
            {
                Text = "Save", Location = new Point(0, 0), Height = 20
            };

            saveButton.Click += (sender, args) => SaveImage();
            Controls.Add(saveButton);
            Show();
        }
Ejemplo n.º 3
0
        public TextSettingWindow(ProgrammArgumentsValue values)
            : base("Text setting", values)
        {
            var dx = 100;
            var dy = 45;

            #region MaxSizeField

            var maxSizeLabel = new Label()
            {
                Text = "Max size of word",
                Font = config.TextFont
            };

            var maxSizeText = new TextBox()
            {
                Text = "120"
            };
            maxSizeLabel.Bounds = GetBounds(config.PadX, config.PadY);
            maxSizeText.Bounds  = GetBounds(config.PadX + dx, config.PadY);
            Controls.Add(maxSizeLabel);
            Controls.Add(maxSizeText);

            #endregion

            #region MinSizeField

            var minSizeLabel = new Label()
            {
                Text = "Min size of word",
                Font = config.TextFont
            };

            var minSizeText = new TextBox()
            {
                Text = "3"
            };
            minSizeLabel.Bounds = GetBounds(config.PadX, config.PadY += dy);
            minSizeText.Bounds  = GetBounds(config.PadX + dx, config.PadY);
            Controls.Add(minSizeLabel);
            Controls.Add(minSizeText);

            #endregion

            #region TextStyleField


            var textStyleLabel = new Label()
            {
                Text = "Text Style",
                Font = config.TextFont
            };

            var textStyleCheange = new ComboBox();
            textStyleCheange.Items.AddRange(new object[] { "Regular", "Bold", "Italic", "Strikeout", "Underline" });

            textStyleLabel.Bounds   = GetBounds(config.PadX, config.PadY += dy);
            textStyleCheange.Bounds = GetBounds(config.PadX + dx, config.PadY);
            Controls.Add(textStyleLabel);
            Controls.Add(textStyleCheange);
            var accept = new Button()
            {
                Text = "Ok",
                Font = config.TextFont
            };

            var cancel = new Button()
            {
                Text = "Cancel",
                Font = config.TextFont
            };

            accept.Bounds = new Rectangle(config.PadX, config.PadY += dy, config.Width, config.Height);
            cancel.Bounds = new Rectangle(config.PadX + dx + 20, config.PadY, config.Width, config.Height);
            accept.Click += (sender, args) => Accept(maxSizeText.Text, minSizeText.Text, textStyleCheange.SelectedItem);
            cancel.Click += (sender, args) => this.Hide();
            Controls.Add(accept);
            Controls.Add(cancel);
            #endregion
        }
Ejemplo n.º 4
0
        public ImageSettingWindow(ProgrammArgumentsValue values)
            : base("Image setting", values)
        {
            //var padx = 25;
            //var pady = 75;
            var dx = 100;
            var dy = 45;

            //var size = new Size(100, 30);
            //var font = new Font(FontFamily.GenericSansSerif, 10);

            #region SettingWidth
            var labelWidth = new Label()
            {
                Font = config.TextFont,
                Text = "Width:"
            };

            var textWidth = new TextBox()
            {
                Text = "800"
            };
            labelWidth.Bounds = new Rectangle(config.PadX, config.PadY, config.Width, config.Height);
            textWidth.Bounds  = new Rectangle(config.PadX + dx, config.PadY, config.Width, config.Height);
            Controls.Add(textWidth);
            Controls.Add(labelWidth);
            #endregion

            #region SettingHeight

            var labelHeight = new Label()
            {
                Text = "Height",
                Font = config.TextFont
            };

            var textHeight = new TextBox()
            {
                Text = "600"
            };
            labelHeight.Bounds = new Rectangle(config.PadX, config.PadY += dy, config.Width, config.Height);
            textHeight.Bounds  = new Rectangle(config.PadX + dx, config.PadY, config.Width, config.Height);
            Controls.Add(labelHeight);
            Controls.Add(textHeight);
            #endregion

            #region BackgroundColorSetting
            var labelBackgroundColor = new Label()
            {
                Text = "Background color",
                Font = config.TextFont,
            };
            var cheangeColorButton = new Button();
            cheangeColorButton.Click   += (sender, args) => CheangeColor(sender);
            labelBackgroundColor.Bounds = new Rectangle(config.PadX, config.PadY += dy, config.Width, config.Height);
            cheangeColorButton.Bounds   = new Rectangle(config.PadX + dx, config.PadY, config.Width, config.Height);
            //this function will added in logik
            //Controls.Add(labelBackgroundColor);
            //Controls.Add(cheangeColorButton);
            #endregion

            #region TextColor

            var labelTextColor = new Label()
            {
                Text = "Text color",
                Font = config.TextFont
            };

            var cheangeTextColorButton = new Button()
            {
                Text      = "Example",
                ForeColor = Color.Red,
            };
            labelTextColor.Bounds         = new Rectangle(config.PadX, config.PadY += dy, config.Width, config.Height);
            cheangeTextColorButton.Bounds = new Rectangle(config.PadX + dx, config.PadY, config.Width, config.Height);
            cheangeTextColorButton.Click += (sender, args) => CheangeTextColor(sender);
            Controls.Add(labelTextColor);
            Controls.Add(cheangeTextColorButton);
            #endregion

            var accept = new Button()
            {
                Text = "Ok",
                Font = config.TextFont
            };

            var cancel = new Button()
            {
                Text = "Cancel",
                Font = config.TextFont
            };

            accept.Bounds = new Rectangle(config.PadX, config.PadY += dy, config.Width, config.Height);
            cancel.Bounds = new Rectangle(config.PadX + dx + 20, config.PadY, config.Width, config.Height);
            accept.Click += (sender, args) => Accept(textWidth.Text, textHeight.Text, cheangeColorButton.BackColor,
                                                     cheangeTextColorButton.ForeColor);
            cancel.Click += (sender, args) => this.Hide();
            Controls.Add(accept);
            Controls.Add(cancel);
        }