void UpdatePadding()
        {
            uint top, left, bottom, right;

            top = left = bottom = right = (uint)Theme.Padding + 1;

            if (ShowArrow)
            {
                if ((position & PopupPosition.Top) != 0)
                {
                    top += (uint)Theme.ArrowLength;
                }
                else if ((position & PopupPosition.Bottom) != 0)
                {
                    bottom += (uint)Theme.ArrowLength;
                }
                else if ((position & PopupPosition.Left) != 0)
                {
                    left += (uint)Theme.ArrowLength;
                }
                else if ((position & PopupPosition.Right) != 0)
                {
                    right += (uint)Theme.ArrowLength;
                }
            }
            alignment.SetPadding(top, bottom, left, right);
        }
Example #2
0
        public WelcomePageWidget()
        {
            logoPixbuf = WelcomePageBranding.GetLogoImage();
            bgPixbuf   = WelcomePageBranding.GetTopBorderImage();

            Gdk.Color color = Gdk.Color.Zero;
            if (!Gdk.Color.Parse(WelcomePageBranding.BackgroundColor, ref color))
            {
                color = Style.White;
            }
            ModifyBg(StateType.Normal, color);

            var mainAlignment = new Gtk.Alignment(0f, 0f, 1f, 1f);

            mainAlignment.SetPadding((uint)(WelcomePageBranding.LogoHeight + WelcomePageBranding.Spacing), 0, (uint)WelcomePageBranding.Spacing, 0);
            this.Add(mainAlignment);

            colBox = new Gtk.HBox(false, WelcomePageBranding.Spacing);
            mainAlignment.Add(colBox);

            BuildContent();

            ShowAll();

            IdeApp.Workbench.GuiLocked   += OnLock;
            IdeApp.Workbench.GuiUnlocked += OnUnlock;
        }
Example #3
0
        public WelcomePageSection(string title = null)
        {
            if (!string.IsNullOrEmpty(title))
            {
                Accessible.SetTitle(title);
            }

            this.title    = title;
            VisibleWindow = false;
            root.Accessible.SetShouldIgnore(true);
            Add(root);

            root.Show();

            uint p = Styles.WelcomeScreen.Pad.ShadowSize * 2;

            root.SetPadding(p, p, p, p);

            TitleAlignment = new Alignment(0f, 0f, 1f, 1f);
            TitleAlignment.Accessible.SetShouldIgnore(true);
            p = Styles.WelcomeScreen.Pad.Padding;
            TitleAlignment.SetPadding(p, Styles.WelcomeScreen.Pad.LargeTitleMarginBottom, p, p);

            ContentAlignment = new Alignment(0f, 0f, 1f, 1f);
            ContentAlignment.SetPadding(0, p, p, p);
            ContentAlignment.Accessible.SetShouldIgnore(true);

            Gui.Styles.Changed += UpdateStyle;
        }
Example #4
0
        private void BuildInterface ()
        {
            NoShowAll = true;

            Alignment matchesAlignment = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
            matchesAlignment.SetPadding (5, 5, 5, 5);
            matchesAlignment.Add (terms_box);

            matchesFrame = new Frame (null);
            matchesFrame.Add (matchesAlignment);
            matchesFrame.LabelWidget = BuildMatchHeader ();
            matchesFrame.ShowAll ();

            terms_entry_box = new HBox ();
            terms_entry_box.Spacing = 8;
            terms_entry_box.PackStart (new Label (Catalog.GetString ("Condition:")), false, false, 0);
            terms_entry = new Entry ();
            terms_entry_box.PackStart (terms_entry, true, true, 0);

            limit_box.ShowAll ();

            PackStart(matchesFrame, true, true, 0);
            PackStart(terms_entry_box, false, false, 0);
            PackStart(limit_box, false, false, 0);

            //ShowAll ();
        }
Example #5
0
        public override Gtk.Widget GetDisplayWidget()
        {
            DrawingArea colorPreview = new DrawingArea ();

            colorPreview.ModifyBg(StateType.Normal, GetColor ());
            colorPreview.WidthRequest = 15;

            Alignment colorPreviewAlign = new Alignment (0, 0, 0, 1);
            colorPreviewAlign.SetPadding (2, 2, 2, 2);
            colorPreviewAlign.Add (colorPreview);

            string labelText;

            System.Drawing.Color color = (System.Drawing.Color) parentRow.PropertyValue;
            //TODO: dropdown known color selector so this does something
            if (color.IsKnownColor)
                labelText = color.Name;
            else if (color.IsEmpty)
                labelText = "[empty]";
            else
                labelText = String.Format("#{0:x2}{1:x2}{2:x2}", color.R, color.G, color.B);

            //we use StringValue as it auto-bolds the text for non-default values
            Label theLabel = (Label) base.StringValue (labelText);
            theLabel.Xalign = 0;
            theLabel.Xpad = 3;

            HBox hbox = new HBox ();
            hbox.PackStart (colorPreviewAlign, false, false, 0);
            hbox.PackStart (theLabel, true, true, 0);

            return hbox;
        }
Example #6
0
        public LoginDialog(Window parent, string errorMsg)
            : base("Login", parent)
        {
            XML gxml = new XML(null, "MultiMC.GTKGUI.LoginDialog.glade",
                "loginTable", null);
            gxml.Autoconnect(this);

            labelErrorMsg.Text = errorMsg;

            Alignment loginAlign = new Alignment(0.5f, 0.5f, 1, 1);
            loginAlign.Add(loginTable);
            loginAlign.SetPadding(4, 4, 4, 4);
            this.VBox.Add(loginAlign);
            loginAlign.ShowAll();

            okButton = this.AddButton("_OK", ResponseType.Ok) as Button;
            cancelButton = this.AddButton("_Cancel", ResponseType.Cancel) as Button;

            this.Default = okButton;

            this.WidthRequest = 420;

            labelErrorMsg.Visible = !string.IsNullOrEmpty(labelErrorMsg.Text);

            entryPassword.Visibility = false;
        }
