Beispiel #1
0
 internal void InitializeFilterButtons(Control container, string[] list)
 {
     try
     {
         container.Controls.Clear();
         foreach (string f in list)
         {
             MetroSetButton b = new MetroSetButton();
             b.Text              = f;
             b.Font              = new Font("Segoe UI", 8f);
             b.NormalColor       = Color.Black;
             b.NormalTextColor   = SystemColors.MenuHighlight;
             b.NormalBorderColor = Color.Black;
             b.HoverBorderColor  = Color.Blue;
             b.HoverColor        = Color.SteelBlue;
             b.HoverTextColor    = Color.AntiqueWhite;
             b.Size              = new Size(175, 30);
             b.Margin            = new Padding(3);
             b.Padding           = new Padding(1);
             container.Controls.Add(b);
             container.AutoSize = true;
             b.Tag = f;
         }
     }
     catch (Exception ex)
     {
         new Error(ex).ShowDialog();
     }
 }
Beispiel #2
0
 private void selectButton(MetroSetButton btn)
 {
     if (this.btnSelected != null)
     {
         this.btnSelected.Selected = false;
     }
     this.btnSelected          = btn;
     this.btnSelected.Selected = true;
 }
Beispiel #3
0
 /// <summary>
 /// Handles the OnClick event of the FilterControlButton control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
 internal void FilterControlButton_OnClick(object sender, EventArgs e)
 {
     try
     {
         MetroSetButton button = sender as MetroSetButton;
         string         name   = button?.Tag.ToString();
         Source         source = (Source)Enum.Parse(typeof(Source), name ?? throw new InvalidOperationException());
         BindingSource.DataSource = new DataBuilder(source, Provider.SQLite).GetDataTable();
     }
     catch (Exception ex)
     {
         new Error(ex).ShowDialog();
     }
 }
Beispiel #4
0
 internal void PopulateFilterPanel(FlowLayoutPanel container, string[] filter)
 {
     try
     {
         InitializeFilterButtons(container, filter);
         foreach (MetroSetComboBox c in container.Controls)
         {
             MetroSetButton msb = new MetroSetButton();
             InitializeFilterButtons(msb, filter);
         }
     }
     catch (Exception ex)
     {
         new Error(ex).ShowDialog();
     }
 }
Beispiel #5
0
 public MetroSetButtonActionList(IComponent component) : base(component)
 {
     metroSetButton = (MetroSetButton)component;
 }