Esempio n. 1
0
        public ParameterInformationWindow()
        {
            WindowTransparencyDecorator.Attach(this);

            headlabel        = new MonoDevelop.Components.FixedWidthWrapLabel();
            headlabel.Indent = -20;

            headlabel.Wrap = Pango.WrapMode.WordChar;
            headlabel.BreakOnCamelCasing = false;
            headlabel.BreakOnPunctuation = false;
            descriptionBox.Spacing       = 4;
            VBox vb = new VBox(false, 0);

            vb.PackStart(headlabel, true, true, 0);
            vb.PackStart(descriptionBox, true, true, 0);

            HBox hb = new HBox(false, 0);

            hb.PackStart(vb, true, true, 0);

            vb2.Spacing = 4;
            vb2.PackStart(hb, true, true, 0);
            Content = BackendHost.ToolkitEngine.WrapWidget(vb2, Xwt.NativeWidgetSizing.DefaultPreferredSize);

            UpdateStyle();
            Styles.Changed += HandleThemeChanged;
            IdeApp.Preferences.ColorScheme.Changed += HandleThemeChanged;

            vb2.ShowAll();
            //DesktopService.RemoveWindowShadow (this);
            Content.BoundsChanged += Content_BoundsChanged;
        }
Esempio n. 2
0
        public CompletionListWindowGtk(CompletionListWindow facade, WindowType type = WindowType.Popup) : base(type)
        {
            this.facade = facade;

            if (IdeApp.Workbench != null)
            {
                this.TransientFor = IdeApp.Workbench.RootWindow;
            }
            TypeHint       = Gdk.WindowTypeHint.Combo;
            SizeAllocated += new SizeAllocatedHandler(ListSizeChanged);
            Events         = Gdk.EventMask.PropertyChangeMask;
            WindowTransparencyDecorator.Attach(this);
            DataProvider = facade;
            HideDeclarationView();
            VisibilityNotifyEvent += (object sender, VisibilityNotifyEventArgs e) => {
                if (!Visible)
                {
                    HideDeclarationView();
                }
            };
            List.ListScrolled += (object sender, EventArgs e) => {
                HideDeclarationView();
                UpdateDeclarationView();
            };
            List.WordsFiltered += delegate {
                HideDeclarationView();
                UpdateDeclarationView();
            };
            List.VisibilityNotifyEvent += (object sender, VisibilityNotifyEventArgs e) => {
                if (!List.Visible)
                {
                    HideDeclarationView();
                }
            };
        }
        public ParameterInformationWindow()
        {
            TypeHint             = Gdk.WindowTypeHint.Tooltip;
            this.SkipTaskbarHint = true;
            this.SkipPagerHint   = true;
            this.AllowShrink     = false;
            this.AllowGrow       = false;
            this.CanFocus        = false;
            this.CanDefault      = false;
            WindowTransparencyDecorator.Attach(this);

            headlabel        = new MonoDevelop.Components.FixedWidthWrapLabel();
            headlabel.Indent = -20;

            headlabel.FontDescription = FontService.GetFontDescription("Editor").CopyModified(1.1);

            headlabel.Wrap = Pango.WrapMode.WordChar;
            headlabel.BreakOnCamelCasing = false;
            headlabel.BreakOnPunctuation = false;
            descriptionBox.Spacing       = 4;
            VBox vb = new VBox(false, 0);

            vb.PackStart(headlabel, true, true, 0);
            vb.PackStart(descriptionBox, true, true, 0);

            HBox hb = new HBox(false, 0);

            hb.PackStart(vb, true, true, 0);

            vb2.Spacing = 4;
            vb2.PackStart(hb, true, true, 0);
            ContentBox.Add(vb2);
            ShowAll();
            DesktopService.RemoveWindowShadow(this);
        }
