Exemplo n.º 1
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;
        }
        public PopoverWindow(Gtk.WindowType type) : base(type)
        {
            SkipTaskbarHint = true;
            SkipPagerHint   = true;
            AppPaintable    = true;
            TypeHint        = WindowTypeHint.Tooltip;
            CheckScreenColormap();

            alignment = new Alignment(0, 0, 1f, 1f);
            alignment.Show();
            Add(alignment);

            disableSizeCheck = false;

            SizeRequested += (object o, SizeRequestedArgs args) => {
                if (this.AnimationIsRunning("Resize") && !disableSizeCheck)
                {
                    Gtk.Requisition result = new Gtk.Requisition();
                    result.Width     = Math.Max(args.Requisition.Width, Math.Max(Allocation.Width, targetSize.Width));
                    result.Height    = Math.Max(args.Requisition.Height, Math.Max(Allocation.Height, targetSize.Height));
                    args.Requisition = result;
                }
            };

            UpdatePadding();
        }
Exemplo n.º 3
0
        public ThemeTestModule()
            : base("Theme")
        {
            var align = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
            var theme_widget = new ThemeTestWidget ();
            align.Add (theme_widget);
            Add (align);
            ShowAll ();

            int state = 0;
            uint[,] borders = {
                {0, 0, 0, 0},
                {10, 0, 0, 0},
                {0, 10, 0, 0},
                {0, 0, 10, 0},
                {0, 0, 0, 10},
                {10, 10, 0, 0},
                {10, 10, 10, 0},
                {10, 10, 10, 10},
                {10, 0, 0, 10},
                {0, 10, 10, 0}
            };

            GLib.Timeout.Add (2000, delegate {
                Console.WriteLine (state);
                align.TopPadding = borders[state, 0];
                align.RightPadding = borders[state, 1];
                align.BottomPadding = borders[state, 2];
                align.LeftPadding = borders[state, 3];
                if (++state % borders.GetLength (0) == 0) {
                    state = 0;
                }
                return true;
            });
        }
Exemplo n.º 4
0
        public LyricsHelp()
            : base(false, 0)
        {
            Label title = new Label ();
            Label details1 = new Label ();
            Label details2 = new Label ();

            title.Markup = "<b><big><big>Lyrics</big></big></b>";

            details1.Markup = "This panel displays the lyrics of the currently playing song";
            details2.Markup = "You can also search for an artist below which will give you a list of albums and tracks to choose from";

            details1.Wrap = true;
            details2.Wrap = true;

            VBox box = new VBox (false, 40);
            box.PackStart (details1, false, false, 0);
            box.PackStart (details2, false, false, 0);

            Alignment align = new Alignment (0.5f, 0.5f, 0, 0);
            align.Add (box);

            this.PackStart (title, false, false, 0);
            this.PackStart (new HSeparator (), false, false, 5);
            this.PackStart (align, true, true, 0);
            this.PackStart (new Image (null, "lyricwiki-logo.png"), false, false, 0);
        }
Exemplo n.º 5
0
		public DocumentOutlinePad ()
		{
			box = new Gtk.Alignment (0, 0, 1, 1);
			box.BorderWidth = 0;
			SetWidget (null);
			box.ShowAll ();
		}
 protected virtual void Build()
 {
     Gui.Initialize (this);
     // Widget BolPatcher.MenuGameWidget
     BinContainer.Attach (this);
     Name = "BolPatcher.MenuGameWidget";
     // Container child BolPatcher.MenuGameWidget.Gtk.Container+ContainerChild
     _frame1 = new Frame ();
     _frame1.Name = "frame1";
     _frame1.ShadowType = 0;
     // Container child frame1.Gtk.Container+ContainerChild
     _gtkAlignment = new Alignment (0F, 0F, 1F, 1F);
     _gtkAlignment.Name = "GtkAlignment";
     _gtkAlignment.LeftPadding = 12;
     // Container child GtkAlignment.Gtk.Container+ContainerChild
     _button2 = new Button ();
     _button2.CanFocus = true;
     _button2.Name = "button2";
     _button2.UseUnderline = true;
     _button2.Label = Catalog.GetString ("GtkButton");
     _gtkAlignment.Add (_button2);
     _frame1.Add (_gtkAlignment);
     _gtkLabel1 = new Label ();
     _gtkLabel1.Name = "GtkLabel1";
     _gtkLabel1.LabelProp = Catalog.GetString ("<b>GtkFrame</b>");
     _gtkLabel1.UseMarkup = true;
     _frame1.LabelWidget = _gtkLabel1;
     Add (_frame1);
     if ((Child != null)) {
         Child.ShowAll ();
     }
     Hide ();
 }
		public EnableStartupNotesPreference ()
		{
			IPropertyEditorBool enableStartupNotes_peditor;
			Gtk.CheckButton enableStartupNotesCheckbox;
			Gtk.Label enableStartupNotesLabel;

			// Enable Startup Notes option
			enableStartupNotesLabel = new Gtk.Label (Catalog.GetString ("Enable startup notes"));
			enableStartupNotesLabel.UseMarkup = true;
			enableStartupNotesLabel.Justify = Gtk.Justification.Left;
			enableStartupNotesLabel.SetAlignment (0.0f, 0.5f);
			enableStartupNotesLabel.Show ();

			enableStartupNotesCheckbox = new Gtk.CheckButton ();
			enableStartupNotesCheckbox.Add (enableStartupNotesLabel);
			enableStartupNotesCheckbox.Show ();

			enableStartupNotes_peditor =
				Services.Factory.CreatePropertyEditorToggleButton (Preferences.ENABLE_STARTUP_NOTES, enableStartupNotesCheckbox);
			Preferences.Get (enableStartupNotes_peditor.Key);
			enableStartupNotes_peditor.Setup ();

			align = new Gtk.Alignment (0.0f, 0.0f, 0.0f, 1.0f);
			align.Show ();
			align.Add (enableStartupNotesCheckbox);
		}
Exemplo n.º 8
0
        public PopupWindow(Gtk.Widget child) : base(WindowType.Popup)
        {
            AppPaintable    = true;
            Decorated       = false;
            SkipPagerHint   = true;
            SkipTaskbarHint = true;
            TypeHint        = Gdk.WindowTypeHint.PopupMenu;

            AddEvents((int)Gdk.EventMask.FocusChangeMask);
            DefaultHeight = DefaultWidth = 1;
            var _frame = new Frame()
            {
                Shadow = ShadowType.EtchedIn
            };

            _alignment = new Gtk.Alignment(0, 0, 1, 1);
            _frame.Add(_alignment);
            Add(_frame);
            if (child != null)
            {
                this._alignment.Add(child);
                //TransientFor = (Gtk.Window)child.Toplevel;
            }
            FocusOutEvent += HandleFocusOutEvent;
            AcceptFocus    = true;
            CanFocus       = true;

            Resizable = true;
            OnScreenChanged(null);
        }
Exemplo n.º 9
0
        void Install(Gtk.Alignment commandBox, Button installButton, Update update)
        {
            if (update.InstallAction == null)
            {
                DesktopService.ShowUrl(update.Url);
                return;
            }

            installButton.Hide();

            if (installing)
            {
                Gtk.Label lab = new Gtk.Label(GettextCatalog.GetString("Waiting"));
                commandBox.Child.Destroy();
                commandBox.Add(lab);
                lab.Show();
                installQueue.Enqueue(delegate {
                    lab.Hide();
                    RunInstall(commandBox, update);
                });
                return;
            }

            RunInstall(commandBox, update);
        }
