当前位置: 首页>>代码示例>>C#>>正文


C# Label.ModifyFont方法代码示例

本文整理汇总了C#中Gtk.Label.ModifyFont方法的典型用法代码示例。如果您正苦于以下问题:C# Label.ModifyFont方法的具体用法?C# Label.ModifyFont怎么用?C# Label.ModifyFont使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gtk.Label的用法示例。


在下文中一共展示了Label.ModifyFont方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandleOnItemSelected

		void HandleOnItemSelected (object sender, SettingCollection sc)
		{
			_current_sc = sc;
			foreach(Widget w in vbox3.AllChildren) {
				vbox3.Remove (w);
				w.Dispose();
			}

			Label title = new Label (sc.Heading + " settings");
			Pango.FontDescription tpf = new Pango.FontDescription ();
			tpf.Weight = Pango.Weight.Bold;
			title.ModifyFont (tpf);
			vbox3.Add (title);
			vbox3.Add (new HSeparator());

			for(int i = sc.Settings.Length -1;i > -1; i --)  {
				isettings_viewer v = _scf.get_control(sc.Settings[i].Type);
				v.set_setting(sc.Settings[i]);
				vbox3.Add((Widget)v);
				vbox3.Add (new HSeparator ());
			}
			HSeparator h = new HSeparator();
			h.HeightRequest = 300;
			vbox3.Add (h);
			vbox3.ShowAll ();
		}
开发者ID:Meticulus,项目名称:tactical,代码行数:26,代码来源:preference_dialog.cs

示例2: GetVisualizerWidget

		public override Control GetVisualizerWidget (ObjectValue val)
		{
			string value = val.Value;
			Gdk.Color col = new Gdk.Color (85, 85, 85);

			if (!val.IsNull && (val.TypeName == "string" || val.TypeName == "char[]"))
				value = '"' + GetString (val) + '"';
			if (DebuggingService.HasInlineVisualizer (val))
				value = DebuggingService.GetInlineVisualizer (val).InlineVisualize (val);

			var label = new Gtk.Label ();
			label.Text = value;
			var font = label.Style.FontDescription.Copy ();

			if (font.SizeIsAbsolute) {
				font.AbsoluteSize = font.Size - 1;
			} else {
				font.Size -= (int)(Pango.Scale.PangoScale);
			}

			label.ModifyFont (font);
			label.ModifyFg (StateType.Normal, col);
			label.SetPadding (4, 4);

			if (label.SizeRequest ().Width > 500) {
				label.WidthRequest = 500;
				label.Wrap = true;
				label.LineWrapMode = Pango.WrapMode.WordChar;
			} else {
				label.Justify = Gtk.Justification.Center;
			}

			if (label.Layout.GetLine (1) != null) {
				label.Justify = Gtk.Justification.Left;
				var line15 = label.Layout.GetLine (15);
				if (line15 != null) {
					label.Text = value.Substring (0, line15.StartIndex).TrimEnd ('\r', '\n') + "\n…";
				}
			}

			label.Show ();

			return label;
		}
开发者ID:michaelc37,项目名称:monodevelop,代码行数:44,代码来源:GenericPreviewVisualizer.cs

示例3: MainWindow

        public MainWindow(HttpAgent httpAgent, IRepositoryFactory repositoryFactory)
            : base(Gtk.WindowType.Toplevel)
        {
            this.httpAgent = httpAgent;

            WindowPosition = WindowPosition.Center;

            rekeningRepository = repositoryFactory.CreateRepository<IRekeningRepository>();
            consumptieRepository = repositoryFactory.CreateRepository<IConsumptieRepository>();

            // Rekeningen overzicht
            rekeningOverzichtWidget = new RekeningOverzichtWidget();
            rekeningOverzichtWidget.Refresh(rekeningRepository.GetAll());
            rekeningOverzichtWidget.RekeningClicked += handleRekeningClicked;

            // Afrekenen button
            Pango.FontDescription fontDescription = Pango.FontDescription.FromString("Arial");
            fontDescription.Size = 13000;
            fontDescription.Weight = Pango.Weight.Bold;
            Label afrekenenLabel = new Label("Afrekenen");
            afrekenenLabel.ModifyFont(fontDescription);
            afrekenenButton = new Button();
            afrekenenButton.Add(afrekenenLabel);
            afrekenenButton.Clicked += handleAfrekenenButtonClicked;

            // Rechter panel (bestellingen)
            bestellingenOverzichtWidget = new BestellingenOverzichtWidget();

            box = new HBox(false, 3);
            box.PackStart(rekeningOverzichtWidget);
            box.PackStart(bestellingenOverzichtWidget);

            // Main box
            vbox = new VBox(false, 0);
            vbox.PackStart(box);
            vbox.PackEnd(afrekenenButton);
            Add(vbox);

            ShowAll();

            this.DeleteEvent += OnDeleteEvent;
        }
