Exemplo n.º 1
0
 public string GetLabelForFilterID(int id)
 {
     SearchEntry.FilterMenuItem filterMenuItem = this.FindFilterMenuItem(id);
     if (filterMenuItem == null)
     {
         return((string)null);
     }
     return(filterMenuItem.Label);
 }
Exemplo n.º 2
0
 public void ActivateFilter(int id)
 {
     SearchEntry.FilterMenuItem filterMenuItem = this.FindFilterMenuItem(id);
     if (filterMenuItem == null)
     {
         return;
     }
     filterMenuItem.Toggle();
 }
Exemplo n.º 3
0
 public void RemoveFilterOption(int id)
 {
     SearchEntry.FilterMenuItem filterMenuItem = this.FindFilterMenuItem(id);
     if (filterMenuItem == null)
     {
         return;
     }
     this.menu.Remove((Widget)filterMenuItem);
 }
Exemplo n.º 4
0
 public CheckMenuItem AddFilterOption(int id, string label)
 {
     if (id < 0)
     {
         throw new ArgumentException("id", "must be >= 0");
     }
     SearchEntry.FilterMenuItem filterMenuItem = new SearchEntry.FilterMenuItem(id, label);
     filterMenuItem.Toggled += new EventHandler(this.OnMenuItemToggled);
     this.menu.Append((Widget)filterMenuItem);
     if (this.ActiveFilterID < 0)
     {
         filterMenuItem.Toggle();
     }
     this.filter_button.Visible = true;
     return((CheckMenuItem)filterMenuItem);
 }
Exemplo n.º 5
0
 private void OnMenuItemToggled(object o, EventArgs args)
 {
     if (this.IsCheckMenu || this.toggling || !(o is SearchEntry.FilterMenuItem))
     {
         return;
     }
     this.toggling = true;
     SearchEntry.FilterMenuItem filterMenuItem1 = (SearchEntry.FilterMenuItem)o;
     foreach (MenuItem menuItem in (Gtk.Container) this.menu)
     {
         if (menuItem is SearchEntry.FilterMenuItem)
         {
             SearchEntry.FilterMenuItem filterMenuItem2 = (SearchEntry.FilterMenuItem)menuItem;
             if (filterMenuItem2 != filterMenuItem1)
             {
                 filterMenuItem2.Active = false;
             }
         }
     }
     filterMenuItem1.Active = true;
     this.ActiveFilterID    = filterMenuItem1.ID;
     this.toggling          = false;
 }