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


C# Gtk.HBox.PackEnd方法代码示例

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


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

示例1: QueryWidget

		public QueryWidget (PhotoQuery query, Db db, TagSelectionWidget selector)
		{
			tips.Enable ();

			this.query = query;
			query.Changed += HandleChanged;

			Gtk.HSeparator sep = new Gtk.HSeparator ();
			sep.Show ();
			this.PackStart (sep, false, false, 0);
			
			Gtk.HBox hbox = new Gtk.HBox ();
			hbox.Show ();
			this.PackStart (hbox, false, false, 0);
			
			label = new Gtk.Label (Catalog.GetString ("Find: "));
			label.Show ();
			label.Ypad = 9;
			hbox.PackStart (label, false, false, 0);

			untagged = new Gtk.Label (Catalog.GetString ("Untagged photos"));
			untagged.Visible = false;
			hbox.PackStart (untagged, false, false, 0);

			comma_label = new Gtk.Label (", ");
			comma_label.Visible = false;
			hbox.PackStart (comma_label, false, false, 0);

			rollfilter = new Gtk.Label (Catalog.GetString ("Import roll"));	
			rollfilter.Visible = false;
			hbox.PackStart (rollfilter, false, false, 0);

			logic_widget = new LogicWidget (query, db.Tags, selector);
			logic_widget.Show ();
			hbox.PackStart (logic_widget, true, true, 0);

			warning_box = new Gtk.HBox ();
			warning_box.PackStart (new Gtk.Label (System.String.Empty));
			
			Gtk.Image warning_image = new Gtk.Image ("gtk-info", Gtk.IconSize.Button);
			warning_image.Show ();
			warning_box.PackStart (warning_image, false, false, 0);
			
			clear_button = new Gtk.Button ();
			clear_button.Add (new Gtk.Image ("gtk-close", Gtk.IconSize.Button));
			clear_button.Clicked += HandleClearButtonClicked;
			clear_button.Relief = Gtk.ReliefStyle.None;
			hbox.PackEnd (clear_button, false, false, 0);
			tips.SetTip (clear_button, Catalog.GetString("Clear search"), null);

			Gtk.Label warning = new Gtk.Label (Catalog.GetString ("No matching photos found"));
			warning_box.PackStart (warning, false, false, 0);
			warning_box.ShowAll ();
			warning_box.Spacing = 6;
			warning_box.Visible = false;

			hbox.PackEnd (warning_box, false, false, 0);
			
			warning_box.Visible = false;
		}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:60,代码来源:QueryWidget.cs

示例2: MakeImageButton

		public static Gtk.Button MakeImageButton (Gtk.Image image, string label)
		{
			Gtk.HBox box = new Gtk.HBox (false, 2);
			box.PackStart (image, false, false, 0);
			box.PackEnd (new Gtk.Label (label), false, false, 0);
			box.ShowAll ();

			Gtk.Button button = new Gtk.Button ();

			Gtk.Alignment align = new Gtk.Alignment (0.5f, 0.5f, 0.0f, 0.0f);
			align.Add (box);
			align.Show ();

			button.Add (align);
			return button;
		}			
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:16,代码来源:GtkUtils.cs

示例3: Header

        public Header(string text)
            : base()
        {
            base.SetSizeRequest (-1, 30);

            Gtk.Alignment alignment = new Gtk.Alignment (0, 0, 1, 1);
            alignment.TopPadding = 1;
            alignment.LeftPadding = 5;
            alignment.RightPadding = 0;
            alignment.BottomPadding = 1;
            base.Add (alignment);

            //Select ();

            Gtk.HBox box = new Gtk.HBox ();
            alignment.Add (box);

            label = new Gtk.Label ();
            label.Ypad = 3;
            //	label.Xpad = 3;
            //base.Add (label);
            box.PackStart (label, true, true, 0);
            label.SetAlignment (0f, 0.5f);
            label.Justify = Gtk.Justification.Left;

            label.Markup = "<b>" + text + "</b>";

            closeButton = new Gtk.Button ();
            closeButton.Add (new Gtk.Image ("gtk-close", Gtk.IconSize.Menu));
            closeButton.Relief = Gtk.ReliefStyle.None;
            box.PackEnd (closeButton, false, false, 0);
            closeButton.ShowAll ();

            label.Show ();
            box.Show ();
            alignment.Show ();

            closeButton.Clicked += closeButton_Clicked;
        }
开发者ID:codebutler,项目名称:meshwork,代码行数:39,代码来源:Header.cs