开发者ID:reinkrul,项目名称:SailorsTabDotNet,代码行数:42,代码来源:MainWindow.cs

示例4: CreateTooltipWindow

        public Window CreateTooltipWindow(TextEditor editor, int offset, Gdk.ModifierType modifierState, TooltipItem item)
        {
            //create a message string from all the results
            var results = item.Item as AbstractTooltipContent[];

            var win = new DToolTipWindow();

            // Set white background
            win.ModifyBg(StateType.Normal,new Gdk.Color(0xff,0xff,0xff));

            var pack = new Gtk.VBox();

            foreach (var r in results)
            {
                var titleLabel = new Label(r.Title);

                // Make left-bound
                titleLabel.SetAlignment(0, 0);

                // Set bold font
                titleLabel.ModifyFont(new Pango.FontDescription() {Weight=Weight.Bold, AbsoluteSize=12*(int)Pango.Scale.PangoScale});

                pack.Add(titleLabel);

                if (!string.IsNullOrEmpty( r.Description))
                {
                    const int maximumDescriptionLength = 300;
                    var descLabel = new Label(r.Description.Length>maximumDescriptionLength ? (r.Description.Substring(0,maximumDescriptionLength)+"...") : r.Description);

                    descLabel.ModifyFont(new Pango.FontDescription() { AbsoluteSize = 10 * (int)Pango.Scale.PangoScale });
                    descLabel.SetAlignment(0, 0);

                    pack.Add(descLabel);
                }
            }

            win.Add(pack);

            return win;
        }
开发者ID:robik,项目名称:Mono-D,代码行数:40,代码来源:DToolTipProvider.cs

示例5: ShowSongInfoPopup

        public void ShowSongInfoPopup(string filepath)
        {
            string sDuration 	= _parent.SecondsToHumanTime(_parent.oXbmc.Media.GetMusicTagByFilepath(filepath, "duration"));
            string songInfo		= "\n\nartist: " + _parent.oXbmc.Media.GetMusicTagByFilepath(filepath, "artist");
            songInfo 			+= "\ntitle: " + _parent.oXbmc.Media.GetMusicTagByFilepath(filepath, "title");
            songInfo 			+= "\nalbum: " + _parent.oXbmc.Media.GetMusicTagByFilepath(filepath, "album");
            songInfo 			+= "\ngenre: " + _parent.oXbmc.Media.GetMusicTagByFilepath(filepath, "genre");
            songInfo 			+= "\nduration: " + sDuration;

            Gtk.Window wSongInfo = new Gtk.Window("Song Info");
            wSongInfo.SetPosition(WindowPosition.CenterAlways);
            wSongInfo.SetIconFromFile("images/icon.png");

            Pango.FontDescription fd = Pango.FontDescription.FromString("Verdana Bold 9");

            /*
            string thumbLocation = _parent.oXbmc.Media.GetFileThumbnailLocation(filepath);

            if (thumbLocation != null)
            {
                MemoryStream msThumbnail = _parent.oXbmc.Media.FileDownload(thumbLocation);

                if (msThumbnail != null)
                    wSongInfo.Add(new Gtk.Image(new Gdk.Pixbuf(msThumbnail)));
            }
            */

            Label lArtist = new Label(songInfo);
            lArtist.ModifyFont(fd);
            lArtist.Xpad = 20;
            lArtist.Ypad = 20;

            wSongInfo.Add(lArtist);

            //Gtk.Image iCoverart = new Gtk.Image(new Gdk.Pixbuf(_parent.oXbmc.Media.GetFileThumbnailLocation(filepath)));
            //wSongInfo.Add(iCoverart);

            wSongInfo.ShowAll();
        }
开发者ID:Bram77,项目名称:xbmcontrol-evo,代码行数:39,代码来源:MediaInfo.cs

