public void ShowSubmenu(IDesignArea area, Gtk.Widget refWidget) { HideSubmenu(); Gdk.Rectangle rect = area.GetCoordinates(refWidget); ActionMenu menu = new ActionMenu(wrapper, parentMenu, node); menu.ShowAll(); area.AddWidget(menu, rect.Right, rect.Top); menu.TrackWidgetPosition(refWidget, parentMenu.IsTopMenu); parentMenu.OpenSubmenu = menu; }
public void TrackWidgetPosition(Gtk.Widget refWidget, bool topMenu) { IDesignArea area = wrapper.GetDesignArea(); Gdk.Rectangle rect = area.GetCoordinates(refWidget); if (topMenu) { area.MoveWidget(this, rect.X, rect.Bottom); } else { area.MoveWidget(this, rect.Right, rect.Top); } GLib.Timeout.Add(50, new GLib.TimeoutHandler(RepositionSubmenu)); }
public void ShowSubmenu (IDesignArea area, Gtk.Widget refWidget) { HideSubmenu (); Gdk.Rectangle rect = area.GetCoordinates (refWidget); ActionMenu menu = new ActionMenu (wrapper, parentMenu, node); menu.ShowAll (); area.AddWidget (menu, rect.Right, rect.Top); menu.TrackWidgetPosition (refWidget, parentMenu.IsTopMenu); parentMenu.OpenSubmenu = menu; }