Ejemplo n.º 1
0
 void filterTextChanged(object sender, EventArgs e)
 {
     foreach (Category cat in toolboxWidget.Categories)
     {
         bool hasVisibleChild = false;
         foreach (Item child in cat.Items)
         {
             child.IsVisible  = ((ItemToolboxNode)child.Tag).Filter(filterEntry.Entry.Text);
             hasVisibleChild |= child.IsVisible;
         }
         cat.IsVisible = hasVisibleChild;
     }
     toolboxWidget.QueueDraw();
     toolboxWidget.QueueResize();
 }
Ejemplo n.º 2
0
 void refilter()
 {
     foreach (ToolboxWidgetCategory cat in toolboxWidget.Categories)
     {
         bool hasVisibleChild = false;
         foreach (ToolboxWidgetItem child in cat.Items)
         {
             child.IsVisible  = ((ItemToolboxNode)child.Tag).Filter(filterEntry.Entry.Text);
             hasVisibleChild |= child.IsVisible;
         }
         cat.IsVisible = hasVisibleChild;
     }
     toolboxWidget.QueueDraw();
     toolboxWidget.QueueResize();
 }
Ejemplo n.º 3
0
        public void Refresh()
        {
            // GUI assert here is to catch Bug 434065 - Exception while going to the editor
            DispatchService.AssertGuiThread();

            if (toolboxService.Initializing)
            {
                toolboxWidget.CustomMessage = GettextCatalog.GetString("Initializing...");
                return;
            }

            toolboxWidget.CustomMessage = null;

            categories.Clear();
            AddItems(toolboxService.GetCurrentToolboxItems());

            Drag.SourceUnset(toolboxWidget);
            toolboxWidget.ClearCategories();
            foreach (Category category in categories.Values)
            {
                category.IsExpanded = true;
                toolboxWidget.AddCategory(category);
            }
            toolboxWidget.QueueResize();
            Gtk.TargetEntry[] targetTable = toolboxService.GetCurrentDragTargetTable();
            if (targetTable != null)
            {
                Drag.SourceSet(toolboxWidget, Gdk.ModifierType.Button1Mask, targetTable, Gdk.DragAction.Copy | Gdk.DragAction.Move);
            }
            compactModeToggleButton.Visible = toolboxWidget.CanIconizeToolboxCategories;
        }