Exemplo n.º 10
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;
        }
		public MonoMacPackagingSettingsDialog ()
		{
			this.Title = GettextCatalog.GetString ("Create Mac Installer");
			this.DestroyWithParent = true;
			this.Modal = true;
			
			settingsWidget.Show ();
			
			var al = new Alignment (0.5f, 0.5f, 1.0f, 1.0f) {
				TopPadding = 12,
				BottomPadding = 12,
				RightPadding = 12,
				LeftPadding = 12,
				Child = settingsWidget,
			};
			al.Show ();
			
			this.VBox.PackStart (al, true, true, 0);
			var okButton = new Button () {
				Label = GettextCatalog.GetString ("Create Package")
			};
			var cancelButton = new Button (Stock.Cancel);
			
			this.AddActionWidget (cancelButton, ResponseType.Cancel);
			this.AddActionWidget (okButton, ResponseType.Ok);
			this.ActionArea.ShowAll ();
		}
Exemplo n.º 12
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 ();
        }
Exemplo n.º 13
0
        public DockMenu(Gtk.Window parent) : base(Gtk.WindowType.Popup)
        {
            SetLight();

            AcceptFocus     = false;
            Decorated       = false;
            KeepAbove       = true;
            AppPaintable    = true;
            SkipPagerHint   = true;
            SkipTaskbarHint = true;
            Resizable       = false;
            Modal           = true;
            TypeHint        = WindowTypeHint.Dock;

            AddEvents((int)Gdk.EventMask.AllEventsMask);

            this.SetCompositeColormap();

            Container = new Gtk.Alignment(0.5f, 0.5f, 0, 0);
            Container.Show();

            Add(Container);

            SetPadding();

            DockServices.Theme.ThemeChanged      += DockyControllerThemeChanged;
            Gdk.Screen.Default.CompositedChanged += HandleCompositedChanged;
        }
Exemplo n.º 14
0
        protected void Construct (Widget buttonWidget, Menu menu, bool showArrow)
        {
            WidgetFlags |= WidgetFlags.NoWindow;

            button_widget = buttonWidget;
            Menu = menu;

            toggle_button.Parent = this;
            toggle_button.FocusOnClick = false;
            toggle_button.Relief = ReliefStyle.None;
            toggle_button.Pressed += delegate { ShowMenu (); toggle_button.Active = true; };
            toggle_button.Activated += delegate { ShowMenu (); };

            box.Parent = this;

            if (showArrow) {
                box.PackStart (button_widget, true, true, 0);
                alignment = new Alignment (0f, 0.5f, 0f, 0f);
                arrow = new Arrow (ArrowType.Down, ShadowType.None);
                alignment.Add (arrow);
                box.PackStart (alignment, false, false, 5);
                size_widget = box;
                FocusChain = new Widget[] {toggle_button, box};
                alignment.ShowAll ();
                alignment.NoShowAll = true;
            } else {
                toggle_button.Add (button_widget);
                size_widget = toggle_button;
            }

            ShowAll ();
        }
		public void AddMessage (string msg, IconId icon)
		{
			if (lastImage != null) {
				HSeparator sep = new HSeparator ();
				sep.Show ();
				msgBox.PackStart (sep, false, false, 0);
				lastImage.IconSize = Gtk.IconSize.Menu;
			}
			
			HBox box = new HBox ();
			box.Spacing = 12;
			Alignment imgBox = new Alignment (0, 0, 0, 0);
			var img = new ImageView (icon, lastImage != null ? Gtk.IconSize.Menu : IconSize.Dialog);
			imgBox.Add (img);
			lastImage = img;
			box.PackStart (imgBox, false, false, 0);
			Label lab = new Label (msg);
			lab.UseUnderline = false;
			lab.Xalign = 0;
			lab.Yalign = 0;
			lab.Wrap = true;
			lab.WidthRequest = 500;
			box.PackStart (lab, true, true, 0);
			msgBox.PackStart (box, false, false, 0);
			box.ShowAll ();
		}
Exemplo n.º 16
0
        public MainWindow_2()
            : base("Allignment")
        {
            SetDefaultSize(260, 150);
            SetPosition(WindowPosition.Center);
            DeleteEvent += delegate { Application.Quit(); };

            VBox vbox = new VBox(false, 5);
            HBox hbox = new HBox(true, 3);

            Alignment valign = new Alignment(0, 0.5f, 0, 0);
            vbox.PackStart(valign);

            Button ok = new Button("OK");
            ok.SetSizeRequest(70, 30);
            Button close = new Button("Close");

            hbox.Add(ok);
            hbox.Add(close);

            Alignment halign = new Alignment(0.5f, 0, 0, 0);
            halign.Add(hbox);

            vbox.PackStart(halign, false, false, 3);

            Add(vbox);

            ShowAll();
        }
Exemplo n.º 17
0
		public PopoverWindow (Gtk.WindowType type) : base(type)
		{
			SkipTaskbarHint = true;
			SkipPagerHint = true;
			AppPaintable = true;
			TypeHint = WindowTypeHint.Tooltip;
			CheckScreenColormap ();

			alignment = new Alignment (0, 0, 1f, 1f);
			alignment.Show ();
			Add (alignment);

			disableSizeCheck = false;

			SizeRequested += (object o, SizeRequestedArgs args) => {
				if (this.AnimationIsRunning("Resize") && !disableSizeCheck) {
					Gtk.Requisition result = new Gtk.Requisition ();
					result.Width  = Math.Max (args.Requisition.Width, Math.Max (Allocation.Width, targetSize.Width));
					result.Height = Math.Max (args.Requisition.Height, Math.Max (Allocation.Height, targetSize.Height));
					args.Requisition = result;
				}
			};

			UpdatePadding ();
		}
Exemplo n.º 18
0
        public ArtistInfoHelp()
            : base(false, 0)
        {
            Label title = new Label ();
            Label details1 = new Label ();
            Label details2 = new Label ();
            Label details3 = new Label ();

            title.Markup = "<b><big><big>Artist Info</big></big></b>";

            details1.Markup = "This panel displays information about the currently playing artist such as:";
            details2.Markup = "<i>Similar Artists\nSimilar Tracks\nTop Albums\nTop Tracks\nAlbum Details</i>";
            details3.Markup = "You can also search for an artist below";

            details1.Wrap = true;
            details2.Wrap = true;
            details3.Wrap = true;

            VBox details_box = new VBox (false, 0);
            details_box.PackStart (details1, false, false, 0);
            details_box.PackStart (details2, false, false, 2);
            details_box.PackStart (details3, false, false, 40);

            Alignment align = new Alignment (0.5f, 0.5f, 0, 0);
            align.Add (details_box);

            this.PackStart (title, false, false, 0);
            this.PackStart (new HSeparator (), false, false, 5);
            this.PackStart (align, true, true, 0);
            this.PackStart (new Image (null, "audioscrobbler-logo.png"), false, false, 0);
        }
