Exemple #1
0
        // HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59

        /*
         * private void PopupContextMenu(IPrimaryToolDelegator mainTool, IDrawingEditor editor, ITool dt, MouseEvent ev)
         * {
         *  m_contextMenu = new Gtk.Menu();
         *  Gtk.MenuItem editLabel = new Gtk.MenuItem("Edit label");
         *
         *  editLabel.Activated += delegate(object sender, EventArgs e)
         *  {
         *      SimpleTextTool textTool = new SimpleTextTool(editor, this, dt, ev);
         *      mainTool.DelegateTool = textTool;
         *      textTool.StartEditing();
         *  };
         *
         *  m_contextMenu.Add(editLabel);
         *  m_contextMenu.ShowAll();
         *
         *  m_contextMenu.Popup();
         * }
         */

        private void PopupContextMenu(IPrimaryToolDelegator mainTool, IDrawingEditor editor, ITool dt, MouseEvent ev)
        {
            m_contextMenu = new Gtk.Menu();
            Gtk.MenuItem editLabel = new Gtk.MenuItem("Edit label");
            Gtk.MenuItem copy      = new Gtk.MenuItem("Copy");
            Gtk.MenuItem cut       = new Gtk.MenuItem("Cut");
            // Gtk.MenuItem paste = new Gtk.MenuItem("Paste");

            editLabel.Activated += delegate(object sender, EventArgs e)
            {
                SimpleTextTool textTool = new SimpleTextTool(editor, this, dt, ev);
                mainTool.DelegateTool = textTool;
                textTool.StartEditing();
            };

            copy.Activated += delegate(object sender, EventArgs e)
            {
                Clipboard.Copy(ExperimentNode.Owner as BaseExperiment);
            };

            cut.Activated += delegate(object sender, EventArgs e)
            {
                Clipboard.Cut(ExperimentNode.Owner as BaseExperiment);
            };

            /*
             * paste.Activated += delegate(object sender, EventArgs e)
             * {
             *  Clipboard.Paste(ExperimentNode.Owner as BaseExperiment);
             *  ExperimentCanvasPad ecp = ExperimentCanvasPadFactory.GetExperimentCanvasPad(m_applicationContext, this);
             *  ecp.DisplayAddedSubgraph(ExperimentNode.Owner as BaseExperiment);
             * };
             */

            m_contextMenu.Add(editLabel);
            m_contextMenu.Add(copy);
            m_contextMenu.Add(cut);
            // m_contextMenu.Add(paste);
            m_contextMenu.ShowAll();

            m_contextMenu.Popup();
        }
Exemple #2
0
 protected virtual void ClipboardCut()
 {
     Clipboard.Cut(Wrapped);
 }