本文整理汇总了C#中MonoDevelop.Components.Docking.DockGroup类的典型用法代码示例。如果您正苦于以下问题:C# DockGroup类的具体用法?C# DockGroup怎么用?C# DockGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DockGroup类属于MonoDevelop.Components.Docking命名空间,在下文中一共展示了DockGroup类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:10,代码来源:DockGroup.cs
示例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);
}
}
}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:11,代码来源:DockGroup.cs
示例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;
}
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:13,代码来源:DockContainer.cs
示例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;
}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:47,代码来源:DockGroup.cs
示例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);
}
开发者ID:kdubau,项目名称:monodevelop,代码行数:52,代码来源:DockFrame.cs
示例6: AddDefaultItem
DockGroupItem AddDefaultItem (DockGroup grp, DockItem it)
{
return AddItemAtLocation (grp, it, it.DefaultLocation, it.DefaultVisible, it.DefaultStatus);
}
开发者ID:kdubau,项目名称:monodevelop,代码行数:4,代码来源:DockFrame.cs
示例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;
}
开发者ID:nocache,项目名称:monodevelop,代码行数:25,代码来源:DockContainer.cs
示例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;
}
开发者ID:kdubau,项目名称:monodevelop,代码行数:27,代码来源:DockFrame.cs
示例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);
}
开发者ID:nocache,项目名称:monodevelop,代码行数:31,代码来源:DockContainer.cs
示例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);
}
}
}
开发者ID:nocache,项目名称:monodevelop,代码行数:17,代码来源:DockContainer.cs
示例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;
}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:26,代码来源:DockGroupItem.cs
示例12: Init
public void Init(DockGroup grp, int index)
{
dockGroup = grp;
dockIndex = index;
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:5,代码来源:DockContainer.cs
示例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);
}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:4,代码来源:DockGroup.cs
示例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;
}
}
}
开发者ID:RudoCris,项目名称:Pinta,代码行数:48,代码来源:DockGroup.cs
示例15: ObjectHasAncestor
bool ObjectHasAncestor (DockObject obj, DockGroup ancestorToFind)
{
return obj != null && (obj.ParentGroup == ancestorToFind || ObjectHasAncestor (obj.ParentGroup, ancestorToFind));
}
开发者ID:kdubau,项目名称:monodevelop,代码行数:4,代码来源:DockFrame.cs
示例16: Read
internal override void Read (XmlReader reader)
{
base.Read (reader);
type = (DockGroupType) Enum.Parse (typeof(DockGroupType), reader.GetAttribute ("type"));
if (type == DockGroupType.Tabbed) {
string s = reader.GetAttribute ("currentTabPage");
if (s != null)
currentTabPage = int.Parse (s);
}
reader.MoveToElement ();
if (reader.IsEmptyElement) {
reader.Skip ();
return;
}
reader.ReadStartElement ();
reader.MoveToContent ();
while (reader.NodeType != XmlNodeType.EndElement) {
if (reader.NodeType == XmlNodeType.Element) {
if (reader.LocalName == "item") {
string id = reader.GetAttribute ("id");
DockItem it = Frame.GetItem (id);
if (it == null) {
it = Frame.AddItem (id);
it.IsPositionMarker = true;
}
DockGroupItem gitem = new DockGroupItem (Frame, it);
gitem.Read (reader);
AddObject (gitem);
reader.MoveToElement ();
reader.Skip ();
}
else if (reader.LocalName == "group") {
DockGroup grp = new DockGroup (Frame);
grp.Read (reader);
AddObject (grp);
}
}
else
reader.Skip ();
reader.MoveToContent ();
}
reader.ReadEndElement ();
}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:46,代码来源:DockGroup.cs
示例17: AddItemAtLocation
DockGroupItem AddItemAtLocation (DockGroup grp, DockItem it, string location, bool visible, DockItemStatus status)
{
string[] positions = location.Split (';');
foreach (string pos in positions) {
int i = pos.IndexOf ('/');
if (i == -1) continue;
string id = pos.Substring (0,i).Trim ();
DockGroup g = grp.FindGroupContaining (id);
if (g != null) {
DockPosition dpos;
try {
dpos = (DockPosition) Enum.Parse (typeof(DockPosition), pos.Substring(i+1).Trim(), true);
}
catch {
continue;
}
DockGroupItem dgt = g.AddObject (it, dpos, id);
dgt.SetVisible (visible);
dgt.Status = status;
return dgt;
}
}
return null;
}
开发者ID:kdubau,项目名称:monodevelop,代码行数:24,代码来源:DockFrame.cs
示例18: AllocateSplitter
internal void AllocateSplitter(DockGroup grp, int index, Gdk.Rectangle a)
{
var s = splitters[usedSplitters++];
if (a.Height > a.Width) {
a.Width = 5;
a.X -= 2;
}
else {
a.Height = 5;
a.Y -= 2;
}
s.SizeAllocate (a);
s.Init (grp, index);
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:14,代码来源:DockContainer.cs
示例19: ResetHandleHighlight
void ResetHandleHighlight ()
{
this.GdkWindow.Cursor = null;
currentHandleGrp = null;
currentHandleIndex = -1;
if (layout != null)
layout.DrawSeparators (Allocation, null, -1, true, null);
}
开发者ID:nocache,项目名称:monodevelop,代码行数:8,代码来源:DockContainer.cs
示例20: CopyFrom
public virtual void CopyFrom (DockObject ob)
{
parentGroup = null;
frame = ob.frame;
rect = ob.rect;
size = ob.size;
allocSize = ob.allocSize;
defaultHorSize = ob.defaultHorSize;
defaultVerSize = ob.defaultVerSize;
prefSize = ob.prefSize;
}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:11,代码来源:DockObject.cs
注:本文中的MonoDevelop.Components.Docking.DockGroup类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论