Exemplo n.º 19
0
		protected override void BuildContent (Container parent)
		{
			LogoImage = Xwt.Drawing.Image.FromResource ("WelcomePage_Logo.png");
			TopBorderImage = Xwt.Drawing.Image.FromResource ("WelcomePage_TopBorderRepeat.png");

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

			var mainCol = new WelcomePageColumn ();
			mainAlignment.Add (mainCol);

			var row1 = new WelcomePageRow ();
			row1.PackStart (new WelcomePageButtonBar (
				new WelcomePageBarButton ("MonoDevelop.com", "http://www.monodevelop.com", "link-cloud.png"),
				new WelcomePageBarButton (GettextCatalog.GetString ("Documentation"), "http://www.go-mono.com/docs", "link-info.png"),
				new WelcomePageBarButton (GettextCatalog.GetString ("Support"), "http://monodevelop.com/index.php?title=Help_%26_Contact", "link-heart.png"),
				new WelcomePageBarButton (GettextCatalog.GetString ("Q&A"), "http://stackoverflow.com/questions/tagged/monodevelop", "link-chat.png")
				)
			);
			mainCol.PackStart (row1, false, false, 0);

			var row2 = new WelcomePageRow (
				new WelcomePageColumn (
				new WelcomePageRecentProjectsList (GettextCatalog.GetString ("Solutions"))
				),
				new WelcomePageColumn (
					new WelcomePageNewsFeed (GettextCatalog.GetString ("Xamarin News"), "http://software.xamarin.com/Service/News", "NewsLinks")
				),
				new WelcomePageColumn (
					new WelcomePageTipOfTheDaySection ()
				)
			);
			mainCol.PackStart (row2, false, false, 0);

			parent.Add (mainAlignment);
		}
        public void InitComponents()
        {
            this.browser = new LyricsBrowser ();
            LyricsManager.Instance.LoadStarted += this.OnLoadStarted;
            LyricsManager.Instance.LoadFinished += this.OnLoadFinished;

            browser.InsertModeAvailable = false;
            label = new Label ();
            label.Xalign = 0;

            Gtk.Alignment label_align = new Gtk.Alignment (0, 0, 0, 0);
            label_align.TopPadding = 5;
            label_align.LeftPadding = 10;
            label_align.Add (label);

            this.scrollPane = new Gtk.ScrolledWindow ();
            this.scrollPane.HscrollbarPolicy = ((Gtk.PolicyType)(2));
            this.scrollPane.ShadowType = Gtk.ShadowType.None;
            this.scrollPane.Add (this.browser);

            PackStart (label_align, false, true, 0);
            PackStart (this.scrollPane, true, true, 0);

            this.ShowAll ();
        }
Exemplo n.º 21
0
        public MainWindow()
            : base(WindowType.Toplevel)
        {
            Name = "MainWindow";
            WindowPosition = ((WindowPosition)(4));
            DefaultWidth = 1280;
            DefaultHeight = 800;

            _north = new Alignment(0, 0, 1, 1);
            _south = new Alignment(0, 0, 1, 1);
            _west = new Alignment(0, 0, 1, 1);
            _east = new Alignment(0, 0, 1, 1);
            _center = new Alignment(0, 0, 1, 1);

            _vBox = new VBox(false, 0);
            _westAndRestHPaned = new HPaned();
            _westAndRestHPaned.Pack1(_west, false, false);
            _centerAndEastHPaned = new HPaned();
            _westAndRestHPaned.Pack2(_centerAndEastHPaned, true, true);
            _centerAndEastHPaned.Pack1(_center, true, true);
            _centerAndEastHPaned.Pack2(_east, true, true);

            _centerAndEastHPaned.Position = 1000;

            _vBox.PackStart(_north, false, false, 0);
            _vBox.PackStart(_westAndRestHPaned, true, true, 0);
            _vBox.PackStart(_south, false, false, 0);

            Add(_vBox);

            ShowAll();
        }
        public EnableStartupNotesPreference()
        {
            IPropertyEditorBool enableStartupNotes_peditor;

            Gtk.CheckButton enableStartupNotesCheckbox;
            Gtk.Label       enableStartupNotesLabel;

            // Enable Startup Notes option
            enableStartupNotesLabel           = new Gtk.Label(Catalog.GetString("Enable startup notes"));
            enableStartupNotesLabel.UseMarkup = true;
            enableStartupNotesLabel.Justify   = Gtk.Justification.Left;
            enableStartupNotesLabel.SetAlignment(0.0f, 0.5f);
            enableStartupNotesLabel.Show();

            enableStartupNotesCheckbox = new Gtk.CheckButton();
            enableStartupNotesCheckbox.Add(enableStartupNotesLabel);
            enableStartupNotesCheckbox.Show();

            enableStartupNotes_peditor =
                Services.Factory.CreatePropertyEditorToggleButton(Preferences.ENABLE_STARTUP_NOTES, enableStartupNotesCheckbox);
            Preferences.Get(enableStartupNotes_peditor.Key);
            enableStartupNotes_peditor.Setup();

            align = new Gtk.Alignment(0.0f, 0.0f, 0.0f, 1.0f);
            align.Show();
            align.Add(enableStartupNotesCheckbox);
        }
Exemplo n.º 23
0
        public InfoBar()
            : base()
        {
            // top panel bar
            Image close = new Image (Stock.Close, IconSize.Menu);
            close_box.Realized += close_box_realized;
            close_box.ButtonReleaseEvent += close_box_released;
            close_box.Add (close);

            Label title = new Label ();
            title.Markup = "<small>Information Bar</small>";
            title.Angle = 90;

            VBox left_box = new VBox (false, 0);
            left_box.PackStart (button_box, false, false, 0);
            left_box.PackStart (title, true, true, 0);

            Alignment align = new Alignment (1, 0.5f, 0, 0);
            align.Add (close_box);

            HBox panel_header = new HBox (false, 0);
            panel_header.PackStart (custom_align, true, true, 0);
            panel_header.PackStart (align, false, false, 0);

            panel_box.PackStart (panel_header, false, false, 0);

            panel_frame.Add (panel_box);
            main_box.PackStart (left_box, false, false, 0);
            this.PackStart (main_box, true, true, 0);

            addInfoPanel (new Lyrics (this), "Lyrics");
            addInfoPanel (new ArtistInfo (this), "Artist Info");
            addInfoPanel (new Profile (this), "Profile");
        }
Exemplo n.º 24
0
		public NotificationMessage (string t, string m) : base (false, 5)
		{
			this.Style = style;

			BorderWidth = 5;

			icon = new Image (Stock.DialogInfo, IconSize.Dialog);
			this.PackStart (icon, false, true, 5);

			VBox vbox = new VBox (false, 5);
			this.PackStart (vbox, true, true, 0);

			title = new Label ();
			title.SetAlignment (0.0f, 0.5f);
			this.Title = t;
			vbox.PackStart (title, false, true, 0);

			message = new Label ();
			message.LineWrap = true;
			message.SetSizeRequest (500, -1); // ugh, no way to sanely reflow a gtk label
			message.SetAlignment (0.0f, 0.0f);
			this.Message = m;			
			vbox.PackStart (message, true, true, 0);

			action_box = new HBox (false, 3);

			Button hide_button = new Button (Catalog.GetString ("Hide"));
			hide_button.Clicked += OnHideClicked;
			action_box.PackEnd (hide_button, false, true, 0);

			Alignment action_align = new Alignment (1.0f, 0.5f, 0.0f, 0.0f);
			action_align.Add (action_box);
			vbox.PackStart (action_align, false, true, 0);
		}
Exemplo n.º 25
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;
        }
Exemplo n.º 26
0
		public DemoColorSelection () : base ("Color Selection")
		{
			BorderWidth = 8;
			VBox vbox = new VBox (false,8);
			vbox.BorderWidth = 8;
			Add (vbox);

			// Create the color swatch area
			Frame frame = new Frame ();
			frame.ShadowType = ShadowType.In;
			vbox.PackStart (frame, true, true, 0);

			drawingArea = new DrawingArea ();
			// set a minimum size
			drawingArea.SetSizeRequest (200,200);
			// set the color
			color.Red = 0;
			color.Green = 0;
			color.Blue = 1;
			color.Alpha = 1;
			drawingArea.OverrideBackgroundColor (StateFlags.Normal, color);
			frame.Add (drawingArea);

			Alignment alignment = new Alignment (1.0f, 0.5f, 0.0f, 0.0f);
			Button button = new Button ("_Change the above color");
			button.Clicked += new EventHandler (ChangeColorCallback);
			alignment.Add (button);
			vbox.PackStart (alignment, false, false, 0);

			ShowAll ();
		}