示例6: initialize

        private void initialize()
        {
            VBox box = new VBox();

            // Label
            label = new Label(rekening.Naam);
            Pango.FontDescription fontDescription = Pango.FontDescription.FromString("Arial");
            fontDescription.Size = FontSize * 700;
            fontDescription.Weight = Pango.Weight.Bold;
            label.ModifyFont(fontDescription);
            box.PackStart(label);

            // Additional image
            Image image = getImage();
            if (image != null)
            {
                box.PackStart(image);
            }

            Add(box);
            Refresh();
        }
开发者ID:reinkrul,项目名称:SailorsTabDotNet,代码行数:22,代码来源:RekeningWidgetDesigner.cs

示例7: GetVisualizerWidget

		public override Control GetVisualizerWidget (ObjectValue val)
		{
			var ops = DebuggingService.DebuggerSession.EvaluationOptions.Clone ();
			ops.AllowTargetInvoke = true;
			ops.ChunkRawStrings = true;
			ops.EllipsizedLength = 5000;//Preview window can hold aprox. 4700 chars
			val.Refresh (ops);//Refresh DebuggerDisplay/String value with full length instead of ellipsized
			string value = val.Value;
			Gdk.Color col = Styles.PreviewVisualizerTextColor.ToGdkColor ();

			if (DebuggingService.HasInlineVisualizer (val))
				value = DebuggingService.GetInlineVisualizer (val).InlineVisualize (val);

			var label = new Gtk.Label ();
			label.Text = value;
			label.ModifyFont (FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11));
			label.ModifyFg (StateType.Normal, col);
			label.SetPadding (4, 4);

			if (label.SizeRequest ().Width > 500) {
				label.WidthRequest = 500;
				label.Wrap = true;
				label.LineWrapMode = Pango.WrapMode.WordChar;
			} else {
				label.Justify = Gtk.Justification.Center;
			}

			if (label.Layout.GetLine (1) != null) {
				label.Justify = Gtk.Justification.Left;
				var trimmedLine = label.Layout.GetLine (50);
				if (trimmedLine != null) {
					label.Text = value.Substring (0, trimmedLine.StartIndex).TrimEnd ('\r', '\n') + "\n…";
				}
			}

			label.Show ();

			return label;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:39,代码来源:GenericPreviewVisualizer.cs

示例8: MainWindow_Pango

        public MainWindow_Pango()
            : base("pango + unicode + font")
        {
            SetPosition(WindowPosition.Center);
            DeleteEvent += delegate
            {
                    Application.Quit();
            };

            ScrolledWindow sw = new ScrolledWindow();
            sw.ShadowType = ShadowType.EtchedIn;
            sw.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);

            Context context = this.CreatePangoContext();
            _fonts = context.Families;

            _store = CreateModel();

            TreeView view = new TreeView();
            view.RulesHint = true;
            sw.Add(view);

            CreateColumn(view);

            string text = @"하늘과 바람과 별과 시 - 윤동주\n1821 года в Москве.Был вторым из 7 детей. Отец, Михаил Андреевич";

            _label = new Label(text);

            Pango.FontDescription fontDesc = Pango.FontDescription.FromString("SignPainter 20");
            _label.ModifyFont(fontDesc);

            Fixed fix = new Fixed();

            fix.Put(_label, 5, 5);
            Add(fix);
            //Add(sw);
            ShowAll();
        }
开发者ID:oraora81,项目名称:NOCmono,代码行数:38,代码来源:MainWindow_Pango.cs

