Esempio n. 1
0
        public DockFrame()
        {
            Docking.Helper.GtkWorkarounds.FixContainerLeak(this);

            dockBarTop    = new DockBar(this, Gtk.PositionType.Top);
            dockBarBottom = new DockBar(this, Gtk.PositionType.Bottom);
            dockBarLeft   = new DockBar(this, Gtk.PositionType.Left);
            dockBarRight  = new DockBar(this, Gtk.PositionType.Right);

            container = new DockContainer(this);
            HBox hbox = new HBox();

            hbox.PackStart(dockBarLeft, false, false, 0);
            hbox.PackStart(container, true, true, 0);
            hbox.PackStart(dockBarRight, false, false, 0);
            mainBox = new VBox();
            mainBox.PackStart(dockBarTop, false, false, 0);
            mainBox.PackStart(hbox, true, true, 0);
            mainBox.PackStart(dockBarBottom, false, false, 0);
            Add(mainBox);
            mainBox.ShowAll();
            mainBox.NoShowAll = true;
            CompactGuiLevel   = 2;
            dockBarTop.UpdateVisibility();
            dockBarBottom.UpdateVisibility();
            dockBarLeft.UpdateVisibility();
            dockBarRight.UpdateVisibility();

            DefaultVisualStyle = new DockVisualStyle();
        }
Esempio n. 2
0
        public DockFrame()
        {
            HandleSize        = 4;
            HandlePadding     = 2;
            DefaultItemWidth  = 300;
            DefaultItemHeight = 250;
            AutoShowDelay     = 400;
            AutoHideDelay     = 500;
            TabType           = TabAlgorithm.Proven;

            dockBarTop    = new DockBar(this, Gtk.PositionType.Top);
            dockBarBottom = new DockBar(this, Gtk.PositionType.Bottom);
            dockBarLeft   = new DockBar(this, Gtk.PositionType.Left);
            dockBarRight  = new DockBar(this, Gtk.PositionType.Right);

            container = new DockContainer(this);
            HBox hbox = new HBox();

            hbox.PackStart(dockBarLeft, false, false, 0);
            hbox.PackStart(container, true, true, 0);
            hbox.PackStart(dockBarRight, false, false, 0);
            mainBox = new VBox();
            mainBox.PackStart(dockBarTop, false, false, 0);
            mainBox.PackStart(hbox, true, true, 0);
            mainBox.PackStart(dockBarBottom, false, false, 0);
            Add(mainBox);
            mainBox.ShowAll();
            mainBox.NoShowAll = true;
            dockBarTop.UpdateVisibility();
            dockBarBottom.UpdateVisibility();
            dockBarLeft.UpdateVisibility();
            dockBarRight.UpdateVisibility();

            DefaultVisualStyle = new DockVisualStyle();
        }
Esempio n. 3
0
        /// <summary>
        /// Gets the style for a dock object, which will inherit values from all region/style definitions
        /// </summary>
        internal DockVisualStyle GetRegionStyleForObject(DockObject obj)
        {
            DockVisualStyle mergedStyle = null;

            if (obj is DockGroupItem)
            {
                DockVisualStyle s;
                if (stylesById.TryGetValue(((DockGroupItem)obj).Id, out s))
                {
                    mergedStyle = DefaultVisualStyle.Clone();
                    mergedStyle.CopyValuesFrom(s);
                }
            }
            foreach (var e in regionStyles)
            {
                if (InRegion(e.Item1, obj))
                {
                    if (mergedStyle == null)
                    {
                        mergedStyle = DefaultVisualStyle.Clone();
                    }
                    mergedStyle.CopyValuesFrom(e.Item2);
                }
            }
            return(mergedStyle ?? DefaultVisualStyle);
        }
Esempio n. 4
0
 /// <summary>
 /// Sets the style for a region of the dock frame
 /// </summary>
 /// <param name='regionPosition'>
 /// A region is a collection with the format: "ItemId1/Position1;ItemId2/Position2..."
 /// ItemId is the id of a dock item. Position is one of the values of the DockPosition enumeration
 /// </param>
 /// <param name='style'>
 /// Style.
 /// </param>
 public void SetRegionStyle(string regionPosition, DockVisualStyle style)
 {
     // Remove any old region style and add it
     regionStyles.RemoveAll(s => s.Item1 == regionPosition);
     if (style != null)
     {
         regionStyles.Add(new Tuple <string, DockVisualStyle> (regionPosition, style));
     }
 }