示例4: Main

 public Main(Controller.Main c)
     : base(Gtk.WindowType.Toplevel)
 {
     ctl = c;
     Name = "di";
     Title = "di";
     DefaultWidth = 800;
     DefaultHeight = 600;
     DeleteEvent += OnDeleteEvent;
     topLevelBox = new Gtk.HBox();
     topLevelBox.Homogeneous = false;
     topLevelBox.Spacing = 20;
     Add(topLevelBox);
     windowsBox = new Gtk.HBox();
     windowsBox.Homogeneous = true;
     windowsBox.Spacing = 10;
     foreach (var window in ctl.Windows)
     {
         var view = new WindowView(this, window);
         windowsBox.Add(view);
     }
     topLevelBox.PackStart(windowsBox, true, true, 0);
     ctl.Windows.Added.Add((index, window) =>
     {
         var view = new WindowView(this, window);
         windowsBox.Add(view);
         windowsBox.ShowAll();
     });
     ctl.Windows.Removed.Add((index, window) =>
     {
         var view = windowsBox.Children[index];
         bool hadFocus = view.ContainsFocus();
         windowsBox.Remove(view);
         if (hadFocus && windowsBox.Children.Length > 0)
         {
             windowsBox.Children[0].GiveFocus();
         }
     });
     ctl.Windows.Cleared.Add(() =>
     {
         foreach (var view in windowsBox.Children)
         {
             windowsBox.Remove(view);
         }
     });
     ctl.Windows.CurrentChanged.Add((idx, win) => ApplyControllerFocus(win));
     ctl.BeginTask.Add(task =>
     {
         var sidebar = Sidebar.Create(task);
         topLevelBox.PackEnd(sidebar, false, false, 20);
         task.End.Add(() =>
         {
             bool hadFocus = sidebar.ContainsFocus();
             topLevelBox.Remove(sidebar);
             if (hadFocus)
             {
                 ApplyControllerFocus(ctl.Windows.Current);
             }
         });
         sidebar.ShowAll();
     });
 }
开发者ID:ktvoelker,项目名称:di,代码行数:62,代码来源:Main.cs

示例5: ChatView

        public ChatView(ChatModel chat)
        {
            Trace.Call(chat);

            _ChatModel = chat;

            IsAutoScrolling = true;
            MessageTextView tv = new MessageTextView();
            _EndMark = tv.Buffer.CreateMark("end", tv.Buffer.EndIter, false);
            tv.ShowTimestamps = true;
            tv.ShowMarkerline = true;
            tv.Editable = false;
            tv.CursorVisible = true;
            tv.WrapMode = Gtk.WrapMode.Char;
            tv.MessageAdded += OnMessageTextViewMessageAdded;
            tv.MessageHighlighted += OnMessageTextViewMessageHighlighted;
            tv.PopulatePopup += OnMessageTextViewPopulatePopup;
            tv.SizeRequested += delegate {
                AutoScroll();
            };
            tv.PersonClicked += OnMessageTextViewPersonClicked;
            _OutputMessageTextView = tv;

            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            _OutputScrolledWindow = sw;
            //sw.HscrollbarPolicy = Gtk.PolicyType.Never;
            sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;
            sw.VscrollbarPolicy = Gtk.PolicyType.Always;
            sw.ShadowType = Gtk.ShadowType.In;
            sw.Vadjustment.ValueChanged += OnVadjustmentValueChanged;
            sw.Add(_OutputMessageTextView);

            // popup menu
            _TabMenu = new Gtk.Menu();
            _TabMenu.Shown += OnTabMenuShown;

            //FocusChild = _OutputTextView;
            //CanFocus = false;

            _TabLabel = new Gtk.Label();

            TabImage = DefaultTabImage;
            _TabHBox = new Gtk.HBox();
            _TabHBox.PackEnd(new Gtk.Fixed(), true, true, 0);
            _TabHBox.PackEnd(_TabLabel, false, false, 0);
            _TabHBox.PackStart(TabImage, false, false, 2);
            _TabHBox.ShowAll();

            _TabEventBox = new Gtk.EventBox();
            _TabEventBox.VisibleWindow = false;
            _TabEventBox.ButtonPressEvent += new Gtk.ButtonPressEventHandler(OnTabButtonPress);
            _TabEventBox.Add(_TabHBox);
            _TabEventBox.ShowAll();

            _ThemeSettings = new ThemeSettings();

            // OPT-TODO: this should use a TaskStack instead of TaskQueue
            _LastSeenHighlightQueue = new TaskQueue("LastSeenHighlightQueue("+ID+")");
            _LastSeenHighlightQueue.AbortedEvent += OnLastSeenHighlightQueueAbortedEvent;
            _LastSeenHighlightQueue.ExceptionEvent += OnLastSeenHighlightQueueExceptionEvent;
        }
开发者ID:Jaykul,项目名称:smuxi,代码行数:61,代码来源:ChatView.cs

