コード例 #1
0
        public AsistimeMultilineTextbox()
        {
            box        = new AsistimeSearchBox();
            box.Width  = 400;
            box.Height = 300;
            this.Controls.Add(box);
            box.BringToFront();

            textbox           = new TextBox();
            textbox.Multiline = true;
            textbox.Width     = 380; //20 menos que el ancho del searchbox
            textbox.Height    = 280; //20 menos que la altura del searchbox
            textbox.Location  = new Point(10, 10);
            this.Controls.Add(textbox);
            textbox.BorderStyle = BorderStyle.None;
            textbox.Font        = Constants.TextBoxFont;
            textbox.BringToFront();

            textbox.Text = texto;
        }
コード例 #2
0
        public AsistimeCreatePanel()
        {
            this.title.Text = "CREACIÓN DE TOUR";

            tourNameLabel = new Label()
            {
                Text  = "NOMBRE DEL TOUR",
                Font  = Constants.H2LabelFont,
                Width = 400
            };
            this.Controls.Add(tourNameLabel);
            tourNameLabel.BringToFront();

            tourNameTextBox = new AsistimeSearchBox()
            {
                Font     = Constants.TextBoxFont,
                Parent   = this,
                Width    = 400,
                TextName = null
            };
            this.Controls.Add(tourNameTextBox);
            tourNameTextBox.BringToFront();

            Label tourDescTextBox = new Label()
            {
                Text  = "DESCRIPCIÓN",
                Font  = Constants.H2LabelFont,
                Width = 400
            };

            this.Controls.Add(tourDescTextBox);
            tourDescTextBox.BringToFront();

            box        = new AsistimeSearchBox();
            box.Width  = 400;
            box.Height = 300;
            this.Controls.Add(box);
            box.BringToFront();

            textbox           = new TextBox();
            textbox.Multiline = true;
            textbox.Width     = 380; //20 menos que el ancho del searchbox
            textbox.Height    = 280; //20 menos que la altura del searchbox
            this.Controls.Add(textbox);
            textbox.BorderStyle = BorderStyle.None;
            textbox.Font        = Constants.H2LabelFont;
            textbox.BringToFront();

            box.Location             = new Point(this.Width / 2 - box.Width / 2, 260);
            textbox.Location         = new Point(box.Location.X + 10, box.Location.Y + 10);
            tourDescTextBox.Location = new Point(box.Location.X, box.Location.Y - 30);
            tourNameTextBox.Location = new Point(this.Width / 2 - tourNameTextBox.Width / 2, 150);
            tourNameLabel.Location   = new Point(tourNameTextBox.Location.X, tourNameTextBox.Location.Y - 30);

            nextButton            = new AsistimeActionButton();
            nextButton.Click     += new EventHandler(Next);
            nextButton.ButtonText = "Siguiente";
            this.Controls.Add(nextButton);
            nextButton.BringToFront();

            cancelButton            = new AsistimeActionButton();
            cancelButton.Click     += new EventHandler(Cancel);
            cancelButton.ButtonText = "Cancelar";
            this.Controls.Add(cancelButton);
            cancelButton.BringToFront();

            int nextButtonWidth;

            using (Graphics cg = this.CreateGraphics())
            {
                SizeF size = cg.MeasureString(nextButton.ButtonText, nextButton.Font);
                size.Width     += 40;
                nextButtonWidth = (int)size.Width;
            }
            nextButton.Location = new Point(this.Width / 2 - nextButtonWidth / 2, 600);

            int cancelButtonWidth;

            using (Graphics cg = this.CreateGraphics())
            {
                SizeF size = cg.MeasureString(cancelButton.ButtonText, cancelButton.Font);
                size.Width       += 40;
                cancelButtonWidth = (int)size.Width;
            }
            cancelButton.Location = new Point(this.Width / 2 - cancelButtonWidth / 2, nextButton.Location.Y + 80);
        }
コード例 #3
0
        public TextElement()
        {
            this.Width     = 700;
            this.Height    = 450;
            this.BackColor = Color.White;

            Panel frontPanel = new Panel();

            frontPanel.Width     = this.Width - 10;
            frontPanel.Height    = this.Height - 10;
            frontPanel.BackColor = Color.White;
            frontPanel.Location  = new Point(this.Location.X + 5, this.Location.Y + 5);
            Controls.Add(frontPanel);
            frontPanel.SendToBack();
            frontPanel.Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, frontPanel.Width, frontPanel.Height, 18, 18));

            Panel backPanel = new Panel();

            backPanel.Width     = this.Width;
            backPanel.Height    = this.Height;
            backPanel.BackColor = ColorTranslator.FromHtml(Constants.AppSecondaryColour);
            backPanel.Location  = new Point(this.Location.X, this.Location.Y);
            Controls.Add(backPanel);
            backPanel.SendToBack();

            title = new Label()
            {
                Text      = "ESCRIBÍ EL TEXTO",
                Font      = Constants.HLabelFont,
                Width     = 400,
                Height    = 40,
                TextAlign = ContentAlignment.MiddleCenter,
            };
            title.Location = new Point(this.Width / 2 - title.Width / 2, 50);
            this.Controls.Add(title);
            title.BringToFront();

            subTitle           = new TextBox();
            subTitle.Multiline = true;
            subTitle.Width     = 450;
            subTitle.Height    = 100;
            this.Controls.Add(subTitle);
            subTitle.BorderStyle = BorderStyle.None;
            subTitle.Font        = Constants.H2LabelFont;
            subTitle.BringToFront();
            subTitle.Text      = "Escribí el texto que quieras colocar en pantalla. Recordá no colocarlo donde el adulto tenga que hacer click.";
            subTitle.TextAlign = HorizontalAlignment.Center;
            subTitle.Location  = new Point(this.Width / 2 - subTitle.Width / 2, 120);
            subTitle.TabStop   = false;
            subTitle.BringToFront();

            textbox = new AsistimeSearchBox()
            {
                Font     = Constants.TextBoxFont,
                Parent   = this,
                Width    = 400,
                TextName = null
            };
            textbox.Location = new Point(this.Width / 2 - title.Width / 2, title.Location.Y + 220);
            this.Controls.Add(textbox);
            textbox.BringToFront();


            BackButton = new AsistimeRoundButton(98, 98, Constants.CancelRedImageW, Constants.CancelRedHoverImageW, Constants.CancelRedClickImageW)
            {
                Parent = this.Parent
            };
            BackButton.Location = new Point(30, this.Height - 128);
            BackButton.Click   += new EventHandler(this.Back);
            this.Controls.Add(BackButton);
            BackButton.BringToFront();

            ForwardButton = new AsistimeRoundButton(98, 98, Constants.ConfirmGreenImageW, Constants.ConfirmGreenHoverImageW, Constants.ConfirmGreenClickImageW)
            {
                Parent = this.Parent
            };
            ForwardButton.Location = new Point(572, this.Height - 128);
            ForwardButton.Click   += new EventHandler(this.Forward);
            this.Controls.Add(ForwardButton);
            ForwardButton.BringToFront();

            Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 20, 20));
        }