Esempio n. 4
0
 public PopUpContainer(Widget content, Gtk.Container placementTarget)
     : base(content, placementTarget)
 {
     WindowTransparencyDecorator.Attach(_popup);//TODO: not sure we want this on all popus?
     _popup.Content = _popupContentContainer;
     _popup.Hidden += OnPopupClosed;
 }
 public CompletionListWindow()
 {
     SizeAllocated += new SizeAllocatedHandler(ListSizeChanged);
     Events         = Gdk.EventMask.PropertyChangeMask;
     WindowTransparencyDecorator.Attach(this);
     DataProvider = this;
     HideDeclarationView();
 }
        public TooltipInformationWindow() : base()
        {
            TypeHint             = Gdk.WindowTypeHint.Tooltip;
            this.SkipTaskbarHint = true;
            this.SkipPagerHint   = true;
            if (IdeApp.Workbench != null)
            {
                this.TransientFor = IdeApp.Workbench.RootWindow;
            }
            this.AllowShrink = false;
            this.AllowGrow   = false;
            this.CanFocus    = false;
            this.CanDefault  = false;
            this.Events     |= Gdk.EventMask.EnterNotifyMask;

            headlabel        = new FixedWidthWrapLabel();
            headlabel.Indent = -20;
            var des = FontService.GetFontDescription("Editor").Copy();

            des.Size = des.Size * 9 / 10;
            headlabel.FontDescription = des;
//			headlabel.MaxWidth = 400;
            headlabel.Wrap = Pango.WrapMode.WordChar;
            headlabel.BreakOnCamelCasing = false;
            headlabel.BreakOnPunctuation = false;
            descriptionBox.Spacing       = 4;
            VBox vb = new VBox(false, 8);

            vb.PackStart(headlabel, true, true, 0);
            vb.PackStart(descriptionBox, true, true, 0);

            HBox hb = new HBox(false, 0);

            hb.PackStart(vb, true, true, 0);
            WindowTransparencyDecorator.Attach(this);

            vb2.Spacing = 4;
            vb2.PackStart(hb, true, true, 0);
            ContentBox.Add(vb2);
            var scheme = Mono.TextEditor.Highlighting.SyntaxModeService.GetColorStyle(IdeApp.Preferences.ColorScheme);

            Theme.SetSchemeColors(scheme);
            foreColor = scheme.PlainText.Foreground;
            headlabel.ModifyFg(StateType.Normal, (HslColor)foreColor);
            ShowAll();
            DesktopService.RemoveWindowShadow(this);
        }
 public CompletionListWindow(WindowType type = WindowType.Popup) : base(type)
 {
     if (IdeApp.Workbench != null)
     {
         this.TransientFor = IdeApp.Workbench.RootWindow;
     }
     TypeHint       = Gdk.WindowTypeHint.Combo;
     SizeAllocated += new SizeAllocatedHandler(ListSizeChanged);
     Events         = Gdk.EventMask.PropertyChangeMask;
     WindowTransparencyDecorator.Attach(this);
     DataProvider = this;
     HideDeclarationView();
     List.ListScrolled += (object sender, EventArgs e) => {
         HideDeclarationView();
         UpdateDeclarationView();
     };
 }
Esempio n. 8
0
        public TooltipInformationWindow() : base()
        {
            TypeHint             = Gdk.WindowTypeHint.Tooltip;
            this.SkipTaskbarHint = true;
            this.SkipPagerHint   = true;
            if (IdeApp.Workbench != null)
            {
                this.TransientFor = IdeApp.Workbench.RootWindow;
            }
            this.AllowShrink = false;
            this.AllowGrow   = false;
            this.CanFocus    = false;
            this.CanDefault  = false;
            this.Events     |= Gdk.EventMask.EnterNotifyMask;

            headLabel                    = new FixedWidthWrapLabel();
            headLabel.Indent             = -20;
            headLabel.FontDescription    = FontService.GetFontDescription("Editor(TooltipSource)");;
            headLabel.Wrap               = Pango.WrapMode.WordChar;
            headLabel.BreakOnCamelCasing = false;
            headLabel.BreakOnPunctuation = false;

            descriptionBox.Spacing = 4;

            VBox vb = new VBox(false, 8);

            vb.PackStart(headLabel, true, true, 4);
            vb.PackStart(descriptionBox, true, true, 4);

            HBox hb = new HBox(false, 4);

            hb.PackStart(vb, true, true, 6);

            WindowTransparencyDecorator.Attach(this);

            vb2.Spacing = 4;
            vb2.PackStart(hb, true, true, 0);
            ContentBox.Add(vb2);

            SetDefaultScheme();

            ShowAll();
            DesktopService.RemoveWindowShadow(this);
        }
        public TooltipInformationWindow() : base()
        {
            TypeHint             = Gdk.WindowTypeHint.Tooltip;
            this.SkipTaskbarHint = true;
            this.SkipPagerHint   = true;
            this.AllowShrink     = false;
            this.AllowGrow       = false;
            this.CanFocus        = false;
            this.CanDefault      = false;
            this.Events         |= Gdk.EventMask.EnterNotifyMask;

            headLabel                    = new FixedWidthWrapLabel();
            headLabel.Indent             = -20;
            headLabel.Wrap               = Pango.WrapMode.WordChar;
            headLabel.BreakOnCamelCasing = false;
            headLabel.BreakOnPunctuation = false;

            descriptionBox.Spacing = 4;

            VBox vb = new VBox(false, 8);

            vb.PackStart(headLabel, true, true, 4);
            vb.PackStart(descriptionBox, true, true, 4);

            HBox hb = new HBox(false, 4);

            hb.PackStart(vb, true, true, 6);

            WindowTransparencyDecorator.Attach(this);

            vb2.Spacing = 4;
            vb2.PackStart(hb, true, true, 0);
            ContentBox.Add(vb2);

            vb2.ShowAll();
            SetDefaultScheme();
            Styles.Changed += HandleSkinChanged;
            IdeApp.Preferences.ColorScheme.Changed += HandleSkinChanged;
        }
        public TooltipInformationWindow()
        {
            headLabel                    = new FixedWidthWrapLabel();
            headLabel.Indent             = -20;
            headLabel.Wrap               = Pango.WrapMode.WordChar;
            headLabel.BreakOnCamelCasing = false;
            headLabel.BreakOnPunctuation = false;

            descriptionBox.Spacing = 4;

            VBox vb = new VBox(false, 8);

            vb.PackStart(headLabel, true, true, 4);
            vb.PackStart(descriptionBox, true, true, 4);

            HBox hb = new HBox(false, 4);

            hb.PackStart(vb, true, true, 6);

            WindowTransparencyDecorator.Attach(this);

            vb2.Spacing = 4;
            vb2.PackStart(hb, true, true, 0);

            vb2.SizeRequested += (o, args) => {
                var w   = Math.Max(headLabel.WidthRequest, headLabel.RealWidth);
                var req = new Gtk.Requisition();
                req.Height   = args.Requisition.Height;
                req.Width    = (int)Math.Max(w + PaddingLeft + PaddingTop, args.Requisition.Width);
                args.Args[0] = req;
            };

            Content = BackendHost.ToolkitEngine.WrapWidget(vb2, Xwt.NativeWidgetSizing.DefaultPreferredSize);

            vb2.ShowAll();
            SetDefaultScheme();
            Styles.Changed += HandleThemeChanged;
            IdeApp.Preferences.ColorScheme.Changed += HandleThemeChanged;
        }
		protected override void OnDestroyed ()
		{
			base.OnDestroyed ();
			if (decorator != null) {
				decorator.Detach ();
				decorator = null;
			}
		}
