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


C# Gtk.Button.Add方法代码示例

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


在下文中一共展示了Gtk.Button.Add方法的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: MultipleObjectViewer

 protected MultipleObjectViewer(IBroadcaster hub, string caption)
     : base(false, 0)
 {
     _hub = hub;
     // --- first line: caption and buttons
     Gtk.HBox hbxFirstLine = new Gtk.HBox(false, 2);
     // Caption label
     Gtk.Alignment labelAlign = new Gtk.Alignment(0F, 0F, 1F, 1F);
     labelAlign.Add(new Gtk.Label(caption));
     hbxFirstLine.PackStart(labelAlign, false, false, 0);
     hbxFirstLine.PackStart(new Gtk.Label(String.Empty), true, true, 0);
     // "Add" button
     Gtk.Image image = new Gtk.Image();
     image.Stock = Gtk.Stock.Add;
     _btnAdd = new Gtk.Button();
     _btnAdd.Add(image);
     _btnAdd.Relief = Gtk.ReliefStyle.None;
     _btnAdd.Clicked += new EventHandler(OnAddButtonClicked);
     _btnAdd.Sensitive = false;
     hbxFirstLine.PackStart(_btnAdd, false, false, 0);
     // "Edit" button
     image = new Gtk.Image();
     image.Stock = Gtk.Stock.JumpTo;
     _btnEdit = new Gtk.Button();
     _btnEdit.Add(image);
     _btnEdit.Relief = Gtk.ReliefStyle.None;
     _btnEdit.Clicked += new EventHandler(OnEditButtonClicked);
     _btnEdit.Sensitive = false;
     hbxFirstLine.PackStart(_btnEdit, false, false, 0);
     // "Delete" button
     image = new Gtk.Image();
     image.Stock = Gtk.Stock.Remove;
     _btnDelete = new Gtk.Button();
     _btnDelete.Add(image);
     _btnDelete.Relief = Gtk.ReliefStyle.None;
     _btnDelete.Clicked += new EventHandler(OnDeleteButtonClicked);
     _btnDelete.Sensitive = false;
     hbxFirstLine.PackStart(_btnDelete, false, false, 0);
     base.PackStart(hbxFirstLine, false, false, 0);
     // --- second line: element list
     _store = new Gtk.TreeStore(typeof(string));
     _tvList = new Gtk.TreeView();
     _tvList.HeadersVisible = false;
     _tvList.AppendColumn("", new Gtk.CellRendererText(), "text", 0);
     _tvList.Model = _store;
     _tvList.FocusInEvent += new Gtk.FocusInEventHandler(EnableButtons);
     _tvList.ButtonPressEvent += new Gtk.ButtonPressEventHandler(ListClickedHandler);
     Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
     sw.ShadowType = Gtk.ShadowType.In;
     sw.Add(_tvList);
     base.PackStart(sw, true, true, 0);
     sw.Show();
 }
开发者ID:MonoBrasil,项目名称:historico,代码行数:53,代码来源:MultipleObjectViewer.cs

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

示例4: SingleObjectViewer

 protected SingleObjectViewer(IBroadcaster hub, string caption)
     : base(false, 0)
 {
     Gtk.Image image;
     _hub = hub;
     // Caption label
     base.PackStart(new Gtk.Label(caption), false, false, 0);
     // Value entry
     _entry = new Gtk.Entry();
     _entry.IsEditable = false;
     base.PackStart(_entry, true, true, 0);
     // "Edit" button
     image = new Gtk.Image();
     image.Stock = Gtk.Stock.Find;
     _btnEdit = new Gtk.Button();
     _btnEdit.Add(image);
     _btnEdit.Relief = Gtk.ReliefStyle.None;
     _btnEdit.Clicked += new EventHandler(OnEditButtonClicked);
     _btnEdit.Sensitive = false;
     base.PackStart(_btnEdit, false, false, 0);
     // "Select" button
     image = new Gtk.Image();
     image.Stock = Gtk.Stock.JumpTo;
     _btnSelect = new Gtk.Button();
     _btnSelect.Add(image);
     _btnSelect.Relief = Gtk.ReliefStyle.None;
     _btnSelect.Clicked += new EventHandler(OnSelectButtonClicked);
     _btnSelect.Sensitive = false;
     base.PackStart(_btnSelect, false, false, 0);
     // "Clear" button
     image = new Gtk.Image();
     image.Stock = Gtk.Stock.Clear;
     _btnClear = new Gtk.Button();
     _btnClear.Add(image);
     _btnClear.Relief = Gtk.ReliefStyle.None;
     _btnClear.Clicked += new EventHandler(OnClearButtonClicked);
     _btnClear.Sensitive = false;
     base.PackStart(_btnClear, false, false, 0);
 }
开发者ID:MonoBrasil,项目名称:historico,代码行数:39,代码来源:SingleObjectViewer.cs

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