Esempio n. 5
0
 public void SetDockItemStyle(string itemId, DockVisualStyle style)
 {
     if (style != null)
     {
         stylesById [itemId] = style;
     }
     else
     {
         stylesById.Remove(itemId);
     }
 }
 public void CopyValuesFrom(DockVisualStyle style)
 {
     if (style.PadBackgroundColor != null)
     {
         PadBackgroundColor = style.PadBackgroundColor;
     }
     if (style.PadTitleLabelColor != null)
     {
         PadTitleLabelColor = style.PadTitleLabelColor;
     }
     if (style.TabStyle != null)
     {
         TabStyle = style.TabStyle;
     }
     if (style.TreeBackgroundColor != null)
     {
         TreeBackgroundColor = style.TreeBackgroundColor;
     }
     if (style.ShowPadTitleIcon != null)
     {
         ShowPadTitleIcon = style.ShowPadTitleIcon;
     }
     if (style.UppercaseTitles != null)
     {
         UppercaseTitles = style.UppercaseTitles;
     }
     if (style.ExpandedTabs != null)
     {
         ExpandedTabs = style.ExpandedTabs;
     }
     if (style.InactivePadBackgroundColor != null)
     {
         InactivePadBackgroundColor = style.InactivePadBackgroundColor;
     }
     if (style.PadTitleHeight != null)
     {
         PadTitleHeight = style.PadTitleHeight;
     }
     if (style.SingleColumnMode != null)
     {
         SingleColumnMode = style.SingleColumnMode;
     }
     if (style.SingleRowMode != null)
     {
         SingleRowMode = style.SingleRowMode;
     }
 }
Esempio n. 7
0
        /// <summary>
        /// Gets the style assigned to a specific position of the layout
        /// </summary>
        /// <returns>
        /// The region style for position.
        /// </returns>
        /// <param name='parentGroup'>
        /// Group which contains the position
        /// </param>
        /// <param name='childIndex'>
        /// Index of the position inside the group
        /// </param>
        /// <param name='insertingPosition'>
        /// If true, the position will be inserted (meaning that the objects in childIndex will be shifted 1 position)
        /// </param>
        internal DockVisualStyle GetRegionStyleForPosition(DockGroup parentGroup, int childIndex, bool insertingPosition)
        {
            DockVisualStyle mergedStyle = null;

            foreach (var e in regionStyles)
            {
                if (InRegion(e.Item1, parentGroup, childIndex, insertingPosition))
                {
                    if (mergedStyle == null)
                    {
                        mergedStyle = DefaultVisualStyle.Clone();
                    }
                    mergedStyle.CopyValuesFrom(e.Item2);
                }
            }
            return(mergedStyle ?? DefaultVisualStyle);
        }
        internal DockItem(DockFrame frame, string id, Component component = null)
        {
            this.frame = frame;
            this.id    = id;
            Content    = component;
            if (Content != null)
            {
                Icon = Content.ComponentInfo.Icon;
            }
            UpdateTitle();
            currentVisualStyle = regionStyle = frame.GetRegionStyleForItem(this);

            titleTab             = new DockItemTitleTab(this);
            titleTab.VisualStyle = currentVisualStyle;
            titleTab.SetTitle(Widget, Icon, Title);
            titleTab.ShowAll();
        }
        public static DockVisualStyle CreateDefaultStyle()
        {
            DockVisualStyle s = new DockVisualStyle();

            s.PadBackgroundColor         = new Gdk.Color(0, 0, 0);
            s.PadTitleLabelColor         = new Gdk.Color(0, 0, 0);
            s.TabStyle                   = DockTabStyle.Normal;
            s.TreeBackgroundColor        = null;
            s.ShowPadTitleIcon           = true;
            s.UppercaseTitles            = false;
            s.ExpandedTabs               = false;
            s.InactivePadBackgroundColor = new Gdk.Color(0, 0, 0);
            s.PadTitleHeight             = -1;
            s.SingleRowMode              = false;
            s.SingleColumnMode           = false;
            return(s);
        }
Esempio n. 10
0
        void UpdateStyle()
        {
            var s = itemStyle != null ? itemStyle : regionStyle;

            if (s != currentVisualStyle)
            {
                currentVisualStyle = s;
                if (titleTab != null)
                {
                    titleTab.VisualStyle = s;
                }
                if (widget != null)
                {
                    widget.VisualStyle = s;
                }
                frame.UpdateStyle(this);
            }
        }
Esempio n. 11
0
 internal void SetStyle(DockVisualStyle style)
 {
     topFrame.BackgroundColor = style.PadBackgroundColor.Value;
 }
 public void CopyValuesFrom(DockVisualStyle style)
 {
     if (style.PadBackgroundColor != null)
         PadBackgroundColor = style.PadBackgroundColor;
     if (style.PadTitleLabelColor != null)
         PadTitleLabelColor = style.PadTitleLabelColor;
     if (style.TabStyle != null)
         TabStyle = style.TabStyle;
     if (style.TreeBackgroundColor != null)
         TreeBackgroundColor = style.TreeBackgroundColor;
     if (style.ShowPadTitleIcon != null)
         ShowPadTitleIcon = style.ShowPadTitleIcon;
     if (style.UppercaseTitles != null)
         UppercaseTitles = style.UppercaseTitles;
     if (style.ExpandedTabs != null)
         ExpandedTabs = style.ExpandedTabs;
     if (style.InactivePadBackgroundColor != null)
         InactivePadBackgroundColor = style.InactivePadBackgroundColor;
     if (style.PadTitleHeight != null)
         PadTitleHeight = style.PadTitleHeight;
     if (style.SingleColumnMode != null)
         SingleColumnMode = style.SingleColumnMode;
     if (style.SingleRowMode != null)
         SingleRowMode = style.SingleRowMode;
 }
