void OnTabPress(object s, Gtk.ButtonPressEventArgs args) { CurrentTab = Array.IndexOf(box.Children, s); DockItemTitleTab t = (DockItemTitleTab)s; DockItem.SetFocus(t.Page); QueueDraw(); args.RetVal = true; }
public void Present(bool giveFocus) { AutoShow(); if (giveFocus) { GLib.Timeout.Add(200, delegate { // Using a small delay because AutoShow uses an animation and setting focus may // not work until the item is visible if (autoShowFrame != null && autoShowFrame.ContainerWindow != null && autoShowFrame.ContainerWindow != (Gtk.Window)Toplevel) { autoShowFrame.ContainerWindow.Present(); } it.SetFocus(); ScheduleAutoHide(false); return(false); }); } }
bool LoadLayout(string layoutName) { DockLayout dl; if (!layouts.TryGetValue(layoutName, out dl)) { return(false); } var focus = GetActiveWidget(); container.LoadLayout(dl); // Keep the currently focused widget when switching layouts if (focus != null && focus.IsRealized && focus.Visible) { DockItem.SetFocus(focus); } return(true); }
internal void Present (DockItem it, bool giveFocus) { if (type == DockGroupType.Tabbed) { for (int n=0; n<VisibleObjects.Count; n++) { DockGroupItem dit = VisibleObjects[n] as DockGroupItem; if (dit.Item == it) { currentTabPage = n; if (boundTabStrip != null) boundTabStrip.CurrentPage = it.Widget; break; } } } if (giveFocus && it.Visible) it.SetFocus (); }