public BlameWidget(VersionControlDocumentInfo info)
        {
            GtkWorkarounds.FixContainerLeak(this);

            this.info = info;
            var sourceEditor = info.Document.GetContent <MonoDevelop.SourceEditor.SourceEditorView> ();

            vAdjustment = new Adjustment(
                sourceEditor.TextEditor.VAdjustment.Value,
                sourceEditor.TextEditor.VAdjustment.Lower,
                sourceEditor.TextEditor.VAdjustment.Upper,
                sourceEditor.TextEditor.VAdjustment.StepIncrement,
                sourceEditor.TextEditor.VAdjustment.PageIncrement,
                sourceEditor.TextEditor.VAdjustment.PageSize);
            vAdjustment.Changed += HandleAdjustmentChanged;

            vScrollBar = new VScrollbar(vAdjustment);
            AddChild(vScrollBar);

            hAdjustment = new Adjustment(
                sourceEditor.TextEditor.HAdjustment.Value,
                sourceEditor.TextEditor.HAdjustment.Lower,
                sourceEditor.TextEditor.HAdjustment.Upper,
                sourceEditor.TextEditor.HAdjustment.StepIncrement,
                sourceEditor.TextEditor.HAdjustment.PageIncrement,
                sourceEditor.TextEditor.HAdjustment.PageSize);
            hAdjustment.Changed += HandleAdjustmentChanged;

            hScrollBar = new HScrollbar(hAdjustment);
            AddChild(hScrollBar);

            var doc = new TextDocument(sourceEditor.TextEditor.Document.Text)
            {
                ReadOnly = true,
                MimeType = sourceEditor.TextEditor.Document.MimeType,
            };

            editor = new MonoTextEditor(doc, sourceEditor.TextEditor.Options);
            AddChild(editor);
            editor.SetScrollAdjustments(hAdjustment, vAdjustment);

            overview = new BlameRenderer(this);
            AddChild(overview);

            this.DoubleBuffered          = true;
            editor.Painted              += HandleEditorExposeEvent;
            editor.EditorOptionsChanged += delegate {
                overview.OptionsChanged();
            };
            editor.Caret.PositionChanged += ComparisonWidget.CaretPositionChanged;
            editor.FocusInEvent          += ComparisonWidget.EditorFocusIn;
            editor.Document.Folded       += delegate {
                QueueDraw();
            };
            editor.Document.FoldTreeUpdated += delegate {
                QueueDraw();
            };
            editor.DoPopupMenu = ShowPopup;
            Show();
        }
Exemplo n.º 2
0
        public DockFrame()
        {
            GtkWorkarounds.FixContainerLeak(this);

            dockBarTop    = new DockBar(this, Gtk.PositionType.Top);
            dockBarBottom = new DockBar(this, Gtk.PositionType.Bottom);
            dockBarLeft   = new DockBar(this, Gtk.PositionType.Left);
            dockBarRight  = new DockBar(this, Gtk.PositionType.Right);

            container = new DockContainer(this);
            HBox hbox = new HBox();

            hbox.PackStart(dockBarLeft, false, false, 0);
            hbox.PackStart(container, true, true, 0);
            hbox.PackStart(dockBarRight, false, false, 0);
            mainBox = new VBox();
            mainBox.PackStart(dockBarTop, false, false, 0);
            mainBox.PackStart(hbox, true, true, 0);
            mainBox.PackStart(dockBarBottom, false, false, 0);
            Add(mainBox);
            mainBox.ShowAll();
            mainBox.NoShowAll = true;
            CompactGuiLevel   = 2;
            UpdateDockbarsVisibility();

            DefaultVisualStyle = new DockVisualStyle();
        }
Exemplo n.º 3
0
        public DockContainer(DockFrame frame)
        {
            GtkWorkarounds.FixContainerLeak(this);

            this.Events = EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.PointerMotionMask | EventMask.LeaveNotifyMask;
            this.frame  = frame;
        }
