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


C# EventBox.ModifyBg方法代码示例

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


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

示例1: CreateColorBox

 private Widget CreateColorBox(string name, Gdk.Color color)
 {
     EventBox eb = new EventBox();
        eb.ModifyBg(StateType.Normal, color);
        Label l = new Label(name);
        eb.Add(l);
        l.Show();
        return eb;
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:9,代码来源:iFolderWindow.cs

示例2: TreeViewCellContainer

		public TreeViewCellContainer (Gtk.Widget child)
		{
			box = new EventBox ();
			box.ButtonPressEvent += new ButtonPressEventHandler (OnClickBox);
			box.ModifyBg (StateType.Normal, Style.White);
			box.Add (child);
			child.Show ();
			Show ();
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:9,代码来源:TreeViewCellContainer.cs

示例3: RecommendationPane

        public RecommendationPane()
        {
            Visible = false;

            EventBox event_box = new EventBox ();
            event_box.ModifyBg(StateType.Normal, new Gdk.Color(0xff,0xff,0xff));

            main_box = new HBox ();
            main_box.BorderWidth = 5;

            similar_box = new VBox (false, 3);
            tracks_box = new VBox (false, 3);
            albums_box = new VBox (false, 3);

            Label similar_header = new Label ();
            similar_header.Xalign = 0;
            similar_header.Ellipsize = Pango.EllipsizeMode.End;
            similar_header.Markup = String.Format ("<b>{0}</b>", Catalog.GetString ("Recommended Artists"));
            similar_box.PackStart (similar_header, false, false, 0);

            tracks_header = new Label ();
            tracks_header.Xalign = 0;
            tracks_header.WidthChars = 25;
            tracks_header.Ellipsize = Pango.EllipsizeMode.End;
            tracks_box.PackStart (tracks_header, false, false, 0);

            albums_header = new Label ();
            albums_header.Xalign = 0;
            albums_header.WidthChars = 25;
            albums_header.Ellipsize = Pango.EllipsizeMode.End;
            albums_box.PackStart (albums_header, false, false, 0);

            similar_items_table = new Table (DEFAULT_SIMILAR_TABLE_ROWS, DEFAULT_SIMILAR_TABLE_COLS, false);
            similar_items_table.SizeAllocated += OnSizeAllocated;
            similar_box.PackEnd (similar_items_table, true, true, 0);

            tracks_items_box = new VBox (false, 0);
            tracks_box.PackEnd (tracks_items_box, true, true, 0);

            albums_items_box = new VBox (false, 0);
            albums_box.PackEnd (albums_items_box, true, true, 0);

            main_box.PackStart (similar_box, true, true, 5);
            main_box.PackStart (new VSeparator (), false, false, 0);
            main_box.PackStart (tracks_box, false, false, 5);
            main_box.PackStart (new VSeparator (), false, false, 0);
            main_box.PackStart (albums_box, false, false, 5);

            event_box.Add (main_box);
            Add (event_box);

            if (!Directory.Exists (CACHE_PATH))
                Directory.CreateDirectory (CACHE_PATH);
        }
开发者ID:jrmuizel,项目名称:banshee-unofficial-plugins,代码行数:54,代码来源:RecommendationPane.cs

示例4: SparkleWindow

        public SparkleWindow()
            : base("")
        {
            Title          = "SparkleShare Setup";
            BorderWidth    = 0;
            IconName       = "folder-sparkleshare";
            Resizable      = false;
            WindowPosition = WindowPosition.Center;

            SetSizeRequest (680, 440);

            DeleteEvent += delegate (object o, DeleteEventArgs args) {

                args.RetVal = true;
                Close ();

            };

            HBox = new HBox (false, 6);

                VBox = new VBox (false, 0);

                    Wrapper = new VBox (false, 0) {
                        BorderWidth = 30
                    };

                    Buttons = CreateButtonBox ();

                VBox.PackStart (Wrapper, true, true, 0);
                VBox.PackStart (Buttons, false, false, 0);

                EventBox box = new EventBox ();
                Gdk.Color bg_color = new Gdk.Color ();
                Gdk.Color.Parse ("#2e3336", ref bg_color);
                box.ModifyBg (StateType.Normal, bg_color);

                    string image_path = SparkleHelpers.CombineMore (Defines.DATAROOTDIR, "sparkleshare",
                        "pixmaps", "side-splash.png");

                    Image side_splash = new Image (image_path) {
                        Yalign = 1
                    };

                box.Add (side_splash);

            HBox.PackStart (box, false, false, 0);
            HBox.PackStart (VBox, true, true, 0);

            base.Add (HBox);
        }
开发者ID:keamas,项目名称:SparkleShare,代码行数:50,代码来源:SparkleWindow.cs

示例5: SparkleSetupWindow

        public SparkleSetupWindow()
            : base("")
        {
            Title          = Catalog.GetString ("SparkleShare Setup");
            BorderWidth    = 0;
            IconName       = "folder-sparkleshare";
            Resizable      = false;
            WindowPosition = WindowPosition.Center;
            Deletable      = false;

            SetSizeRequest (680, 440);

            DeleteEvent += delegate (object o, DeleteEventArgs args) {
                args.RetVal = true;
                Close ();
            };

            HBox = new HBox (false, 6);

                VBox = new VBox (false, 0);

                    Wrapper = new VBox (false, 0) {
                        BorderWidth = 30
                    };

                    Buttons = CreateButtonBox ();

                VBox.PackStart (Wrapper, true, true, 0);
                VBox.PackStart (Buttons, false, false, 0);

                EventBox box = new EventBox ();
                Gdk.Color bg_color = new Gdk.Color ();
                Gdk.Color.Parse ("#000", ref bg_color);
                box.ModifyBg (StateType.Normal, bg_color);

                Image side_splash = SparkleUIHelpers.GetImage ("side-splash.png");
                side_splash.Yalign = 1;

            box.Add (side_splash);

            HBox.PackStart (box, false, false, 0);
            HBox.PackStart (VBox, true, true, 0);

            base.Add (HBox);
        }
开发者ID:kkris,项目名称:SparkleShare,代码行数:45,代码来源:SparkleSetupWindow.cs

示例6: AddFeature

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

			if (enabledByDefault) {
				Alignment al = new Alignment (0,0,0,0);
				al.SetPadding (6,6,6,6);
				al.Add (fl);
				cbox.PackStart (al, false, false, 0);
			}
			else {
				check = new CheckButton ();
				check.Image = fl;
				cbox.PackStart (check, false, false, 0);
				check.ModifyBg (StateType.Prelight, Style.MidColors [(int)StateType.Normal]);
				check.BorderWidth = 3;
			}
			EventBox eb = new EventBox ();
			if (!enabledByDefault) {
				eb.Realized += delegate {
					eb.GdkWindow.Cursor = handCursor;
				};
			}
			eb.ModifyBg (StateType.Normal, Style.MidColors[(int)StateType.Normal]);
			eb.Add (cbox);
			eb.ShowAll ();
			box.PackStart (eb, false, false, 0);
			
			HBox fbox = new HBox ();
			Gtk.Widget editor = feature.CreateFeatureEditor (parentCombine, entry);
			if (editor != null) {
				Label sp = new Label ("");
				sp.WidthRequest = 24;
				sp.Show ();
				fbox.PackStart (sp, false, false, 0);
				editor.Show ();
				fbox.PackStart (editor, false, false, 0);
				box.PackStart (fbox, false, false, 0);
			}
			
			if (check != null) {
				ISolutionItemFeature f = feature;
				check.Toggled += delegate {
					OnClickFeature (f, check, fbox, editor);
				};
			} else {
				fbox.Show ();
			}
			return editor;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:57,代码来源:CombineEntryFeatureSelector.cs

示例7: Build

        private void Build()
        {
            this.Title = "MonoGame Packager";
            this.DefaultWidth = this.WidthRequest = 640;
            this.DefaultHeight = this.HeightRequest = 480;

#if WINDOWS
            this.ModifyBg (StateType.Normal, new Gdk.Color (255, 255, 255));
#endif

#if GTK3
            var geom = new Gdk.Geometry();
            geom.MinWidth = geom.MaxWidth = this.DefaultWidth;
            geom.MinHeight = geom.MaxHeight = this.DefaultHeight;
            this.SetGeometryHints(this, geom, Gdk.WindowHints.MinSize | Gdk.WindowHints.MaxSize);
#else
            this.Resizable = false;
#endif

            vbox1 = new VBox();
            vbox1.Spacing = 4;

            notebook1 = new Notebook();
            notebook1.ShowBorder = false;
            notebook1.ShowTabs = false;

            // Wizard Page 0

            vbox2 = new VBox();
            vbox2.Spacing = 10;

            label1 = new Label();
            label1.Wrap = true;
            label1.LineWrapMode = Pango.WrapMode.Word;
            label1.Text = "Welcome to MonoGame Packager\n" +
                "\n" +
                "This tool will help you pack you desktop game for redistribution. It offers 2 options, installer and bundle of binaries. The difference between bundling the game into an archive with this tool and doing it by hand is the fact that this tool will help by adding per platform dependencies.";
            vbox2.PackStart(label1, true, true, 0);

            label2 = new Label("Do note that installer generation is usually only supported for the OS this tool is run from.\n");
            vbox2.PackStart(label2, false, true, 1);

            notebook1.Add(vbox2);

            // Wizaed Page 1

            table1 = new Table(5, 3, false);

            table1.Attach(new Label(), 0, 3, 0, 1);

            label3 = new Label(" Select game folder: ");
            label3.SetAlignment(0f, 0.5f);
            table1.Attach(label3, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            entryGameDir = new Entry();
            entryGameDir.Sensitive = false;
            table1.Attach(entryGameDir, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            btnBrowse = new Button("Browse...");
            btnBrowse.Clicked += BtnBrowse_Clicked;
            table1.Attach(btnBrowse, 2, 3, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            label4 = new Label(" Select game .exe file:");
            label4.SetAlignment(0f, 0.5f);
            table1.Attach(label4, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            scroll1 = new ScrolledWindow();
            scroll1.HeightRequest = 200;

            treeview1 = new TreeView();
            treeview1.HeightRequest = scroll1.HeightRequest;
            treeview1.HeadersVisible = false;
            treeview1.Reorderable = false;
            treeview1.CursorChanged += Treeview1_CursorChanged;

            scroll1.Add(treeview1);

            table1.Attach(scroll1, 0, 3, 3, 4, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

            table1.Attach(new Label(), 0, 3, 4, 5);

            notebook1.Add(table1);

            // Wizard Page 2

            table2 = new Table(10, 3, false);

            table2.Attach(new Label(), 0, 3, 0, 1);

            imageIcon = new Image();

            btnIcon = new Button(imageIcon);
            btnIcon.WidthRequest = btnIcon.HeightRequest = 64;
            btnIcon.Clicked += BtnIcon_Clicked;
            table2.Attach(btnIcon, 0, 1, 1, 3, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            label5 = new Label("Title:");
            label5.SetAlignment(0f, 0.5f);
            table2.Attach(label5, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

//.........这里部分代码省略.........
开发者ID:MonoGame,项目名称:MonoGame.Packager,代码行数:101,代码来源:MainWindow.GUI.cs

示例8: 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

示例9: CreateEventLog


//.........这里部分代码省略.........
                        date_label.Markup = "<b>Today</b>";

                    } else if (yesterday.Day   == activity_day.DateTime.Day &&
                               yesterday.Month == activity_day.DateTime.Month &&
                               yesterday.Year  == activity_day.DateTime.Year) {

                        date_label.Markup = "<b>Yesterday</b>";

                    } else {

                        date_label.Markup = "<b>" + activity_day.DateTime.ToString ("ddd MMM d, yyyy") + "</b>";

                    }

                box.Add (date_label);
                layout_vertical.PackStart (box, false, false, 0);

                Gdk.Color color = Style.Foreground (StateType.Insensitive);
                string secondary_text_color = SparkleUIHelpers.GdkColorToHex (color);

                foreach (SparkleCommit change_set in activity_day) {

                    VBox log_entry     = new VBox (false, 0);
                    VBox deleted_files = new VBox (false, 0);
                    VBox edited_files  = new VBox (false, 0);
                    VBox added_files   = new VBox (false, 0);
                    VBox moved_files   = new VBox (false, 0);

                    foreach (string file_path in change_set.Edited) {

                        SparkleLink link = new SparkleLink (file_path,
                            SparkleHelpers.CombineMore (LocalPath, file_path));

                        link.ModifyBg (StateType.Normal, background_color);

                        edited_files.PackStart (link, false, false, 0);

                    }

                    foreach (string file_path in change_set.Added) {

                        SparkleLink link = new SparkleLink (file_path,
                            SparkleHelpers.CombineMore (LocalPath, file_path));

                        link.ModifyBg (StateType.Normal, background_color);

                        added_files.PackStart (link, false, false, 0);

                    }

                    foreach (string file_path in change_set.Deleted) {

                        SparkleLink link = new SparkleLink (file_path,
                            SparkleHelpers.CombineMore (LocalPath, file_path));

                        link.ModifyBg (StateType.Normal, background_color);

                        deleted_files.PackStart (link, false, false, 0);

                    }

                    for (int i = 0; i < change_set.MovedFrom.Count; i++) {

                        SparkleLink from_link = new SparkleLink (change_set.MovedFrom [i],
                            SparkleHelpers.CombineMore (LocalPath, change_set.MovedFrom [i]));
开发者ID:qirtaiba,项目名称:SparkleShare,代码行数:66,代码来源:SparkleLog.cs

示例10: CreateTooltip

		EventBoxTooltip CreateTooltip (EventBox eventBox, string tooltipText)
		{
			Xwt.Drawing.Image image = ImageService.GetIcon ("md-information");
			eventBox.ModifyBg (StateType.Normal, leftHandBackgroundColor);
			eventBox.Add (new ImageView (image));
			eventBox.ShowAll ();

			return new EventBoxTooltip (eventBox) {
				ToolTip = GettextCatalog.GetString (tooltipText),
				Severity = TaskSeverity.Information
			};
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:12,代码来源:GtkProjectConfigurationWidget.cs

示例11: Build

		void Build ()
		{
			Title = GettextCatalog.GetString ("Exception Caught");
			DefaultWidth = 500;
			DefaultHeight = 500;
			HeightRequest = 350;
			WidthRequest = 350;
			VBox.Foreach (VBox.Remove);
			VBox.PackStart (CreateExceptionHeader (), false, true, 0);
			paned = new VPanedThin ();
			paned.GrabAreaSize = 10;
			paned.Pack1 (CreateStackTraceTreeView (), true, false);
			paned.Pack2 (CreateExceptionValueTreeView (), true, false);
			paned.Show ();
			var vbox = new VBox (false, 0);
			var whiteBackground = new EventBox ();
			whiteBackground.Show ();
			whiteBackground.ModifyBg (StateType.Normal, Ide.Gui.Styles.PrimaryBackgroundColor.ToGdkColor ());
			whiteBackground.Add (vbox);
			hadInnerException = HasInnerException ();
			if (hadInnerException) {
				vbox.PackStart (new VBox (), false, false, 6);
				vbox.PackStart (CreateInnerExceptionMessage (), false, true, 0);
				vbox.ShowAll ();
			}
			vbox.PackStart (paned, true, true, 0);
			vbox.Show ();

			if (hadInnerException) {
				var box = new HBox ();
				box.PackStart (CreateInnerExceptionsTree (), false, false, 0);
				box.PackStart (whiteBackground, true, true, 0);
				box.Show ();
				VBox.PackStart (box, true, true, 0);
				DefaultWidth = 900;
				DefaultHeight = 700;
				WidthRequest = 550;
				HeightRequest = 450;
			} else {
				VBox.PackStart (whiteBackground, true, true, 0);
			}
			var actionArea = new HBox (false, 0) { BorderWidth = 14 };

			OnlyShowMyCodeCheckbox = new CheckButton (GettextCatalog.GetString ("_Only show my code."));
			OnlyShowMyCodeCheckbox.Toggled += OnlyShowMyCodeToggled;
			OnlyShowMyCodeCheckbox.Show ();
			OnlyShowMyCodeCheckbox.Active = DebuggingService.GetUserOptions ().ProjectAssembliesOnly;

			var alignment = new Alignment (0.0f, 0.5f, 0.0f, 0.0f) { Child = OnlyShowMyCodeCheckbox };
			alignment.Show ();

			actionArea.PackStart (alignment, true, true, 0);
			actionArea.PackStart (CreateButtonBox (), false, true, 0);
			actionArea.PackStart (new VBox (), false, true, 3); // dummy just to take extra 6px at end to make it 20pixels
			actionArea.ShowAll ();

			VBox.PackStart (actionArea, false, true, 0);
		}
开发者ID:kdubau,项目名称:monodevelop,代码行数:58,代码来源: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: SetupWindow

        public SetupWindow() : base(string.Empty) {
            this.Title          = string.Format("{0} {1}", Properties_Resources.ApplicationName, Catalog.GetString("Setup"));
            this.BorderWidth    = 0;
            this.IconName       = "dataspacesync-app";
            this.Resizable      = false;
            this.WindowPosition = WindowPosition.Center;
            this.Deletable      = false;

            this.DeleteEvent += delegate(object sender, DeleteEventArgs args) {
                args.RetVal = true;
            };

            this.SecondaryTextColor = Style.Foreground(StateType.Insensitive).ToHex();

            this.SecondaryTextColorSelected = this.MixColors(
                new TreeView().Style.Foreground(StateType.Selected),
                new TreeView().Style.Background(StateType.Selected),
                0.15).ToHex();

            this.SetSizeRequest(680, 400);

            this.hBox = new HBox(false, 0);

            this.vBox = new VBox(false, 0);

            this.wrapper = new VBox(false, 0) {
                BorderWidth = 0
            };

            this.optionArea = new VBox(false, 0) {
                BorderWidth = 0
            };

            this.buttons = this.CreateButtonBox();

            HBox layout_horizontal = new HBox(false, 0) {
                BorderWidth = 0
            };

            layout_horizontal.PackStart(this.optionArea, true, true, 0);
            layout_horizontal.PackStart(this.buttons, false, false, 0);

            this.vBox.PackStart(this.wrapper, true, true, 0);
            this.vBox.PackStart(layout_horizontal, false, false, 15);

            EventBox box = new EventBox();
            Gdk.Color bg_color = new Gdk.Color();
            Gdk.Color.Parse("#000", ref bg_color);
            box.ModifyBg(StateType.Normal, bg_color);

            Image side_splash = UIHelpers.GetImage("side-splash.png");
            side_splash.Yalign = 1;

            box.Add(side_splash);

            this.hBox.PackStart(box, false, false, 0);
            this.hBox.PackStart(this.vBox, true, true, 30);

            base.Add(this.hBox);
        }
开发者ID:OpenDataSpace,项目名称:CmisSync,代码行数:60,代码来源:SetupWindow.cs

示例14: CreateiFolderActionButtonArea

 private Widget CreateiFolderActionButtonArea()
 {
     EventBox buttonArea = new EventBox();
        VBox actionsVBox = new VBox(false, 0);
        actionsVBox.WidthRequest = 100;
        buttonArea.ModifyBg(StateType.Normal, this.Style.Background(StateType.Normal));
        buttonArea.Add(actionsVBox);
        buttontips = new Tooltips();
     HBox ButtonControl = new HBox (false, 0);
        actionsVBox.PackStart(ButtonControl, false, false, 0);
        Image stopImage = new Image(Stock.Stop, Gtk.IconSize.Menu);
        stopImage.SetAlignment(0.5F, 0F);
        CancelSearchButton = new Button(stopImage);
        CancelSearchButton.Sensitive = false;
        CancelSearchButton.Clicked +=
     new EventHandler(OnCancelSearchButton);
        CancelSearchButton.Visible = false;
        HBox spacerHBox = new HBox(false, 0);
        ButtonControl.PackStart(spacerHBox, false, false, 0);
        HBox vbox = new HBox(false, 0);
        spacerHBox.PackStart(vbox, true, true, 0);
        HBox hbox = new HBox(false, 0);
        AddiFolderButton = new Button(hbox);
        vbox.PackStart(AddiFolderButton, false, false, 0);
        Label buttonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("Upload a folder...")));
        hbox.PackStart(buttonText, false, false, 4);
        buttonText.UseMarkup = true;
        buttonText.UseUnderline = false;
        buttonText.Xalign = 0;
        AddiFolderButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder48.png")));
        AddiFolderButton.Clicked +=
     new EventHandler(AddiFolderHandler);
        buttontips.SetTip(AddiFolderButton, Util.GS("Create iFolder"),"");
        hbox = new HBox(false, 0);
        ShowHideAllFoldersButton = new Button(hbox);
        vbox.PackStart(ShowHideAllFoldersButton, false, false, 0);
        ShowHideAllFoldersButtonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("View available iFolders")));
        hbox.PackStart(ShowHideAllFoldersButtonText, false, false, 4);
        ShowHideAllFoldersButtonText.UseMarkup = true;
        ShowHideAllFoldersButtonText.UseUnderline = false;
        ShowHideAllFoldersButtonText.Xalign = 0;
        ShowHideAllFoldersButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder48.png")));
        ShowHideAllFoldersButton.Clicked +=
     new EventHandler(ShowHideAllFoldersHandler);
        buttontips.SetTip(ShowHideAllFoldersButton, Util.GS("Show or Hide iFolder"),"");
        hbox = new HBox(false, 0);
        DownloadAvailableiFolderButton = new Button(hbox);
        vbox.PackStart(DownloadAvailableiFolderButton, false, false, 0);
        buttonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("Download...")));
        hbox.PackStart(buttonText, true, true, 4);
        buttonText.UseMarkup = true;
        buttonText.UseUnderline = false;
        buttonText.Xalign = 0;
        DownloadAvailableiFolderButton.Sensitive = false;
        DownloadAvailableiFolderButton.Image= new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder-download48.png")));
        DownloadAvailableiFolderButton.Clicked +=
     new EventHandler(DownloadAvailableiFolderHandler);
        buttontips.SetTip(DownloadAvailableiFolderButton, Util.GS("Download"),"");
        hbox = new HBox(false, 0);
        MergeAvailableiFolderButton = new Button(hbox);
        vbox.PackStart(MergeAvailableiFolderButton, false, false, 0);
        buttonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("Merge")));
        hbox.PackStart(buttonText, true, true, 4);
        buttonText.UseMarkup = true;
        buttonText.UseUnderline = false;
        buttonText.Xalign = 0;
        MergeAvailableiFolderButton.Sensitive = false;
        MergeAvailableiFolderButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("merge48.png")));
        MergeAvailableiFolderButton.Clicked +=
     new EventHandler(MergeAvailableiFolderHandler);
        buttontips.SetTip(MergeAvailableiFolderButton, Util.GS("Merge"),"");
        hbox = new HBox(false, 0);
        RemoveMembershipButton = new Button(hbox);
        vbox.PackStart(RemoveMembershipButton, false, false, 0);
        buttonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("Remove My Membership")));
        hbox.PackStart(buttonText, true, true, 4);
        buttonText.UseMarkup = true;
        buttonText.UseUnderline = false;
        buttonText.Xalign = 0;
        RemoveMembershipButton.Sensitive = false;
        RemoveMembershipButton.Visible = false;
        RemoveMembershipButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder-error48.png")));
        RemoveMembershipButton.Clicked += new EventHandler(RemoveMembershipHandler);
        buttontips.SetTip(RemoveMembershipButton, Util.GS("Remove My Membership"),"");
        hbox = new HBox(false, 0);
        DeleteFromServerButton = new Button(hbox);
        vbox.PackStart(DeleteFromServerButton, false, false, 0);
        buttonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("Delete from server")));