示例6: Build

 public static void Build(object obj, string id)
 {
     System.Collections.Hashtable bindings = new System.Collections.Hashtable();
     if ((id == "administrator.EditCreateUser")) {
         Gtk.Window cobj = ((Gtk.Window)(obj));
         // Widget administrator.EditCreateUser
         cobj.Title = "EditCreateUser";
         cobj.WindowPosition = ((Gtk.WindowPosition)(4));
         cobj.Events = ((Gdk.EventMask)(0));
         cobj.Name = "administrator.EditCreateUser";
         cobj.DefaultWidth = 400;
         cobj.DefaultHeight = 300;
         bindings["administrator.EditCreateUser"] = cobj;
         cobj.Show();
     }
     else {
         if ((id == "administrator.LoginWindow")) {
             Gtk.Window cobj = ((Gtk.Window)(obj));
             // Widget administrator.LoginWindow
             cobj.Title = "Boxerp Server Administrator";
             cobj.WindowPosition = ((Gtk.WindowPosition)(1));
             cobj.Modal = true;
             cobj.Resizable = false;
             cobj.AllowGrow = false;
             cobj.Events = ((Gdk.EventMask)(0));
             cobj.Name = "administrator.LoginWindow";
             // Container child administrator.LoginWindow.Gtk.Container+ContainerChild
             Gtk.VBox w1 = new Gtk.VBox();
             w1.BorderWidth = ((uint)(5));
             w1.Events = ((Gdk.EventMask)(0));
             w1.Name = "vbox1";
             // Container child vbox1.Gtk.Box+BoxChild
             Gtk.HBox w2 = new Gtk.HBox();
             w2.Events = ((Gdk.EventMask)(0));
             w2.Name = "hbox1";
             // Container child hbox1.Gtk.Box+BoxChild
             Gtk.Label w3 = new Gtk.Label();
             w3.LabelProp = "Login:";
             w3.Events = ((Gdk.EventMask)(0));
             w3.Name = "label1";
             w3.WidthRequest = 150;
             bindings["label1"] = w3;
             w2.Add(w3);
             Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(w2[w3]));
             w4.Position = 0;
             // Container child hbox1.Gtk.Box+BoxChild
             Gtk.Entry w5 = new Gtk.Entry();
             w5.Text = "demo";
             w5.IsEditable = true;
             w5.MaxLength = 100;
             w5.InvisibleChar = '●';
             w5.CanFocus = true;
             w5.Events = ((Gdk.EventMask)(0));
             w5.Name = "entryLogin";
             w5.WidthRequest = 200;
             bindings["entryLogin"] = w5;
             w2.Add(w5);
             Gtk.Box.BoxChild w6 = ((Gtk.Box.BoxChild)(w2[w5]));
             w6.Position = 1;
             w6.Expand = false;
             w6.Fill = false;
             bindings["hbox1"] = w2;
             w1.Add(w2);
             Gtk.Box.BoxChild w7 = ((Gtk.Box.BoxChild)(w1[w2]));
             w7.Position = 0;
             w7.Expand = false;
             w7.Fill = false;
             // Container child vbox1.Gtk.Box+BoxChild
             Gtk.HBox w8 = new Gtk.HBox();
             w8.Events = ((Gdk.EventMask)(0));
             w8.Name = "hbox2";
             w8.WidthRequest = 150;
             // Container child hbox2.Gtk.Box+BoxChild
             Gtk.Label w9 = new Gtk.Label();
             w9.LabelProp = "Password:";
             w9.Events = ((Gdk.EventMask)(0));
             w9.Name = "label2";
             bindings["label2"] = w9;
             w8.Add(w9);
             Gtk.Box.BoxChild w10 = ((Gtk.Box.BoxChild)(w8[w9]));
             w10.Position = 0;
             w10.Fill = false;
             // Container child hbox2.Gtk.Box+BoxChild
             Gtk.Entry w11 = new Gtk.Entry();
             w11.Text = "pass";
             w11.IsEditable = true;
             w11.Visibility = false;
             w11.InvisibleChar = '●';
             w11.CanFocus = true;
             w11.Events = ((Gdk.EventMask)(0));
             w11.Name = "entryPassword";
             w11.WidthRequest = 200;
             bindings["entryPassword"] = w11;
             w8.Add(w11);
             Gtk.Box.BoxChild w12 = ((Gtk.Box.BoxChild)(w8[w11]));
             w12.Position = 1;
             w12.Expand = false;
             w12.Fill = false;
             bindings["hbox2"] = w8;
             w1.Add(w8);
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:boxerp-svn,代码行数:101,代码来源:generated.cs

示例7: Build

 public static void Build(object obj, string id)
 {
     System.Collections.Hashtable bindings = new System.Collections.Hashtable();
     if ((id == "SharpTranslator.ReversibleCombos")) {
         Gtk.Bin cobj = ((Gtk.Bin)(obj));
         // Widget SharpTranslator.ReversibleCombos
         BinContainer.Attach(cobj);
         cobj.Events = ((Gdk.EventMask)(256));
         cobj.Name = "SharpTranslator.ReversibleCombos";
         // Container child SharpTranslator.ReversibleCombos.Gtk.Container+ContainerChild
         Gtk.HBox w1 = new Gtk.HBox();
         w1.Spacing = 5;
         w1.BorderWidth = ((uint)(5));
         w1.Events = ((Gdk.EventMask)(0));
         w1.Name = "hbox1";
         // Container child hbox1.Gtk.Box+BoxChild
         Gtk.Label w2 = new Gtk.Label();
         w2.LabelProp = "Source:";
         w2.Events = ((Gdk.EventMask)(0));
         w2.Name = "labelSource";
         bindings["labelSource"] = w2;
         w1.Add(w2);
         Gtk.Box.BoxChild w3 = ((Gtk.Box.BoxChild)(w1[w2]));
         w3.Position = 0;
         w3.Expand = false;
         w3.Fill = false;
         // Container child hbox1.Gtk.Box+BoxChild
         Gtk.ComboBox w4 = Gtk.ComboBox.NewText();
         w4.Events = ((Gdk.EventMask)(0));
         w4.Name = "comboSource";
         bindings["comboSource"] = w4;
         w1.Add(w4);
         Gtk.Box.BoxChild w5 = ((Gtk.Box.BoxChild)(w1[w4]));
         w5.Position = 1;
         w5.Expand = false;
         w5.Fill = false;
         // Container child hbox1.Gtk.Box+BoxChild
         Gtk.VSeparator w6 = new Gtk.VSeparator();
         w6.Events = ((Gdk.EventMask)(0));
         w6.Name = "vseparator1";
         bindings["vseparator1"] = w6;
         w1.Add(w6);
         Gtk.Box.BoxChild w7 = ((Gtk.Box.BoxChild)(w1[w6]));
         w7.Position = 2;
         w7.Expand = false;
         w7.Fill = false;
         // Container child hbox1.Gtk.Box+BoxChild
         Gtk.CheckButton w8 = new Gtk.CheckButton();
         w8.Label = "reverse";
         w8.DrawIndicator = true;
         w8.BorderWidth = ((uint)(5));
         w8.CanFocus = true;
         w8.Events = ((Gdk.EventMask)(0));
         w8.Name = "checkbuttonReverse";
         bindings["checkbuttonReverse"] = w8;
         w1.Add(w8);
         Gtk.Box.BoxChild w9 = ((Gtk.Box.BoxChild)(w1[w8]));
         w9.Position = 3;
         w9.Expand = false;
         // Container child hbox1.Gtk.Box+BoxChild
         Gtk.VSeparator w10 = new Gtk.VSeparator();
         w10.Events = ((Gdk.EventMask)(0));
         w10.Name = "vseparator2";
         bindings["vseparator2"] = w10;
         w1.Add(w10);
         Gtk.Box.BoxChild w11 = ((Gtk.Box.BoxChild)(w1[w10]));
         w11.Position = 4;
         w11.Expand = false;
         w11.Fill = false;
         // Container child hbox1.Gtk.Box+BoxChild
         Gtk.Label w12 = new Gtk.Label();
         w12.LabelProp = "Target:";
         w12.Events = ((Gdk.EventMask)(0));
         w12.Name = "labelTarget";
         bindings["labelTarget"] = w12;
         w1.Add(w12);
         Gtk.Box.BoxChild w13 = ((Gtk.Box.BoxChild)(w1[w12]));
         w13.Position = 5;
         w13.Expand = false;
         w13.Fill = false;
         // Container child hbox1.Gtk.Box+BoxChild
         Gtk.ComboBox w14 = Gtk.ComboBox.NewText();
         w14.Events = ((Gdk.EventMask)(0));
         w14.Name = "comboTarget";
         bindings["comboTarget"] = w14;
         w1.Add(w14);
         Gtk.Box.BoxChild w15 = ((Gtk.Box.BoxChild)(w1[w14]));
         w15.Position = 6;
         w15.Expand = false;
         w15.Fill = false;
         bindings["hbox1"] = w1;
         cobj.Add(w1);
         bindings["SharpTranslator.ReversibleCombos"] = cobj;
         w2.Show();
         w4.Show();
         w6.Show();
         w8.Show();
         w10.Show();
         w12.Show();
         w14.Show();
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:sharptranslator-svn,代码行数:101,代码来源:generated.cs

示例8: Build

 public static void Build(object obj, string id)
 {
     System.Collections.Hashtable bindings = new System.Collections.Hashtable();
     if ((id == "Boxerp.Client.GtkSharp.Lib.QuestionDialog")) {
         Gtk.Dialog cobj = ((Gtk.Dialog)(obj));
         // Widget Boxerp.Client.GtkSharp.Lib.QuestionDialog
         cobj.Title = "Question";
         cobj.WindowPosition = ((Gtk.WindowPosition)(4));
         cobj.Modal = true;
         cobj.HasSeparator = false;
         cobj.Events = ((Gdk.EventMask)(256));
         cobj.Name = "Boxerp.Client.GtkSharp.Lib.QuestionDialog";
         // Internal child Boxerp.Client.GtkSharp.Lib.QuestionDialog.VBox
         Gtk.VBox w1 = cobj.VBox;
         w1.BorderWidth = ((uint)(2));
         w1.Events = ((Gdk.EventMask)(256));
         w1.Name = "dialog_VBox";
         // Container child dialog_VBox.Gtk.Box+BoxChild
         Gtk.HBox w2 = new Gtk.HBox();
         w2.Events = ((Gdk.EventMask)(0));
         w2.Name = "hbox1";
         // Container child hbox1.Gtk.Box+BoxChild
         Gtk.Image w3 = new Gtk.Image();
         w3.Pixbuf = Gtk.IconTheme.Default.LoadIcon("gtk-dialog-info", 16, 0);
         w3.Events = ((Gdk.EventMask)(0));
         w3.Name = "image";
         bindings["image"] = w3;
         w2.Add(w3);
         Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(w2[w3]));
         w4.Position = 0;
         w4.Expand = false;
         w4.Fill = false;
         w4.Padding = ((uint)(5));
         // Container child hbox1.Gtk.Box+BoxChild
         Gtk.Label w5 = new Gtk.Label();
         w5.LabelProp = "Info";
         w5.Events = ((Gdk.EventMask)(0));
         w5.Name = "label";
         bindings["label"] = w5;
         w2.Add(w5);
         Gtk.Box.BoxChild w6 = ((Gtk.Box.BoxChild)(w2[w5]));
         w6.Position = 1;
         bindings["hbox1"] = w2;
         w1.Add(w2);
         Gtk.Box.BoxChild w7 = ((Gtk.Box.BoxChild)(w1[w2]));
         w7.Position = 0;
         w7.Expand = false;
         w7.Fill = false;
         w7.Padding = ((uint)(5));
         bindings["dialog_VBox"] = w1;
         // Internal child Boxerp.Client.GtkSharp.Lib.QuestionDialog.ActionArea
         Gtk.HButtonBox w8 = cobj.ActionArea;
         w8.LayoutStyle = ((Gtk.ButtonBoxStyle)(4));
         w8.Spacing = 10;
         w8.BorderWidth = ((uint)(5));
         w8.Events = ((Gdk.EventMask)(256));
         w8.Name = "Boxerp.Client.GtkSharp.Lib.QuestionDialog_ActionArea";
         // Container child Boxerp.Client.GtkSharp.Lib.QuestionDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild
         Gtk.Button w9 = new Gtk.Button();
         w9.CanFocus = true;
         w9.Events = ((Gdk.EventMask)(0));
         w9.Name = "button22";
         w9.CanDefault = true;
         // Container child button22.Gtk.Container+ContainerChild
         Gtk.Alignment w10 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
         w10.Events = ((Gdk.EventMask)(0));
         w10.Name = "GtkAlignment";
         // Container child GtkAlignment.Gtk.Container+ContainerChild
         Gtk.HBox w11 = new Gtk.HBox();
         w11.Spacing = 2;
         w11.Events = ((Gdk.EventMask)(0));
         w11.Name = "GtkHBox";
         // Container child GtkHBox.Gtk.Container+ContainerChild
         Gtk.Image w12 = new Gtk.Image();
         w12.Pixbuf = Gtk.IconTheme.Default.LoadIcon("gtk-no", 16, 0);
         w12.Events = ((Gdk.EventMask)(0));
         w12.Name = "image2";
         bindings["image2"] = w12;
         w11.Add(w12);
         // Container child GtkHBox.Gtk.Container+ContainerChild
         Gtk.Label w14 = new Gtk.Label();
         w14.LabelProp = "No";
         w14.Events = ((Gdk.EventMask)(0));
         w14.Name = "GtkLabel";
         bindings["GtkLabel"] = w14;
         w11.Add(w14);
         bindings["GtkHBox"] = w11;
         w10.Add(w11);
         bindings["GtkAlignment"] = w10;
         w9.Add(w10);
         bindings["button22"] = w9;
         cobj.AddActionWidget(w9, -9);
         Gtk.ButtonBox.ButtonBoxChild w18 = ((Gtk.ButtonBox.ButtonBoxChild)(w8[w9]));
         w18.Expand = false;
         w18.Fill = false;
         // Container child Boxerp.Client.GtkSharp.Lib.QuestionDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild
         Gtk.Button w19 = new Gtk.Button();
         w19.CanFocus = true;
         w19.Events = ((Gdk.EventMask)(0));
         w19.Name = "button24";
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:boxerp-svn,代码行数:101,代码来源:generated.cs

示例9: Rebuild

		private void Rebuild(Gtk.Table table, uint[][][] positions, GedcomIndividualRecord activePerson, GedcomFamilyLink[] lst)
		{
			foreach (Gtk.Widget child in table.Children)
			{
				child.Destroy();
			}
			table.Resize(1,1);
			
			uint xmax = 0;
			uint ymax = 0;
			
			for (int i = 0; i < positions.Length; i ++)
			{
				uint x = positions[i][0][0] + 1;
				uint y = positions[i][0][1] + 1;
				uint w = positions[i][0][2];
				uint h = positions[i][0][3];
				
				GedcomFamilyLink famLink = (GedcomFamilyLink)lst[i];
				if (famLink == null)
				{	
					PedigreeBox pw = new PedigreeBox(null, 0, null);
					
					if (i > 0 && lst[((i+1)/2)-1] != null)
					{
						GedcomFamilyLink missingFamLink = (GedcomFamilyLink)lst[((i+1)/2)-1];
						
						// missing parent button
						pw.ForceMouseOver = true;
					}
					// FIXME: both conditions do the same thing, double checking
					// the gramps code it doesn't appear to be a mistake in porting
					if (positions[i][0][2] > 1)
					{
						table.Attach(pw,x, x+w, y, y+h, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);
					}
					else
					{
						table.Attach(pw,x, x+w, y, y+h, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);
					}
					
					xmax = (uint)Math.Max(xmax, x + w);
					ymax = (uint)Math.Max(ymax, y + h);
				}
				else
				{
					GedcomIndividualRecord indi = (GedcomIndividualRecord)_database[famLink.Indi];
					
					if (_showImages && i < ((positions.Length - 1) / 2) && positions[i][0][3] > 1)
					{
						
					}
					
					PedigreeBox pw = new PedigreeBox(indi, positions[i][0][3], null);
					pw.SelectIndividual += PedigreeBox_SelectIndividual;
					
					if (positions[i][0][3] < 7)
					{
						pw.TooltipMarkup = pw.FormatPerson(11, true);
					}
					
					if (positions[i][0][2] > 1)
					{
						table.Attach(pw, x, x+w, y, y+h, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, 0);
					}
					else
					{
						table.Attach(pw, x, x+w, y, y+h, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);
					}
					
					xmax = (uint)Math.Max(xmax, x + w);
					ymax = (uint)Math.Max(ymax, y + h);
				}
				
				// connection lines
				if (positions[i].Length > 1)
				{
					// separate boxes for father and mother
					x = positions[i][1][0] + 1;
					y = positions[i][1][1] + 1;
					w = 1;
					h = positions[i][1][2];
					
					Gtk.DrawingArea line = new Gtk.DrawingArea();
					line.ExposeEvent += Line_Expose;
					bool rela = false;
					if (famLink != null && (famLink.Pedigree == PedegreeLinkageType.Birth || famLink.Pedigree == PedegreeLinkageType.Unknown))
					{
						line.AddEvents((int)Gdk.EventMask.ButtonPressMask);
						rela = true;
					}
					Utility.Pair<int, bool> lineData = new Pair<int,bool>();
					lineData.First = i * 2 + 1;
					lineData.Second = rela;
					_lines[line] = lineData;
					
					table.Attach(line, x, x + w, y, y + h, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);
					
					xmax = (uint)Math.Max(xmax, x + w);
					ymax = (uint)Math.Max(ymax, y + h);
//.........这里部分代码省略.........
开发者ID:Bert6623,项目名称:Gedcom.Net,代码行数:101,代码来源:PedigreeView.cs

示例10: Image

        public Image(bool allowStock, bool allowFile)
            : base(false, 6)
        {
            image = new Gtk.Image (Gnome.Stock.Blank, Gtk.IconSize.Button);
            PackStart (image, false, false, 0);

            if (allowStock) {
                store = new Gtk.ListStore (typeof (string), typeof (string));
                store.AppendValues (Gnome.Stock.Blank, Catalog.GetString ("(None)"));
                for (int i = 0; i < stockIds.Length; i++)
                    store.AppendValues (stockIds[i], stockLabels[i]);

                combo = new Gtk.ComboBoxEntry (store, LabelColumn);
                Gtk.CellRendererPixbuf iconRenderer = new Gtk.CellRendererPixbuf ();
                iconRenderer.StockSize = (uint)Gtk.IconSize.Menu;
                combo.PackStart (iconRenderer, false);
                combo.Reorder (iconRenderer, 0);
                combo.AddAttribute (iconRenderer, "stock-id", IconColumn);
                combo.Changed += combo_Changed;

                // Pack the combo non-expandily into a VBox so it doesn't
                // get stretched to the file button's height
                Gtk.VBox vbox = new Gtk.VBox (false, 0);
                vbox.PackStart (combo, true, false, 0);
                PackStart (vbox, true, true, 0);

                entry = (Gtk.Entry)combo.Child;
                entry.Changed += entry_Changed;

                useStock = true;
            }

            if (allowFile) {
                if (!allowStock) {
                    entry = new Gtk.Entry ();
                    PackStart (entry, true, true, 0);
                    entry.Changed += entry_Changed;
                }

                button = new Gtk.Button ();
                Gtk.Image icon = new Gtk.Image (Gtk.Stock.Open, Gtk.IconSize.Button);
                button.Add (icon);
                PackStart (button, false, false, 0);
                button.Clicked += button_Clicked;
            }
            ShowAll ();
        }
开发者ID:mono,项目名称:stetic,代码行数:47,代码来源:Image.cs

示例11: StockItemEditor

        public StockItemEditor()
        {
            Spacing = 3;
            imageFrame = new Gtk.Frame ();
            imageFrame.Shadow = Gtk.ShadowType.In;
            imageFrame.BorderWidth = 2;
            PackStart (imageFrame, false, false, 0);

            image = new Gtk.Image (Gnome.Stock.Blank, Gtk.IconSize.Button);
            imageFrame.Add (image);

            entry = new Gtk.Entry ();
            entry.Changed += OnTextChanged;
            entry.HasFrame = false;
            PackStart (entry, true, true, 0);

            button = new Gtk.Button ();
            button.Add (new Gtk.Arrow (Gtk.ArrowType.Down, Gtk.ShadowType.Out));
            PackStart (button, false, false, 0);
            button.Clicked += button_Clicked;
            ShowAll ();
        }
开发者ID:mono,项目名称:stetic,代码行数:22,代码来源:StockItem.cs

示例12: Build

		protected virtual void Build ()
		{
			Gtk.Window cobj = (Gtk.Window) null;
			// Widget Sya.reclutamiento
			cobj.Title = "Datos del Aspirante - Reclutamiento de Personal";
			Gtk.UIManager w1 = new Gtk.UIManager ();
			Gtk.ActionGroup w2 = new Gtk.ActionGroup ("Default");
			Gtk.Action w3 = new Gtk.Action ("goBack", null, null, "gtk-go-back");
			this.goBack = w3;
			w2.Add (w3, null);
			Gtk.Action w4 = new Gtk.Action ("goForward", null, null, "gtk-go-forward");
			this.goForward = w4;
			w2.Add (w4, null);
			Gtk.Action w5 = new Gtk.Action ("gotoLast", null, null, "gtk-goto-last");
			this.gotoLast = w5;
			w2.Add (w5, null);
			Gtk.Action w6 = new Gtk.Action ("print", null, null, "gtk-print");
			this.print = w6;
			w2.Add (w6, null);
			Gtk.Action w7 = new Gtk.Action ("save", null, null, "gtk-save");
			this.save = w7;
			w2.Add (w7, null);
			Gtk.Action w8 = new Gtk.Action ("quit", null, null, "gtk-quit");
			this.quit = w8;
			w2.Add (w8, null);
			Gtk.Action w9 = new Gtk.Action ("quit1", null, null, "gtk-quit");
			this.quit1 = w9;
			w2.Add (w9, null);
			Gtk.Action w10 = new Gtk.Action ("save1", null, null, "gtk-save");
			this.save1 = w10;
			w2.Add (w10, null);
			Gtk.Action w11 = new Gtk.Action ("quit2", null, null, "gtk-quit");
			this.quit2 = w11;
			w2.Add (w11, null);
			Gtk.Action w12 = new Gtk.Action ("about", null, null, "gtk-about");
			this.about = w12;
			w2.Add (w12, null);
			Gtk.Action w13 = new Gtk.Action ("gotoFirst", null, null, "gtk-goto-first");
			this.gotoFirst = w13;
			w2.Add (w13, null);
			Gtk.Action w14 = new Gtk.Action ("goBack1", null, null, "gtk-media-rewind");
			this.goBack1 = w14;
			w2.Add (w14, null);
			Gtk.Action w15 = new Gtk.Action ("goForward1", null, null, "gtk-media-forward");
			this.goForward1 = w15;
			w2.Add (w15, null);
			Gtk.Action w16 = new Gtk.Action ("gotoLast1", null, null, "gtk-goto-last");
			this.gotoLast1 = w16;
			w2.Add (w16, null);
			Gtk.Action w17 = new Gtk.Action ("save2", null, null, "gtk-save");
			this.save2 = w17;
			w2.Add (w17, null);
			Gtk.Action w18 = new Gtk.Action ("print1", null, null, "gtk-print");
			this.print1 = w18;
			w2.Add (w18, null);
			Gtk.Action w19 = new Gtk.Action ("quit3", null, null, "gtk-quit");
			this.quit3 = w19;
			w2.Add (w19, null);
			Gtk.Action w20 = new Gtk.Action ("dialogInfo", null, null, "gtk-dialog-info");
			this.dialogInfo = w20;
			w2.Add (w20, null);
			Gtk.Action w21 = new Gtk.Action ("about1", null, null, "gtk-about");
			this.about1 = w21;
			w2.Add (w21, null);
			Gtk.Action w22 = new Gtk.Action ("goBack2", null, null, "gtk-go-back");
			this.goBack2 = w22;
			w2.Add (w22, null);
			Gtk.Action w23 = new Gtk.Action ("goForward2", null, null, "gtk-go-forward");
			this.goForward2 = w23;
			w2.Add (w23, null);
			Gtk.Action w24 = new Gtk.Action ("printPreview", null, null, "gtk-print-preview");
			this.printPreview = w24;
			w2.Add (w24, null);
			w1.InsertActionGroup (w2, 0);
			cobj.AddAccelGroup (w1.AccelGroup);
			cobj.WindowPosition = ((Gtk.WindowPosition) (4));
			cobj.Modal = true;
			cobj.Gravity = ((Gdk.Gravity) (5));
			cobj.Name = "Sya.reclutamiento";
			// Container child Sya.reclutamiento.Gtk.Container+ContainerChild
			Gtk.ScrolledWindow w25 = new Gtk.ScrolledWindow ();
			w25.VscrollbarPolicy = ((Gtk.PolicyType) (1));
			w25.HscrollbarPolicy = ((Gtk.PolicyType) (1));
			w25.CanFocus = true;
			w25.Name = "scrolledwindow2";
			// Container child scrolledwindow2.Gtk.Container+ContainerChild
			Gtk.Viewport w26 = new Gtk.Viewport ();
			w26.ShadowType = ((Gtk.ShadowType) (0));
			w26.Name = "GtkViewport";
			// Container child GtkViewport.Gtk.Container+ContainerChild
			Gtk.VBox w27 = new Gtk.VBox ();
			w27.Name = "vbox1";
			// Container child vbox1.Gtk.Box+BoxChild
			Gtk.HBox w28 = new Gtk.HBox ();
			w28.Name = "hbox2";
			// Container child hbox2.Gtk.Box+BoxChild
			w1.AddUiFromString ("<ui><toolbar name='toolbar1'><toolitem action='gotoFirst'/><toolitem action='goBack1'/><toolitem action='goForward1'/><toolitem action='gotoLast1'/><toolitem action='save2'/><toolitem action='printPreview'/><toolitem action='print1'/><toolitem action='quit3'/><toolitem action='dialogInfo'/><toolitem action='about1'/><toolitem action='goBack2'/><toolitem action='goForward2'/></toolbar></ui>");
			Gtk.Toolbar w29 = ((Gtk.Toolbar) (w1.GetWidget ("/toolbar1")));
			w29.ShowArrow = false;
			w29.Tooltips = true;
//.........这里部分代码省略.........
开发者ID:mono,项目名称:gert,代码行数:101,代码来源:test.cs

示例13: Build

 public static void Build(object obj, string id)
 {
     System.Collections.Hashtable bindings = new System.Collections.Hashtable();
     if ((id == "igaeditorgtk.MainForm")) {
         Gtk.Window cobj = ((Gtk.Window)(obj));
         // Widget igaeditorgtk.MainForm
         cobj.Title = "IGA Ad Cache Editor (GTK) by micolous";
         Gtk.UIManager w1 = new Gtk.UIManager();
         Gtk.ActionGroup w2 = new Gtk.ActionGroup("Default");
         Gtk.Action w3 = new Gtk.Action("Application", "_Application", null, null);
         w3.ShortLabel = "_Application";
         bindings["Application"] = w3;
         w2.Add(w3, null);
         Gtk.Action w4 = new Gtk.Action("ImportAdpack", "_Import Adpack", null, null);
         w4.ShortLabel = "_Import Adpack";
         bindings["ImportAdpack"] = w4;
         w2.Add(w4, null);
         Gtk.Action w5 = new Gtk.Action("ExportAdpack", "_Export Adpack", null, null);
         w5.ShortLabel = "_Export Adpack";
         bindings["ExportAdpack"] = w5;
         w2.Add(w5, null);
         Gtk.Action w6 = new Gtk.Action("", "-", null, null);
         w6.ShortLabel = "-";
         bindings[""] = w6;
         w2.Add(w6, null);
         Gtk.Action w7 = new Gtk.Action("Reload", "_Reload", null, "gtk-refresh");
         w7.ShortLabel = "_Reload";
         bindings["Reload"] = w7;
         w2.Add(w7, null);
         Gtk.Action w8 = new Gtk.Action("VaccumShrinkDatabase", "_Vaccum/Shrink Database", null, null);
         w8.ShortLabel = "_Vaccum/Shrink Database";
         bindings["VaccumShrinkDatabase"] = w8;
         w2.Add(w8, null);
         Gtk.Action w9 = new Gtk.Action("CloseDatabase", "_Close Database", null, "gtk-close");
         w9.ShortLabel = "_Close Database";
         bindings["CloseDatabase"] = w9;
         w2.Add(w9, null);
         Gtk.Action w10 = new Gtk.Action("Exit", "E_xit", null, "gtk-quit");
         w10.ShortLabel = "E_xit";
         bindings["Exit"] = w10;
         w2.Add(w10, null);
         Gtk.Action w11 = new Gtk.Action("Debug", "_Debug", null, null);
         w11.ShortLabel = "_Debug";
         bindings["Debug"] = w11;
         w2.Add(w11, null);
         Gtk.Action w12 = new Gtk.Action("Help", "_Help", null, null);
         w12.ShortLabel = "_Help";
         bindings["Help"] = w12;
         w2.Add(w12, null);
         Gtk.Action w13 = new Gtk.Action("About", "_About", null, "gtk-about");
         w13.ShortLabel = "_About";
         bindings["About"] = w13;
         w2.Add(w13, null);
         Gtk.Action w14 = new Gtk.Action("ExecuteSQL", "_Execute SQL", null, null);
         w14.ShortLabel = "_Execute SQL";
         bindings["ExecuteSQL"] = w14;
         w2.Add(w14, null);
         w1.InsertActionGroup(w2, 0);
         cobj.AddAccelGroup(w1.AccelGroup);
         cobj.WindowPosition = ((Gtk.WindowPosition)(4));
         cobj.Events = ((Gdk.EventMask)(0));
         cobj.Name = "igaeditorgtk.MainForm";
         // Container child igaeditorgtk.MainForm.Gtk.Container+ContainerChild
         Gtk.VBox w15 = new Gtk.VBox();
         w15.Events = ((Gdk.EventMask)(0));
         w15.Name = "vbox1";
         // Container child vbox1.Gtk.Box+BoxChild
         w1.AddUiFromString("<ui><menubar name='menubar1'><menu action='Application'><menuitem action='ImportAdpack'/><menuitem action='ExportAdpack'/><separator/><menuitem action='Reload'/><menuitem action='VaccumShrinkDatabase'/><menuitem action='CloseDatabase'/><separator/><menuitem action='Exit'/></menu><menu action='Debug'><menuitem action='ExecuteSQL'/></menu><menu action='Help'><menuitem action='About'/><separator/></menu></menubar></ui>");
         Gtk.MenuBar w16 = ((Gtk.MenuBar)(w1.GetWidget("/menubar1")));
         w16.Events = ((Gdk.EventMask)(0));
         w16.Name = "menubar1";
         bindings["menubar1"] = w16;
         w15.Add(w16);
         Gtk.Box.BoxChild w17 = ((Gtk.Box.BoxChild)(w15[w16]));
         w17.Position = 0;
         w17.Expand = false;
         w17.Fill = false;
         // Container child vbox1.Gtk.Box+BoxChild
         Gtk.Frame w18 = new Gtk.Frame();
         w18.ShadowType = ((Gtk.ShadowType)(0));
         w18.LabelXalign = 0F;
         w18.Events = ((Gdk.EventMask)(0));
         w18.Name = "frame1";
         // Container child frame1.Gtk.Container+ContainerChild
         Gtk.Alignment w19 = new Gtk.Alignment(0F, 0F, 1F, 1F);
         w19.LeftPadding = ((uint)(12));
         w19.Events = ((Gdk.EventMask)(0));
         w19.Name = "GtkAlignment6";
         // Container child GtkAlignment6.Gtk.Container+ContainerChild
         Gtk.ScrolledWindow w20 = new Gtk.ScrolledWindow();
         w20.VscrollbarPolicy = ((Gtk.PolicyType)(1));
         w20.HscrollbarPolicy = ((Gtk.PolicyType)(2));
         w20.CanFocus = true;
         w20.Events = ((Gdk.EventMask)(0));
         w20.Name = "scrolledwindow1";
         // Container child scrolledwindow1.Gtk.Container+ContainerChild
         Gtk.TreeView w21 = new Gtk.TreeView();
         w21.EnableSearch = false;
         w21.CanFocus = true;
         w21.Events = ((Gdk.EventMask)(0));
//.........这里部分代码省略.........
开发者ID:micolous,项目名称:igaeditor,代码行数:101,代码来源:generated.cs

示例14: Initialize

		public virtual void Initialize (PropertyDescriptor prop)
		{
			CheckType (prop);
			
			this.prop = prop;

			mainHBox = new Gtk.HBox (false, 6);
			PackStart (mainHBox, false, false, 0);

			if (!prop.Translatable)
				return;

			button = new Gtk.Button ();
			try {
				globe = Gdk.Pixbuf.LoadFromResource ("globe.png");
				globe_not = Gdk.Pixbuf.LoadFromResource ("globe-not.png");
			} catch (Exception e) {
				Console.WriteLine ("Error while loading pixbuf: " + e);
			}
			image = new Gtk.Image (globe);
			button.Add (image);
			button.ButtonPressEvent += ButtonPressed;
			mainHBox.PackEnd (button, false, false, 0);
			mainHBox.ShowAll ();
			
			menu = new Gtk.Menu ();

			markItem = new Gtk.CheckMenuItem ("Mark for Translation");
			markItem.Toggled += ToggleMark;
			markItem.Show ();
			menu.Add (markItem);
			
			addContextItem = new Gtk.MenuItem ("Add Translation Context Hint");
			addContextItem.Activated += AddContext;
			menu.Add (addContextItem);
			remContextItem = new Gtk.MenuItem ("Remove Translation Context Hint");
			remContextItem.Activated += RemoveContext;
			menu.Add (remContextItem);
			
			addCommentItem = new Gtk.MenuItem ("Add Comment for Translators");
			addCommentItem.Activated += AddComment;
			menu.Add (addCommentItem);
			remCommentItem = new Gtk.MenuItem ("Remove Comment for Translators");
			remCommentItem.Activated += RemoveComment;
			menu.Add (remCommentItem);
			
			contextBox = new Gtk.HBox (false, 6);
			Gtk.Label contextLabel = new Gtk.Label ("Translation context");
			contextLabel.Xalign = 0.0f;
			contextBox.PackStart (contextLabel, false, false, 0);
			contextEntry = new Gtk.Entry ();
			contextEntry.WidthChars = 8;
			contextBox.PackStart (contextEntry, true, true, 0);
			contextBox.ShowAll ();
			contextEntry.Changed += ContextChanged;

			commentBox = new Gtk.VBox (false, 3);
			Gtk.Label commentLabel = new Gtk.Label ("Comment for Translators:");
			commentLabel.Xalign = 0.0f;
			commentBox.PackStart (commentLabel, false, false, 0);
			commentText = new TextBox (3);
			commentBox.PackStart (commentText, false, false, 0);
			commentBox.ShowAll ();
			commentText.Changed += CommentChanged;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:65,代码来源:Translatable.cs

示例15: MakeFontButton

		Gtk.Button MakeFontButton ()
		{
			Gtk.HBox font_box = new Gtk.HBox (false, 0);
			font_box.Show ();

			font_face = new Gtk.Label (null);
			font_face.UseMarkup = true;
			font_face.Show ();
			font_box.PackStart (font_face, true, true, 0);

			Gtk.VSeparator sep = new Gtk.VSeparator ();
			sep.Show ();
			font_box.PackStart (sep, false, false, 0);

			font_size = new Gtk.Label (null);
			font_size.Xpad = 4;
			font_size.Show ();
			font_box.PackStart (font_size, false, false, 0);

			Gtk.Button button = new Gtk.Button ();
			button.Clicked += OnFontButtonClicked;
			button.Add (font_box);
			button.Show ();

			string font_desc = (string) Preferences.Get (Preferences.CUSTOM_FONT_FACE);
			UpdateFontButton (font_desc);

			return button;
		}
开发者ID:oluc,项目名称:tomboy,代码行数:29,代码来源:PreferencesDialog.cs


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