本文整理汇总了C#中MonoDevelop.Components.Docking.DockGroup类的典型用法代码示例。如果您正苦于以下问题:C# DockGroup类的具体用法?C# DockGroup怎么用?C# DockGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DockGroup类属于MonoDevelop.Components.Docking命名空间,在下文中一共展示了DockGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Copy
DockGroup Copy ()
{
DockGroup grp = new DockGroup (Frame, type);
grp.dockObjects = new List<MonoDevelop.Components.Docking.DockObject> (dockObjects);
foreach (DockObject obj in grp.dockObjects)
obj.ParentGroup = grp;
grp.CopySizeFrom (this);
return grp;
}
示例2: Draw
public void Draw (Gdk.Rectangle exposedArea, DockGroup currentHandleGrp, int currentHandleIndex)
{
if (type != DockGroupType.Tabbed) {
DrawSeparators (exposedArea, currentHandleGrp, currentHandleIndex, DrawSeparatorOperation.Draw, false, null);
foreach (DockObject it in VisibleObjects) {
DockGroup grp = it as DockGroup;
if (grp != null)
grp.Draw (exposedArea, currentHandleGrp, currentHandleIndex);
}
}
}
示例3: CountRequiredSplitters
int CountRequiredSplitters(DockGroup grp)
{
if (grp.Type == DockGroupType.Tabbed)
return 0;
else {
int num = grp.VisibleObjects.Count - 1;
if (num < 0)
return 0;
foreach (var c in grp.VisibleObjects.OfType<DockGroup> ())
num += CountRequiredSplitters (c);
return num;
}
}
示例4: Split
DockGroupItem Split (DockGroupType newType, bool addFirst, DockItem obj, int npos)
{
DockGroupItem item = new DockGroupItem (Frame, obj);
if (npos == -1 || type == DockGroupType.Tabbed) {
if (ParentGroup != null && ParentGroup.Type == newType) {
// No need to split. Just add the new item as a sibling of this one.
int i = ParentGroup.Objects.IndexOf (this);
if (addFirst)
ParentGroup.Objects.Insert (i, item);
else
ParentGroup.Objects.Insert (i+1, item);
item.ParentGroup = ParentGroup;
item.ResetDefaultSize ();
}
else {
DockGroup grp = Copy ();
dockObjects.Clear ();
if (addFirst) {
dockObjects.Add (item);
dockObjects.Add (grp);
} else {
dockObjects.Add (grp);
dockObjects.Add (item);
}
item.ParentGroup = this;
item.ResetDefaultSize ();
grp.ParentGroup = this;
grp.ResetDefaultSize ();
Type = newType;
}
}
else {
DockGroup grp = new DockGroup (Frame, newType);
DockObject replaced = dockObjects[npos];
if (addFirst) {
grp.AddObject (item);
grp.AddObject (replaced);
} else {
grp.AddObject (replaced);
grp.AddObject (item);
}
grp.CopySizeFrom (replaced);
dockObjects [npos] = grp;
grp.ParentGroup = this;
}
return item;
}
示例5: InRegion
bool InRegion (DockGroup grp, DockPosition pos, DockObject refObject, DockGroup objToFindParent, int objToFindIndex, bool insertingPosition)
{
if (grp == null)
return false;
if (grp.Type == DockGroupType.Tabbed) {
if (pos != DockPosition.Center && pos != DockPosition.CenterBefore)
return InRegion (grp.ParentGroup, pos, grp, objToFindParent, objToFindIndex, insertingPosition);
}
if (grp.Type == DockGroupType.Horizontal) {
if (pos != DockPosition.Left && pos != DockPosition.Right)
return InRegion (grp.ParentGroup, pos, grp, objToFindParent, objToFindIndex, insertingPosition);
}
if (grp.Type == DockGroupType.Vertical) {
if (pos != DockPosition.Top && pos != DockPosition.Bottom)
return InRegion (grp.ParentGroup, pos, grp, objToFindParent, objToFindIndex, insertingPosition);
}
bool foundAtLeftSide = true;
bool findingLeft = pos == DockPosition.Left || pos == DockPosition.Top || pos == DockPosition.CenterBefore;
if (objToFindParent == grp) {
// Check positions beyond the current range of items
if (objToFindIndex < 0 && findingLeft)
return true;
if (objToFindIndex >= grp.Objects.Count && !findingLeft)
return true;
}
for (int n=0; n<grp.Objects.Count; n++) {
var ob = grp.Objects[n];
bool foundRefObject = ob == refObject;
bool foundTargetObject = objToFindParent == grp && objToFindIndex == n;
if (foundRefObject) {
// Found the reference object, but if insertingPosition=true it is in the position that the new item will have,
// so this position still has to be considered to be at the left side
if (foundTargetObject && insertingPosition)
return foundAtLeftSide == findingLeft;
foundAtLeftSide = false;
}
else if (foundTargetObject)
return foundAtLeftSide == findingLeft;
else if (ob is DockGroup) {
DockGroup gob = (DockGroup)ob;
if (gob == objToFindParent || ObjectHasAncestor (objToFindParent, gob))
return foundAtLeftSide == findingLeft;
}
}
return InRegion (grp.ParentGroup, pos, grp, objToFindParent, objToFindIndex, insertingPosition);
}
示例6: AddDefaultItem
DockGroupItem AddDefaultItem (DockGroup grp, DockItem it)
{
return AddItemAtLocation (grp, it, it.DefaultLocation, it.DefaultVisible, it.DefaultStatus);
}
示例7: FindHandle
bool FindHandle (DockGroup grp, int x, int y, out DockGroup foundGrp, out int objectIndex)
{
if (grp.Type != DockGroupType.Tabbed && grp.Allocation.Contains (x, y)) {
for (int n=0; n<grp.VisibleObjects.Count; n++) {
DockObject obj = grp.VisibleObjects [n];
if (n < grp.Objects.Count - 1) {
if ((grp.Type == DockGroupType.Horizontal && x > obj.Allocation.Right && x < obj.Allocation.Right + frame.TotalHandleSize) ||
(grp.Type == DockGroupType.Vertical && y > obj.Allocation.Bottom && y < obj.Allocation.Bottom + frame.TotalHandleSize))
{
foundGrp = grp;
objectIndex = n;
return true;
}
}
if (obj is DockGroup) {
if (FindHandle ((DockGroup) obj, x, y, out foundGrp, out objectIndex))
return true;
}
}
}
foundGrp = null;
objectIndex = 0;
return false;
}
示例8: GetRegionStyleForPosition
/// <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;
}
示例9: OnMotionNotifyEvent
protected override bool OnMotionNotifyEvent (Gdk.EventMotion e)
{
if (dragging) {
NotifySeparatorsChanged ();
int newpos = (currentHandleGrp.Type == DockGroupType.Horizontal) ? (int)e.XRoot : (int)e.YRoot;
if (newpos != dragPos) {
int nsize = dragSize + (newpos - dragPos);
currentHandleGrp.ResizeItem (currentHandleIndex, nsize);
layout.DrawSeparators (Allocation, currentHandleGrp, currentHandleIndex, true, null);
}
}
else if (layout != null && placeholderWindow == null) {
int index;
DockGroup grp;
if (FindHandle (layout, (int)e.X, (int)e.Y, out grp, out index)) {
if (currentHandleGrp != grp || currentHandleIndex != index) {
if (grp.Type == DockGroupType.Horizontal)
this.GdkWindow.Cursor = hresizeCursor;
else
this.GdkWindow.Cursor = vresizeCursor;
currentHandleGrp = grp;
currentHandleIndex = index;
layout.DrawSeparators (Allocation, currentHandleGrp, currentHandleIndex, true, null);
}
}
else if (currentHandleGrp != null) {
ResetHandleHighlight ();
}
}
return base.OnMotionNotifyEvent (e);
}
示例10: GetTabbedGroups
void GetTabbedGroups (DockGroup grp, List<DockGroup> tabbedGroups)
{
if (grp.Type == DockGroupType.Tabbed) {
if (grp.VisibleObjects.Count > 1)
tabbedGroups.Add (grp);
else
grp.ResetNotebook ();
}
else {
// Make sure it doesn't have a notebook bound to it
grp.ResetNotebook ();
foreach (DockObject ob in grp.Objects) {
if (ob is DockGroup)
GetTabbedGroups ((DockGroup) ob, tabbedGroups);
}
}
}
示例11: EstimateBarDocPosition
bool EstimateBarDocPosition (DockGroup grp, DockObject ignoreChild, out PositionType pos, out int size)
{
foreach (DockObject ob in grp.Objects) {
if (ob == ignoreChild)
continue;
if (ob is DockGroup) {
if (EstimateBarDocPosition ((DockGroup)ob, null, out pos, out size))
return true;
} else if (ob is DockGroupItem) {
DockGroupItem it = (DockGroupItem) ob;
if (it.status == DockItemStatus.AutoHide) {
pos = it.barDocPosition;
size = it.autoHideSize;
return true;
}
if (!it.Allocation.IsEmpty) {
pos = it.CalcBarDocPosition ();
size = it.GetAutoHideSize (pos);
return true;
}
}
}
pos = PositionType.Bottom;
size = 0;
return false;
}
示例12: Init
public void Init(DockGroup grp, int index)
{
dockGroup = grp;
dockIndex = index;
}
示例13: DrawSeparators
public void DrawSeparators (Gdk.Rectangle exposedArea, DockGroup currentHandleGrp, int currentHandleIndex, DrawSeparatorOperation oper, List<Gdk.Rectangle> areasList)
{
DrawSeparators (exposedArea, currentHandleGrp, currentHandleIndex, oper, true, areasList);
}
示例14: DrawSeparators
void DrawSeparators(Gdk.Rectangle exposedArea, DockGroup currentHandleGrp, int currentHandleIndex, bool invalidateOnly, 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;
Gtk.Orientation or = horiz ? Gtk.Orientation.Vertical : Gtk.Orientation.Horizontal;
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, invalidateOnly, areasList);
if (ob != last) {
if (horiz)
x += ob.Allocation.Width + Frame.HandlePadding;
else
y += ob.Allocation.Height + Frame.HandlePadding;
if (areasList != null) {
if (Frame.ShadedSeparators)
areasList.Add (new Gdk.Rectangle (x, y, hw, hh));
} else if (invalidateOnly) {
Frame.Container.QueueDrawArea (x, y, hw, hh);
}
else {
if (Frame.ShadedSeparators) {
Frame.ShadedContainer.DrawBackground (Frame.Container, new Gdk.Rectangle (x, y, hw, hh));
} else {
StateType state = (currentHandleGrp == this && currentHandleIndex == n) ? StateType.Prelight : StateType.Normal;
if (!DockFrame.IsWindows)
Gtk.Style.PaintHandle (Frame.Style, Frame.Container.GdkWindow, state, ShadowType.None, exposedArea, Frame, "paned", x, y, hw, hh, or);
}
}
if (horiz)
x += Frame.HandleSize + Frame.HandlePadding;
else
y += Frame.HandleSize + Frame.HandlePadding;
}
}
}
示例15: ObjectHasAncestor
bool ObjectHasAncestor (DockObject obj, DockGroup ancestorToFind)
{
return obj != null && (obj.ParentGroup == ancestorToFind || ObjectHasAncestor (obj.ParentGroup, ancestorToFind));
}