本文整理汇总了C#中MonoDevelop.Components.Docking.DockItem类的典型用法代码示例。如果您正苦于以下问题:C# DockItem类的具体用法?C# DockItem怎么用?C# DockItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DockItem类属于MonoDevelop.Components.Docking命名空间,在下文中一共展示了DockItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DockItemToolbar
internal DockItemToolbar (DockItem parentItem, PositionType position)
{
this.parentItem = parentItem;
frame = new CustomFrame ();
switch (position) {
case PositionType.Top:
frame.SetMargins (0, 0, 1, 1);
frame.SetPadding (0, 2, 2, 0);
break;
case PositionType.Bottom:
frame.SetMargins (0, 1, 1, 1);
frame.SetPadding (2, 2, 2, 0);
break;
case PositionType.Left:
frame.SetMargins (0, 1, 1, 0);
frame.SetPadding (0, 0, 2, 2);
break;
case PositionType.Right:
frame.SetMargins (0, 1, 0, 1);
frame.SetPadding (0, 0, 2, 2);
break;
}
this.position = position;
if (position == PositionType.Top || position == PositionType.Bottom)
box = new HBox (false, 3);
else
box = new VBox (false, 3);
box.Show ();
frame.Add (box);
frame.GradientBackround = true;
}
示例2: AutoHideBox
public AutoHideBox (DockFrame frame, DockItem item, Gtk.PositionType pos, int size)
{
this.position = pos;
this.frame = frame;
this.targetSize = size;
horiz = pos == PositionType.Left || pos == PositionType.Right;
startPos = pos == PositionType.Top || pos == PositionType.Left;
Events = Events | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask;
Box fr;
CustomFrame cframe = new CustomFrame ();
switch (pos) {
case PositionType.Left: cframe.SetMargins (1, 1, 0, 1); break;
case PositionType.Right: cframe.SetMargins (1, 1, 1, 0); break;
case PositionType.Top: cframe.SetMargins (0, 1, 1, 1); break;
case PositionType.Bottom: cframe.SetMargins (1, 0, 1, 1); break;
}
EventBox sepBox = new EventBox ();
cframe.Add (sepBox);
if (horiz) {
fr = new HBox ();
sepBox.Realized += delegate { sepBox.GdkWindow.Cursor = resizeCursorW; };
sepBox.WidthRequest = gripSize;
} else {
fr = new VBox ();
sepBox.Realized += delegate { sepBox.GdkWindow.Cursor = resizeCursorH; };
sepBox.HeightRequest = gripSize;
}
sepBox.Events = EventMask.AllEventsMask;
if (pos == PositionType.Left || pos == PositionType.Top)
fr.PackEnd (cframe, false, false, 0);
else
fr.PackStart (cframe, false, false, 0);
Add (fr);
ShowAll ();
Hide ();
scrollable = new ScrollableContainer ();
scrollable.ScrollMode = false;
scrollable.Show ();
if (item.Widget.Parent != null) {
((Gtk.Container)item.Widget.Parent).Remove (item.Widget);
}
item.Widget.Show ();
scrollable.Add (item.Widget);
fr.PackStart (scrollable, true, true, 0);
sepBox.ButtonPressEvent += OnSizeButtonPress;
sepBox.ButtonReleaseEvent += OnSizeButtonRelease;
sepBox.MotionNotifyEvent += OnSizeMotion;
sepBox.ExposeEvent += OnGripExpose;
sepBox.EnterNotifyEvent += delegate { insideGrip = true; sepBox.QueueDraw (); };
sepBox.LeaveNotifyEvent += delegate { insideGrip = false; sepBox.QueueDraw (); };
}
示例3: DockItemContainer
public DockItemContainer (DockFrame frame, DockItem item)
{
this.item = item;
mainBox = new VBox ();
Add (mainBox);
mainBox.ResizeMode = Gtk.ResizeMode.Queue;
mainBox.Spacing = 0;
ShowAll ();
mainBox.PackStart (item.GetToolbar (PositionType.Top).Container, false, false, 0);
HBox hbox = new HBox ();
hbox.Show ();
hbox.PackStart (item.GetToolbar (PositionType.Left).Container, false, false, 0);
contentBox = new HBox ();
contentBox.Show ();
hbox.PackStart (contentBox, true, true, 0);
hbox.PackStart (item.GetToolbar (PositionType.Right).Container, false, false, 0);
mainBox.PackStart (hbox, true, true, 0);
mainBox.PackStart (item.GetToolbar (PositionType.Bottom).Container, false, false, 0);
}
示例4: DockBarItem
public DockBarItem (DockBar bar, DockItem it, int size)
{
Events = Events | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask;
this.size = size;
this.bar = bar;
this.it = it;
VisibleWindow = false;
UpdateTab ();
}
示例5: Initialize
public void Initialize(DockFrame dockframe){
m_dockFrame = dockframe;
m_experimentPad = m_dockFrame.AddItem ("ExperimentPad");
m_experimentPad.Label = Catalog.GetString ("ExperimentPad");
m_experimentPad.Behavior = DockItemBehavior.Locked;
m_experimentPad.Expand = true;
m_experimentPad.DrawFrame = false;
m_initialized = true;
}
示例6: DockBarItem
public DockBarItem (DockBar bar, DockItem it, int size)
{
Events = Events | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask;
this.size = size;
this.bar = bar;
this.it = it;
VisibleWindow = false;
UpdateTab ();
lastFrameSize = bar.Frame.Allocation.Size;
bar.Frame.SizeAllocated += HandleBarFrameSizeAllocated;
}
示例7: DockItemTitleTab
public DockItemTitleTab (DockItem item, DockFrame frame)
{
this.item = item;
this.frame = frame;
this.VisibleWindow = false;
UpdateVisualStyle ();
NoShowAll = true;
Events |= Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.PointerMotionMask;
KeyPressEvent += HeaderKeyPress;
KeyReleaseEvent += HeaderKeyRelease;
this.SubscribeLeaveEvent (OnLeave);
}
示例8: AddObject
public DockGroupItem AddObject (DockItem obj, DockPosition pos, string relItemId)
{
int npos = -1;
if (relItemId != null) {
for (int n=0; n<dockObjects.Count; n++) {
DockGroupItem it = dockObjects [n] as DockGroupItem;
if (it != null && it.Id == relItemId)
npos = n;
}
}
if (npos == -1) {
if (pos == DockPosition.Left || pos == DockPosition.Top)
npos = 0;
else
npos = dockObjects.Count - 1;
}
DockGroupItem gitem = null;
if (pos == DockPosition.Left || pos == DockPosition.Right) {
if (type != DockGroupType.Horizontal)
gitem = Split (DockGroupType.Horizontal, pos == DockPosition.Left, obj, npos);
else
gitem = InsertObject (obj, npos, pos);
}
else if (pos == DockPosition.Top || pos == DockPosition.Bottom) {
if (type != DockGroupType.Vertical)
gitem = Split (DockGroupType.Vertical, pos == DockPosition.Top, obj, npos);
else
gitem = InsertObject (obj, npos, pos);
}
else if (pos == DockPosition.CenterBefore || pos == DockPosition.Center) {
if (type != DockGroupType.Tabbed)
gitem = Split (DockGroupType.Tabbed, pos == DockPosition.CenterBefore, obj, npos);
else {
if (pos == DockPosition.Center)
npos++;
gitem = new DockGroupItem (Frame, obj);
dockObjects.Insert (npos, gitem);
gitem.ParentGroup = this;
}
}
ResetVisibleGroups ();
return gitem;
}
示例9: BarDock
internal DockBarItem BarDock (Gtk.PositionType pos, DockItem item, int size)
{
return GetDockBar (pos).AddItem (item, size);
}
示例10: DockInPlaceholder
internal void DockInPlaceholder (DockItem item)
{
container.DockInPlaceholder (item);
}
示例11: 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;
}
示例12: SetDockLocation
internal void SetDockLocation (DockItem item, string placement)
{
bool vis = item.Visible;
DockItemStatus stat = item.Status;
item.ResetMode ();
container.Layout.RemoveItemRec (item);
AddItemAtLocation (container.Layout, item, placement, vis, stat);
}
示例13: GetStatus
internal DockItemStatus GetStatus (DockItem item)
{
DockGroupItem gitem = container.FindDockGroupItem (item.Id);
if (gitem == null)
return DockItemStatus.Dockable;
return gitem.Status;
}
示例14: GetVisible
internal bool GetVisible (DockItem item, string layoutName)
{
DockLayout dl;
if (!layouts.TryGetValue (layoutName, out dl))
return false;
DockGroupItem gitem = dl.FindDockGroupItem (item.Id);
if (gitem == null)
return false;
return gitem.VisibleFlag;
}
示例15: CreateComponents
void CreateComponents ()
{
fullViewVBox = new VBox (false, 0);
rootWidget = fullViewVBox;
InstallMenuBar ();
toolbarFrame = new CommandFrame (IdeApp.CommandService);
fullViewVBox.PackStart (toolbarFrame, true, true, 0);
foreach (DockToolbar t in toolbars)
toolbarFrame.AddBar (t);
// Create the docking widget and add it to the window.
dock = new DockFrame ();
dock.CompactGuiLevel = ((int)IdeApp.Preferences.WorkbenchCompactness) + 1;
IdeApp.Preferences.WorkbenchCompactnessChanged += delegate {
dock.CompactGuiLevel = ((int)IdeApp.Preferences.WorkbenchCompactness) + 1;
};
/* Side bar is experimental. Disabled for now
HBox hbox = new HBox ();
VBox sideBox = new VBox ();
sideBox.PackStart (new SideBar (workbench, Orientation.Vertical), false, false, 0);
hbox.PackStart (sideBox, false, false, 0);
hbox.ShowAll ();
sideBox.NoShowAll = true;
hbox.PackStart (dock, true, true, 0);
DockBar bar = dock.ExtractDockBar (PositionType.Left);
bar.AlwaysVisible = true;
sideBox.PackStart (bar, true, true, 0);
toolbarFrame.AddContent (hbox);
*/
toolbarFrame.AddContent (dock);
// Create the notebook for the various documents.
tabControl = new SdiDragNotebook (dock.ShadedContainer);
tabControl.Scrollable = true;
tabControl.SwitchPage += OnActiveWindowChanged;
tabControl.PageAdded += delegate { OnActiveWindowChanged (null, null); };
tabControl.PageRemoved += delegate { OnActiveWindowChanged (null, null); };
tabControl.ButtonPressEvent += delegate(object sender, ButtonPressEventArgs e) {
int tab = tabControl.FindTabAtPosition (e.Event.XRoot, e.Event.YRoot);
if (tab < 0)
return;
tabControl.CurrentPage = tab;
if (e.Event.Type == Gdk.EventType.TwoButtonPress)
ToggleFullViewMode ();
};
this.tabControl.PopupMenu += delegate {
ShowPopup ();
};
this.tabControl.ButtonReleaseEvent += delegate (object sender, Gtk.ButtonReleaseEventArgs e) {
int tab = tabControl.FindTabAtPosition (e.Event.XRoot, e.Event.YRoot);
if (tab < 0)
return;
if (e.Event.Button == 3)
ShowPopup ();
};
tabControl.TabsReordered += new TabsReorderedHandler (OnTabsReordered);
// The main document area
documentDockItem = dock.AddItem ("Documents");
documentDockItem.Behavior = DockItemBehavior.Locked;
documentDockItem.Expand = true;
documentDockItem.DrawFrame = false;
documentDockItem.Label = GettextCatalog.GetString ("Documents");
documentDockItem.Content = tabControl;
// Add some hiden items to be used as position reference
DockItem dit = dock.AddItem ("__left");
dit.DefaultLocation = "Documents/Left";
dit.Behavior = DockItemBehavior.Locked;
dit.DefaultVisible = false;
dit = dock.AddItem ("__right");
dit.DefaultLocation = "Documents/Right";
dit.Behavior = DockItemBehavior.Locked;
dit.DefaultVisible = false;
dit = dock.AddItem ("__top");
dit.DefaultLocation = "Documents/Top";
dit.Behavior = DockItemBehavior.Locked;
dit.DefaultVisible = false;
dit = dock.AddItem ("__bottom");
dit.DefaultLocation = "Documents/Bottom";
dit.Behavior = DockItemBehavior.Locked;
dit.DefaultVisible = false;
Add (fullViewVBox);
fullViewVBox.ShowAll ();
fullViewVBox.PackEnd (this.StatusBar, false, true, 0);
//.........这里部分代码省略.........