Exemplo n.º 4
0
        public TabStrip(DockNotebook notebook)
        {
            TabWidth    = 125;
            TargetWidth = 125;
            tracker     = new MouseTracker(this);
            GtkWorkarounds.FixContainerLeak(this);

            this.notebook = notebook;
            WidgetFlags  |= Gtk.WidgetFlags.AppPaintable;
            Events       |= Gdk.EventMask.PointerMotionMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.ButtonPressMask;

            var arr = new Gtk.Image(Gdk.Pixbuf.LoadFromResource("tabbar-prev.png"));

            arr.HeightRequest         = arr.WidthRequest = 10;
            PreviousButton            = new Button(arr);
            PreviousButton.Relief     = ReliefStyle.None;
            PreviousButton.CanDefault = PreviousButton.CanFocus = false;

            arr = new Gtk.Image(Gdk.Pixbuf.LoadFromResource("tabbar-next.png"));
            arr.HeightRequest     = arr.WidthRequest = 10;
            NextButton            = new Button(arr);
            NextButton.Relief     = ReliefStyle.None;
            NextButton.CanDefault = NextButton.CanFocus = false;

            DropDownButton            = new MenuButton();
            DropDownButton.Relief     = ReliefStyle.None;
            DropDownButton.CanDefault = DropDownButton.CanFocus = false;

            PreviousButton.ShowAll();
            NextButton.ShowAll();
            DropDownButton.ShowAll();

            PreviousButton.Name = "MonoDevelop.DockNotebook.BarButton";
            NextButton.Name     = "MonoDevelop.DockNotebook.BarButton";
            DropDownButton.Name = "MonoDevelop.DockNotebook.BarButton";

            PreviousButton.Parent = this;
            NextButton.Parent     = this;
            DropDownButton.Parent = this;

            children.Add(PreviousButton);
            children.Add(NextButton);
            children.Add(DropDownButton);

            tracker.HoveredChanged += (sender, e) => {
                if (!tracker.Hovered)
                {
                    SetHighlightedTab(null);
                    UpdateTabWidth(tabEndX - tabStartX);
                    QueueDraw();
                }
            };

            notebook.PageAdded   += (object sender, EventArgs e) => QueueResize();
            notebook.PageRemoved += (object sender, EventArgs e) => QueueResize();

            closingTabs = new Dictionary <int, DockNotebookTab> ();
        }
Exemplo n.º 5
0
        protected AnimatedBox(bool horizontal)
        {
            GtkWorkarounds.FixContainerLeak(this);

            WidgetFlags            |= WidgetFlags.NoWindow;
            this.horizontal         = horizontal;
            stage.ActorStep        += OnActorStep;
            border_stage.Iteration += OnBorderIteration;
        }
Exemplo n.º 6
0
        public DockContainer(DockFrame frame)
        {
            GtkWorkarounds.FixContainerLeak(this);

            Accessible.SetRole(AtkCocoa.Roles.AXSplitGroup);

            this.Events = EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.PointerMotionMask | EventMask.LeaveNotifyMask;
            this.frame  = frame;
        }
        public PropertyGridTable(EditorManager editorManager, PropertyGrid parentGrid)
        {
            GtkWorkarounds.FixContainerLeak(this);

            this.parentGrid    = parentGrid;
            this.editorManager = editorManager;
            WidgetFlags       |= Gtk.WidgetFlags.AppPaintable;
            Events            |= Gdk.EventMask.PointerMotionMask;
            CanFocus           = true;
            resizeCursor       = new Cursor(CursorType.SbHDoubleArrow);
            handCursor         = new Cursor(CursorType.Hand1);
        }
