Ejemplo n.º 1
0
        public void MouseRightButton(TabKey key)
        {
            IPoderosaDocument         doc    = KeyToDocument(key);
            IPoderosaContextMenuPoint ctx_pt = (IPoderosaContextMenuPoint)doc.GetAdapter(typeof(IPoderosaContextMenuPoint));

            //メニューが取れない場合は無視
            if (ctx_pt == null || ctx_pt.ContextMenu == null || ctx_pt.ContextMenu.Length == 0)
            {
                return;
            }

            IPoderosaForm f = (IPoderosaForm)_tabBarTable.ParentForm;

            f.ShowContextMenu(ctx_pt.ContextMenu, doc, Control.MousePosition, ContextMenuFlags.None);
        }
Ejemplo n.º 2
0
        private void ShowMenu()
        {
            TerminalControl tc = _terminal.TerminalHost.TerminalControl;

            Debug.Assert(tc != null);
            TerminalDocument doc   = _terminal.GetDocument();
            SizeF            pitch = tc.GetRenderProfile().Pitch;
            Point            popup = new Point((int)(doc.CaretColumn * pitch.Width), (int)((doc.CurrentLineNumber - doc.TopLineNumber + 1) * pitch.Height));

            IPoderosaForm f = tc.FindForm() as IPoderosaForm;

            Debug.Assert(f != null);
            //EXTPにしてもいいんだけど
            f.ShowContextMenu(new IPoderosaMenuGroup[] { new PoderosaMenuGroupImpl(CreatePopupMenuItems()) },
                              (ICommandTarget)tc.GetAdapter(typeof(ICommandTarget)),
                              tc.PointToScreen(popup),
                              ContextMenuFlags.SelectFirstItem);
        }