Example #7
0
        public WelcomePageWidget()
        {
            ShowScrollbars = true;
            VisibleWindow  = false;

            UpdateTeme(null, null);
            LogoHeight = 90;

            var background = new WelcomePageWidgetBackground();

            background.Accessible.SetShouldIgnore(true);
            Background       = background;
            background.Owner = this;
            var mainAlignment = new Gtk.Alignment(0f, 0f, 1f, 1f);

            mainAlignment.Accessible.SetShouldIgnore(true);
            background.Add(mainAlignment);

            BuildContent(mainAlignment);

            if (ShowScrollbars)
            {
                var scroller = new ScrolledWindow();
                scroller.Accessible.SetShouldIgnore(true);
                scroller.AddWithViewport(background);
                ((Gtk.Viewport)scroller.Child).ShadowType = ShadowType.None;
                scroller.Child.Accessible.SetShouldIgnore(true);

                scroller.ShadowType = ShadowType.None;
                scroller.FocusChain = new Widget[] { background };
                scroller.Show();
                Add(scroller);
            }
            else
            {
                this.Add(background);
            }

            if (LogoImage != null)
            {
                var logoHeight = LogoHeight;
                mainAlignment.SetPadding((uint)(logoHeight + Styles.WelcomeScreen.Spacing), 0, (uint)Styles.WelcomeScreen.Spacing, 0);
            }

            ShowAll();

            IdeApp.Workbench.GuiLocked         += OnLock;
            IdeApp.Workbench.GuiUnlocked       += OnUnlock;
            MonoDevelop.Ide.Gui.Styles.Changed += UpdateTeme;
        }
        public PaletteGroup(string name) : base("<b>" + name + "</b>")
        {
            vbox              = new VBox(false, 0);
            emptyLabel        = new Gtk.Label();
            emptyLabel.Markup = "<small><i><span foreground='darkgrey'>  " + Catalog.GetString("Empty") + "</span></i></small>";
            vbox.PackStart(emptyLabel, false, false, 0);

            align = new Gtk.Alignment(0, 0, 0, 0);
            align.SetPadding(0, 0, 20, 0);
            align.Child = vbox;

            UseMarkup = true;
            Expanded  = true;
            Child     = align;
        }
Example #9
0
        public WelcomePageSection(string title = null)
        {
            this.title = title;
            VisibleWindow = false;
            Add (root);
            root.Show ();

            uint p = Styles.WelcomeScreen.Pad.ShadowSize * 2;
            root.SetPadding (p, p, p, p);

            TitleAlignment = new Alignment (0f, 0f, 1f, 1f);
            p = Styles.WelcomeScreen.Pad.Padding;
            TitleAlignment.SetPadding (p, Styles.WelcomeScreen.Pad.LargeTitleMarginBottom, p, p);
            ContentAlignment = new Alignment (0f, 0f, 1f, 1f);
            ContentAlignment.SetPadding (0, p, p, p);
        }
Example #10
0
        public WelcomePageSection(string title = null)
        {
            this.title    = title;
            VisibleWindow = false;
            Add(root);
            root.Show();

            uint p = Styles.WelcomeScreen.Pad.ShadowSize * 2;

            root.SetPadding(p, p, p, p);

            TitleAlignment = new Alignment(0f, 0f, 1f, 1f);
            p = Styles.WelcomeScreen.Pad.Padding;
            TitleAlignment.SetPadding(p, Styles.WelcomeScreen.Pad.LargeTitleMarginBottom, p, p);
            ContentAlignment = new Alignment(0f, 0f, 1f, 1f);
            ContentAlignment.SetPadding(0, p, p, p);
        }
		public WelcomePageWidget ()
		{
			logoPixbuf = WelcomePageBranding.GetLogoImage ();
			bgPixbuf = WelcomePageBranding.GetTopBorderImage ();
			
			Gdk.Color color = Gdk.Color.Zero;
			if (!Gdk.Color.Parse (WelcomePageBranding.BackgroundColor, ref color))
				color = Style.White;
			ModifyBg (StateType.Normal, color);
			
			var mainAlignment = new Gtk.Alignment (0f, 0f, 1f, 1f);
			mainAlignment.SetPadding ((uint) (WelcomePageBranding.LogoHeight + WelcomePageBranding.Spacing), 0, (uint) WelcomePageBranding.Spacing, 0);
			this.Add (mainAlignment);
			
			colBox = new Gtk.HBox (false, WelcomePageBranding.Spacing);
			mainAlignment.Add (colBox);
			
			BuildContent ();
			
			ShowAll ();

			IdeApp.Workbench.GuiLocked += OnLock;
			IdeApp.Workbench.GuiUnlocked += OnUnlock;
		}
		private void BuildWidget ()
		{
			alignment = new Alignment (0.5f, 0.5f, 1f, 0f);
			alignment.SetPadding (1, 1, 3, 3);
			VisibleWindow = false;

			box = new HBox ();
			entry = new FramelessEntry (this);
			filter_button = new HoverImageButton (IconSize.Menu, "md-searchbox-search");
			clear_button = new HoverImageButton (IconSize.Menu, "md-searchbox-clear");

			entryAlignment = new Gtk.Alignment (0.5f, 0.5f, 1f, 1f);
			alignment.SetPadding (0, 0, 3, 3);
			entryAlignment.Add (entry);
			box.PackStart (filter_button, false, false, 0);
			box.PackStart (entryAlignment, true, true, 0);
			box.PackStart (clear_button, false, false, 0);
			alignment.Add (box);
			Add (alignment);
			alignment.ShowAll ();
			
			entry.StyleSet += OnInnerEntryStyleSet;
			entry.StateChanged += OnInnerEntryStateChanged;
			entry.FocusInEvent += OnInnerEntryFocusEvent;
			entry.FocusOutEvent += OnInnerEntryFocusEvent;
			entry.Changed += OnInnerEntryChanged;
			entry.Activated += delegate {
				NotifyActivated ();
			};

			filter_button.Image.Xpad = 0;
			clear_button.Image.Xpad = 0;
			filter_button.CanFocus = false;
			clear_button.CanFocus = false;
			
			filter_button.ButtonReleaseEvent += OnButtonReleaseEvent;
			clear_button.ButtonReleaseEvent += OnButtonReleaseEvent;
			clear_button.Clicked += OnClearButtonClicked;

			ShowHideButtons ();
		}