Exemplo n.º 8
0
        public BlameWidget(VersionControlDocumentInfo info)
        {
            GtkWorkarounds.FixContainerLeak(this);

            this.info = info;
            var textView = info.Controller.GetContent <ITextView> ();

            vAdjustment          = new Adjustment(0, 0, 0, 0, 0, 0);
            vAdjustment.Changed += HandleAdjustmentChanged;

            vScrollBar = new VScrollbar(vAdjustment);
            AddChild(vScrollBar);

            hAdjustment          = new Adjustment(0, 0, 0, 0, 0, 0);
            hAdjustment.Changed += HandleAdjustmentChanged;

            hScrollBar = new HScrollbar(hAdjustment);
            AddChild(hScrollBar);

            var doc = new TextDocument(textView.TextSnapshot.GetText())
            {
                IsReadOnly = true,
                MimeType   = IdeServices.DesktopService.GetMimeTypeForContentType(textView.TextBuffer.ContentType)
            };
            var options = new CustomEditorOptions(DefaultSourceEditorOptions.Instance);

            options.TabsToSpaces = false;

            editor = new MonoTextEditor(doc, new SourceEditor.StyledSourceEditorOptions(options));

            AddChild(editor);
            editor.SetScrollAdjustments(hAdjustment, vAdjustment);

            overview = new BlameRenderer(this);
            AddChild(overview);

            this.DoubleBuffered          = true;
            editor.Painted              += HandleEditorExposeEvent;
            editor.EditorOptionsChanged += delegate {
                overview.OptionsChanged();
            };
            editor.Caret.PositionChanged += ComparisonWidget.CaretPositionChanged;
            editor.FocusInEvent          += ComparisonWidget.EditorFocusIn;
            editor.Document.Folded       += delegate {
                QueueDraw();
            };
            editor.Document.FoldTreeUpdated += delegate {
                QueueDraw();
            };
            editor.DoPopupMenu = ShowPopup;
            Show();
        }
Exemplo n.º 9
0
        public ResizableFixed()
        {
            GtkWorkarounds.FixContainerLeak(this);

            fixd = new Fixed();
            Add(fixd);
            this.CanFocus = true;
            this.Events   = EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.PointerMotionMask | EventMask.KeyPressMask;
//			fixd.ModifyBg (Gtk.StateType.Normal, this.Style.Mid (Gtk.StateType.Normal));
//			VisibleWindow = false;
            selectionBox = new SelectionHandleBox(this);
            selectionBox.Show();
        }
Exemplo n.º 10
0
        public PropertyGridTable(EditorManager editorManager, PropertyGrid parentGrid)
        {
            GtkWorkarounds.FixContainerLeak(this);

            this.parentGrid    = parentGrid;
            this.editorManager = editorManager;
            WidgetFlags       |= Gtk.WidgetFlags.AppPaintable;
            Events            |= Gdk.EventMask.PointerMotionMask;
            CanFocus           = true;
            resizeCursor       = new Cursor(CursorType.SbHDoubleArrow);
            handCursor         = new Cursor(CursorType.Hand1);
            discloseDown       = Xwt.Drawing.Image.FromResource("disclose-arrow-down-16.png");
            discloseUp         = Xwt.Drawing.Image.FromResource("disclose-arrow-up-16.png");
        }
Exemplo n.º 11
0
        public AnimatedWidget(Widget widget, uint duration, Easing easing, Blocking blocking, bool horizontal)
        {
            GtkWorkarounds.FixContainerLeak(this);

            this.horizontal = horizontal;
            Widget          = widget;
            Duration        = duration;
            Easing          = easing;
            Blocking        = blocking;
            AnimationState  = AnimationState.Coming;

            Widget.Parent     = this;
            Widget.Destroyed += OnWidgetDestroyed;
            ShowAll();
        }
        public SmartScrolledWindow(Widget vScrollBar = null)
        {
            GtkWorkarounds.FixContainerLeak(this);

            vAdjustment = new ScrollAdjustment();
            vAdjustment.ValueChanged += HandleAdjustmentChanged;

            this.vScrollBar        = vScrollBar ?? new VScrollbar(vAdjustment);
            this.vScrollBar.Parent = this;
            this.vScrollBar.Show();

            hAdjustment = new ScrollAdjustment();
            hAdjustment.ValueChanged += HandleAdjustmentChanged;

            hScrollBar        = new HScrollbar(hAdjustment);
            hScrollBar.Parent = this;
            hScrollBar.Show();
        }