示例6: createGui

        public void createGui()
        {
            basedir_section=new Section("cuesheets-basedir","CueSheet Music Directory:",20);
            source_page.Add (basedir_section);

            string dir=_source.getCueSheetDir();
            Gtk.Label lbl=new Gtk.Label("CueSheet Music Directory:");
            Gtk.FileChooserButton btn=new Gtk.FileChooserButton("CueSheet Music Directory:",Gtk.FileChooserAction.SelectFolder);
            if (dir!=null) {
                btn.SelectFilename (dir);
            }
            Gtk.HBox box=new Gtk.HBox();
            box.Add (lbl);
            box.Add (btn);
            box.ShowAll ();
            btn.CurrentFolderChanged+=delegate(object sender,EventArgs args) {
                string dir1=btn.Filename;
                Hyena.Log.Information ("Folder changed to = "+dir1);
            };
            btn.FileSet+=delegate(object sender,EventArgs args) {
                string dir1=btn.Filename;
                Hyena.Log.Information ("Base directory changed to = "+dir1);
                _source.setCueSheetDir(dir1);
            };

            Console.WriteLine (_source);

            Gtk.VBox vb=new Gtk.VBox();
            vb.PackStart (box,false,false,0);

            Gtk.Image icn_about=new Gtk.Image(Gtk.Stock.About,Gtk.IconSize.Button);
            Gtk.Button about=new Gtk.Button(icn_about);
            about.Clicked+=new EventHandler(handleAbout);
            Gtk.HBox hb=new Gtk.HBox();
            Gtk.Label _about=new Gtk.Label("About the CueSheet extension");
            hb.PackEnd (about,false,false,0);
            hb.PackEnd (_about,false,false,5);
            vb.PackStart (hb,false,false,0);
            Gtk.HBox hb1=new Gtk.HBox();
            Gtk.Label _info=new Gtk.Label("How to use the Cuesheet extension (opens browser)");
            Gtk.Image icn_info=new Gtk.Image(Gtk.Stock.Info,Gtk.IconSize.Button);
            Gtk.Button btn_info=new Gtk.Button(icn_info);
            btn_info.Clicked+=new EventHandler(handleInfo);
            hb1.PackEnd(btn_info,false,false,0);
            hb1.PackEnd(_info,false,false,5);
            vb.PackStart (hb1,false,false,0);

            Gtk.HBox hbX=new Gtk.HBox();
            vb.PackEnd (hbX,true,true,0);

            vb.ShowAll ();

            source_page.DisplayWidget = vb;
        }
开发者ID:nailyk,项目名称:banshee-community-extensions,代码行数:54,代码来源:CueSheetsPrefs.cs

示例7: CreateControls


//.........这里部分代码省略.........

			Gtk.Action gaction = node.Action.GtkAction;
			bool barItem = parentMenu.IsTopMenu;
		
			string text = gaction.Label;
			string stock = gaction.StockId;

			if (barItem) {
				icon = null;
			} else if (node.Action.Type == Stetic.Wrapper.Action.ActionType.Radio) {
				icon = new CheckActionIcon (true, node.Action.Active);
			} else if (node.Action.Type == Stetic.Wrapper.Action.ActionType.Toggle) {
				icon = new CheckActionIcon (node.Action.DrawAsRadio, node.Action.Active);
			}
				
			if (stock != null) {
				Gtk.StockItem item = Gtk.Stock.Lookup (stock);
				if (text == null || text.Length == 0)
					text = item.Label;
				
				if (item.Keyval != 0 && !editing && !barItem) {
					Gtk.Label lac = new Gtk.Label ();
					string accelName =  Gtk.Accelerator.Name (item.Keyval, item.Modifier).ToUpper ();
					accelName = accelName.Replace ("<CONTROL>", "Ctrl+");
					accelName = accelName.Replace ("<SHIFT>", "Shift+");
					accelName = accelName.Replace ("<ALT>", "Alt+");
					lac.Text = accelName;
					accel = lac;
				}
				
				if (icon == null && !barItem)
					icon = node.Action.CreateIcon (Gtk.IconSize.Menu);
			}
			
			if (editing && !isGlobal) {
				if (!barItem) {
					Gtk.HBox bbox = new Gtk.HBox ();
					if (icon != null) {
						bbox.PackStart (icon, false, false, 0);
					}
					bbox.PackStart (new Gtk.Arrow (Gtk.ArrowType.Down, Gtk.ShadowType.In), false, false, 0);
					Gtk.Button b = new Gtk.Button (bbox);
					b.TooltipText = Catalog.GetString ("Select action type");
					b.Relief = Gtk.ReliefStyle.None;
					b.ButtonPressEvent += OnSelectIcon;
					icon = b;
				} else
					icon = null;
				
				Gtk.Entry entry = new Gtk.Entry ();
				entry.Text = text;
				entry.Activated += OnLabelActivated;
				entry.KeyPressEvent += OnEntryKeyPress;
				entry.HasFrame = false;
				this.label = entry;
				entry.TooltipText = Catalog.GetString ("Action label");
			} else {
				Gtk.Label label = new Gtk.Label (text);
				label.Xalign = 0;
				this.label = label;
			}
			
			if (editing && wrapper != null) {
				// Add a button for creating / deleting a submenu
				Gdk.Pixbuf img;
				string tip;
				if (node.Type != Gtk.UIManagerItemType.Menu) {
					img = addMenuImage;
					tip = Catalog.GetString ("Add submenu (Ctrl+Right)");
				} else {
					img = removeMenuImage;
					tip = Catalog.GetString ("Remove submenu (Ctrl+Left)");
				}
					
				Gtk.Button sb = new Gtk.Button (new Gtk.Image (img));
				sb.TooltipText = tip;
				sb.Relief = Gtk.ReliefStyle.None;
				sb.Clicked += OnCreateDeleteSubmenu;
				
				// Make sure the button is alligned to the right of the column
				Gtk.HBox bbox = new Gtk.HBox ();
				bbox.PackEnd (sb, false, false, 0);
				accel = bbox;
			}
			
			
			if (node.Type == Gtk.UIManagerItemType.Menu && !editing && !barItem) {
				Gtk.Arrow arrow = new Gtk.Arrow (Gtk.ArrowType.Right, Gtk.ShadowType.None);
				arrow.Xalign = 1;
				this.accel = arrow;
			}
			
			if (itemSpacing > 0 && icon != null) {
				// Add some padding to the left of the icon
				Gtk.Alignment a = new Gtk.Alignment (0, 0.5f, 0, 0);
				a.LeftPadding = itemSpacing;
				a.Add (icon);
				icon = a;
			}
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:101,代码来源:ActionMenuItem.cs