Example #13
0
		public void UpdateTab ()
		{
			if (Child != null) {
				Widget w = Child;
				Remove (w);
				w.Destroy ();
			}
			
			mainBox = new Alignment (0,0,1,1);
			if (bar.Orientation == Gtk.Orientation.Horizontal) {
				box = new HBox ();
				if (bar.AlignToEnd)
					mainBox.SetPadding (5, 5, 11, 9);
				else
					mainBox.SetPadding (5, 5, 9, 11);
			}
			else {
				box = new VBox ();
				if (bar.AlignToEnd)
					mainBox.SetPadding (11, 9, 5, 5);
				else
					mainBox.SetPadding (9, 11, 5, 5);
			}
			
			if (it.Icon != null) {
				var desat = it.Icon.WithAlpha (0.5);
				crossfade = new CrossfadeIcon (desat, it.Icon);
				box.PackStart (crossfade, false, false, 0);
				desat.Dispose ();
			}
				
			if (!string.IsNullOrEmpty (it.Label)) {
				label = new Label (it.Label);
				label.UseMarkup = true;
				label.ModifyFont (FontService.SansFont.CopyModified (Styles.FontScale11));

				if (bar.Orientation == Orientation.Vertical)
					label.Angle = 270;

				// fine-tune label alignment issues
				if (Platform.IsMac) {
					if (bar.Orientation == Orientation.Horizontal)
						label.SetAlignment (0, 0.5f);
					else
						label.SetAlignment (0.6f, 0);
				} else {
					if (bar.Orientation == Orientation.Vertical)
						label.SetAlignment (1, 0);
				}
				// TODO: VV: Test Linux

				box.PackStart (label, true, true, 0);
			} else
				label = null;

			box.Spacing = 2;
			mainBox.Add (box);
			mainBox.ShowAll ();
			Add (mainBox);
			UpdateStyle (this, null); 
			QueueDraw ();
		}
Example #14
0
        public void ShowCalendar()
        {
            popup = new Window(WindowType.Popup);
            popup.Screen = parent.Screen;

            Frame frame = new Frame();
            frame.Shadow = ShadowType.Out;
            frame.Show();

            popup.Add(frame);

            VBox box = new VBox(false, 0);
            box.Show();
            frame.Add(box);

            cal = new Calendar();
            cal.DisplayOptions = CalendarDisplayOptions.ShowHeading
                                 | CalendarDisplayOptions.ShowDayNames
                                 | CalendarDisplayOptions.ShowWeekNumbers;

            cal.KeyPressEvent += OnCalendarKeyPressed;
            popup.ButtonPressEvent += OnButtonPressed;

            cal.Show();

            Alignment calAlignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);
            calAlignment.Show();
            calAlignment.SetPadding(4, 4, 4, 4);
            calAlignment.Add(cal);

            box.PackStart(calAlignment, false, false, 0);

            //Requisition req = SizeRequest();

            parent.GdkWindow.GetOrigin(out xPos, out yPos);
            //			popup.Move(x + Allocation.X, y + Allocation.Y + req.Height + 3);
            popup.Move(xPos, yPos);
            popup.Show();
            popup.GrabFocus();

            Grab.Add(popup);

            Gdk.GrabStatus grabbed = Gdk.Pointer.Grab(popup.GdkWindow, true,
                                     Gdk.EventMask.ButtonPressMask
                                     | Gdk.EventMask.ButtonReleaseMask
                                     | Gdk.EventMask.PointerMotionMask, null, null, CURRENT_TIME);

            if (grabbed == Gdk.GrabStatus.Success) {
                grabbed = Gdk.Keyboard.Grab(popup.GdkWindow,
                                            true, CURRENT_TIME);

                if (grabbed != Gdk.GrabStatus.Success) {
                    Grab.Remove(popup);
                    popup.Destroy();
                    popup = null;
                }
            } else {
                Grab.Remove(popup);
                popup.Destroy();
                popup = null;
            }

            cal.DaySelected += OnCalendarDaySelected;
            cal.MonthChanged += OnCalendarMonthChanged;

            cal.Date = date;
        }