示例9: GetFileInfo

        public void GetFileInfo()
        {
            TreeModel selectedModel;
            TreeIter selectedIter	= new TreeIter();

            if (_parent._tvShares.Selection.GetSelected(out selectedModel, out selectedIter))
            {
                string filepath = selectedModel.GetValue(selectedIter, 2).ToString();

                string sDuration = _parent.oHelper.SecondsToHumanTime(_parent.oXbmc.Media.GetMusicTagByFilepath(filepath, "duration"));

                string songInfo = "artist: " + _parent.oXbmc.Media.GetMusicTagByFilepath(filepath, "artist");
                songInfo += "\ntitle: " + _parent.oXbmc.Media.GetMusicTagByFilepath(filepath, "title");
                songInfo += "\nalbum: " + _parent.oXbmc.Media.GetMusicTagByFilepath(filepath, "album");
                songInfo += "\ngenre: " + _parent.oXbmc.Media.GetMusicTagByFilepath(filepath, "genre");
                songInfo += "\nduration: " + sDuration;

                Window wSongInfo = new Window("Song Info");
                wSongInfo.SetPosition(WindowPosition.CenterAlways);
                wSongInfo.SetIconFromFile("images/icon.png");

                Pango.FontDescription fd = Pango.FontDescription.FromString("Verdana Bold 9");

                Label lArtist = new Label(songInfo);
                lArtist.ModifyFont(fd);
                lArtist.Xpad = 20;
                lArtist.Ypad = 20;

                wSongInfo.Add(lArtist);

                //Gtk.Image iCoverart = new Gtk.Image(new Gdk.Pixbuf(_parent.oXbmc.Media.GetFileThumbnailLocation(filepath)));
                //wSongInfo.Add(iCoverart);

                wSongInfo.ShowAll();
                //_parent.Messagebox(songInfo);
            }
        }
开发者ID:Bram77,项目名称:xbmcontrol-evo,代码行数:37,代码来源:Controls.cs

示例10: GetVisualizerWidget

		public override Control GetVisualizerWidget (ObjectValue val)
		{
			string value = val.Value;
			Gdk.Color col = Styles.PreviewVisualizerTextColor.ToGdkColor ();

			if (!val.IsNull && (val.TypeName == "string" || val.TypeName == "char[]"))
				value = '"' + GetString (val) + '"';
			if (DebuggingService.HasInlineVisualizer (val))
				value = DebuggingService.GetInlineVisualizer (val).InlineVisualize (val);

			var label = new Gtk.Label ();
			label.Text = value;
			label.ModifyFont (FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11));
			label.ModifyFg (StateType.Normal, col);
			label.SetPadding (4, 4);

			if (label.SizeRequest ().Width > 500) {
				label.WidthRequest = 500;
				label.Wrap = true;
				label.LineWrapMode = Pango.WrapMode.WordChar;
			} else {
				label.Justify = Gtk.Justification.Center;
			}

			if (label.Layout.GetLine (1) != null) {
				label.Justify = Gtk.Justification.Left;
				var line15 = label.Layout.GetLine (15);
				if (line15 != null) {
					label.Text = value.Substring (0, line15.StartIndex).TrimEnd ('\r', '\n') + "\n…";
				}
			}

			label.Show ();

			return label;
		}
开发者ID:vvarshne,项目名称:monodevelop,代码行数:36,代码来源:GenericPreviewVisualizer.cs

示例11: CreateInnerExceptionMessage

		Widget CreateInnerExceptionMessage ()
		{
			var hboxMain = new HBox ();
			vboxAroundInnerExceptionMessage = new VBox ();
			var hbox = new HBox ();

			var icon = new ImageView (WarningIconPixbufInner);
			icon.Yalign = 0;
			hbox.PackStart (icon, false, false, 0);

			InnerExceptionTypeLabel = new Label ();
			InnerExceptionTypeLabel.UseMarkup = true;
			InnerExceptionTypeLabel.Xalign = 0;
			InnerExceptionTypeLabel.Selectable = true;
			hbox.PackStart (InnerExceptionTypeLabel, false, true, 4);

			InnerExceptionMessageLabel = new Label ();
			InnerExceptionMessageLabel.Wrap = true;
			InnerExceptionMessageLabel.Selectable = true;
			InnerExceptionMessageLabel.Xalign = 0;
			InnerExceptionMessageLabel.ModifyFont (Pango.FontDescription.FromString (Platform.IsWindows ? "9" : "11"));
			vboxAroundInnerExceptionMessage.PackStart (hbox, false, true, 0);
			vboxAroundInnerExceptionMessage.PackStart (InnerExceptionMessageLabel, true, true, 10);
			hboxMain.PackStart (vboxAroundInnerExceptionMessage, true, true, 10);
			hboxMain.ShowAll ();
			return hboxMain;
		}
开发者ID:kdubau,项目名称:monodevelop,代码行数:27,代码来源:ExceptionCaughtDialog.cs