示例8: CreateGui


//.........这里部分代码省略.........

            _store=new Gtk.ListStore(typeof(int),typeof(string),typeof(string),typeof(string),typeof(string),typeof(string));
            _tracks=new Gtk.TreeView();
            {
                Gtk.CellRendererText cr0=new Gtk.CellRendererText();
                cr0.Scale=0.8;
                _tracks.AppendColumn ("Nr.", cr0, "text", 0);

                Gtk.CellRendererText cr_title=new Gtk.CellRendererText();
                cr_title.Scale=0.8;
                cr_title.Editable=true;
                cr_title.Edited+=new Gtk.EditedHandler(delegate(object sender,Gtk.EditedArgs args) {
                    setCell(1,args.NewText,new Gtk.TreePath(args.Path));
                });
                _tracks.AppendColumn ("Title", cr_title, "text", 1);

                Gtk.CellRendererText cr_artist=new Gtk.CellRendererText();
                cr_artist.Editable=true;
                cr_artist.Scale=0.8;
                cr_artist.Edited+=new Gtk.EditedHandler(delegate(object sender,Gtk.EditedArgs args) {
                    setCell(2,args.NewText,new Gtk.TreePath(args.Path));
                });
                _tracks.AppendColumn ("Artist", cr_artist, "text", 2);

                Gtk.CellRendererText cr_composer=new Gtk.CellRendererText();
                cr_composer.Editable=true;
                cr_composer.Scale=0.8;
                cr_composer.Edited+=new Gtk.EditedHandler(delegate(object sender,Gtk.EditedArgs args) {
                    setCell(3,args.NewText,new Gtk.TreePath(args.Path));
                });
                _tracks.AppendColumn ("Composer", cr_composer, "text", 3);

                Gtk.CellRendererText cr_piece=new Gtk.CellRendererText();
                cr_piece.Editable=true;
                cr_piece.Scale=0.8;
                cr_piece.Edited+=new Gtk.EditedHandler(delegate(object sender,Gtk.EditedArgs args) {
                    setCell(4,args.NewText,new Gtk.TreePath(args.Path));
                });
                _tracks.AppendColumn ("Piece", cr_piece, "text", 4);

                Gtk.CellRendererText cr_time=new Gtk.CellRendererText();
                cr_time.Editable=true;
                cr_time.Scale=0.8;
                cr_time.Edited+=new Gtk.EditedHandler(delegate(object sender,Gtk.EditedArgs args) {
                    setCell (5,args.NewText,new Gtk.TreePath(args.Path));
                });
                _tracks.AppendColumn ("Offset", cr_time, "text", 5);
            }

            _tracks.Model = _store;

            Gtk.Table tbl=new Gtk.Table(2,5,false);
            tbl.Attach (new Gtk.Label("Album:"),0,1,0,1);
            tbl.Attach (_title,1,2,0,1);
            tbl.Attach (new Gtk.Label("Artist:"),0,1,1,2);
            tbl.Attach (_performer,1,2,1,2);
            tbl.Attach (new Gtk.Label("Composer:"),0,1,2,3);
            tbl.Attach (_composer,1,2,2,3);
            tbl.Attach (new Gtk.Label("Subtitle:"),0,1,3,4);
            tbl.Attach (_subtitle,1,2,3,4);
            tbl.Attach (new Gtk.Label("year:"),0,1,4,5);
            tbl.Attach (_year,1,2,4,5);

            Gtk.Frame frm=new Gtk.Frame();
            frm.Add (tbl);

            Gtk.HBox hb2=new Gtk.HBox();
            hb2.PackEnd (_reload,false,false,1);
            hb2.PackEnd (_del_track,false,false,1);
            hb2.PackEnd (_add_track,false,false,1);
            hb2.PackEnd (_save,false,false,1);

            Gtk.HBox hb=new Gtk.HBox();
            Gtk.VBox vb1=new Gtk.VBox();
            vb1.PackStart (frm,false,false,0);
            vb1.PackStart (hb2,true,true,0);
            hb.PackStart (vb1,false,false,0);

            Gtk.Frame frm2=new Gtk.Frame();
            frm2.Add (_image);
            Gtk.VBox vbi=new Gtk.VBox();
            Gtk.HBox bb=new Gtk.HBox();
            bb.PackStart(new Gtk.VBox(),true,true,0);
            bb.PackStart(frm2,false,false,0);
            bb.PackEnd (new Gtk.VBox(),true,true,0);

            vbi.PackStart (bb,true,true,2);
            vbi.PackEnd (_imagefile,false,false,2);
            hb.PackEnd (vbi,true,true,2);

            Gtk.ScrolledWindow scroll=new Gtk.ScrolledWindow();
            scroll.Add (_tracks);
            scroll.SetSizeRequest (800,300);

            base.VBox.PackStart(hb,false,false,4);
            base.VBox.PackStart(scroll,true,true,0);
            base.VBox.ShowAll ();

            base.AddButton ("Close",0);
        }