Exemplo n.º 27
0
		public DemoColorSelection () : base ("Color Selection")
		{
			BorderWidth = 8;
			VBox vbox = new VBox (false,8);
			vbox.BorderWidth = 8;
			Add (vbox);

			// Create the color swatch area
			Frame frame = new Frame ();
			frame.ShadowType = ShadowType.In;
			vbox.PackStart (frame, true, true, 0);

			drawingArea = new DrawingArea ();
			drawingArea.ExposeEvent += new ExposeEventHandler (ExposeEventCallback);
			// set a minimum size
			drawingArea.SetSizeRequest (200,200);
			// set the color
			color = new Gdk.Color (0, 0, 0xff);
			drawingArea.ModifyBg (StateType.Normal, color);
			frame.Add (drawingArea);

			Alignment alignment = new Alignment (1.0f, 0.5f, 0.0f, 0.0f);
			Button button = new Button ("_Change the above color");
			button.Clicked += new EventHandler (ChangeColorCallback);
			alignment.Add (button);
			vbox.PackStart (alignment);

			ShowAll ();
		}
Exemplo n.º 28
0
		public void AddMessage (string msg, string icon)
		{
			if (lastImage != null) {
				HSeparator sep = new HSeparator ();
				sep.Show ();
				msgBox.PackStart (sep);
				lastImage.IconSize = (int) Gtk.IconSize.Button;
			}
			
			HBox box = new HBox ();
			box.Spacing = 12;
			Alignment imgBox = new Alignment (0, 0, 0, 0);
			Image img = new Image (icon, lastImage != null ? Gtk.IconSize.Button : IconSize.Dialog);
			imgBox.Add (img);
			lastImage = img;
			box.PackStart (imgBox, false, false, 0);
			Label lab = new Label (msg);
			lab.Xalign = 0;
			lab.Yalign = 0;
			lab.Wrap = true;
			lab.WidthRequest = 500;
			box.PackStart (lab, true, true, 0);
			msgBox.PackStart (box, false, false, 0);
			box.ShowAll ();
		}
Exemplo n.º 29
0
 public override Widget GetHeader(Context context)
 {
     if (context.compact)
     {
         HBox header = new HBox(false, 0);
         header.PackStart(new Label(name), false, false, 0);
         header.PackStart(Graphics.GetIcon(Threat.C, Graphics.GetColor(affiliation), Graphics.textSize),
                          false, false, (uint)(Graphics.textSize / 5));
         return(new InspectableBox(header, this, context));
     }
     else
     {
         VBox           headerBox = new VBox(false, 5);
         InspectableBox namebox   = new InspectableBox(new Label(name), this, context);
         Gtk.Alignment  align     = new Gtk.Alignment(0.5f, 0.5f, 0, 0)
         {
             Child = namebox, WidthRequest = 200
         };
         headerBox.PackStart(align, false, false, 0);
         if (parent != null)
         {
             headerBox.PackStart(UIFactory.Align(Graphics.GetSmartHeader(context.butCompact, parent), 0.5f, 0.5f, 0, 0));
         }
         return(headerBox);
     }
 }
Exemplo n.º 30
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;
        }
Exemplo n.º 31
0
        void BuildLayout ()
        {
            var primary_vbox = new VBox () {
                Spacing = 6
            };

            // Source selector
            var combo_align = new Alignment (0, .5f, 0, 0);
            var combo_hbox = new HBox (false, 6);
            combo_hbox.Add (new Label (Catalog.GetString ("Import from:")));
            sources_combo = new ComboBox (sources_model);
            var render = new CellRendererText ();
            sources_combo.PackStart (render, true);
            sources_combo.SetAttributes (render, "text", 1);
            combo_hbox.Add (sources_combo);
            combo_align.Add (combo_hbox);
            combo_align.ShowAll ();
            primary_vbox.Add (combo_align);

            // Button row near the top
            var align = new Alignment (1, .5f, 0, 0);
            var button_box = new HButtonBox () {
                Spacing = 6
            };
            button_box.Add (cancel_button = new Button (Stock.Cancel));
            button_box.Add (import_button = new Button (Stock.Add));
            align.Add (button_box);
            align.ShowAll ();

            primary_vbox.Add (align);
            primary_vbox.Show ();

            Add (primary_vbox);
        }
Exemplo n.º 32
0
		protected override void BuildContent (Container parent)
		{
			LogoImage = Xwt.Drawing.Image.FromResource ("WelcomePage_Logo.png");
			TopBorderImage = Xwt.Drawing.Image.FromResource ("WelcomePage_TopBorderRepeat.png");

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

			var mainCol = new WelcomePageColumn ();
			mainAlignment.Add (mainCol);

			var row1 = new WelcomePageRow ();
			row1.PackStart (new WelcomePageButtonBar (
				new WelcomePageBarButton ("Haxe.org", "http://www.haxe.org", "link-cloud.png"),
				new WelcomePageBarButton (GettextCatalog.GetString ("Documentation"), "http://www.http://haxe.org/doc", "link-info.png"),
				new WelcomePageBarButton (GettextCatalog.GetString ("Support"), "https://groups.google.com/forum/#!forum/haxelang", "link-heart.png"),
				new WelcomePageBarButton (GettextCatalog.GetString ("Q&A"), "https://groups.google.com/forum/#!forum/haxelang", "link-chat.png")
				)
			);
			mainCol.PackStart (row1, false, false, 0);

			var row2 = new WelcomePageRow (
				new WelcomePageColumn (
				new WelcomePageRecentProjectsList (GettextCatalog.GetString ("Solutions"))
				),
				new WelcomePageColumn (
					new WelcomePageNewsFeed (GettextCatalog.GetString ("Haxe News"), "http://software.xamarin.com/Service/News", "NewsLinks")
				),
				new WelcomePageColumn (
					new WelcomePageTipOfTheDaySection ()
				)
			);
			mainCol.PackStart (row2, false, false, 0);

			parent.Add (mainAlignment);
		}
Exemplo n.º 33
0
        private void BuildWidget ()
        {
            HBox box = new HBox ();

            disk_bar_align = new Alignment (0.5f, 0.5f, 1.0f, 1.0f);
            disk_bar = new SegmentedBar ();
            disk_bar.ValueFormatter = DapValueFormatter;

            disk_bar.AddSegmentRgb (Catalog.GetString ("Audio"), 0, 0x3465a4);
            disk_bar.AddSegmentRgb (Catalog.GetString ("Video"), 0, 0x73d216);
            disk_bar.AddSegmentRgb (Catalog.GetString ("Other"), 0, 0xf57900);
            disk_bar.AddSegment (Catalog.GetString ("Free Space"), 0, disk_bar.RemainderColor, false);

            UpdateUsage ();

            disk_bar_align.Add (disk_bar);

            box.PackStart (disk_bar_align, true, true, 0);
            disk_bar_align.TopPadding = 6;

            Add (box);
            box.ShowAll ();

            SizeAllocated += delegate (object o, Gtk.SizeAllocatedArgs args) {
                SetBackground ();
                disk_bar.HorizontalPadding = (int)(args.Allocation.Width * 0.25);
            };
        }