Esempio n. 13
0
        public DockFrame()
        {
            Docking.Helper.GtkWorkarounds.FixContainerLeak (this);

            dockBarTop = new DockBar (this, Gtk.PositionType.Top);
            dockBarBottom = new DockBar (this, Gtk.PositionType.Bottom);
            dockBarLeft = new DockBar (this, Gtk.PositionType.Left);
            dockBarRight = new DockBar (this, Gtk.PositionType.Right);

            container = new DockContainer (this);
            HBox hbox = new HBox ();
            hbox.PackStart (dockBarLeft, false, false, 0);
            hbox.PackStart (container, true, true, 0);
            hbox.PackStart (dockBarRight, false, false, 0);
            mainBox = new VBox ();
            mainBox.PackStart (dockBarTop, false, false, 0);
            mainBox.PackStart (hbox, true, true, 0);
            mainBox.PackStart (dockBarBottom, false, false, 0);
            Add (mainBox);
            mainBox.ShowAll ();
            mainBox.NoShowAll = true;
            CompactGuiLevel = 2;
            dockBarTop.UpdateVisibility ();
            dockBarBottom.UpdateVisibility ();
            dockBarLeft.UpdateVisibility ();
            dockBarRight.UpdateVisibility ();

            DefaultVisualStyle = new DockVisualStyle ();
        }
Esempio n. 14
0
 /// <summary>
 /// Sets the style for a region of the dock frame
 /// </summary>
 /// <param name='regionPosition'>
 /// A region is a collection with the format: "ItemId1/Position1;ItemId2/Position2..."
 /// ItemId is the id of a dock item. Position is one of the values of the DockPosition enumeration
 /// </param>
 /// <param name='style'>
 /// Style.
 /// </param>
 public void SetRegionStyle(string regionPosition, DockVisualStyle style)
 {
     // Remove any old region style and add it
     regionStyles.RemoveAll (s => s.Item1 == regionPosition);
     if (style != null)
         regionStyles.Add (new Tuple<string,DockVisualStyle> (regionPosition, style));
 }
Esempio n. 15
0
 public void SetDockItemStyle(string itemId, DockVisualStyle style)
 {
     if (style != null)
         stylesById [itemId] = style;
     else
         stylesById.Remove (itemId);
 }
Esempio n. 16
0
 internal DockItem(DockFrame frame, string id)
 {
     this.frame = frame;
      this.id = id;
      currentVisualStyle = regionStyle = frame.GetRegionStyleForItem(this);
 }
Esempio n. 17
0
 void UpdateStyle()
 {
     var s = itemStyle != null ? itemStyle : regionStyle;
      if (s != currentVisualStyle)
      {
     currentVisualStyle = s;
     if (titleTab != null)
        titleTab.VisualStyle = s;
     if (widget != null)
        widget.VisualStyle = s;
     frame.UpdateStyle(this);
      }
 }
Esempio n. 18
0
 internal void SetRegionStyle(DockVisualStyle style)
 {
     regionStyle = style;
      UpdateStyle();
 }
Esempio n. 19
0
 internal void SetRegionStyle(DockVisualStyle style)
 {
     regionStyle = style;
     UpdateStyle();
 }
 internal void SetStyle(DockVisualStyle style)
 {
     topFrame.BackgroundColor = style.PadBackgroundColor.Value;
 }
Esempio n. 21
0
 internal DockItem(DockFrame frame, string id)
 {
     this.frame         = frame;
     this.id            = id;
     currentVisualStyle = regionStyle = frame.GetRegionStyleForItem(this);
 }
 public static DockVisualStyle CreateDefaultStyle()
 {
     DockVisualStyle s = new DockVisualStyle ();
     s.PadBackgroundColor = new Gdk.Color (0,0,0);
     s.PadTitleLabelColor = new Gdk.Color (0,0,0);
     s.TabStyle = DockTabStyle.Normal;
     s.TreeBackgroundColor = null;
     s.ShowPadTitleIcon = true;
     s.UppercaseTitles = false;
     s.ExpandedTabs = false;
     s.InactivePadBackgroundColor = new Gdk.Color (0,0,0);
     s.PadTitleHeight = -1;
     s.SingleRowMode = false;
     s.SingleColumnMode = false;
     return s;
 }