Exemplo n.º 13
0
        public FixedPanel()
        {
            GtkWorkarounds.FixContainerLeak(this);

            WidgetFlags |= WidgetFlags.NoWindow;
        }
Exemplo n.º 14
0
        public TabStrip(DockNotebook notebook)
        {
            if (notebook == null)
            {
                throw new ArgumentNullException("notebook");
            }
            TabWidth    = 125;
            TargetWidth = 125;
            tracker     = new MouseTracker(this);
            GtkWorkarounds.FixContainerLeak(this);

            this.notebook = notebook;
            WidgetFlags  |= Gtk.WidgetFlags.AppPaintable;
            Events       |= EventMask.PointerMotionMask | EventMask.LeaveNotifyMask | EventMask.ButtonPressMask;

            var arr = new Xwt.ImageView(tabbarPrevImage);

            arr.HeightRequest = arr.WidthRequest = 10;

            var alignment = new Alignment(0.5f, 1, 0.0f, 0.0f);

            alignment.Add(arr.ToGtkWidget());
            PreviousButton            = new Button(alignment);
            PreviousButton.Relief     = ReliefStyle.None;
            PreviousButton.CanDefault = PreviousButton.CanFocus = false;

            arr = new Xwt.ImageView(tabbarNextImage);
            arr.HeightRequest = arr.WidthRequest = 10;

            alignment = new Alignment(0.5f, 1, 0.0f, 0.0f);
            alignment.Add(arr.ToGtkWidget());
            NextButton            = new Button(alignment);
            NextButton.Relief     = ReliefStyle.None;
            NextButton.CanDefault = NextButton.CanFocus = false;

            DropDownButton            = new MenuButton();
            DropDownButton.Relief     = ReliefStyle.None;
            DropDownButton.CanDefault = DropDownButton.CanFocus = false;

            PreviousButton.ShowAll();
            NextButton.ShowAll();
            DropDownButton.ShowAll();

            PreviousButton.Name = "MonoDevelop.DockNotebook.BarButton";
            NextButton.Name     = "MonoDevelop.DockNotebook.BarButton";
            DropDownButton.Name = "MonoDevelop.DockNotebook.BarButton";

            PreviousButton.Parent = this;
            NextButton.Parent     = this;
            DropDownButton.Parent = this;

            children.Add(PreviousButton);
            children.Add(NextButton);
            children.Add(DropDownButton);

            tracker.HoveredChanged += (sender, e) => {
                if (!tracker.Hovered)
                {
                    SetHighlightedTab(null);
                    UpdateTabWidth(tabEndX - tabStartX);
                    QueueDraw();
                }
            };

            notebook.PageAdded   += (sender, e) => QueueResize();
            notebook.PageRemoved += (sender, e) => QueueResize();

            closingTabs = new Dictionary <int, DockNotebookTab> ();
        }
Exemplo n.º 15
0
 protected EditorCompareWidgetBase(bool viewOnly)
 {
     GtkWorkarounds.FixContainerLeak(this);
     this.viewOnly = viewOnly;
 }
Exemplo n.º 16
0
 protected EditorCompareWidgetBase()
 {
     GtkWorkarounds.FixContainerLeak(this);
     Intialize();
 }