Esempio n. 12
0
        GenerateCodeWindow(CodeGenerationOptions options, MonoDevelop.Ide.CodeCompletion.CodeCompletionContext completionContext) : base(Gtk.WindowType.Toplevel)
        {
            this.options = options;
            this.Build();
            scrolledwindow1.Child = treeviewGenerateActions;
            scrolledwindow1.ShowAll();

            scrolledwindow2.Child = treeviewSelection;
            scrolledwindow2.ShowAll();

            treeviewGenerateActions.Cancel += delegate {
                Destroy();
            };
            treeviewGenerateActions.Submit += delegate {
                treeviewSelection.GrabFocus();
            };

            treeviewSelection.Cancel += delegate {
                treeviewGenerateActions.GrabFocus();
            };

            treeviewSelection.Submit += delegate {
                if (curInitializeObject != null)
                {
                    curInitializeObject.GenerateCode();
                    curInitializeObject = null;
                }
                Destroy();
            };

            WindowTransparencyDecorator.Attach(this);

            treeviewSelection.HeadersVisible = false;

            treeviewGenerateActions.HeadersVisible = false;
            treeviewGenerateActions.Model          = generateActionsStore;
            TreeViewColumn column         = new TreeViewColumn();
            var            pixbufRenderer = new CellRendererImage();

            column.PackStart(pixbufRenderer, false);
            column.AddAttribute(pixbufRenderer, "image", 0);

            CellRendererText textRenderer = new CellRendererText();

            column.PackStart(textRenderer, true);
            column.AddAttribute(textRenderer, "text", 1);
            column.Expand = true;
            treeviewGenerateActions.AppendColumn(column);

            treeviewGenerateActions.Selection.Changed += TreeviewGenerateActionsSelectionChanged;
            this.Remove(this.vbox1);
            BorderBox messageArea = new BorderBox();

            messageArea.Add(vbox1);
            this.Add(messageArea);
            this.ShowAll();

            int x = completionContext.TriggerXCoord;
            int y = completionContext.TriggerYCoord;

            int w, h;

            GetSize(out w, out h);

            int myMonitor = Screen.GetMonitorAtPoint(x, y);

            Gdk.Rectangle geometry = DesktopService.GetUsableMonitorGeometry(Screen, myMonitor);

            if (x + w > geometry.Right)
            {
                x = geometry.Right - w;
            }

            if (y + h > geometry.Bottom)
            {
                y = y - completionContext.TriggerTextHeight - h;
            }

            Move(x, y);
        }