Exemplo n.º 34
0
        public override bool GetPreferenceTabWidget(PreferencesDialog parent,
                                                    out string tabLabel,
                                                    out Gtk.Widget preferenceWidget)
        {
            Gtk.Label      label;
            Gtk.SpinButton menuNoteCountSpinner;
            Gtk.Alignment  align;
            int            menuNoteCount;

            // Addin's tab caption
            tabLabel = Catalog.GetString("Advanced");

            Gtk.VBox opts_list = new Gtk.VBox(false, 12);
            opts_list.BorderWidth = 12;
            opts_list.Show();

            align = new Gtk.Alignment(0.5f, 0.5f, 0.0f, 1.0f);
            align.Show();
            opts_list.PackStart(align, false, false, 0);

            Gtk.Table table = new Gtk.Table(1, 2, false);
            table.ColumnSpacing = 6;
            table.RowSpacing    = 6;
            table.Show();
            align.Add(table);


            // Menu Note Count option
            label = new Gtk.Label(Catalog.GetString("Minimum number of notes to show in Recent list (maximum 18)"));

            label.UseMarkup = true;
            label.Justify   = Gtk.Justification.Left;
            label.SetAlignment(0.0f, 0.5f);
            label.Show();

            table.Attach(label, 0, 1, 0, 1);

            menuNoteCount = (int)Preferences.Get(Preferences.MENU_NOTE_COUNT);
            // we have a hard limit of 18 set, thus not allowing anything bigger than 18
            menuNoteCountSpinner       = new Gtk.SpinButton(1, 18, 1);
            menuNoteCountSpinner.Value = menuNoteCount <= 18 ? menuNoteCount : 18;

            menuNoteCountSpinner.Show();
            table.Attach(menuNoteCountSpinner, 1, 2, 0, 1);

            menuNoteCountSpinner.ValueChanged += UpdateMenuNoteCountPreference;

            if (opts_list != null)
            {
                preferenceWidget = opts_list;
                return(true);
            }
            else
            {
                preferenceWidget = null;
                return(false);
            }
        }
Exemplo n.º 35
0
		public DemoStockBrowser () : base ("Stock Icons and Items")
		{
			SetDefaultSize (-1, 500);
			BorderWidth = 8;

			HBox hbox = new HBox (false, 8);
			Add (hbox);

			ScrolledWindow sw = new ScrolledWindow ();
			sw.SetPolicy (PolicyType.Never, PolicyType.Automatic);
			hbox.PackStart (sw, false, false, 0);

			ListStore model = CreateModel ();

			TreeView treeview = new TreeView (model);
			sw.Add (treeview);

			TreeViewColumn column = new TreeViewColumn ();
			column.Title = "Name";
			CellRenderer renderer = new CellRendererPixbuf ();
			column.PackStart (renderer, false);
			column.SetAttributes (renderer, "stock_id", Column.Id);
			renderer = new CellRendererText ();
			column.PackStart (renderer, true);
			column.SetAttributes (renderer, "text", Column.Name);

			treeview.AppendColumn (column);
			treeview.AppendColumn ("Label", new CellRendererText (), "text", Column.Label);
			treeview.AppendColumn ("Accel", new CellRendererText (), "text", Column.Accel);
			treeview.AppendColumn ("ID", new CellRendererText (), "text", Column.Id);

			Alignment align = new Alignment (0.5f, 0.0f, 0.0f, 0.0f);
			hbox.PackEnd (align, false, false, 0);

			Frame frame = new Frame ("Selected Item");
			align.Add (frame);

			VBox vbox = new VBox (false, 8);
			vbox.BorderWidth = 8;
			frame.Add (vbox);

			typeLabel = new Label ();
			vbox.PackStart (typeLabel, false, false, 0);
			iconImage = new Gtk.Image ();
			vbox.PackStart (iconImage, false, false, 0);
			accelLabel = new Label ();
			vbox.PackStart (accelLabel, false, false, 0);
			nameLabel = new Label ();
			vbox.PackStart (nameLabel, false, false, 0);
			idLabel = new Label ();
			vbox.PackStart (idLabel, false, false, 0);

			treeview.Selection.Mode = Gtk.SelectionMode.Single;
			treeview.Selection.Changed += new EventHandler (SelectionChanged);

			ShowAll ();
		}
Exemplo n.º 36
0
		public override bool GetPreferenceTabWidget (	PreferencesDialog parent,
								out string tabLabel,
								out Gtk.Widget preferenceWidget)
		{
			
			Gtk.Label label;
			Gtk.SpinButton menuNoteCountSpinner;
			Gtk.Alignment align;
			int menuNoteCount;

			// Addin's tab caption
			tabLabel = Catalog.GetString ("Advanced");
			
			Gtk.VBox opts_list = new Gtk.VBox (false, 12);
			opts_list.BorderWidth = 12;
			opts_list.Show ();
			
			align = new Gtk.Alignment (0.5f, 0.5f, 0.0f, 1.0f);
			align.Show ();
			opts_list.PackStart (align, false, false, 0);

			Gtk.Table table = new Gtk.Table (1, 2, false);
			table.ColumnSpacing = 6;
			table.RowSpacing = 6;
			table.Show ();
			align.Add (table);


			// Menu Note Count option
			label = new Gtk.Label (Catalog.GetString ("Minimum number of notes to show in Recent list (maximum 18)"));

			label.UseMarkup = true;
			label.Justify = Gtk.Justification.Left;
			label.SetAlignment (0.0f, 0.5f);
			label.Show ();
			
			table.Attach (label, 0, 1, 0, 1);
		
			menuNoteCount = (int) Preferences.Get (Preferences.MENU_NOTE_COUNT);
			// we have a hard limit of 18 set, thus not allowing anything bigger than 18
			menuNoteCountSpinner = new Gtk.SpinButton (1, 18, 1);
			menuNoteCountSpinner.Value = menuNoteCount <= 18 ? menuNoteCount : 18;
			
			menuNoteCountSpinner.Show ();
			table.Attach (menuNoteCountSpinner, 1, 2, 0, 1);
			
			menuNoteCountSpinner.ValueChanged += UpdateMenuNoteCountPreference;
			
			if (opts_list != null) {
				preferenceWidget = opts_list;
				return true;
			} else {
				preferenceWidget = null;
				return false;
			}
		}
Exemplo n.º 37
0
        public void UpdateTab()
        {
            if (box != null)
            {
                Remove(box);
                box.Destroy();
                slabel = null;
            }

            Gtk.Alignment align = new Gtk.Alignment(0, 0, 0, 0);

            if (orientation == Gtk.Orientation.Horizontal)
            {
                box = new HBox();
                align.LeftPadding   = ItemPadding;
                align.RightPadding  = ItemPadding;
                align.TopPadding    = BarPadding;
                align.BottomPadding = BarPadding;
            }
            else
            {
                box = new VBox();
                align.LeftPadding   = BarPadding;
                align.RightPadding  = BarPadding;
                align.TopPadding    = ItemPadding;
                align.BottomPadding = ItemPadding;
            }
            align.Add(box);

            if (!string.IsNullOrEmpty(icon))
            {
                box.PackStart(new Gtk.Image(icon, IconSize.Menu), false, false, 0);
            }

            if (!string.IsNullOrEmpty(label))
            {
                string txt = label;
//				string txt = "<b>" + label + "</b>";
                if (running)
                {
                    txt = "<span foreground='blue'>" + txt + "</span>";
                }
                slabel = new Gtk.Label(txt);
                UpdateColor();
                slabel.UseMarkup = true;
                if (orientation == Gtk.Orientation.Vertical)
                {
                    slabel.Angle = 270;
                }
                box.PackStart(slabel, true, true, 0);
            }
            box.Spacing = 2;
            align.ShowAll();

            Add(align);
        }
        private void BuildWidget()
        {
            Spacing = 10;

            Label title = new Label();
            title.Markup = String.Format("<big><b>{0}</b></big>",
                GLib.Markup.EscapeText(Catalog.GetString("Music Locker")));
            title.Xalign = 0.0f;

            Label label = new Label(Catalog.GetString("Enter your MP3tunes account information"));
            label.Xalign = 0.0f;

            Alignment account_alignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);
            account_alignment.BorderWidth = 5;
            account_alignment.LeftPadding = 10;
            account_alignment.RightPadding = 10;
            account_alignment.BottomPadding = 10;

            table = new PropertyTable();
            table.RowSpacing = 5;
            table.ColumnSpacing = 5;

            user_entry = table.AddEntry(Catalog.GetString("Username"), "", false);
            pass_entry = table.AddEntry(Catalog.GetString("Password"), "", false);
            pass_entry.Visibility = false;
            user_entry.Text = plugin.Username;
            pass_entry.Text = plugin.Password;
            user_entry.Changed += OnUserPassChanged;
            pass_entry.Changed += OnUserPassChanged;

            account_alignment.Add(table);

            HBox logo_box = new HBox();
            logo_box.Spacing = 20;

            logo = new Image();
            logo.Pixbuf = Gdk.Pixbuf.LoadFromResource("locker-logo.png");
            logo.Xalign = 0.0f;

            VBox button_box = new VBox();
            Button create_account_button = new Button(Catalog.GetString("Create an account..."));
            create_account_button.Clicked += delegate(object o, EventArgs args) {
                plugin.CreateAccount();
            };
            button_box.PackStart(create_account_button, true, false, 0);

            logo_box.PackStart(logo, false, false, 0);
            logo_box.PackStart(button_box, true, true, 0);

            PackStart(title, false, false, 0);
            PackStart(label, false, false, 0);
            PackStart(account_alignment, false, false, 0);
            PackStart(logo_box, false, false, 0);

            ShowAll();
        }