Example #15
0
        private void ShowCalendar()
        {
            popup = new Window(WindowType.Popup);
            popup.Screen = tree.Screen;

            Frame frame = new Frame();
            frame.Shadow = ShadowType.Out;
            frame.Show();

            popup.Add(frame);

            VBox box = new VBox(false, 0);
            box.Show();
            frame.Add(box);

            cal = new Calendar();
            cal.DisplayOptions = CalendarDisplayOptions.ShowHeading
                                 | CalendarDisplayOptions.ShowDayNames
                                 | CalendarDisplayOptions.ShowWeekNumbers;

            cal.KeyPressEvent += OnCalendarKeyPressed;
            popup.ButtonPressEvent += OnButtonPressed;

            cal.Show();

            Alignment calAlignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);
            calAlignment.Show();
            calAlignment.SetPadding(4, 4, 4, 4);
            calAlignment.Add(cal);

            box.PackStart(calAlignment, false, false, 0);

            // FIXME: Make the popup appear directly below the date
            Gdk.Rectangle allocation = tree.Allocation;
            //   Gtk.Requisition req = tree.SizeRequest ();
            int x = 0, y = 0;
            tree.GdkWindow.GetOrigin(out x, out y);
            //   popup.Move(x + allocation.X, y + allocation.Y + req.Height + 3);
            popup.Move(x + allocation.X, y + allocation.Y);
            popup.Show();
            popup.GrabFocus();

            Grab.Add(popup);

            Gdk.GrabStatus grabbed = Gdk.Pointer.Grab(popup.GdkWindow, true,
                                     Gdk.EventMask.ButtonPressMask
                                     | Gdk.EventMask.ButtonReleaseMask
                                     | Gdk.EventMask.PointerMotionMask, null, null, CURRENT_TIME);

            if (grabbed == Gdk.GrabStatus.Success) {
                grabbed = Gdk.Keyboard.Grab(popup.GdkWindow,
                                            true, CURRENT_TIME);

                if (grabbed != Gdk.GrabStatus.Success) {
                    Grab.Remove(popup);
                    popup.Destroy();
                    popup = null;
                }
            } else {
                Grab.Remove(popup);
                popup.Destroy();
                popup = null;
            }

            cal.DaySelectedDoubleClick += OnCalendarDaySelected;
            cal.ButtonPressEvent += OnCalendarButtonPressed;

            cal.Date = date == DateTime.MinValue ? DateTime.Now : date;
        }
		public PreviewVisualizerWindow (ObjectValue val, Gtk.Widget invokingWidget) : base (Gtk.WindowType.Toplevel)
		{
			this.TypeHint = WindowTypeHint.PopupMenu;
			this.Decorated = false;
			if (((Gtk.Window)invokingWidget.Toplevel).Modal)
				this.Modal = true;
			TransientFor = (Gtk.Window) invokingWidget.Toplevel;

			Theme.SetFlatColor (new Cairo.Color (245 / 256.0, 245 / 256.0, 245 / 256.0));
			Theme.Padding = 3;
			ShowArrow = true;
			var mainBox = new VBox ();
			var headerTable = new Table (1, 3, false);
			headerTable.ColumnSpacing = 5;
			var closeButton = new ImageButton () {
				InactiveImage = ImageService.GetIcon ("md-popup-close", IconSize.Menu),
				Image = ImageService.GetIcon ("md-popup-close-hover", IconSize.Menu)
			};
			closeButton.Clicked += delegate {
				this.Destroy ();
			};
			var hb = new HBox ();
			var vb = new VBox ();
			hb.PackStart (vb, false, false, 0);
			vb.PackStart (closeButton, false, false, 0);
			headerTable.Attach (hb, 0, 1, 0, 1);

			var headerTitle = new Label ();
			headerTitle.ModifyFg (StateType.Normal, new Color (36, 36, 36));
			var font = headerTitle.Style.FontDescription.Copy ();
			font.Weight = Pango.Weight.Bold;
			headerTitle.ModifyFont (font);
			headerTitle.Text = val.TypeName;
			var vbTitle = new VBox ();
			vbTitle.PackStart (headerTitle, false, false, 3);
			headerTable.Attach (vbTitle, 1, 2, 0, 1);

			if (DebuggingService.HasValueVisualizers (val)) {
				var openButton = new Button ();
				openButton.Label = "Open";
				openButton.Relief = ReliefStyle.Half;
				openButton.Clicked += delegate {
					PreviewWindowManager.DestroyWindow ();
					DebuggingService.ShowValueVisualizer (val);
				};
				var hbox = new HBox ();
				hbox.PackEnd (openButton, false, false, 2);
				headerTable.Attach (hbox, 2, 3, 0, 1);
			} else {
				headerTable.Attach (new Label (), 2, 3, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill | AttachOptions.Expand, 10, 0);
			}
			mainBox.PackStart (headerTable);
			mainBox.ShowAll ();

			var previewVisualizer = DebuggingService.GetPreviewVisualizer (val);
			if (previewVisualizer == null)
				previewVisualizer = new GenericPreviewVisualizer ();
			Control widget = null;
			try {
				widget = previewVisualizer.GetVisualizerWidget (val);
			} catch (Exception e) {
				DebuggingService.DebuggerSession.LogWriter (true, "Exception during preview widget creation: " + e.Message);
			}
			if (widget == null) {
				widget = new GenericPreviewVisualizer ().GetVisualizerWidget (val);
			}
			var alignment = new Alignment (0, 0, 1, 1);
			alignment.SetPadding (3, 5, 5, 5);
			alignment.Show ();
			alignment.Add (widget);
			mainBox.PackStart (alignment);
			ContentBox.Add (mainBox);
		}