Exemplo n.º 17
0
        public TabStrip(DockNotebook notebook)
        {
            if (notebook == null)
            {
                throw new ArgumentNullException("notebook");
            }

            Accessible.SetRole(AtkCocoa.Roles.AXTabGroup);

            // Handle focus for the tabs.
            CanFocus = true;

            TabWidth    = 125;
            TargetWidth = 125;
            tracker     = new MouseTracker(this);
            GtkWorkarounds.FixContainerLeak(this);

            innerBox = new HBox(false, 0);
            innerBox.Accessible.SetShouldIgnore(true);
            Add(innerBox);

            this.notebook = notebook;
            WidgetFlags  |= Gtk.WidgetFlags.AppPaintable;
            Events       |= EventMask.PointerMotionMask | EventMask.LeaveNotifyMask | EventMask.ButtonPressMask;

            var arr = new Xwt.ImageView(tabbarPrevImage);

            arr.HeightRequest = arr.WidthRequest = 10;

            var alignment = new Alignment(0.5f, 0.5f, 0.0f, 0.0f);

            alignment.Add(arr.ToGtkWidget());
            PreviousButton                 = new Button(alignment);
            PreviousButton.TooltipText     = Core.GettextCatalog.GetString("Switch to previous document");
            PreviousButton.Relief          = ReliefStyle.None;
            PreviousButton.CanDefault      = false;
            PreviousButton.CanFocus        = true;
            PreviousButton.Accessible.Name = "DockNotebook.Tabstrip.PreviousButton";
            PreviousButton.Accessible.SetTitle(Core.GettextCatalog.GetString("Previous document"));
            PreviousButton.Accessible.Description = Core.GettextCatalog.GetString("Switch to previous document");

            arr = new Xwt.ImageView(tabbarNextImage);
            arr.HeightRequest = arr.WidthRequest = 10;

            alignment = new Alignment(0.5f, 0.5f, 0.0f, 0.0f);
            alignment.Add(arr.ToGtkWidget());
            NextButton                 = new Button(alignment);
            NextButton.TooltipText     = Core.GettextCatalog.GetString("Switch to next document");
            NextButton.Relief          = ReliefStyle.None;
            NextButton.CanDefault      = false;
            NextButton.CanFocus        = true;
            NextButton.Accessible.Name = "DockNotebook.Tabstrip.NextButton";
            NextButton.Accessible.SetTitle(Core.GettextCatalog.GetString("Next document"));
            NextButton.Accessible.Description = Core.GettextCatalog.GetString("Switch to next document");

            DropDownButton                 = new MenuButton();
            DropDownButton.TooltipText     = Core.GettextCatalog.GetString("Document List");
            DropDownButton.Relief          = ReliefStyle.None;
            DropDownButton.CanDefault      = false;
            DropDownButton.CanFocus        = true;
            DropDownButton.Accessible.Name = "DockNotebook.Tabstrip.DocumentListButton";
            DropDownButton.Accessible.SetTitle(Core.GettextCatalog.GetString("Document list"));
            DropDownButton.Accessible.Description = Core.GettextCatalog.GetString("Display the document list menu");

            PreviousButton.ShowAll();
            PreviousButton.NoShowAll = true;
            NextButton.ShowAll();
            NextButton.NoShowAll = true;
            DropDownButton.ShowAll();

            PreviousButton.Name = "MonoDevelop.DockNotebook.BarButton";
            NextButton.Name     = "MonoDevelop.DockNotebook.BarButton";
            DropDownButton.Name = "MonoDevelop.DockNotebook.BarButton";

            innerBox.PackStart(PreviousButton, false, false, 0);
            innerBox.PackStart(NextButton, false, false, 0);
            innerBox.PackEnd(DropDownButton, false, false, 0);

            tracker.HoveredChanged += (sender, e) => {
                if (!tracker.Hovered)
                {
                    SetHighlightedTab(null);
                    UpdateTabWidth(tabEndX - tabStartX);
                    QueueDraw();
                }
            };

            foreach (var tab in notebook.Tabs)
            {
                Accessible.AddAccessibleElement(tab.Accessible);
            }
            UpdateAccessibilityTabs();
            notebook.PageAdded     += PageAddedHandler;
            notebook.PageRemoved   += PageRemovedHandler;
            notebook.TabsReordered += PageReorderedHandler;

            closingTabs = new Dictionary <int, DockNotebookTab> ();
        }
Exemplo n.º 18
0
 public WorkbenchWindow() : base(Gtk.WindowType.Toplevel)
 {
     GtkWorkarounds.FixContainerLeak(this);
     this.Role = "workbench";
 }