public AsistimeModalForm() { InitializeComponent(); this.FormBorderStyle = FormBorderStyle.None; StartPosition = FormStartPosition.CenterScreen; this.AllowTransparency = true; this.BackColor = Color.White; this.Width = 700; this.Height = 900; Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 20, 20)); AsistimeRoundButton exitButton = new AsistimeRoundButton(44, 44, Constants.CloseImage, Constants.CloseHoverImage, Constants.CloseClickedImage) { Parent = this.Parent }; exitButton.Location = new Point(this.Width - 56, 10); exitButton.Click += new EventHandler(Exit); this.Controls.Add(exitButton); PictureBox logo = new PictureBox(); logo.Image = Constants.AsistimeLogo;; this.Controls.Add(logo); logo.Width = 500; logo.Height = 200; logo.Location = new Point(101, 70); logo.BringToFront(); }
private void Center_With(Label label, AsistimeRoundButton button) { int labelWidth; using (Graphics cg = this.CreateGraphics()) { SizeF size = cg.MeasureString(label.Text, label.Font); labelWidth = (int)size.Width + 7; } label.Width = labelWidth; label.Location = new Point(button.Location.X + button.Width / 2 - labelWidth / 2, button.Location.Y + button.Width); }
protected Control GetStepBackButton(int x, int y) { if (StepBackButton == null) { StepBackButton = new AsistimeRoundButton(98, 98, Constants.StepBackImage, Constants.StepBackHoverImage, Constants.StepBackClickImage) { Parent = this.Parent }; StepBackButton.Location = new Point(x, y); } StepBackButton.Click += new EventHandler(this.GoOneStepBack); return(StepBackButton); }
protected Control GetPlayButton(int x, int y) { if (PlayButton == null) { PlayButton = new AsistimeRoundButton(98, 98, Constants.StepPlayImage, Constants.StepPlayHoverImage, Constants.StepPlayClickImage) { Parent = this.Parent }; PlayButton.Location = new Point(x, y); } PlayButton.Click += new EventHandler(this.PlayStep); return(PlayButton); }
protected Control GetCloseTourButton(int x, int y) { if (CloseTourButton == null) { CloseTourButton = new AsistimeRoundButton(98, 98, Constants.CloseTourImage, Constants.CloseTourHoverImage, Constants.CloseTourClickImage) { Parent = this.Parent }; CloseTourButton.Location = new Point(x, y); } CloseTourButton.Click += new EventHandler(this.CloseTour); return(CloseTourButton); }
protected Control GetNavBackButton(int x, int y) { if (NavBackButton == null) { NavBackButton = new AsistimeRoundButton(98, 98, Constants.NavBackImage, Constants.NavBackHoverImage, Constants.NavBackClickedImage) { Parent = this.Parent }; NavBackButton.Location = new Point(x, y); } NavBackButton.Click += new EventHandler(this.NavigateBack); return(NavBackButton); }
protected Control GetNavProfileButton(int x, int y) { if (NavProfileButton == null) { NavProfileButton = new AsistimeRoundButton(98, 98, Constants.NavProfileImage, Constants.NavProfileHoverImage, Constants.NavProfileClickedImage) { Parent = this.Parent }; NavProfileButton.Location = new Point(x, y); } NavProfileButton.Click += new EventHandler(this.ShowMenu); return(NavProfileButton); }
public HowToAudio() { this.ForwardButton.Hide(); AsistimeRoundButton ConfirmButton = new AsistimeRoundButton(98, 98, Constants.ConfirmGreenImageW, Constants.ConfirmGreenHoverImageW, Constants.ConfirmGreenClickImageW) { Parent = this.Parent }; ConfirmButton.Location = new Point(ForwardButton.Location.X, ForwardButton.Location.Y); ConfirmButton.Click += new EventHandler(this.Confirm); this.Controls.Add(ConfirmButton); ConfirmButton.BringToFront(); title.Text = "GRABACIÓN DE AUDIO"; subTitle.Text = "¡Con audio se entiende mejor! Podés grabar una ayuda auditiva que explique la acción que se debe realizar. Recordá hablar despacio y claro, para que alguien mayor te pueda entender. Si querés, podés saltear este paso."; }
public HowToTour() { this.BackButton.Hide(); AsistimeRoundButton CancelButton = new AsistimeRoundButton(98, 98, Constants.CancelRedImageW, Constants.CancelRedHoverImageW, Constants.CancelRedClickImageW) { Parent = this.Parent }; CancelButton.Location = new Point(BackButton.Location.X, BackButton.Location.Y); CancelButton.Click += new EventHandler(this.Cancel); this.Controls.Add(CancelButton); CancelButton.BringToFront(); title.Text = "CREACIÓN DE TOUR"; subTitle.Text = "Creá un tour para un adulto mayor. Dale un nombre que represente para qué sirve, y una descripción para que la persona que lo realice entienda de qué se trata."; }
public AssistantTourCard(Tour tour, int x, int y) { color = Color.Transparent; BorderRadius = 20; BackColor = ColorTranslator.FromHtml(Constants.TourCardBackground); //Título Label title = new Label(); title.AutoSize = true; title.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); title.Location = new System.Drawing.Point(12, 16); title.Width = Constants.TourCardWidth - 20; title.TabIndex = 1; title.Text = tour.name; //Descripción Label description = new Label(); description.Location = new System.Drawing.Point(12, 59); description.Width = Constants.TourCardWidth - 20; description.Height = Constants.TourCardHeigth / 2; description.TabIndex = 2; description.Text = tour.description; //Botón de asignar tour AsistimeActionButton assignButton = new AsistimeActionButton(); assignButton.TabIndex = 0; assignButton.ButtonText = "Asignar"; //assignButton.ReSize(); //assignButton.Location = new Point(30, Constants.TourCardHeigth - assignButton.Height - 10); int assignButtonWidth; using (Graphics cg = this.CreateGraphics()) { SizeF size = cg.MeasureString(assignButton.ButtonText, assignButton.Font); size.Width += 40; assignButtonWidth = (int)size.Width; } //assignButton.Location = new Point(10, Constants.TourCardHeigth - assignButton.Height - 10); assignButton.Click += new EventHandler(this.AssignTour); assignButton.Location = new Point(Constants.TourCardWidth - assignButtonWidth - 10, Constants.TourCardHeigth - assignButton.Height - 10); //Botón de borrar tour AsistimeRoundButton exitButton = new AsistimeRoundButton(44, 44, Constants.DestroyImage, Constants.DestroyHoverImage, Constants.DestroyClickedImage) { Parent = this.Parent }; exitButton.Location = new Point(Constants.TourCardWidth - 56, 10); exitButton.Click += new EventHandler(DeleteTour); this.Controls.Add(exitButton); //Botón de realizar tour /*AsistimeActionButton playButton = new AsistimeActionButton(); * playButton.TabIndex = 0; * playButton.ButtonText = "Realizar"; * int playButtonWidth; * using (Graphics cg = this.CreateGraphics()) * { * SizeF size = cg.MeasureString(playButton.ButtonText, playButton.Font); * size.Width += 40; * playButtonWidth = (int)size.Width; * } * playButton.Location = new Point(Constants.TourCardWidth - playButtonWidth - 10, Constants.TourCardHeigth - playButton.Height - 10); * playButton.Click += new EventHandler(this.PlayTour);*/ //Formato de la tarjeta Controls.Add(description); Controls.Add(title); Controls.Add(assignButton); //Controls.Add(playButton); Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); ForeColor = ColorTranslator.FromHtml(Constants.TourCardFontColour); Size = new System.Drawing.Size(Constants.TourCardWidth, Constants.TourCardHeigth); TabIndex = 0; TabStop = false; Location = new System.Drawing.Point(x, y); tourAsociado = tour; }
public TutorialAssign() { this.Width = 700; this.Height = 500; 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 = "ASIGNÁ EL TOUR A UN ADULTO", Font = Constants.HLabelFont, Width = 500, 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 = "Seleccioná los adultos a los que quieras asignar el tour y después hacé click en la tilde para completar:"; subTitle.TextAlign = HorizontalAlignment.Center; subTitle.Location = new Point(this.Width / 2 - subTitle.Width / 2, 120); subTitle.TabStop = false; subTitle.BringToFront(); BackButton = new AsistimeRoundButton(98, 98, Constants.CancelRedImageW, Constants.CancelRedHoverImageW, Constants.CancelRedClickImageW) { Parent = this.Parent }; BackButton.Location = new Point(30, 372); 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, 372); ForwardButton.Click += new EventHandler(this.Forward); this.Controls.Add(ForwardButton); ForwardButton.BringToFront(); userController = new UserController(); adultsChecked = new List <int>(); //Busco lista de usuarios adults = userController.GetAdults().Result; var ad = adults.Select(a => a.name).ToArray(); checkedListBox1 = new CheckedListBox(); checkedListBox1.Items.AddRange(ad); checkedListBox1.SelectedIndexChanged += new EventHandler(OnSelect); this.Controls.Add(checkedListBox1); checkedListBox1.BringToFront(); checkedListBox1.CheckOnClick = true; checkedListBox1.Font = Constants.H2LabelFont; checkedListBox1.BorderStyle = BorderStyle.None; checkedListBox1.Width = this.Width / 2; checkedListBox1.Height = this.Height / 2; checkedListBox1.Location = new Point((this.Width / 2) - (checkedListBox1.Width / 2), 220); Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 20, 20)); }
public TutorialStep() { this.Width = 700; this.Height = 500; 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 = " ", 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 = 250; this.Controls.Add(subTitle); subTitle.BorderStyle = BorderStyle.None; subTitle.Font = Constants.H2LabelFont; subTitle.BringToFront(); subTitle.Text = " "; subTitle.TextAlign = HorizontalAlignment.Center; subTitle.Location = new Point(this.Width / 2 - subTitle.Width / 2, 120); subTitle.TabStop = false; subTitle.BringToFront(); BackButton = new AsistimeRoundButton(98, 98, Constants.PreviousImage, Constants.PreviousHoverImage, Constants.PreviousClickImage) { Parent = this.Parent }; BackButton.Location = new Point(30, 372); BackButton.Click += new EventHandler(this.Back); this.Controls.Add(BackButton); BackButton.BringToFront(); ForwardButton = new AsistimeRoundButton(98, 98, Constants.NextImage, Constants.NextHoverImage, Constants.NextClickImage) { Parent = this.Parent }; ForwardButton.Location = new Point(572, 372); ForwardButton.Click += new EventHandler(this.Forward); this.Controls.Add(ForwardButton); ForwardButton.BringToFront(); Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 20, 20)); }
public AsistimeAudioPanel() { this.title.Text = "GRABACIÓN DE AUDIO"; textbox = new TextBox(); textbox.Multiline = true; textbox.Width = 450; textbox.Height = 250; this.Controls.Add(textbox); textbox.BorderStyle = BorderStyle.None; textbox.Font = Constants.H2LabelFont; textbox.BringToFront(); textbox.Text = "Recordá hablar despacio y claro, para que alguien mayor te pueda entender. ¡Ojo! Sólo puede haber un audio por paso, si ya existe un audio y grabás uno nuevo vas a borrar el anterior."; textbox.TextAlign = HorizontalAlignment.Center; textbox.Location = new Point(this.Width / 2 - textbox.Width / 2, 120); ReproductorWav = new SoundPlayer(); RecordButton = new AsistimeRoundButton(84, 84, Constants.RecordImage, Constants.RecordHoverImage, Constants.RecordClickImage) { Parent = this.Parent }; Label recordLabel = new Label() { Text = "Grabar", ForeColor = ColorTranslator.FromHtml(Constants.AppPrimaryColour), Font = Constants.H1LabelFont, Height = 40 }; RecordButton.Location = new Point(103, 400); Center_With(recordLabel, RecordButton); RecordButton.Click += new EventHandler(RecordAudio); this.Controls.Add(RecordButton); this.Controls.Add(recordLabel); recordLabel.BringToFront(); RecordButton.BringToFront(); StopButton = new AsistimeRoundButton(84, 84, Constants.StopImage, Constants.StopHoverImage, Constants.StopClickImage) { Parent = this.Parent }; Label stopLabel = new Label() { Text = "Parar", ForeColor = ColorTranslator.FromHtml(Constants.AppPrimaryColour), Font = Constants.H1LabelFont, Height = 40 }; StopButton.Location = new Point(RecordButton.Location.X + 205, RecordButton.Location.Y); Center_With(stopLabel, StopButton); StopButton.Click += new EventHandler(StopRecording); this.Controls.Add(StopButton); StopButton.Enabled = false; this.Controls.Add(stopLabel); stopLabel.BringToFront(); StopButton.BringToFront(); PlayButton = new AsistimeRoundButton(84, 84, Constants.ListenImage, Constants.ListenHoverImage, Constants.ListenClickImage) { Parent = this.Parent }; Label playLabel = new Label() { Text = "Reproducir", ForeColor = ColorTranslator.FromHtml(Constants.AppPrimaryColour), Font = Constants.H1LabelFont, Height = 40 }; PlayButton.Location = new Point(RecordButton.Location.X + 410, RecordButton.Location.Y); Center_With(playLabel, PlayButton); PlayButton.Click += new EventHandler(PlayAudio); this.Controls.Add(PlayButton); PlayButton.Enabled = false; this.Controls.Add(playLabel); playLabel.BringToFront(); PlayButton.BringToFront(); nextButton = new AsistimeActionButton(); nextButton.Click += new EventHandler(Next); nextButton.ButtonText = "¡Listo!"; this.Controls.Add(nextButton); nextButton.BringToFront(); /*cancelButton = new AsistimeActionButton(); * cancelButton.Click += new EventHandler(Cancel); * cancelButton.ButtonText = "Salir"; * 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); try { if (File.Exists(UrlReproductor)) { PlayButton.Enabled = false; } ; } catch { new PopupNotification("Error", "Error al crear el directorio para los audios"); } /*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);*/ }
public AsistimeFormsPanel() { this.title.Text = "CREACIÓN DE FORMAS"; textbox = new TextBox(); textbox.Multiline = true; textbox.Width = 450; textbox.Height = 250; this.Controls.Add(textbox); textbox.BorderStyle = BorderStyle.None; textbox.Font = Constants.H2LabelFont; textbox.BringToFront(); textbox.Text = "¡Dale forma al tour! Cada una de las siguientes formas está pensada para resaltar sectores del sitio web. Con ellas podés indicarle al adulto mayor en qué sector de la página debe realizar una acción, qué componentes debe observar, o restringir el 'click' en algún sector."; textbox.TextAlign = HorizontalAlignment.Center; textbox.Location = new Point(this.Width / 2 - textbox.Width / 2, 120); AsistimeRoundButton RectangleButton = new AsistimeRoundButton(84, 84, Constants.RectImage, Constants.RectHoverImage, Constants.RectClickImage) { Parent = this.Parent }; Label rectLabel = new Label() { Text = "Rectángulo", ForeColor = ColorTranslator.FromHtml(Constants.AppPrimaryColour), Font = Constants.H1LabelFont, Height = 40 }; RectangleButton.Location = new Point(87, 400); Center_With(rectLabel, RectangleButton); RectangleButton.Click += new EventHandler(DrawRectangle); this.Controls.Add(RectangleButton); this.Controls.Add(rectLabel); AsistimeRoundButton DivButton = new AsistimeRoundButton(84, 84, Constants.DivImage, Constants.DivHoverImage, Constants.DivClickImage) { Parent = this.Parent }; Label divLabel = new Label() { Text = "Recuadrar", ForeColor = ColorTranslator.FromHtml(Constants.AppPrimaryColour), Font = Constants.H1LabelFont, Height = 40 }; DivButton.Location = new Point(RectangleButton.Location.X + 110, RectangleButton.Location.Y); Center_With(divLabel, DivButton); DivButton.Click += new EventHandler(DrawDiv); this.Controls.Add(DivButton); this.Controls.Add(divLabel); AsistimeRoundButton DialogButton = new AsistimeRoundButton(84, 84, Constants.DialogImage, Constants.DialogHoverImage, Constants.DialogClickImage) { Parent = this.Parent }; Label dialogLabel = new Label() { Text = "Diálogo", ForeColor = ColorTranslator.FromHtml(Constants.AppPrimaryColour), Font = Constants.H1LabelFont, Height = 40 }; DialogButton.Location = new Point(RectangleButton.Location.X + 220, RectangleButton.Location.Y); Center_With(dialogLabel, DialogButton); DialogButton.Click += new EventHandler(DrawDialog); this.Controls.Add(DialogButton); this.Controls.Add(dialogLabel); AsistimeRoundButton TextButton = new AsistimeRoundButton(84, 84, Constants.TextImage, Constants.TextHoverImage, Constants.TextClickImage) { Parent = this.Parent }; Label textLabel = new Label() { Text = "Texto", ForeColor = ColorTranslator.FromHtml(Constants.AppPrimaryColour), Font = Constants.H1LabelFont, Height = 40 }; TextButton.Location = new Point(RectangleButton.Location.X + 330, RectangleButton.Location.Y); Center_With(textLabel, TextButton); TextButton.Click += new EventHandler(DrawText); this.Controls.Add(TextButton); this.Controls.Add(textLabel); AsistimeRoundButton CircleButton = new AsistimeRoundButton(84, 84, Constants.CircleImage, Constants.CircleHoverImage, Constants.CircleClickImage) { Parent = this.Parent }; Label circleLabel = new Label() { Text = "Círculo", ForeColor = ColorTranslator.FromHtml(Constants.AppPrimaryColour), Font = Constants.H1LabelFont, Height = 40 }; CircleButton.Location = new Point(RectangleButton.Location.X + 440, RectangleButton.Location.Y); Center_With(circleLabel, CircleButton); CircleButton.Click += new EventHandler(DrawCircle); this.Controls.Add(CircleButton); this.Controls.Add(circleLabel); 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 = "Anterior"; 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); }
//private List<Step>; public AsistimeStepsPanel() { this.title.Text = "ALTA DE PASOS"; stepCount = 0; /*tourNameLabel = new Label() * { * Font = Constants.H2LabelFont, * Width = 400 * }; * this.Controls.Add(tourNameLabel);*/ textbox = new TextBox(); textbox.Multiline = true; textbox.Width = 450; textbox.Height = 300; this.Controls.Add(textbox); textbox.BorderStyle = BorderStyle.None; textbox.Font = Constants.H2LabelFont; textbox.BringToFront(); textbox.Text = "¡Agregá pasos al tour! En cada paso, indicale al adulto mayor qué es lo que debe hacer, ayudándolo con dibujos en pantalla y un audio opcional. Recordá que cuanta menos información incluyas en cada paso, el adulto mayor podrá realizar el tour con mas facilidad."; textbox.TextAlign = HorizontalAlignment.Center; textbox.Location = new Point(this.Width / 2 - textbox.Width / 2, 120); //tourNameLabel.Location = new Point(textbox.Location.X, textbox.Location.Y - 30); Label stepsLabel = new Label() { Text = "CANTIDAD DE PASOS: " + stepCount, Font = Constants.H2LabelFont, Width = 400 }; stepsLabel.Location = new Point(textbox.Location.X, textbox.Location.Y + textbox.Height); this.Controls.Add(stepsLabel); AsistimeRoundButton AddStepButton = new AsistimeRoundButton(84, 84, Constants.AddStepImage, Constants.AddStepHoverImage, Constants.AddStepClickImage) { Parent = this.Parent }; Label addLabel = new Label() { Text = "Agregar paso", ForeColor = ColorTranslator.FromHtml(Constants.AppPrimaryColour), Font = Constants.H1LabelFont, Height = 40 }; AddStepButton.Location = new Point(450, textbox.Location.Y + textbox.Height - 30); Center_With(addLabel, AddStepButton); AddStepButton.Click += new EventHandler(AddStep); this.Controls.Add(AddStepButton); AddStepButton.BringToFront(); this.Controls.Add(addLabel); 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 = "Anterior"; 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); }
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)); }