Exemplo n.º 39
0
        public WelcomePageFeedItem()
        {
            var actionHandler = new ActionDelegate(this);

            actionHandler.PerformPress += PerformPress;

            Accessible.Description = "A news item that opens the full story in a browser when clicked";
            Accessible.Role        = Atk.Role.Link;

            VisibleWindow = false;

            box = new VBox();
            box.Accessible.SetShouldIgnore(true);

            titleLabel = new Label()
            {
                Xalign = 0
            };
            titleLabel.Accessible.SetShouldIgnore(true);
            titleLabel.Wrap         = false;
            titleLabel.Ellipsize    = Pango.EllipsizeMode.End;
            titleLabel.LineWrapMode = Pango.WrapMode.Word;
            box.PackStart(titleLabel, false, false, 0);

            subtitleLabel = new Label()
            {
                Xalign = 0
            };
            subtitleLabel.Accessible.SetShouldIgnore(true);
            var align = new Gtk.Alignment(0, 0, 1f, 1f)
            {
                TopPadding    = Styles.WelcomeScreen.Pad.MediumTitleMarginBottom,
                BottomPadding = Styles.WelcomeScreen.Pad.SummaryParagraphMarginTop
            };

            align.Add(subtitleLabel);
            align.Accessible.SetShouldIgnore(true);
            box.PackStart(align, false, false, 0);

            summaryLabel = new Label()
            {
                Xalign = 0
            };
            summaryLabel.Accessible.SetShouldIgnore(true);
            summaryLabel.Wrap = true;
            box.PackStart(summaryLabel, true, true, 0);

            Pango.AttrRise rise = new Pango.AttrRise(Pango.Units.FromPixels(7));
            summaryLabel.Attributes = new Pango.AttrList();
            summaryLabel.Attributes.Insert(rise);

            Add(box);

            Gui.Styles.Changed += UpdateStyle;
        }
Exemplo n.º 40
0
        public void set_picture(Gtk.Alignment img_alignment, string pic_path)
        {
            this.img_alignment = img_alignment;

            if (picture == null && starred)
                picture = CairoDrawing.create_small_starred_image(pic_path);
            else if (picture == null)
                picture = new Gtk.Image(null, pic_path);

            this.pic_path = pic_path;
        }
Exemplo n.º 41
0
        public static void ShowSimOnlyDialog()
        {
            if (!SimOnly)
            {
                return;
            }

            var dialog = new Dialog();

            dialog.Title = GettextCatalog.GetString("Evaluation Version");

            dialog.VBox.PackStart(
                new Label("<b><big>Feature Not Available In Evaluation Version</big></b>")
            {
                Xalign    = 0.5f,
                UseMarkup = true
            }, true, false, 12);

            var align = new Gtk.Alignment(0.5f, 0.5f, 1.0f, 1.0f)
            {
                LeftPadding = 12, RightPadding = 12
            };

            dialog.VBox.PackStart(align, true, false, 12);
            align.Add(new Label(
                          "You should upgrade to the full version of MonoTouch to target and deploy\n" +
                          " to the device, and to enable your applications to be distributed.")
            {
                Xalign  = 0.5f,
                Justify = Justification.Center
            });

            align = new Gtk.Alignment(0.5f, 0.5f, 1.0f, 1.0f)
            {
                LeftPadding = 12, RightPadding = 12
            };
            dialog.VBox.PackStart(align, true, false, 12);
            var buyButton = new Button(
                new Label(GettextCatalog.GetString("<big>Buy MonoTouch</big>"))
            {
                UseMarkup = true
            });

            buyButton.Clicked += delegate {
                System.Diagnostics.Process.Start("http://monotouch.net");
                dialog.Respond(ResponseType.Accept);
            };
            align.Add(buyButton);

            dialog.AddButton(GettextCatalog.GetString("Continue evaluation"), ResponseType.Close);
            dialog.ShowAll();

            MessageService.ShowCustomDialog(dialog);
        }
Exemplo n.º 42
0
        public HoverImageButton()
        {
			Gtk.Alignment al = new Alignment (0.5f, 0.5f, 0f, 0f);
			al.Show ();
            CanFocus = true;
			VisibleWindow = false;
			image = new ImageView();
            image.Show();
			al.Add (image);
            Add(al);
        }
Exemplo n.º 43
0
 public PopoverWindow() : base(WindowType.Toplevel)
 {
     this.AppPaintable      = true;
     this.Decorated         = false;
     this.SkipPagerHint     = true;
     this.SkipTaskbarHint   = true;
     this.TypeHint          = Gdk.WindowTypeHint.PopupMenu;
     this.DestroyWithParent = true;
     this.AddEvents((int)Gdk.EventMask.FocusChangeMask);
     this.alignment = new Gtk.Alignment(0, 0, 1, 1);
     this.alignment.Show();
     this.Add(alignment);
 }
Exemplo n.º 44
0
 public ActionField(PropertyInfo property, object obj, Context context, DisplayableAttribute attribute) : base(new Gtk.Alignment(0, 0, 1, 1))
 {
     action = (GameAction)property.GetValue(obj);
     Gtk.Alignment alignment = (Gtk.Alignment)Child;
     alignment.Add(new Label(action.name));
     if (attribute.arg != null)
     {
         alignment.BorderWidth = (uint)(int)attribute.arg;
     }
     TooltipText = action.description;
     Sensitive   = action.condition(context);
     Clicked    += (o, a) => action.action(context);
 }
