Exemplo n.º 1
0
		void DrawSeparators (Gdk.Rectangle exposedArea, DockGroup currentHandleGrp, int currentHandleIndex, DrawSeparatorOperation oper, bool drawChildrenSep, List<Gdk.Rectangle> areasList)
		{
			if (type == DockGroupType.Tabbed || VisibleObjects.Count == 0)
				return;
			
			DockObject last = VisibleObjects [VisibleObjects.Count - 1];
			
			bool horiz = type == DockGroupType.Horizontal;
			int x = Allocation.X;
			int y = Allocation.Y;
			int hw = horiz ? Frame.HandleSize : Allocation.Width;
			int hh = horiz ? Allocation.Height : Frame.HandleSize;

			Gdk.GC hgc = null;

			if (areasList == null && oper == DrawSeparatorOperation.Draw) {
				hgc = new Gdk.GC (Frame.Container.GdkWindow);
				hgc.RgbFgColor = Styles.DockFrameBackground.ToGdkColor ();
			}

			for (int n=0; n<VisibleObjects.Count; n++) {
				DockObject ob = VisibleObjects [n];
				DockGroup grp = ob as DockGroup;
				if (grp != null && drawChildrenSep)
					grp.DrawSeparators (exposedArea, currentHandleGrp, currentHandleIndex, oper, areasList);
				if (ob != last) {
					if (horiz)
						x += ob.Allocation.Width + Frame.HandlePadding;
					else
						y += ob.Allocation.Height + Frame.HandlePadding;

					switch (oper) {
					case DrawSeparatorOperation.CollectAreas:
						if (Frame.ShadedSeparators)
							areasList.Add (new Gdk.Rectangle (x, y, hw, hh));
						break;
					case DrawSeparatorOperation.Invalidate:
						Frame.Container.QueueDrawArea (x, y, hw, hh);
						break;
					case DrawSeparatorOperation.Draw:
						Frame.Container.GdkWindow.DrawRectangle (hgc, true, x, y, hw, hh);
						break;
					case DrawSeparatorOperation.Allocate:
						Frame.Container.AllocateSplitter (this, n, new Gdk.Rectangle (x, y, hw, hh));
						break;
					}
					
					if (horiz)
						x += Frame.HandleSize + Frame.HandlePadding;
					else
						y += Frame.HandleSize + Frame.HandlePadding;
				}
			}
			if (hgc != null)
				hgc.Dispose ();
		}
Exemplo n.º 2
0
		public void DrawSeparators (Gdk.Rectangle exposedArea, DockGroup currentHandleGrp, int currentHandleIndex, DrawSeparatorOperation oper, List<Gdk.Rectangle> areasList)
		{
			DrawSeparators (exposedArea, currentHandleGrp, currentHandleIndex, oper, true, areasList);
		}