开发者ID:nailyk,项目名称:banshee-community-extensions,代码行数:101,代码来源:CueSheetEditor.cs

示例9: ConstructContents

		void ConstructContents ()
		{
			if (button.Child != null)
				button.Remove (button.Child);

			if (useUnderline) {
				labelWidget = new Gtk.Label (label);
				labelWidget.MnemonicWidget = button;
			} else
				labelWidget = Gtk.Label.New (label);

			Gtk.Image imageWidget = (Gtk.Image)Registry.NewInstance ("Gtk.Image", proj);
			Image imageWrapper = (Image)Widget.Lookup (imageWidget);
			imageWrapper.Unselectable = true;
			if (type != ButtonType.StockItem) {
				imageWrapper.Pixbuf = imageInfo;
			}

			Gtk.HBox box = new Gtk.HBox (false, 2);
			box.PackStart (imageWidget, false, false, 0);
			box.PackEnd (labelWidget, false, false, 0);

			Gtk.Alignment alignment = new Gtk.Alignment (button.Xalign, button.Yalign, 0.0f, 0.0f);
			alignment.Add (box);

			ObjectWrapper buttonWrapper = ObjectWrapper.Lookup (this);
			Widget wrapper = (Widget)ObjectWrapper.Create (proj, labelWidget, buttonWrapper);
			wrapper.Unselectable = true;
			wrapper = (Widget)ObjectWrapper.Create (proj, box, buttonWrapper);
			wrapper.Unselectable = true;
			wrapper = (Widget)ObjectWrapper.Create (proj, alignment, buttonWrapper);
			wrapper.Unselectable = true;

			alignment.ShowAll ();
			button.Add (alignment);
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:36,代码来源:Button.cs

示例10: ClockControls

		Gtk.Widget ClockControls ()
		{

#if GTK2
			var vbox = new Gtk.VBox ();
			var spinners = new Gtk.HBox ();
#else
			var vbox = new Gtk.HBox ();
			var spinners = new Gtk.VBox ();
#endif
			vbox.Spacing = 6;
			spinners.Spacing = 6;

			clock = new AnalogClock();
			clock.SetSizeRequest (130, 130);
			vbox.PackStart(clock, true, true, 0);


			spinners.PackStart (new Gtk.Label ("Hour"), false, false, 0);
			
			hourSpin = CreateSpinner (24, 1, null);
			spinners.PackStart (hourSpin, false, false, 0);

			spinners.PackStart (new Gtk.Label ("Min"), false, false, 0);

			minutesSpin = CreateSpinner (60, 10, hourSpin);
			spinners.PackStart (minutesSpin, false, false, 0);
			
			spinners.PackStart (new Gtk.Label ("Sec"), false, false, 0);

			secondsSpin = CreateSpinner (60, 10, minutesSpin);
			spinners.PackStart (secondsSpin, false, false, 0);
			
			vbox.PackEnd (spinners, false, false, 0);

			return vbox;
		}
开发者ID:mhusen,项目名称:Eto,代码行数:37,代码来源:DateComboBoxDialog.cs

示例11: FeedbackDialog

		public FeedbackDialog (int x, int y): base (Gtk.WindowType.Toplevel)
		{
			SetDefaultSize (350, 200);
			if (x == -1 && y == -1) {
				int ww, wh;
				IdeApp.Workbench.RootWindow.GdkWindow.GetSize (out ww, out wh);
				IdeApp.Workbench.RootWindow.GdkWindow.GetOrigin (out x, out y);
				x = ww / 2 - 350 / 2;
				y = wh / 2 - 200 / 2;
				Move (x, y);
			} else
				Move (x - 350, y - 200);

			mainFrame = new Gtk.Frame ();
			
			mainBox = new Gtk.VBox ();
			mainBox.BorderWidth = 12;
			mainBox.Spacing = 6;
			headerBox = new Gtk.HBox ();
			mailEntry = new EntryWithEmptyMessage ();
			mailEntry.EmptyMessage = GettextCatalog.GetString ("email address");
			Decorated = false;
			mainFrame.ShadowType = Gtk.ShadowType.Out;
			
			// Header
			
			headerBox.Spacing = 6;
			mailLabel = new Gtk.Label ();
			headerBox.PackStart (mailLabel, false, false, 0);
			Gtk.Button changeButton = new Gtk.Button ("(Change)");
			changeButton.Relief = Gtk.ReliefStyle.None;
			headerBox.PackStart (changeButton, false, false, 0);
			changeButton.Clicked += HandleChangeButtonClicked;
			mainBox.PackStart (headerBox, false, false, 0);
			mainBox.PackStart (mailEntry, false, false, 0);
			mailWarningLabel = new Gtk.Label (GettextCatalog.GetString ("Please enter a valid e-mail address"));
			mailWarningLabel.Xalign = 0;
			mainBox.PackStart (mailWarningLabel, false, false, 0);
			
			// Body
			
			textEntry = new TextViewWithEmptyMessage ();
			textEntry.EmptyMessage = GettextCatalog.GetString (
				"Tell us how we can make {0} better.",
				BrandingService.SuiteName
			);
			textEntry.AcceptsTab = false;
			textEntry.WrapMode = Gtk.WrapMode.Word;
			textEntry.WidthRequest = 300;
			var sw = new Gtk.ScrolledWindow ();
			sw.ShadowType = Gtk.ShadowType.In;
			sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;
			sw.HscrollbarPolicy = Gtk.PolicyType.Never;
			sw.Add (textEntry);
			mainBox.PackStart (sw, true, true, 0);
			bodyWarningLabel = new Gtk.Label (GettextCatalog.GetString ("Please enter some feedback"));
			bodyWarningLabel.Xalign = 0;
			mainBox.PackStart (bodyWarningLabel, false, false, 0);
			
			// Bottom
			
			Gtk.HBox bottomBox = new Gtk.HBox (false, 6);
			Gtk.Label countLabel = new Gtk.Label ();
			countLabel.Xalign = 0;
			bottomBox.PackStart (countLabel, false, false, 0);
			
			Gtk.Button sendButton = new Gtk.Button (GettextCatalog.GetString ("Send Feedback"));
			sendButton.Clicked += HandleSendButtonClicked;
			bottomBox.PackEnd (sendButton, false, false, 0);
			mainBox.PackStart (bottomBox, false, false, 0);
			
			// Init
			
			mainBox.ShowAll ();
			
			mailWarningLabel.Hide ();
			bodyWarningLabel.Hide ();
			
			string mail = FeedbackService.ReporterEMail;
			if (string.IsNullOrEmpty (mail))
				mail = AuthorInformation.Default.Email;
			
			if (string.IsNullOrEmpty (mail)) {
				headerBox.Hide ();
				mailEntry.GrabFocus ();
			}
			else {
				mailEntry.Text = mail;
				mailEntry.Hide ();
				mailLabel.Text = GettextCatalog.GetString ("From: {0}", mail);
				textEntry.GrabFocus ();
			}
			if (FeedbackService.FeedbacksSent > 0)
				countLabel.Text = GettextCatalog.GetString ("Your feedbacks: {0}", FeedbackService.FeedbacksSent);
			else
				countLabel.Hide ();
			
			mainFrame.Show ();
			mainFrame.Add (mainBox);
			Add (mainFrame);
//.........这里部分代码省略.........
开发者ID:zenek-y,项目名称:monodevelop,代码行数:101,代码来源:FeedbackDialog.cs

示例12: CreateLabel

        Gtk.Widget CreateLabel(NotebookTab tab)
        {
            var vbox = new Gtk.HBox();
            Gtk.Label label = new Gtk.Label ();

            /* INTRODUCED BY houen */

            if (tab.Label.Contains("\\_"))
            {
                label.Text = tab.Label.Replace("\\_", "_");
            }
            else
            {
                label.TextWithMnemonic = tab.Label.Replace("\\_", "_");
            }

            /* INTRODUCED BY houen */

            label.Show ();
            vbox.PackStart(label);

            if(!label.Text.StartsWith(char.ConvertFromUtf32(0x200B)))
            {
                var closeImage = new Gtk.Image(Assembly.GetExecutingAssembly(), "Xwt.GtkBackend.delete.png");
                var button = new Gtk.ToolButton(closeImage, "");
                vbox.PackEnd(button, false, false, 0);
                button.Show();
                closeImage.Show();
                var nativeWidget = GetWidget((IWidgetBackend)Toolkit.GetBackend(tab.Child));
                button.Clicked += (object sender, EventArgs e) =>
                {
                    tab.OnClosing();
                    Widget.Remove(nativeWidget);
                };
            }

            return vbox;
        }
开发者ID:antmicro,项目名称:xwt,代码行数:38,代码来源:NotebookBackend.cs

示例13: ChatView

        public ChatView(ChatModel chat)
        {
            Trace.Call(chat);

            _ChatModel = chat;
            _Name = _ChatModel.Name;
            ID = _ChatModel.ID;
            Name = _Name;

            MessageTextView tv = new MessageTextView();
            _EndMark = tv.Buffer.CreateMark("end", tv.Buffer.EndIter, false);
            tv.ShowTimestamps = true;
            tv.ShowMarkerline = true;
            tv.Editable = false;
            tv.CursorVisible = true;
            tv.WrapMode = Gtk.WrapMode.Char;
            tv.MessageAdded += OnMessageTextViewMessageAdded;
            tv.MessageHighlighted += OnMessageTextViewMessageHighlighted;
            tv.PopulatePopup += OnMessageTextViewPopulatePopup;
            _OutputMessageTextView = tv;

            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            //sw.HscrollbarPolicy = Gtk.PolicyType.Never;
            sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;
            sw.VscrollbarPolicy = Gtk.PolicyType.Always;
            sw.ShadowType = Gtk.ShadowType.In;
            sw.Add(_OutputMessageTextView);
            _OutputScrolledWindow = sw;

            // popup menu
            _TabMenu = new Gtk.Menu();

            Gtk.ImageMenuItem close_item = new Gtk.ImageMenuItem(Gtk.Stock.Close, null);
            close_item.Activated += new EventHandler(OnTabMenuCloseActivated);
            _TabMenu.Append(close_item);
            _TabMenu.ShowAll();

            //FocusChild = _OutputTextView;
            //CanFocus = false;

            _TabLabel = new Gtk.Label();
            _TabLabel.Text = _Name;

            _TabHBox = new Gtk.HBox();
            _TabHBox.PackEnd(new Gtk.Fixed(), true, true, 0);
            _TabHBox.PackEnd(_TabLabel, false, false, 0);
            _TabHBox.ShowAll();

            _TabEventBox = new Gtk.EventBox();
            _TabEventBox.VisibleWindow = false;
            _TabEventBox.ButtonPressEvent += new Gtk.ButtonPressEventHandler(OnTabButtonPress);
            _TabEventBox.Add(_TabHBox);
            _TabEventBox.ShowAll();

            _ThemeSettings = new ThemeSettings();

            // OPT-TODO: this should use a TaskStack instead of TaskQueue
            _LastSeenHighlightQueue = new TaskQueue("LastSeenHighlightQueue("+_Name+")");
            _LastSeenHighlightQueue.AbortedEvent += OnLastSeenHighlightQueueAbortedEvent;
            _LastSeenHighlightQueue.ExceptionEvent += OnLastSeenHighlightQueueExceptionEvent;
        }
开发者ID:txdv,项目名称:smuxi,代码行数:61,代码来源:ChatView.cs

示例14: BuildNotebook

        private void BuildNotebook()
        {
            var vBox = new Gtk.VBox( false, 5 );
            var hBox = new Gtk.HPaned();
            this.nbDocPages = new Gtk.Notebook();
            this.nbDocPages.SwitchPage += (o, args) => this.OnCurrentPageChanged();

            // Text view for the document
            var swScrollText = new Gtk.ScrolledWindow();
            this.txtDocument = new Gtk.TextView { Editable = false };
            swScrollText.AddWithViewport( this.txtDocument );
            this.txtDocument.FocusOutEvent += (o, args) => this.StoreQuestionText();

            // Test treeview
            this.tvDocument = new Gtk.TreeView();
            var swScroll = new Gtk.ScrolledWindow();
            var frmTest = new Gtk.Frame( "Test" );
            ( (Gtk.Label) frmTest.LabelWidget ).Markup = "<b>Test</b>";
            frmTest.Add( swScroll );
            swScroll.AddWithViewport( this.tvDocument );

            // Frame question
            var frmQuestion = new Gtk.Frame( "Question" );
            var swScrolledQuestion = new Gtk.ScrolledWindow();
            ( (Gtk.Label) frmQuestion.LabelWidget ).Markup = "<b>Question</b>";
            this.edQuestionText = new Gtk.TextView();
            this.edQuestionText.KeyReleaseEvent += (o, args) => this.OnQuestionTextChanged();
            swScrolledQuestion.AddWithViewport( edQuestionText );
            frmQuestion.Add( swScrolledQuestion );
            vBox.PackStart( frmQuestion, false, false, 5 );

            // Frame answers
            var bttAnswers = new Gtk.HButtonBox();
            var vBoxAnswers = new Gtk.VBox( false, 5 );
            var frmAnswer = new Gtk.Frame( "Answer" );
            var hBoxAnswers = new Gtk.HBox( false, 5 );
            var hBoxCorrect = new Gtk.HBox( false, 5 );
            var swScrolledAnswers = new Gtk.ScrolledWindow();
            ( (Gtk.Label) frmAnswer.LabelWidget ).Markup = "<b>Answer</b>";
            this.tvAnswers = new Gtk.TreeView();
            swScrolledAnswers.Add( this.tvAnswers );
            this.btAddAnswer = new Gtk.Button( new Gtk.Image( this.iconAdd.ScaleSimple( 16, 16, InterpType.Bilinear ) ) );
            this.btAddAnswer.Clicked += (sender, e) => this.AddAnswer();
            this.btRemoveAnswer = new Gtk.Button( new Gtk.Image( this.iconRemove.ScaleSimple( 16, 16, InterpType.Bilinear ) ) );
            this.btRemoveAnswer.Clicked += (sender, e) => this.RemoveAnswer();
            bttAnswers.Add( this.btAddAnswer );
            bttAnswers.Add( this.btRemoveAnswer );
            bttAnswers.Layout = Gtk.ButtonBoxStyle.Center;
            bttAnswers.Spacing = 20;
            hBoxAnswers.PackStart( swScrolledAnswers, true, true, 5 );
            vBoxAnswers.PackStart( hBoxAnswers, true, true, 5 );
            this.spNumberValidAnswer = new Gtk.SpinButton( 1, 20, 1 );
            this.spNumberValidAnswer.ValueChanged += (o, args) => this.OnCorrectAnswerChanged();
            hBoxCorrect.PackStart( new Gtk.Label( "Correct answer:" ), false, false, 5 );
            hBoxCorrect.PackStart( this.spNumberValidAnswer, false, false, 5 );
            hBoxCorrect.PackEnd( bttAnswers, false, false, 5 );
            vBoxAnswers.PackStart( hBoxCorrect, false, false, 5 );
            frmAnswer.Add( vBoxAnswers );
            vBox.PackStart( frmAnswer, true, true, 5 );

            // Layout
            hBox.Pack1( frmTest, false, false );
            hBox.Pack2( vBox, false, false );
            this.nbDocPages.AppendPage( hBox, new Gtk.Label( "Edit" ) );
            this.nbDocPages.AppendPage( swScrollText, new Gtk.Label( "Document" ) );
            this.nbDocPages.Page = 0;
        }
开发者ID:Baltasarq,项目名称:Testy,代码行数:67,代码来源:MainWindowView.cs

示例15: ChatView

        public ChatView(ChatModel chat)
        {
            Trace.Call(chat);

            _ChatModel = chat;
            _Name = _ChatModel.Name;
            Name = _Name;

            // TextTags
            Gtk.TextTagTable ttt = new Gtk.TextTagTable();
            _OutputTextTagTable = ttt;
            Gtk.TextTag tt;
            Pango.FontDescription fd;

            tt = new Gtk.TextTag("bold");
            fd = new Pango.FontDescription();
            fd.Weight = Pango.Weight.Bold;
            tt.FontDesc = fd;
            ttt.Add(tt);

            tt = new Gtk.TextTag("italic");
            fd = new Pango.FontDescription();
            fd.Style = Pango.Style.Italic;
            tt.FontDesc = fd;
            ttt.Add(tt);

            tt = new Gtk.TextTag("underline");
            tt.Underline = Pango.Underline.Single;
            ttt.Add(tt);

            tt = new Gtk.TextTag("url");
            tt.Underline = Pango.Underline.Single;
            tt.Foreground = "darkblue";
            tt.TextEvent += new Gtk.TextEventHandler(_OnTextTagUrlTextEvent);
            fd = new Pango.FontDescription();
            tt.FontDesc = fd;
            ttt.Add(tt);

            Gtk.TextView tv = new Gtk.TextView();
            tv.Buffer = new Gtk.TextBuffer(ttt);
            _EndMark = tv.Buffer.CreateMark("end", tv.Buffer.EndIter, false);
            tv.Editable = false;
            //tv.CursorVisible = false;
            tv.CursorVisible = true;
            tv.WrapMode = Gtk.WrapMode.Char;
            tv.Buffer.Changed += new EventHandler(_OnTextBufferChanged);
            tv.MotionNotifyEvent += new Gtk.MotionNotifyEventHandler(_OnMotionNotifyEvent);
            _OutputTextView = tv;

            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            //sw.HscrollbarPolicy = Gtk.PolicyType.Never;
            sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;
            sw.VscrollbarPolicy = Gtk.PolicyType.Always;
            sw.ShadowType = Gtk.ShadowType.In;
            sw.Add(_OutputTextView);
            _OutputScrolledWindow = sw;

            // popup menu
            _TabMenu = new Gtk.Menu();

            Gtk.ImageMenuItem close_item = new Gtk.ImageMenuItem(Gtk.Stock.Close, null);
            close_item.Activated += new EventHandler(OnTabMenuCloseActivated);
            _TabMenu.Append(close_item);

            //FocusChild = _OutputTextView;
            //CanFocus = false;

            _TabLabel = new Gtk.Label();
            _TabLabel.Text = _Name;

            _TabHBox = new Gtk.HBox();
            _TabHBox.PackEnd(new Gtk.Fixed(), true, true, 0);
            _TabHBox.PackEnd(_TabLabel, false, false, 0);
            _TabHBox.ShowAll();

            _TabEventBox = new Gtk.EventBox();
            _TabEventBox.VisibleWindow = false;
            _TabEventBox.ButtonPressEvent += new Gtk.ButtonPressEventHandler(OnTabButtonPress);
            _TabEventBox.Add(_TabHBox);
            _TabEventBox.ShowAll();
        }
开发者ID:RoninBG,项目名称:smuxi,代码行数:81,代码来源:ChatView.cs


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