Exemplo n.º 45
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 MenuMinMaxNoteCountPreference()
        {
            table = new Gtk.Table(2, 2, false);
            table.ColumnSpacing = 6;
            table.RowSpacing    = 6;
            table.Show();

            // Menu Min Note Count option
            menuMinNoteCountLabel = new Gtk.Label(Catalog.GetString("Minimum number of notes to show in Recent list"));

            menuMinNoteCountLabel.UseMarkup = true;
            menuMinNoteCountLabel.Justify   = Gtk.Justification.Left;
            menuMinNoteCountLabel.SetAlignment(0.0f, 0.5f);
            menuMinNoteCountLabel.Show();
            table.Attach(menuMinNoteCountLabel, 0, 1, 0, 1);

            menuMinNoteCount = (int)Preferences.Get(Preferences.MENU_NOTE_COUNT);
            menuMaxNoteCount = (int)Preferences.Get(Preferences.MENU_MAX_NOTE_COUNT);
            // This is to avoid having Max bigger than absolute maximum if someone changed the setting
            // outside of the Tomboy using e.g. gconf
            menuMaxNoteCount = (menuMaxNoteCount <= int.MaxValue ? menuMaxNoteCount : int.MaxValue);
            // This is to avoid having Min bigger than Max if someone changed the setting
            // outside of the Tomboy using e.g. gconf
            menuMinNoteCount = (menuMinNoteCount <= menuMaxNoteCount ? menuMinNoteCount : menuMaxNoteCount);

            menuMinNoteCountSpinner       = new Gtk.SpinButton(1, menuMaxNoteCount, 1);
            menuMinNoteCountSpinner.Value = menuMinNoteCount;
            menuMinNoteCountSpinner.Show();
            table.Attach(menuMinNoteCountSpinner, 1, 2, 0, 1);
            menuMinNoteCountSpinner.ValueChanged += UpdateMenuMinNoteCountPreference;

            // Menu Max Note Count option
            menuMaxNoteCountLabel = new Gtk.Label(Catalog.GetString("Maximum number of notes to show in Recent list"));

            menuMaxNoteCountLabel.UseMarkup = true;
            menuMaxNoteCountLabel.Justify   = Gtk.Justification.Left;
            menuMaxNoteCountLabel.SetAlignment(0.0f, 0.5f);
            menuMaxNoteCountLabel.Show();
            table.Attach(menuMaxNoteCountLabel, 0, 1, 1, 2);

            menuMaxNoteCountSpinner       = new Gtk.SpinButton(menuMinNoteCount, int.MaxValue, 1);
            menuMaxNoteCountSpinner.Value = menuMaxNoteCount;
            menuMaxNoteCountSpinner.Show();
            table.Attach(menuMaxNoteCountSpinner, 1, 2, 1, 2);
            menuMaxNoteCountSpinner.ValueChanged += UpdateMenuMaxNoteCountPreference;

            align = new Gtk.Alignment(0.0f, 0.0f, 0.0f, 1.0f);
            align.Show();
            align.Add(table);
        }
        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;
        }
Exemplo n.º 48
0
        Widget SetupListing(GameObject obj)
        {
            Gtk.Alignment align = new Gtk.Alignment(0, 0, 0, 0)
            {
                Child        = new Listing(obj, lazy),
                BorderWidth  = 5,
                LeftPadding  = 10,
                RightPadding = 10
            };
            ClickableEventBox eventbox = new ClickableEventBox {
                Child = align
            };

            eventbox.Clicked += (o, a) => OnClicked(obj);
            return(eventbox);
        }
Exemplo n.º 49
0
 public PopoverWindow(Gtk.Widget child, Xwt.Popover.Position orientation) : base(WindowType.Toplevel)
 {
     this.AppPaintable    = true;
     this.Decorated       = false;
     this.SkipPagerHint   = true;
     this.SkipTaskbarHint = true;
     this.TypeHint        = Gdk.WindowTypeHint.PopupMenu;
     //this.TransientFor = (Gtk.Window)child.Toplevel;
     this.AddEvents((int)Gdk.EventMask.FocusChangeMask);
     //this.DefaultHeight = this.DefaultWidth = 400;
     this.arrowPosition = orientation;
     this.alignment     = new Gtk.Alignment(0, 0, 1, 1);
     this.Add(alignment);
     this.alignment.Add(child);
     OnScreenChanged(null);
 }
Exemplo n.º 50
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);
        }
Exemplo n.º 51
0
        private static bool ConfirmUnmap(IUnmapableSource source)
        {
            string key        = "no_confirm_unmap_" + source.GetType().Name.ToLower();
            bool   do_not_ask = ConfigurationClient.Get <bool> ("sources", key, false);

            if (do_not_ask)
            {
                return(true);
            }

            Hyena.Widgets.HigMessageDialog dialog = new Hyena.Widgets.HigMessageDialog(
                ServiceManager.Get <GtkElementsService> ().PrimaryWindow,
                Gtk.DialogFlags.Modal,
                Gtk.MessageType.Question,
                Gtk.ButtonsType.Cancel,
                String.Format(Catalog.GetString("Are you sure you want to delete this {0}?"),
                              source.GenericName.ToLower()),
                source.Name);

            dialog.AddButton(Gtk.Stock.Delete, Gtk.ResponseType.Ok, false);

            Gtk.Alignment alignment = new Gtk.Alignment(0.0f, 0.0f, 0.0f, 0.0f);
            alignment.TopPadding = 10;
            Gtk.CheckButton confirm_button = new Gtk.CheckButton(String.Format(Catalog.GetString(
                                                                                   "Do not ask me this again"), source.GenericName.ToLower()));
            confirm_button.Toggled += delegate {
                do_not_ask = confirm_button.Active;
            };
            alignment.Add(confirm_button);
            alignment.ShowAll();
            dialog.LabelVBox.PackStart(alignment, false, false, 0);

            try {
                if (dialog.Run() == (int)Gtk.ResponseType.Ok)
                {
                    ConfigurationClient.Set <bool> ("sources", key, do_not_ask);
                    return(true);
                }

                return(false);
            } finally {
                dialog.Destroy();
            }
        }
Exemplo n.º 52
0
        protected override void BuildContent(Container parent)
        {
            LogoImage      = Xwt.Drawing.Image.FromResource("welcome-logo.png");
            TopBorderImage = Xwt.Drawing.Image.FromResource("welcome-tile.png");

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

            mainAlignment.Accessible.SetShouldIgnore(true);

            var mainCol = new WelcomePageColumn();

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

            var row1 = new WelcomePageRow();

            row1.PackStart(new WelcomePageButtonBar(
                               new WelcomePageBarButton("MonoDevelop.com", "http://www.monodevelop.com", "welcome-link-md-16.png"),
                               new WelcomePageBarButton(GettextCatalog.GetString("Documentation"), "http://www.go-mono.com/docs", "welcome-link-info-16.png"),
                               new WelcomePageBarButton(GettextCatalog.GetString("Support"), "http://monodevelop.com/index.php?title=Help_%26_Contact", "welcome-link-support-16.png"),
                               new WelcomePageBarButton(GettextCatalog.GetString("Q&A"), "http://stackoverflow.com/questions/tagged/monodevelop", "welcome-link-chat-16.png")
                               )
                           );
            row1.Accessible.SetShouldIgnore(true);
            mainCol.PackStart(row1, false, false, 0);

            var row2 = new WelcomePageRow(
                new WelcomePageColumn(
                    new WelcomePageRecentProjectsList(GettextCatalog.GetString("Solutions"))
                    ),
                new WelcomePageColumn(
                    new WelcomePageNewsFeed(GettextCatalog.GetString("Xamarin News"), "http://software.xamarin.com/Service/News", "NewsLinks")
                    ),
                new WelcomePageColumn(
                    new WelcomePageTipOfTheDaySection()
                    )
                );

            row2.Accessible.SetShouldIgnore(true);
            mainCol.PackStart(row2, false, false, 0);

            parent.Add(mainAlignment);
        }