示例12: CreateExceptionHeader

		Widget CreateExceptionHeader ()
		{
			var icon = new ImageView (WarningIconPixbuf);
			icon.Yalign = 0;

			ExceptionTypeLabel = new Label { Xalign = 0.0f, Selectable = true };
			ExceptionMessageLabel = new Label { Wrap = true, Xalign = 0.0f, Selectable = true };
			ExceptionTypeLabel.ModifyFg (StateType.Normal, new Gdk.Color (255, 255, 255));
			ExceptionMessageLabel.ModifyFg (StateType.Normal, new Gdk.Color (255, 255, 255));

			if (Platform.IsWindows) {
				ExceptionTypeLabel.ModifyFont (Pango.FontDescription.FromString ("bold 19"));
				ExceptionMessageLabel.ModifyFont (Pango.FontDescription.FromString ("10"));
			} else {
				ExceptionTypeLabel.ModifyFont (Pango.FontDescription.FromString ("21"));
				ExceptionMessageLabel.ModifyFont (Pango.FontDescription.FromString ("12"));
			}

			//Force rendering of background with EventBox
			var eventBox = new EventBox ();
			var hBox = new HBox ();
			var leftVBox = new VBox ();
			rightVBox = new VBox ();
			leftVBox.PackStart (icon, false, false, (uint)(Platform.IsWindows ? 5 : 0)); // as we change frame.BorderWidth below, we need to compensate

			rightVBox.PackStart (ExceptionTypeLabel, false, false, (uint)(Platform.IsWindows ? 0 : 2));
			rightVBox.PackStart (ExceptionMessageLabel, true, true, (uint)(Platform.IsWindows ? 6 : 5));

			hBox.PackStart (leftVBox, false, false, (uint)(Platform.IsWindows ? 5 : 0)); // as we change frame.BorderWidth below, we need to compensate
			hBox.PackStart (rightVBox, true, true, (uint)(Platform.IsWindows ? 5 : 10));

			var frame = new Frame ();
			frame.Add (hBox);
			frame.BorderWidth = (uint)(Platform.IsWindows ? 5 : 10); // on Windows we need to have smaller border due to ExceptionTypeLabel vertical misalignment
			frame.Shadow = ShadowType.None;
			frame.ShadowType = ShadowType.None;

			eventBox.Add (frame);
			eventBox.ShowAll ();
			eventBox.ModifyBg (StateType.Normal, new Gdk.Color (119, 130, 140));

			return eventBox;
		}
开发者ID:kdubau,项目名称:monodevelop,代码行数:43,代码来源:ExceptionCaughtDialog.cs