Example #17
0
		public MainToolbar ()
		{
			WidgetFlags |= Gtk.WidgetFlags.AppPaintable;

			AddWidget (button);
			AddSpace (8);

			configurationCombo = new Gtk.ComboBox ();
			configurationCombo.Model = configurationStore;
			var ctx = new Gtk.CellRendererText ();
			configurationCombo.PackStart (ctx, true);
			configurationCombo.AddAttribute (ctx, "text", 0);

			configurationCombosBox = new HBox (false, 8);

			var configurationComboVBox = new VBox ();
			configurationComboVBox.PackStart (configurationCombo, true, false, 0);
			configurationCombosBox.PackStart (configurationComboVBox, false, false, 0);

			// bold attributes for running runtime targets / (emulators)
			boldAttributes.Insert (new Pango.AttrWeight (Pango.Weight.Bold));

			runtimeCombo = new Gtk.ComboBox ();
			runtimeCombo.Model = runtimeStore;
			ctx = new Gtk.CellRendererText ();
			if (Platform.IsWindows)
				ctx.Ellipsize = Pango.EllipsizeMode.Middle;
			runtimeCombo.PackStart (ctx, true);
			runtimeCombo.SetCellDataFunc (ctx, RuntimeRenderCell);
			runtimeCombo.RowSeparatorFunc = RuntimeIsSeparator;

			var runtimeComboVBox = new VBox ();
			runtimeComboVBox.PackStart (runtimeCombo, true, false, 0);
			configurationCombosBox.PackStart (runtimeComboVBox, false, false, 0);
			AddWidget (configurationCombosBox);

			buttonBarBox = new Alignment (0.5f, 0.5f, 0, 0);
			buttonBarBox.LeftPadding = (uint) 7;
			buttonBarBox.Add (buttonBar);
			buttonBarBox.NoShowAll = true;
			AddWidget (buttonBarBox);
			AddSpace (24);

			statusArea = new StatusArea ();
			statusArea.ShowMessage (BrandingService.ApplicationName);

			var statusAreaAlign = new Alignment (0, 0, 1, 1);
			statusAreaAlign.Add (statusArea);
			contentBox.PackStart (statusAreaAlign, true, true, 0);
			AddSpace (24);

			statusAreaAlign.SizeAllocated += (object o, SizeAllocatedArgs args) => {
				Gtk.Widget toplevel = this.Toplevel;
				if (toplevel == null)
					return;

				int windowWidth = toplevel.Allocation.Width;
				int center = windowWidth / 2;
				int left = Math.Max (center - 300, args.Allocation.Left);
				int right = Math.Min (left + 600, args.Allocation.Right);
				uint left_padding = (uint) (left - args.Allocation.Left);
				uint right_padding = (uint) (args.Allocation.Right - right);

				if (left_padding != statusAreaAlign.LeftPadding || right_padding != statusAreaAlign.RightPadding)
					statusAreaAlign.SetPadding (0, 0, (uint) left_padding, (uint) right_padding);
			};

			matchEntry = new SearchEntry ();

			matchEntry.ForceFilterButtonVisible = true;
			matchEntry.Entry.FocusOutEvent += (o, e) => {
				if (SearchEntryLostFocus != null)
					SearchEntryLostFocus (o, e);
			};

			matchEntry.Ready = true;
			matchEntry.Visible = true;
			matchEntry.IsCheckMenu = true;
			matchEntry.WidthRequest = 240;
			if (!Platform.IsMac && !Platform.IsWindows)
				matchEntry.Entry.ModifyFont (Pango.FontDescription.FromString ("Sans 9")); // TODO: VV: "Segoe UI 9"
			matchEntry.RoundedShape = true;
			matchEntry.Entry.Changed += HandleSearchEntryChanged;
			matchEntry.Activated += HandleSearchEntryActivated;
			matchEntry.Entry.KeyPressEvent += HandleSearchEntryKeyPressed;
			SizeAllocated += (o, e) => {
				if (SearchEntryResized != null)
					SearchEntryResized (o, e);
			};

			contentBox.PackStart (matchEntry, false, false, 0);

			var align = new Gtk.Alignment (0, 0, 1f, 1f);
			align.Show ();
			align.TopPadding = (uint) 5;
			align.LeftPadding = (uint) 9;
			align.RightPadding = (uint) 18;
			align.BottomPadding = (uint) 10;
			align.Add (contentBox);

			Add (align);
			SetDefaultSizes (-1, 21);

			configurationCombo.Changed += (o, e) => {
				if (ConfigurationChanged != null)
					ConfigurationChanged (o, e);
			};
			runtimeCombo.Changed += (o, e) => {
				var ea = new HandledEventArgs ();
				if (RuntimeChanged != null)
					RuntimeChanged (o, ea);

				TreeIter it;
				if (runtimeCombo.GetActiveIter (out it)) {
					if (ea.Handled) {
						runtimeCombo.SetActiveIter (lastSelection);
						return;
					}
					lastSelection = it;
				}
			};

			button.Clicked += HandleStartButtonClicked;

			IdeApp.CommandService.ActiveWidgetChanged += (sender, e) => {
				lastCommandTarget = new WeakReference (e.OldActiveWidget);
			};

			this.ShowAll ();
			this.statusArea.statusIconBox.HideAll ();
		}
		public WelcomePageWidget ()
		{
			ShowScrollbars = true;
			VisibleWindow = false;

			BackgroundColor = "white";
			LogoHeight = 90;

			var background = new WelcomePageWidgetBackground ();
			Background = background;
			background.Owner = this;
			var mainAlignment = new Gtk.Alignment (0f, 0f, 1f, 1f);
			background.Add (mainAlignment);

			BuildContent (mainAlignment);

			if (ShowScrollbars) {
				var scroller = new ScrolledWindow ();
				scroller.AddWithViewport (background);
				((Gtk.Viewport)scroller.Child).ShadowType = ShadowType.None;
				scroller.ShadowType = ShadowType.None;
				scroller.FocusChain = new Widget[] { background };
				scroller.Show ();
				Add (scroller);
			} else
				this.Add (background);

			if (LogoImage != null) {
				var logoHeight = LogoHeight;
				mainAlignment.SetPadding ((uint)(logoHeight + Styles.WelcomeScreen.Spacing), 0, (uint)Styles.WelcomeScreen.Spacing, 0);
			}

			ShowAll ();

			IdeApp.Workbench.GuiLocked += OnLock;
			IdeApp.Workbench.GuiUnlocked += OnUnlock;
		}