Exemplo n.º 53
0
        public WelcomePageFeedItem()
        {
            VisibleWindow = false;

            box = new VBox();

            titleLabel = new Label()
            {
                Xalign = 0
            };
            titleLabel.Wrap         = false;
            titleLabel.Ellipsize    = Pango.EllipsizeMode.End;
            titleLabel.LineWrapMode = Pango.WrapMode.Word;
            box.PackStart(titleLabel, false, false, 0);

            subtitleLabel = new Label()
            {
                Xalign = 0
            };
            var align = new Gtk.Alignment(0, 0, 1f, 1f)
            {
                TopPadding    = Styles.WelcomeScreen.Pad.MediumTitleMarginBottom,
                BottomPadding = Styles.WelcomeScreen.Pad.SummaryParagraphMarginTop
            };

            align.Add(subtitleLabel);
            box.PackStart(align, false, false, 0);

            summaryLabel = new Label()
            {
                Xalign = 0
            };
            summaryLabel.Wrap = true;
            box.PackStart(summaryLabel, true, true, 0);

            Pango.AttrRise rise = new Pango.AttrRise(Pango.Units.FromPixels(7));
            summaryLabel.Attributes = new Pango.AttrList();
            summaryLabel.Attributes.Insert(rise);

            Add(box);

            Gui.Styles.Changed += UpdateStyle;
        }
        private void Add(bool filled, string header_txt, params Widget [] widgets)
        {
            var vbox = new VBox()
            {
                Spacing = 3
            };

            vbox.PackStart(HeaderLabel(header_txt), false, false, 0);

            foreach (var child in widgets)
            {
                var align = new Gtk.Alignment(0, 0, 1, 1)
                {
                    LeftPadding = 12, Child = child
                };
                vbox.PackStart(align, filled, filled, 0);
            }

            main_box.PackStart(vbox, filled, filled, 0);
        }
Exemplo n.º 55
0
        public override bool GetPreferenceTabWidget(PreferencesDialog parent,
                                                    out string tabLabel,
                                                    out Gtk.Widget preferenceWidget)
        {
            Gtk.Alignment align;

            // Addin's tab caption
            tabLabel = Catalog.GetString("Advanced");

            Gtk.VBox opts_list = new Gtk.VBox(false, 12);
            opts_list.BorderWidth = 12;
            opts_list.Show();

            align = new Gtk.Alignment(0.5f, 0.5f, 0.0f, 1.0f);
            align.Show();
            opts_list.PackStart(align, false, false, 0);

            /*
             * If you want to add new settings to the Advanced tab - follow the steps below:
             *      1) define a class which implements the functionality (see e.g. MenuMinMaxNoteCountPreference.cs);
             *      2) define property/method for that class that returns the widget you want to place onto the tab;
             *      3) (similar to the below) instantiate object of your class and add its widget to the "align" widget;
             */
            // Instantiate class for Menu Min/Max Note Count setting
            MenuMinMaxNoteCountPreference menuNoteCountPref = new MenuMinMaxNoteCountPreference();

            // Add the widget for this setting to the Advanced tab
            align.Add(menuNoteCountPref.Widget);

            if (opts_list != null)
            {
                preferenceWidget = opts_list;
                return(true);
            }
            else
            {
                preferenceWidget = null;
                return(false);
            }
        }
Exemplo n.º 56
0
 //IGUIComplete stuff
 public virtual Widget GetHeader(Context context)
 {
     if (context.compact)
     {
         return(new InspectableBox(new Label(name), this, context));
     }
     else
     {
         VBox           headerBox = new VBox(false, 5);
         InspectableBox namebox   = new InspectableBox(new Label(name), this, context);
         Gtk.Alignment  align     = new Gtk.Alignment(0.5f, 0.5f, 0, 0)
         {
             Child = namebox, WidthRequest = 200
         };
         headerBox.PackStart(align, false, false, 0);
         if (parent != null)
         {
             headerBox.PackStart(UIFactory.Align(Graphics.GetSmartHeader(context.butCompact, parent), 0.5f, 0.5f, 0, 0));
         }
         return(headerBox);
     }
 }
Exemplo n.º 57
0
        protected override void BuildContent(Container parent)
        {
            LogoImage      = Gdk.Pixbuf.LoadFromResource("WelcomePage_Logo.png");
            TopBorderImage = Gdk.Pixbuf.LoadFromResource("WelcomePage_TopBorderRepeat.png");

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

            var mainCol = new WelcomePageColumn();

            mainAlignment.Add(mainCol);

            var row1 = new WelcomePageRow();

            row1.PackStart(new WelcomePageButtonBar(
                               new WelcomePageBarButton("MonoDevelop.com", "http://www.monodevelop.com", "link-cloud.png"),
                               new WelcomePageBarButton(GettextCatalog.GetString("Documentation"), "http://www.go-mono.com/docs", "link-info.png"),
                               new WelcomePageBarButton(GettextCatalog.GetString("Support"), "http://monodevelop.com/index.php?title=Help_%26_Contact", "link-heart.png"),
                               new WelcomePageBarButton(GettextCatalog.GetString("Q&A"), "http://stackoverflow.com/questions/tagged/monodevelop", "link-chat.png")
                               )
                           );
            mainCol.PackStart(row1, false, false, 0);

            var row2 = new WelcomePageRow(
                new WelcomePageColumn(
                    new WelcomePageRecentProjectsList(GettextCatalog.GetString("Solutions"))
                    ),
                new WelcomePageColumn(
                    new WelcomePageNewsFeed(GettextCatalog.GetString("Xamarin News"), "http://software.xamarin.com/Service/News", "NewsLinks")
                    ),
                new WelcomePageColumn(
                    new WelcomePageTipOfTheDaySection()
                    )
                );

            mainCol.PackStart(row2, false, false, 0);

            parent.Add(mainAlignment);
        }
        private void InitComponents()
        {
            browser = new LyricsBrowser();
            browser.InsertModeAvailable = false;

            label        = new Label();
            label.Xalign = 0;

            Gtk.Alignment label_align = new Gtk.Alignment(0, 0, 0, 0);
            label_align.TopPadding  = 5;
            label_align.LeftPadding = 10;
            label_align.Add(label);

            Gtk.ScrolledWindow scroll_pane = new Gtk.ScrolledWindow();
            scroll_pane.HscrollbarPolicy = PolicyType.Automatic;
            scroll_pane.ShadowType       = Gtk.ShadowType.None;
            scroll_pane.Add(browser);

            PackStart(label_align, false, true, 0);
            PackStart(scroll_pane, true, true, 0);

            this.ShowAll();
        }
Exemplo n.º 59
0
        public void AddWidgets(IEnumerable <Widget> widgets)
        {
            if (widgets.Count() > 1)
            {
                Notebook notebook = new Notebook();

                foreach (Widget widget in widgets)
                {
                    Gtk.Alignment spacer = new Gtk.Alignment(0, 0, 1, 1);
                    spacer.LeftPadding = spacer.RightPadding = spacer.TopPadding = spacer.BottomPadding = 7;
                    spacer.Child       = widget;
                    notebook.AppendPage(spacer, new Label(widget.Name));
                }

                VBox.PackStart(notebook);
            }
            else
            {
                VBox.PackStart(widgets.First());
            }

            VBox.ShowAll();
        }
Exemplo n.º 60
0
        public PopoverWidget()
        {
            AppPaintable  = true;
            VisibleWindow = false;

            alignment = new Alignment(0, 0, 1f, 1f);
            alignment.Show();
            Add(alignment);

            disableSizeCheck = false;

            SizeRequested += (object o, SizeRequestedArgs args) => {
                if (this.AnimationIsRunning("Resize") && !disableSizeCheck)
                {
                    Gtk.Requisition result = new Gtk.Requisition();
                    result.Width     = Math.Max(args.Requisition.Width, Math.Max(Allocation.Width, targetSize.Width));
                    result.Height    = Math.Max(args.Requisition.Height, Math.Max(Allocation.Height, targetSize.Height));
                    args.Requisition = result;
                }
            };

            UpdatePadding();
        }