コード例 #1
0
        public void Show(Gtk.Widget parent, Gdk.EventButton evt)
        {
                        #if MAC
            if (Platform.IsMac)
            {
                ContextMenuExtensionsMac.ShowContextMenu(parent, evt, this);
                return;
            }
                        #endif

            ContextMenuExtensionsGtk.ShowContextMenu(parent, evt, this);
        }
コード例 #2
0
        public void Show(Gtk.Widget parent, int x, int y, Action closeHandler, bool selectFirstItem = false)
        {
                        #if MAC
            if (Platform.IsMac)
            {
                ContextMenuExtensionsMac.ShowContextMenu(parent, x, y, this, closeHandler, selectFirstItem);
                return;
            }
                        #endif

            ContextMenuExtensionsGtk.ShowContextMenu(parent, x, y, this, closeHandler, selectFirstItem);
        }
コード例 #3
0
ファイル: ContextMenu.cs プロジェクト: t9up/monodevelop
        public void Show(Gtk.Widget parent, int x, int y, Action closeHandler, bool selectFirstItem = false)
        {
                        #if MAC
            if (Platform.IsMac)
            {
                int tx, ty;

                // x, y are in gtk coordinates, so they need to be translated for Cocoa.
                parent.TranslateCoordinates(parent.Toplevel, x, y, out tx, out ty);
                ContextMenuExtensionsMac.ShowContextMenu(parent, tx, ty, this, closeHandler, selectFirstItem);
                return;
            }
                        #endif

            ContextMenuExtensionsGtk.ShowContextMenu(parent, x, y, this, closeHandler, selectFirstItem);
        }
コード例 #4
0
ファイル: ContextMenu.cs プロジェクト: noah1510/dotdevelop
 internal void Show(Xwt.Widget parent, int x, int y, Action closeHandler, bool selectFirstItem = false)
 {
     if (parent.Surface.NativeWidget is Gtk.Widget widget)
     {
         Show(widget, x, y, closeHandler, selectFirstItem);
         return;
     }
                 #if MAC
     if (parent.Surface.NativeWidget is AppKit.NSView view)
     {
         ContextMenuExtensionsMac.ShowContextMenu((AppKit.NSView)view, x, y, this, closeHandler, selectFirstItem);
         return;
     }
                 #endif
     throw new NotSupportedException();
 }