Example #19
0
		public void UpdateTab ()
		{
			if (Child != null) {
				Widget w = Child;
				Remove (w);
				w.Destroy ();
			}
			
			mainBox = new Alignment (0,0,1,1);
			if (bar.Orientation == Gtk.Orientation.Horizontal) {
				box = new HBox ();
				if (bar.AlignToEnd)
					mainBox.SetPadding (3, 3, 11, 9);
				else
					mainBox.SetPadding (3, 3, 9, 11);
			}
			else {
				box = new VBox ();
				if (bar.AlignToEnd)
					mainBox.SetPadding (11, 9, 3, 3);
				else
					mainBox.SetPadding (9, 11, 3, 3);
			}
			
			Gtk.Widget customLabel = null;
			if (it.DockLabelProvider != null)
				customLabel = it.DockLabelProvider.CreateLabel (bar.Orientation);
			
			if (customLabel != null) {
				customLabel.ShowAll ();
				box.PackStart (customLabel, true, true, 0);
			}
			else {
				if (it.Icon != null) {
					var desat = it.Icon.WithAlpha (0.5);
					crossfade = new CrossfadeIcon (desat, it.Icon);
					box.PackStart (crossfade, false, false, 0);
					desat.Dispose ();
				}
					
				if (!string.IsNullOrEmpty (it.Label)) {
					label = new Gtk.Label (it.Label);
					label.UseMarkup = true;
					if (bar.Orientation == Gtk.Orientation.Vertical)
						label.Angle = 270;
					box.PackStart (label, true, true, 0);
				} else
					label = null;
			}

			box.Spacing = 2;
			mainBox.Add (box);
			mainBox.ShowAll ();
			Add (mainBox);
			QueueDraw ();
		}
		Gtk.Widget AddFeature (ISolutionItemFeature feature)
		{
			Gtk.HBox cbox = new Gtk.HBox ();
			CheckButton check = null;
			
			Label fl = new Label ();
			fl.Wrap = true;
			fl.WidthRequest = 630;
			fl.Markup = "<b>" + feature.Title + "</b>\n<small>" + feature.Description + "</small>";
			bool enabledByDefault = feature.GetSupportLevel (parentCombine, entry) == FeatureSupportLevel.Enabled;

			if (enabledByDefault) {
				Alignment al = new Alignment (0,0,0,0);
				al.SetPadding (6,6,6,6);
				al.Add (fl);
				cbox.PackStart (al, false, false, 0);
			}
			else {
				check = new CheckButton ();
				check.Image = fl;
				cbox.PackStart (check, false, false, 0);
				check.ModifyBg (StateType.Prelight, Style.MidColors [(int)StateType.Normal]);
				check.BorderWidth = 3;
			}
			EventBox eb = new EventBox ();
			if (!enabledByDefault) {
				eb.Realized += delegate {
					eb.GdkWindow.Cursor = handCursor;
				};
			}
			eb.ModifyBg (StateType.Normal, Style.MidColors[(int)StateType.Normal]);
			eb.Add (cbox);
			eb.ShowAll ();
			box.PackStart (eb, false, false, 0);
			
			HBox fbox = new HBox ();
			Gtk.Widget editor = feature.CreateFeatureEditor (parentCombine, entry);
			if (editor != null) {
				Label sp = new Label ("");
				sp.WidthRequest = 24;
				sp.Show ();
				fbox.PackStart (sp, false, false, 0);
				editor.Show ();
				fbox.PackStart (editor, false, false, 0);
				box.PackStart (fbox, false, false, 0);
			}
			
			if (check != null) {
				ISolutionItemFeature f = feature;
				check.Toggled += delegate {
					OnClickFeature (f, check, fbox, editor);
				};
			} else {
				fbox.Show ();
			}
			return editor;
		}
        public QueryBuilder(QueryBuilderModel model)
            : base()
        {
            this.model = model;

            matchesBox = new QueryBuilderMatches(model);
            matchesBox.Spacing = 5;
            matchesBox.Show();

            Alignment matchesAlignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);
            matchesAlignment.Show();
            matchesAlignment.SetPadding(10, 10, 10, 10);
            matchesAlignment.Add(matchesBox);

            Frame matchesFrame = new Frame(null);
            matchesFrame.Show();
            matchesFrame.Add(matchesAlignment);

            matchesFrame.LabelWidget = BuildMatchHeader();

            PackStart(matchesFrame, true, true, 0);
            PackStart(BuildLimitFooter(), false, false, 0);
        }
		public MonoGameContentEditorViewContent (MonoDevelop.Core.FilePath filename, MonoDevelop.Projects.Project project)
		{
			this.ContentName = Path.GetFileName (filename.ToString());
			this.Project = project;
			control = new Alignment (0, 0, 1, 1);
			control.SetPadding (5, 5, 5, 5);

			view = new Pipeline.MacOS.MainView (null);

			if (filename != null) {
				view.OpenProjectPath = filename.ToString();
			}
			Pipeline.MacOS.MainView.CreateControllers (view);
			view.BuildUI ();

			control.Add (view);

			control.ShowAll ();
		}