示例13: Build

		void Build ()
		{
			BorderWidth = 0;
			WidthRequest = 901;
			HeightRequest = 632;

			Name = "wizard_dialog";
			Title = GettextCatalog.GetString ("New Project");
			WindowPosition = WindowPosition.CenterOnParent;
			TransientFor = IdeApp.Workbench.RootWindow;

			projectConfigurationWidget = new GtkProjectConfigurationWidget ();
			projectConfigurationWidget.Name = "projectConfigurationWidget";

			// Top banner of dialog.
			var topLabelEventBox = new EventBox ();
			topLabelEventBox.Name = "topLabelEventBox";
			topLabelEventBox.HeightRequest = 52;
			topLabelEventBox.ModifyBg (StateType.Normal, bannerBackgroundColor);
			topLabelEventBox.ModifyFg (StateType.Normal, whiteColor);
			topLabelEventBox.BorderWidth = 0;

			var topBannerTopEdgeLineEventBox = new EventBox ();
			topBannerTopEdgeLineEventBox.Name = "topBannerTopEdgeLineEventBox";
			topBannerTopEdgeLineEventBox.HeightRequest = 1;
			topBannerTopEdgeLineEventBox.ModifyBg (StateType.Normal, bannerLineColor);
			topBannerTopEdgeLineEventBox.BorderWidth = 0;

			var topBannerBottomEdgeLineEventBox = new EventBox ();
			topBannerBottomEdgeLineEventBox.Name = "topBannerBottomEdgeLineEventBox";
			topBannerBottomEdgeLineEventBox.HeightRequest = 1;
			topBannerBottomEdgeLineEventBox.ModifyBg (StateType.Normal, bannerLineColor);
			topBannerBottomEdgeLineEventBox.BorderWidth = 0;

			topBannerLabel = new Label ();
			topBannerLabel.Name = "topBannerLabel";
			Pango.FontDescription font = topBannerLabel.Style.FontDescription.Copy (); // UNDONE: VV: Use FontService?
			font.Size = (int)(font.Size * 1.8);
			topBannerLabel.ModifyFont (font);
			topBannerLabel.ModifyFg (StateType.Normal, whiteColor);
			var topLabelHBox = new HBox ();
			topLabelHBox.Name = "topLabelHBox";
			topLabelHBox.PackStart (topBannerLabel, false, false, 20);
			topLabelEventBox.Add (topLabelHBox);

			VBox.PackStart (topBannerTopEdgeLineEventBox, false, false, 0);
			VBox.PackStart (topLabelEventBox, false, false, 0);
			VBox.PackStart (topBannerBottomEdgeLineEventBox, false, false, 0);

			// Main templates section.
			centreVBox = new VBox ();
			centreVBox.Name = "centreVBox";
			VBox.PackStart (centreVBox, true, true, 0);
			templatesHBox = new HBox ();
			templatesHBox.Name = "templatesHBox";
			centreVBox.PackEnd (templatesHBox, true, true, 0);

			// Template categories.
			var templateCategoriesBgBox = new EventBox ();
			templateCategoriesBgBox.Name = "templateCategoriesVBox";
			templateCategoriesBgBox.BorderWidth = 0;
			templateCategoriesBgBox.ModifyBg (StateType.Normal, categoriesBackgroundColor);
			templateCategoriesBgBox.WidthRequest = 220;
			var templateCategoriesScrolledWindow = new ScrolledWindow ();
			templateCategoriesScrolledWindow.Name = "templateCategoriesScrolledWindow";
			templateCategoriesScrolledWindow.HscrollbarPolicy = PolicyType.Never;

			// Template categories tree view.
			templateCategoriesTreeView = new TreeView ();
			templateCategoriesTreeView.Name = "templateCategoriesTreeView";
			templateCategoriesTreeView.BorderWidth = 0;
			templateCategoriesTreeView.HeadersVisible = false;
			templateCategoriesTreeView.Model = templateCategoriesListStore;
			templateCategoriesTreeView.SearchColumn = -1; // disable the interactive search
			templateCategoriesTreeView.AppendColumn (CreateTemplateCategoriesTreeViewColumn ());
			templateCategoriesScrolledWindow.Add (templateCategoriesTreeView);
			templateCategoriesBgBox.Add (templateCategoriesScrolledWindow);
			templatesHBox.PackStart (templateCategoriesBgBox, false, false, 0);

			// Templates.
			var templatesBgBox = new EventBox ();
			templatesBgBox.ModifyBg (StateType.Normal, templateListBackgroundColor);
			templatesBgBox.Name = "templatesVBox";
			templatesBgBox.WidthRequest = 400;
			templatesHBox.PackStart (templatesBgBox, false, false, 0);
			var templatesScrolledWindow = new ScrolledWindow ();
			templatesScrolledWindow.Name = "templatesScrolledWindow";
			templatesScrolledWindow.HscrollbarPolicy = PolicyType.Never;

			// Templates tree view.
			templatesTreeView = new TreeView ();
			templatesTreeView.Name = "templatesTreeView";
			templatesTreeView.HeadersVisible = false;
			templatesTreeView.Model = templatesListStore;
			templatesTreeView.SearchColumn = -1; // disable the interactive search
			templatesTreeView.AppendColumn (CreateTemplateListTreeViewColumn ());
			templatesScrolledWindow.Add (templatesTreeView);
			templatesBgBox.Add (templatesScrolledWindow);

			// Template
//.........这里部分代码省略.........
开发者ID:sushihangover,项目名称:monodevelop,代码行数:101,代码来源:GtkNewProjectDialogBackend.UI.cs

示例14: PreviewVisualizerWindow

		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);
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:73,代码来源:PreviewVisualizerWindow.cs

示例15: CategoryBox

            public CategoryBox(string labelText)
                : base()
            {
                var frame = new Frame ();
                var vbox = new VBox ();

                var label = new Label (labelText);
                label.ModifyFont (new Pango.FontDescription () { Size = 24, Weight = Pango.Weight.Bold });

                Body = new HBox ();

                vbox.Add (label);
                vbox.Add (Body);
                frame.Add (vbox);
                Add (frame);

                DarkenBackground (this);
            }
开发者ID:JoeyScarr,项目名称:Pinta,代码行数:18,代码来源:CommandMapWindow.cs


注:本文中的Gtk.Label.ModifyFont方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。