Exemplo n.º 1
0
        public override void MouseDown(MouseEvent ev)
        {
            IDrawingView view = ev.View;

            SetAnchorCoords(ev.X, ev.Y);
            View = view;

            Gdk.EventType type = ev.GdkEvent.Type;
            if (type == EventType.TwoButtonPress)
            {
                CreateUndoActivity();
                _showingWidget        = true;
                _textview.Buffer.Text = ((MultiLineTextFigure)Figure).Text;

                View.AddWidget(_textview, 0, 0);
                CalculateTextViewSize();

                _textview.Show();
                _textview.GrabFocus();

                //selects all
                _textview.Buffer.SelectRange(_textview.Buffer.StartIter, _textview.Buffer.EndIter);

                return;
            }
            DefaultTool.MouseDown(ev);
        }
Exemplo n.º 2
0
        public override void MouseDown(MouseEvent ev)
        {
            View = ev.View;

            Gdk.EventType type = ev.GdkEvent.Type;

            if (type == EventType.TwoButtonPress)
            {
                StartEditing();
                return;
            }
            DefaultTool.MouseDown(ev);
        }
Exemplo n.º 3
0
        public override void MouseDown(MouseEvent ev)
        {
            View = ev.View;

            Gdk.EventType type = ev.GdkEvent.Type;

            if (type == EventType.TwoButtonPress)
            {
                CreateUndoActivity();
                _showingWidget = true;
                _entry.Text    = (Figure as SimpleTextFigure).Text;

                View.AddWidget(_entry, 0, 0);
                CalculateSizeEntry();

                _entry.GrabFocus();
                _entry.Show();

                return;
            }
            DefaultTool.MouseDown(ev);
        }
Exemplo n.º 4
0
        public override void MouseDown(MouseEvent ev)
        {
            SetAnchorCoords(ev.X, ev.Y);
            IDrawingView view = ev.View;

            View = view;

            Gdk.EventType type = ev.GdkEvent.Type;
            if (type == EventType.TwoButtonPress)
            {
                PolyLineFigure connection = (PolyLineFigure)Figure;
                connection.SplitSegment(ev.X, ev.Y);
                view.ClearSelection();
                view.AddToSelection(Figure);
                _handle = view.FindHandle(ev.X, ev.Y) as PolyLineHandle;
                ((Gtk.Widget)view).GdkWindow.Cursor = _handle.CreateCursor();
                _handle.InvokeStart(ev.X, ev.Y, ev.View);
                CreateUndoActivity();
            }
            else
            {
                DefaultTool.MouseDown(ev);
            }
        }