Example #23
0
		public PaletteGroup (string name) : base ("<b>" + name + "</b>")
		{
			vbox = new VBox (false, 0);
			emptyLabel = new Gtk.Label ();
			emptyLabel.Markup = "<small><i><span foreground='darkgrey'>  " + Catalog.GetString ("Empty") + "</span></i></small>";
			vbox.PackStart (emptyLabel, false, false, 0);
			
			align = new Gtk.Alignment (0, 0, 0, 0);
			align.SetPadding (0, 0, 20, 0);
			align.Child = vbox;

			UseMarkup = true;
			Expanded = true;
			Child = align;
		}
Example #24
0
		public MainToolbar ()
		{
			executionTargetsChanged = DispatchService.GuiDispatch (new EventHandler (HandleExecutionTargetsChanged));

			IdeApp.Workspace.ActiveConfigurationChanged += (sender, e) => UpdateCombos ();
			IdeApp.Workspace.ConfigurationsChanged += (sender, e) => UpdateCombos ();

			IdeApp.Workspace.SolutionLoaded += (sender, e) => UpdateCombos ();
			IdeApp.Workspace.SolutionUnloaded += (sender, e) => UpdateCombos ();

			IdeApp.ProjectOperations.CurrentSelectedSolutionChanged += HandleCurrentSelectedSolutionChanged;

			WidgetFlags |= Gtk.WidgetFlags.AppPaintable;

			AddWidget (button);
			AddSpace (8);

			configurationCombo = new Gtk.ComboBox ();
			configurationCombo.Model = configurationStore;
			var ctx = new Gtk.CellRendererText ();
			configurationCombo.PackStart (ctx, true);
			configurationCombo.AddAttribute (ctx, "text", 0);

			configurationCombosBox = new HBox (false, 8);

			var configurationComboVBox = new VBox ();
			configurationComboVBox.PackStart (configurationCombo, true, false, 0);
			configurationCombosBox.PackStart (configurationComboVBox, false, false, 0);

			runtimeCombo = new Gtk.ComboBox ();
			runtimeCombo.Model = runtimeStore;
			ctx = new Gtk.CellRendererText ();
			runtimeCombo.PackStart (ctx, true);
			runtimeCombo.SetCellDataFunc (ctx, RuntimeRenderCell);
			runtimeCombo.RowSeparatorFunc = RuntimeIsSeparator;

			var runtimeComboVBox = new VBox ();
			runtimeComboVBox.PackStart (runtimeCombo, true, false, 0);
			configurationCombosBox.PackStart (runtimeComboVBox, false, false, 0);
			AddWidget (configurationCombosBox);

			buttonBarBox = new Alignment (0.5f, 0.5f, 0, 0);
			buttonBarBox.LeftPadding = (uint) 7;
			buttonBarBox.Add (buttonBar);
			buttonBarBox.NoShowAll = true;
			AddWidget (buttonBarBox);
			AddSpace (24);

			statusArea = new StatusArea ();
			statusArea.ShowMessage (BrandingService.ApplicationName);

			var statusAreaAlign = new Alignment (0, 0, 1, 1);
			statusAreaAlign.Add (statusArea);
			contentBox.PackStart (statusAreaAlign, true, true, 0);
			AddSpace (24);

			statusAreaAlign.SizeAllocated += (object o, SizeAllocatedArgs args) => {
				Gtk.Widget toplevel = this.Toplevel;
				if (toplevel == null)
					return;

				int windowWidth = toplevel.Allocation.Width;
				int center = windowWidth / 2;
				int left = Math.Max (center - 300, args.Allocation.Left);
				int right = Math.Min (left + 600, args.Allocation.Right);
				uint left_padding = (uint) (left - args.Allocation.Left);
				uint right_padding = (uint) (args.Allocation.Right - right);

				if (left_padding != statusAreaAlign.LeftPadding || right_padding != statusAreaAlign.RightPadding)
					statusAreaAlign.SetPadding (0, 0, (uint) left_padding, (uint) right_padding);
			};

			matchEntry = new SearchEntry ();

			var searchFiles = this.matchEntry.AddMenuItem (GettextCatalog.GetString ("Search Files"));
			searchFiles.Activated += delegate {
				SetSearchCategory ("files");
			};
			var searchTypes = this.matchEntry.AddMenuItem (GettextCatalog.GetString ("Search Types"));
			searchTypes.Activated += delegate {
				SetSearchCategory ("type");
			};
			var searchMembers = this.matchEntry.AddMenuItem (GettextCatalog.GetString ("Search Members"));
			searchMembers.Activated += delegate {
				SetSearchCategory ("member");
			};

			matchEntry.ForceFilterButtonVisible = true;
			matchEntry.Entry.FocusOutEvent += delegate {
				matchEntry.Entry.Text = "";
			};
			var cmd = IdeApp.CommandService.GetCommand (Commands.NavigateTo);
			cmd.KeyBindingChanged += delegate {
				UpdateSearchEntryLabel ();
			};
			UpdateSearchEntryLabel ();

			matchEntry.Ready = true;
			matchEntry.Visible = true;
			matchEntry.IsCheckMenu = true;
			matchEntry.Entry.ModifyBase (StateType.Normal, Style.White);
			matchEntry.WidthRequest = 240;
			matchEntry.RoundedShape = true;
			matchEntry.Entry.Changed += HandleSearchEntryChanged;
			matchEntry.Activated += (sender, e) => {
				var pattern = SearchPopupSearchPattern.ParsePattern (matchEntry.Entry.Text);
				if (pattern.Pattern == null && pattern.LineNumber > 0) {
					popup.Destroy ();
					var doc = IdeApp.Workbench.ActiveDocument;
					if (doc != null && doc != null) {
						doc.Select ();
						doc.Editor.Caret.Location = new Mono.TextEditor.DocumentLocation (pattern.LineNumber, pattern.Column > 0 ? pattern.Column : 1);
						doc.Editor.CenterToCaret ();
						doc.Editor.Parent.StartCaretPulseAnimation ();
					}
					return;
				}
				if (popup != null)
					popup.OpenFile ();
			};
			matchEntry.Entry.KeyPressEvent += (o, args) => {
				if (args.Event.Key == Gdk.Key.Escape) {
					var doc = IdeApp.Workbench.ActiveDocument;
					if (doc != null) {
						if (popup != null)
							popup.Destroy ();
						doc.Select ();
					}
					return;
				}
				if (popup != null) {
					args.RetVal = popup.ProcessKey (args.Event.Key, args.Event.State);
				}
			};
			IdeApp.Workbench.RootWindow.WidgetEvent += delegate(object o, WidgetEventArgs args) {
				if (args.Event is Gdk.EventConfigure)
					PositionPopup ();
			};

			BuildToolbar ();
			IdeApp.CommandService.RegisterCommandBar (buttonBar);

			AddinManager.ExtensionChanged += delegate(object sender, ExtensionEventArgs args) {
				if (args.PathChanged (ToolbarExtensionPath))
					BuildToolbar ();
			};

			contentBox.PackStart (matchEntry, false, false, 0);

			var align = new Gtk.Alignment (0, 0, 1f, 1f);
			align.Show ();
			align.TopPadding = (uint) 5;
			align.LeftPadding = (uint) 9;
			align.RightPadding = (uint) 18;
			align.BottomPadding = (uint) 10;
			align.Add (contentBox);

			Add (align);
			SetDefaultSizes (-1, 21);
			UpdateCombos ();

			button.Clicked += HandleStartButtonClicked;
			IdeApp.CommandService.RegisterCommandBar (this);

			IdeApp.CommandService.ActiveWidgetChanged += (sender, e) => {
				lastCommandTarget = e.OldActiveWidget;
			};

			this.ShowAll ();
			this.statusArea.statusIconBox.HideAll ();
		}
        public RtmPreferencesWidget(RtmBackend backend, IPreferences preferences)
            : base()
        {
            if (backend == null)
                throw new ArgumentNullException ("backend");
            if (preferences == null)
                throw new ArgumentNullException ("preferences");
            this.backend = backend;
            this.preferences = preferences;

            LoadPreferences ();

            BorderWidth = 0;

            // We're using an event box so we can paint the background white
            EventBox imageEb = new EventBox ();
            imageEb.BorderWidth = 0;
            imageEb.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255));
            imageEb.ModifyBase(StateType.Normal, new Gdk.Color(255,255,255));
            imageEb.Show ();

            VBox mainVBox = new VBox(false, 0);
            mainVBox.BorderWidth = 10;
            mainVBox.Show();
            Add(mainVBox);

            // Add the rtm logo
            image = new Gtk.Image (normalPixbuf);
            image.Show();
            //make the dialog box look pretty without hard coding total size and
            //therefore clipping displays with large fonts.
            Alignment spacer = new Alignment((float)0.5, 0, 0, 0);
            spacer.SetPadding(0, 0, 125, 125);
            spacer.Add(image);
            spacer.Show();
            imageEb.Add (spacer);
            mainVBox.PackStart(imageEb, true, true, 0);

            // Status message label
            statusLabel = new Label();
            statusLabel.Justify = Gtk.Justification.Center;
            statusLabel.Wrap = true;
            statusLabel.LineWrap = true;
            statusLabel.Show();
            statusLabel.UseMarkup = true;
            statusLabel.UseUnderline = false;

            authButton = new LinkButton (
            #if GETTEXT
            Catalog.GetString ("Click Here to Connect"));
            #elif ANDROID

            #endif
            authButton.Clicked += OnAuthButtonClicked;

            if ( isAuthorized ) {
                statusLabel.Text = "\n\n" +
            #if GETTEXT
                    Catalog.GetString ("You are currently connected");
            #elif ANDROID

            #endif
                string userName = preferences.Get (PreferencesKeys.UserNameKey);
                if (userName != null && userName.Trim () != string.Empty)
                    statusLabel.Text = "\n\n" +
            #if GETTEXT
                        Catalog.GetString ("You are currently connected as") +
            #elif ANDROID

            #endif
                        "\n" + userName.Trim();
            } else {
                statusLabel.Text = "\n\n" +
            #if GETTEXT
                    Catalog.GetString ("You are not connected");
            #elif ANDROID

            #endif
                authButton.Show();
            }
            mainVBox.PackStart(statusLabel, false, false, 0);
            mainVBox.PackStart(authButton, false, false, 0);

            Label blankLabel = new Label("\n");
            blankLabel.Show();
            mainVBox.PackStart(blankLabel, false, false, 0);
        }