//.........这里部分代码省略.........
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:101,代码来源:iFolderWindow.cs

示例15: InitWindow

		///<summary>
		///	InitWindow
		/// Sets up the widgets and events in the chat window
		///</summary>	
		void InitWindow()
		{
			this.Icon = Utilities.GetIcon ("giver-48", 48);
			// Update the window title
			Title = string.Format ("Giver Recipients");	
			
			this.DefaultSize = new Gdk.Size (300, 500); 			

			// Start with an event box to paint the background white
			EventBox eb = new EventBox();
			eb.BorderWidth = 0;
            eb.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255));
            eb.ModifyBase(StateType.Normal, new Gdk.Color(255,255,255));

			VBox mainVBox = new VBox();
			mainVBox.BorderWidth = 0;
			mainVBox.Show ();
			eb.Add(mainVBox);
			this.Add (eb);

			scrolledWindow = new ScrolledWindow ();
			scrolledWindow.VscrollbarPolicy = PolicyType.Automatic;
			scrolledWindow.HscrollbarPolicy = PolicyType.Never;
			//scrolledWindow.ShadowType = ShadowType.None;
			scrolledWindow.BorderWidth = 0;
			scrolledWindow.CanFocus = true;
			scrolledWindow.Show ();
			mainVBox.PackStart (scrolledWindow, true, true, 0);

			// Add a second Event box in the scrolled window so it will also be white
			EventBox innerEb = new EventBox();
			innerEb.BorderWidth = 0;
            innerEb.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255));
            innerEb.ModifyBase(StateType.Normal, new Gdk.Color(255,255,255));

			targetVBox = new VBox();
			targetVBox.BorderWidth = 0;
			targetVBox.Show ();
			innerEb.Add(targetVBox);

			scrolledWindow.AddWithViewport(innerEb);

			//mainVBox.PackStart (targetVBox, false, false, 0);
			manualTarget = new TargetService();
			manualTarget.Show ();
			mainVBox.PackStart(manualTarget, false, false, 0);

			Shown += OnWindowShown;
			DeleteEvent += WindowDeleted;

			Application.Instance.TransferStarted += TransferStartedHandler;
		}
开发者ID:tcausby,项目名称:giver,代码行数:56,代码来源:TargetWindow.cs


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