private void tagButton_Click(object sender, EventArgs e) { var location = PointToScreen(tagButton.Location); using (var dialog = new UI.TagPickerDialog( location.X + tagButton.Bounds.Location.X - tagButton.Width, location.Y + tagButton.Bounds.Location.Y)) { dialog.Select(TagSymbol); if (dialog.ShowDialog(this) == DialogResult.OK) { var glyph = dialog.GetGlyph(); if (glyph != null) { tagButton.Text = null; tagButton.Image = glyph; } else { tagButton.Text = "?"; } TagSymbol = dialog.Symbol; } } }
private void SelectTag(object sender, System.EventArgs e) { var location = PointToScreen(tagButton.Location); using (var dialog = new UI.TagPickerDialog(0, 0)) { // TagPickerDialog customizes Left and Top in its constructor because most // consumers place the tagButton in a groupBox and that offsets its true // position, whereas here we need the actual location of tagButton dialog.Left = location.X + (tagButton.Width / 2); dialog.Top = location.Y + tagButton.Height - 3; if (symbol is string sym && sym != "0") { dialog.Select(int.Parse(sym)); } if (dialog.ShowDialog(this) == DialogResult.OK) { var glyph = dialog.GetGlyph(); if (glyph != null) { tagButton.Text = null; tagButton.Image = glyph; } else { tagButton.Text = "?"; } symbol = dialog.Symbol.ToString(); } } }
public RemindDialog(Reminder reminder, bool canSnooze) : this() { this.reminder = reminder; subjectBox.Text = reminder.Subject; startDateBox.Value = reminder.Start.ToLocalTime(); if (reminder.Status == ReminderStatus.InProgress || reminder.Status == ReminderStatus.Completed) { startedBox.Text = reminder.Started.ToFriendlyString(); } dueDateBox.Value = reminder.Due.ToLocalTime(); if (reminder.Status == ReminderStatus.Completed) { completedBox.Text = reminder.Completed.ToFriendlyString(); } statusBox.SelectedIndex = (int)reminder.Status; priorityBox.SelectedIndex = (int)reminder.Priority; percentBox.Value = reminder.Percent; silentBox.Checked = reminder.Silent; if (!string.IsNullOrEmpty(reminder.Symbol)) { symbol = reminder.Symbol; var symval = int.Parse(reminder.Symbol); using (var dialog = new UI.TagPickerDialog(0, 0)) { var glyph = dialog.GetGlyph(symval); if (glyph != null) { tagButton.Text = null; tagButton.Image = glyph; } } } snoozeTimeLabel.Text = string.Empty; var snoozed = reminder.Snooze != SnoozeRange.None && reminder.SnoozeTime.CompareTo(DateTime.UtcNow) > 0; if (snoozed) { snoozeBox.SelectedIndex = (int)reminder.Snooze; } snoozeBox.Enabled = snoozeButton.Enabled = canSnooze || snoozed; }
private void RestoreSettings() { var provider = new SettingsProvider(); var settings = provider.GetCollection("outline"); if (settings != null) { numberingBox.Checked = settings.Get <bool>("addNumbering"); if (numberingBox.Checked) { alphaRadio.Checked = settings.Get <bool>("alphaNumbering"); numRadio.Checked = settings.Get <bool>("numericNumbering"); } cleanBox.Checked = settings.Get <bool>("cleanupNumbering"); indentBox.Checked = settings.Get <bool>("indent"); indentTagBox.Checked = settings.Get <bool>("indentTagged"); if (indentTagBox.Checked) { removeTagsBox.Checked = settings.Get <bool>("removeTags"); TagSymbol = settings.Get <int>("tagSymbol"); if (TagSymbol > 0) { using (var dialog = new UI.TagPickerDialog(0, 0)) { var glyph = dialog.GetGlyph(TagSymbol); if (glyph != null) { tagButton.Text = null; tagButton.Image = glyph; } } } } } }