public static DialogResult Show(string text, string title, RemindMeBoxReason buttons, bool showDontRemindOption = false) { newMessageBox = new RemindMeBox(text, title, buttons, showDontRemindOption); newMessageBox.ShowDialog(); BLIO.Log("Closing RemindMeBox with result " + result); return(result); }
public static DialogResult Show(string text, string title, RemindMeBoxReason buttons, bool showDontRemindOption = false, FormStartPosition position = FormStartPosition.CenterParent) { newMessageBox = new MaterialRemindMeBox(text, title, buttons, showDontRemindOption); newMessageBox.StartPosition = position; MaterialSkin.MaterialSkinManager.Instance.AddFormToManage(newMessageBox); newMessageBox.ShowDialog(); BLIO.Log("Closing RemindMeBox with result " + result); return(result); }
private RemindMeBox(string description, RemindMeBoxReason buttons, bool showDontRemindOption) { BLIO.Log("Constructing RemindMeBox(" + description + ""); //We will use the default "Attention" title text InitializeComponent(); showDontRemind = showDontRemindOption; if (buttons == RemindMeBoxReason.YesNo) { btnYes.Visible = true; btnNo.Visible = true; } else { btnOk.Visible = true; } if (showDontRemind) { pnlRemind.Visible = true; } this.description = description; this.Opacity = 0; tmrFadeIn.Start(); lblText.MaximumSize = new Size((pnlMainGradient.Width - lblText.Location.X) - 10, 0); lblTitle.MaximumSize = new Size((pnlMainGradient.Width - lblTitle.Location.X) - 10, 0); lblText.Text = description; //Resize the form so that the entire text shows while (pnlMainGradient.Height < (lblText.Location.Y + lblText.Height)) { this.Height += 35; } Form1 remindme = (Form1)Application.OpenForms["Form1"]; if (remindme != null) { //Place the message box in the middle of remindme this.StartPosition = FormStartPosition.Manual; this.Location = new Point(remindme.Location.X + ((remindme.Width / 2) - this.Width / 2), remindme.Location.Y + ((remindme.Height / 2) - (this.Height / 2))); } else { this.StartPosition = FormStartPosition.CenterScreen; } BLIO.Log("RemindMeBox constructed"); }
private MaterialRemindMeBox(string title, string description, RemindMeBoxReason buttons, bool showDontRemindOption) : this(description, buttons, showDontRemindOption) { this.Text = title; //Resize the form so that the entire text shows while (pnlMainGradient.Height < (lblText.Location.Y + lblText.Height)) { this.Height += 35; } }
private RemindMeBox(string title, string description, RemindMeBoxReason buttons, bool showDontRemindOption) : this(description, buttons, showDontRemindOption) { lblTitle.Text = title; //Reposition the text label so that the title label wont overlap while (lblTitle.Location.Y + lblTitle.Height >= lblText.Location.Y) { lblText.Location = new Point(lblText.Location.X, lblText.Location.Y + 20); } //Resize the form so that the entire text shows while (pnlMainGradient.Height < (lblText.Location.Y + lblText.Height)) { this.Height += 35; } }
private MaterialRemindMeBox(string description, RemindMeBoxReason buttons, bool showDontRemindOption) { BLIO.Log("Constructing RemindMeBox(" + description + ""); //We will use the default "Attention" title text InitializeComponent(); AddFont(Properties.Resources.Roboto_Medium); showDontRemind = showDontRemindOption; if (buttons == RemindMeBoxReason.YesNo) { btnYes.Visible = true; btnNo.Visible = true; } else { btnOk.Visible = true; } if (showDontRemind) { pnlRemind.Visible = true; } this.description = description; this.Opacity = 0; tmrFadeIn.Start(); lblText.MaximumSize = new Size((pnlMainGradient.Width - lblText.Location.X) - 10, 0); lblText.Text = description; MaterialForm1 remindme = (MaterialForm1)Application.OpenForms["MaterialForm1"]; if (remindme != null && remindme.Visible) { //Place the message box in the middle of remindme this.StartPosition = FormStartPosition.Manual; this.Location = new Point(remindme.Location.X + ((remindme.Width / 2) - this.Width / 2), remindme.Location.Y + ((remindme.Height / 2) - (this.Height / 2))); } else { this.StartPosition = FormStartPosition.CenterScreen; } lblText.LinkColor = MaterialSkin.MaterialSkinManager.Instance.ColorScheme.AccentColor; lblText.ActiveLinkColor = MaterialSkin.MaterialSkinManager.Instance.ColorScheme.LightPrimaryColor; string timers = "Click here to convert these Timers into Reminders and close RemindMe"; if (lblText.Text.EndsWith(timers)) { lblText.Links.Add(lblText.Text.IndexOf(timers), timers.Length); lblText.LinkClicked += (s, ee) => { ImportRemindersFromTimers(); }; } BLIO.Log("RemindMeBox constructed"); }