protected 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 GetNavConfirmButton(int x, int y) { if (ConfirmButton == null) { ConfirmButton = new AsistimeRoundButton(98, 98, Constants.ConfirmImage, Constants.ConfirmHoverImage, Constants.ConfirmClickImage) { Parent = this.Parent }; ConfirmButton.Location = new Point(x, y); } ConfirmButton.Click += new EventHandler(this.SaveStep); return(ConfirmButton); }
protected Control GetAsistimeButton(int x, int y) { if (AsistimeButton == null) { AsistimeButton = new AsistimeRoundButton(98, 98, Constants.AsistimeImage, Constants.AsistimeHoverImage, Constants.AsistimeClickImage) { Parent = this.Parent }; AsistimeButton.Location = new Point(x, y); } AsistimeButton.Click += new EventHandler(this.Asistime); return(AsistimeButton); }
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 GetAddStepsButton(int x, int y) { if (AddStepButton == null) { AddStepButton = new AsistimeRoundButton(98, 98, Constants.AddTourImage, Constants.AddTourHoverImage, Constants.AddTourClickImage) { Parent = this.Parent }; AddStepButton.Location = new Point(x, y); } AddStepButton.Click += new EventHandler(this.AddStep); return(AddStepButton); }
protected void AddButtons() { backButton = new AsistimeRoundButton(98, 98, Constants.PreviousImageG, Constants.PreviousHoverImageG, Constants.PreviousClickImageG) { Parent = this }; backButton.Location = new Point(20, 15); backButton.Click += new EventHandler(this.ReturnToNavigation); this.Controls.Add(backButton); Label backLabel = new Label() { Text = "Volver", ForeColor = ColorTranslator.FromHtml(Constants.AppPrimaryColour), Font = Constants.H1LabelFont, Height = 40 }; Center_With(backLabel, backButton); backButton.BringToFront(); this.Controls.Add(backLabel); if (Constants.user.rol == "Adulto") { assistButton = new AsistimeRoundButton(98, 98, Constants.AsistimeImageG, Constants.AsistimeHoverImageG, Constants.AsistimeClickImageG) { Parent = this }; assistButton.Location = new Point(this.ClientSize.Width - 150, 15); assistButton.Click += new EventHandler(this.Asistime); this.Controls.Add(assistButton); Label assistLabel = new Label() { Text = "Asistime", ForeColor = ColorTranslator.FromHtml(Constants.AppPrimaryColour), Font = Constants.H1LabelFont, Height = 40 }; Center_With(assistLabel, assistButton); assistButton.BringToFront(); this.Controls.Add(assistLabel); } else if (Constants.user.rol == "Responsable") { addAdultButton = new AsistimeRoundButton(98, 98, Constants.AddAdultImage, Constants.AddAdultHoverImage, Constants.AddAdultClickImage) { Parent = this }; addAdultButton.Location = new Point(this.ClientSize.Width - 150, 15); addAdultButton.Click += new EventHandler(this.AddAdult); this.Controls.Add(addAdultButton); Label addLabel = new Label() { Text = "Nuevo Adulto", ForeColor = ColorTranslator.FromHtml(Constants.AppPrimaryColour), Font = Constants.H1LabelFont, Height = 40 }; Center_With(addLabel, addAdultButton); addAdultButton.BringToFront(); this.Controls.Add(addLabel); } PictureBox logo = new PictureBox(); logo.Image = Constants.AsistimeLogo291x99; this.Controls.Add(logo); logo.Width = 291; logo.Height = 99; logo.Location = new Point(this.Width / 2 - logo.Width / 2, 15); logo.BringToFront(); }
public AsistimeIconBar() { BackColor = ColorTranslator.FromHtml(Constants.AppPrimaryColour); ForeColor = ColorTranslator.FromHtml(Constants.AppSecondaryColour); Height = 300; Width = 200; this.MouseMove += new MouseEventHandler(panel_MouseMove); Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 20, 20)); Ban = new AsistimeRoundButton(37, 37, Constants.Ban, Constants.BanHover, Constants.BanHover) { Parent = this.Parent }; Ban.Location = new Point(40, 30); Ban.Click += new EventHandler((sender, e) => DrawIcon("ban")); this.Controls.Add(Ban); Bell = new AsistimeRoundButton(37, 37, Constants.Bell, Constants.BellHover, Constants.BellHover) { Parent = this.Parent }; Bell.Location = new Point(107, 30); Bell.Click += new EventHandler((sender, e) => DrawIcon("bell")); this.Controls.Add(Bell); Check = new AsistimeRoundButton(37, 37, Constants.Check, Constants.CheckHover, Constants.CheckHover) { Parent = this.Parent }; Check.Location = new Point(40, 78); Check.Click += new EventHandler((sender, e) => DrawIcon("check")); this.Controls.Add(Check); Comment = new AsistimeRoundButton(37, 37, Constants.Comment, Constants.CommentHover, Constants.CommentHover) { Parent = this.Parent }; Comment.Location = new Point(107, 78); Comment.Click += new EventHandler((sender, e) => DrawIcon("comment")); this.Controls.Add(Comment); Frown = new AsistimeRoundButton(37, 37, Constants.Frown, Constants.FrownHover, Constants.FrownHover) { Parent = this.Parent }; Frown.Location = new Point(40, 126); Frown.Click += new EventHandler((sender, e) => DrawIcon("frown")); this.Controls.Add(Frown); GrinAlt = new AsistimeRoundButton(37, 37, Constants.GrinAlt, Constants.GrinAltHover, Constants.GrinAltHover) { Parent = this.Parent }; GrinAlt.Location = new Point(107, 126); GrinAlt.Click += new EventHandler((sender, e) => DrawIcon("grin-alt")); this.Controls.Add(GrinAlt); HandPaper = new AsistimeRoundButton(37, 37, Constants.HandPaper, Constants.HandPaperHover, Constants.HandPaperHover) { Parent = this.Parent }; HandPaper.Location = new Point(40, 174); HandPaper.Click += new EventHandler((sender, e) => DrawIcon("hand-paper")); this.Controls.Add(HandPaper); HandPointUp = new AsistimeRoundButton(37, 37, Constants.HandPointUp, Constants.HandPointUpHover, Constants.HandPointUpHover) { Parent = this.Parent }; HandPointUp.Location = new Point(107, 174); HandPointUp.Click += new EventHandler((sender, e) => DrawIcon("hand-point-up")); this.Controls.Add(HandPointUp); ShoppingCart = new AsistimeRoundButton(37, 37, Constants.ShoppingCart, Constants.ShoppingCartHover, Constants.ShoppingCartHover) { Parent = this.Parent }; ShoppingCart.Location = new Point(40, 222); ShoppingCart.Click += new EventHandler((sender, e) => DrawIcon("shopping-cart")); this.Controls.Add(ShoppingCart); ThumbsUp = new AsistimeRoundButton(37, 37, Constants.ThumbsUp, Constants.ThumbsUpHover, Constants.ThumbsUpHover) { Parent = this.Parent }; ThumbsUp.Location = new Point(107, 222); ThumbsUp.Click += new EventHandler((sender, e) => DrawIcon("thumbs-up")); this.Controls.Add(ThumbsUp); }
public AsistimeFormBar() { BackColor = ColorTranslator.FromHtml(Constants.AppPrimaryColour); ForeColor = ColorTranslator.FromHtml(Constants.AppSecondaryColour); Height = 700; Width = 200; this.MouseMove += new MouseEventHandler(panel_MouseMove); Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 20, 20)); LessThicknessButton = new AsistimeRoundButton(37, 37, Constants.MinusImage, Constants.MinusHoverImage, Constants.MinusHoverImage) { Parent = this.Parent }; LessThicknessButton.Location = new Point(40, 30); LessThicknessButton.Click += new EventHandler(this.LessThickness); this.Controls.Add(LessThicknessButton); MoreThicknessButton = new AsistimeRoundButton(37, 37, Constants.PlusImage, Constants.PlusHoverImage, Constants.PlusHoverImage) { Parent = this.Parent }; MoreThicknessButton.Location = new Point(107, 30); MoreThicknessButton.Click += new EventHandler(this.MoreThickness); this.Controls.Add(MoreThicknessButton); Label thickness = new Label() { Text = "Grosor", ForeColor = Color.White, Font = Constants.H1LabelFont, Height = 40 }; thickness.Location = new Point(10, 80); Center(thickness, this); this.Controls.Add(thickness); LessSizeButton = new AsistimeRoundButton(37, 37, Constants.MinusImage, Constants.MinusHoverImage, Constants.MinusHoverImage) { Parent = this.Parent }; LessSizeButton.Location = new Point(40, 147); LessSizeButton.Click += new EventHandler(this.LessSize); this.Controls.Add(LessSizeButton); MoreSizeButton = new AsistimeRoundButton(37, 37, Constants.PlusImage, Constants.PlusHoverImage, Constants.PlusHoverImage) { Parent = this.Parent }; MoreSizeButton.Location = new Point(107, 147); MoreSizeButton.Click += new EventHandler(this.MoreSize); this.Controls.Add(MoreSizeButton); Label size = new Label() { Text = "Tamaño", ForeColor = Color.White, Font = Constants.H1LabelFont, Height = 40 }; size.Location = new Point(10, 187); Center(size, this); this.Controls.Add(size); TurnRightButton = new AsistimeRoundButton(37, 37, Constants.TurnRightImage, Constants.TurnRightHoverImage, Constants.TurnRightHoverImage) { Parent = this.Parent }; TurnRightButton.Location = new Point(40, 264); TurnRightButton.Click += new EventHandler(this.TurnRightSize); this.Controls.Add(TurnRightButton); TurnLeftButton = new AsistimeRoundButton(37, 37, Constants.TurnLeftImage, Constants.TurnLeftHoverImage, Constants.TurnLeftHoverImage) { Parent = this.Parent }; TurnLeftButton.Location = new Point(107, 264); TurnLeftButton.Click += new EventHandler(this.TurnLeftSize); this.Controls.Add(TurnLeftButton); Label rotate = new Label() { Text = "Girar", ForeColor = Color.White, Font = Constants.H1LabelFont, Height = 40 }; rotate.Location = new Point(10, 304); Center(rotate, this); this.Controls.Add(rotate); FontDownButton = new AsistimeRoundButton(37, 37, Constants.FontDownImage, Constants.FontDownHoverImage, Constants.FontDownHoverImage) { Parent = this.Parent }; FontDownButton.Location = new Point(40, 381); FontDownButton.Click += new EventHandler(this.FontDown); this.Controls.Add(FontDownButton); FontUpButton = new AsistimeRoundButton(37, 37, Constants.FontUpImage, Constants.FontUpHoverImage, Constants.FontUpHoverImage) { Parent = this.Parent }; FontUpButton.Location = new Point(107, 381); FontUpButton.Click += new EventHandler(this.FontUp); this.Controls.Add(FontUpButton); Label font = new Label() { Text = "Fuente", ForeColor = Color.White, Font = Constants.H1LabelFont, Height = 40 }; font.Location = new Point(10, 421); Center(font, this); this.Controls.Add(font); BlueButton = new AsistimeRoundButton(37, 37, Constants.BlueImage, Constants.BlueImage, Constants.BlueImage) { Parent = this.Parent }; BlueButton.Location = new Point(30, 498); BlueButton.Click += new EventHandler(this.Blue); this.Controls.Add(BlueButton); YellowButton = new AsistimeRoundButton(37, 37, Constants.YellowImage, Constants.YellowImage, Constants.YellowImage) { Parent = this.Parent }; YellowButton.Location = new Point(80, 498); YellowButton.Click += new EventHandler(this.Yellow); this.Controls.Add(YellowButton); RedButton = new AsistimeRoundButton(37, 37, Constants.RedImage, Constants.RedImage, Constants.RedImage) { Parent = this.Parent }; RedButton.Location = new Point(130, 498); RedButton.Click += new EventHandler(this.Red); this.Controls.Add(RedButton); GreenButton = new AsistimeRoundButton(37, 37, Constants.GreenImage, Constants.GreenImage, Constants.GreenImage) { Parent = this.Parent }; GreenButton.Location = new Point(30, 540); GreenButton.Click += new EventHandler(this.Green); this.Controls.Add(GreenButton); OrangeButton = new AsistimeRoundButton(37, 37, Constants.OrangeImage, Constants.OrangeImage, Constants.OrangeImage) { Parent = this.Parent }; OrangeButton.Location = new Point(80, 540); OrangeButton.Click += new EventHandler(this.Orange); this.Controls.Add(OrangeButton); VioletButton = new AsistimeRoundButton(37, 37, Constants.VioletImage, Constants.VioletImage, Constants.VioletImage) { Parent = this.Parent }; VioletButton.Location = new Point(130, 540); VioletButton.Click += new EventHandler(this.Violet); this.Controls.Add(VioletButton); BackButton = new AsistimeRoundButton(37, 37, Constants.BlackImage, Constants.BlackImage, Constants.BlackImage) { Parent = this.Parent }; BackButton.Location = new Point(80, 582); BackButton.Click += new EventHandler(this.Black); this.Controls.Add(BackButton); Label color = new Label() { Text = "Color", ForeColor = Color.White, Font = Constants.H1LabelFont, Height = 40 }; color.Location = new Point(10, 622); Center(color, this); this.Controls.Add(color); }
public AsistimeStepsBar() { BackColor = ColorTranslator.FromHtml(Constants.AppPrimaryColour); ForeColor = ColorTranslator.FromHtml(Constants.AppSecondaryColour); Height = Constants.AppBarHeight; Width = Constants.AppBarWidth; this.Controls.Add(this.GetNavBackButton(50, 15)); Label backLabel = new Label() { Text = "Atrás", ForeColor = Color.White, Font = Constants.H1LabelFont, Height = 40 }; Center_With(backLabel, NavBackButton); this.Controls.Add(backLabel); var firstElement = (this.Width / 2 - 42 - (330)); AsistimeRoundButton RectangleButton = new AsistimeRoundButton(84, 84, Constants.RectImage2, Constants.RectHoverImage2, Constants.RectClickImage2) { Parent = this.Parent }; Label rectLabel = new Label() { Text = "Cuadrado", ForeColor = Color.White, Font = Constants.H1LabelFont, Height = 40 }; RectangleButton.Location = new Point(firstElement, 28); Center_With(rectLabel, RectangleButton); RectangleButton.Click += new EventHandler(DrawRectangle); RectangleButton.BackColor = Color.Black; this.Controls.Add(RectangleButton); this.Controls.Add(rectLabel); AsistimeRoundButton DivButton = new AsistimeRoundButton(84, 84, Constants.DivImage2, Constants.DivHoverImage2, Constants.DivClickImage2) { Parent = this.Parent }; Label divLabel = new Label() { Text = "Zona", ForeColor = Color.White, 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 TextButton = new AsistimeRoundButton(84, 84, Constants.TextImage2, Constants.TextHoverImage2, Constants.TextClickImage2) { Parent = this.Parent }; Label textLabel = new Label() { Text = "Texto", ForeColor = Color.White, Font = Constants.H1LabelFont, Height = 40 }; TextButton.Location = new Point(RectangleButton.Location.X + 220, 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.CircleImage2, Constants.CircleHoverImage2, Constants.CircleClickImage2) { Parent = this.Parent }; Label circleLabel = new Label() { Text = "Círculo", ForeColor = Color.White, Font = Constants.H1LabelFont, Height = 40 }; CircleButton.Location = new Point(RectangleButton.Location.X + 330, RectangleButton.Location.Y); Center_With(circleLabel, CircleButton); CircleButton.Click += new EventHandler(DrawCircle); this.Controls.Add(CircleButton); this.Controls.Add(circleLabel); AsistimeRoundButton IconButton = new AsistimeRoundButton(84, 84, Constants.IconImage, Constants.IconHoverImage, Constants.IconClickImage) { Parent = this.Parent }; Label iconLabel = new Label() { Text = "Íconos", ForeColor = Color.White, Font = Constants.H1LabelFont, Height = 40 }; IconButton.Location = new Point(RectangleButton.Location.X + 440, RectangleButton.Location.Y); Center_With(iconLabel, IconButton); IconButton.Click += new EventHandler(ShowIconPanel); this.Controls.Add(IconButton); this.Controls.Add(iconLabel); AsistimeRoundButton AudioButton = new AsistimeRoundButton(84, 84, Constants.AudioImage, Constants.AudioHoverImage, Constants.AudioClickImage) { Parent = this.Parent }; Label audioLabel = new Label() { Text = "Audio", ForeColor = Color.White, Font = Constants.H1LabelFont, Height = 40 }; AudioButton.Location = new Point(RectangleButton.Location.X + 550, RectangleButton.Location.Y); Center_With(audioLabel, AudioButton); AudioButton.Click += new EventHandler(RecordAudio); this.Controls.Add(AudioButton); this.Controls.Add(audioLabel); AsistimeRoundButton EraseButton = new AsistimeRoundButton(84, 84, Constants.EraseImage, Constants.EraseHoverImage, Constants.EraseClickImage) { Parent = this.Parent }; Label eraseLabel = new Label() { Text = "Deshacer", ForeColor = Color.White, Font = Constants.H1LabelFont, Height = 40 }; EraseButton.Location = new Point(RectangleButton.Location.X + 660, RectangleButton.Location.Y); Center_With(eraseLabel, EraseButton); EraseButton.Click += new EventHandler(EraseForm); this.Controls.Add(EraseButton); this.Controls.Add(eraseLabel); this.Controls.Add(this.GetNavConfirmButton(this.ClientSize.Width - 150, 15)); Label profileLabel = new Label() { Text = "Confirmar", ForeColor = Color.White, Font = Constants.H1LabelFont, Height = 40 }; Center_With(profileLabel, ConfirmButton); this.Controls.Add(profileLabel); }