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


C# Table.Attach方法代码示例

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


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

示例1: PlayerPage

            public PlayerPage(ICSGameObserverWidget widget,
					   MoveDetails details)
                : base(widget,
								      details)
            {
                Table table = new Table (5, 2, true);

                  drawButton =
                    new Button (Catalog.
                            GetString ("Draw"));
                  resignButton =
                    new Button (Catalog.
                            GetString ("Resign"));
                  abortButton =
                    new Button (Catalog.
                            GetString ("Abort"));
                  adjournButton =
                    new Button (Catalog.
                            GetString ("Adjourn"));
                  takebackButton =
                    new Button (Catalog.
                            GetString ("Takeback"));

                  drawButton.Clicked += OnClicked;
                  resignButton.Clicked += OnClicked;
                  abortButton.Clicked += OnClicked;
                  adjournButton.Clicked += OnClicked;
                  takebackButton.Clicked += OnClicked;

                uint row = 0, col = 0;
                  table.Attach (drawButton, col, col + 1, row,
                        row + 1);
                  col++;
                  table.Attach (resignButton, col, col + 1,
                        row, row + 1);
                  col = 0;
                  row++;
                  table.Attach (abortButton, col, col + 1,
                        row, row + 1);
                  col++;
                  table.Attach (adjournButton, col, col + 1,
                        row, row + 1);
                  col = 0;
                  row++;
                  table.Attach (takebackButton, col, col + 1,
                        row, row + 1);
                  table.ShowAll ();
                  movesBox.PackEnd (table, false, true, 2);
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:49,代码来源:PlayerPage.cs

示例2: AttachToTable

            private void AttachToTable(Table table,
						    Widget widget, uint x,
						    uint y, uint width)
            {
                //                      table.Attach(widget, x, x + width, y, y + 1, AttachOptions.Fill, AttachOptions.Fill, 2, 2);
                table.Attach (widget, x, x + width, y, y + 1);
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:7,代码来源:ICSConfigWidget.cs

示例3: CreateViewport

	   public static ScrolledWindow CreateViewport()
	   {
		   ScrolledWindow scroller = new ScrolledWindow();
		   Viewport viewer = new Viewport();
		   
		   Table widgets = new Table(1, 2, false);
		   
		   widgets.Attach(new Button("This is example Entry 1"), 0, 1, 0, 1);
		   widgets.Attach(new Button("This is example Entry 2"), 1, 2, 0, 1);
 
		   // Place the widgets in a Viewport, and the 
		   // Viewport in a ScrolledWindow
		   viewer.Add(widgets);
		   scroller.Add(viewer);
		   return scroller;
	   }
开发者ID:emtees,项目名称:old-code,代码行数:16,代码来源:viewport.cs

示例4: SetUpGui

	static void SetUpGui ()
	{
		
		Window w = new Window ("Eblocks Test Suite");
		
		Button b;
		
		Table tableLayout = new Table (3, 1, false);
		w.Add (tableLayout);
		
		b = new Button ("Buttons");
		b.Clicked += TestBoxesButtonMenus;
		tableLayout.Attach (b, 0, 1, 0, 1);
		
		b = new Button ("Scale");
		b.Clicked += TestScale;
		tableLayout.Attach (b, 0, 1, 1, 2);
		
		b = new Button ("Entry");
		b.Clicked += TestEntryLabel;
		tableLayout.Attach (b, 0, 1, 2, 3);
		
		w.ShowAll ();
	}
开发者ID:emtees,项目名称:old-code,代码行数:24,代码来源:eblocks_test.cs

示例5: PopulateTable

	public static Table PopulateTable (ArrayList items)
	{
		Table table = new Table (0, 0, false);
		uint x = 0;
		uint y = 0;
		
		foreach (object item in items) {
			if (x > 4) {
				x = 0;
				y++;
			}
			table.Attach (((Widget) item), x, x + 1, y, y + 1, AttachOptions.Fill, AttachOptions.Fill, 5, 5);
			x++;
		}

		return table;
	}
开发者ID:emtees,项目名称:old-code,代码行数:17,代码来源:ImageBrowser.cs

示例6: SetUpGui

	static void SetUpGui ()
	{
		Button b;
		
		Window w = new Window ("Eap Editor");
		//w.BorderWidth = 10;
		Table tableLayout = new Table(10, 2, false);
		//tableLayout.BorderWidth = 6;
		//tableLayout.ColumnSpacing = 6;
		//tableLayout.RowSpacing = 6;
		
		Image im = new Image ("data/icon.png");
//		b = new Button (im);
		tableLayout.Attach (im, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
								
		b = new Button ("App name:");
		tableLayout.Attach (b, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Expand, 0, 0);
		
		b = new Button ("Generic Info:");
		tableLayout.Attach (b, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Expand, 0, 0);
		
		b = new Button ("Comments:");
		tableLayout.Attach (b, 0, 1, 3, 4, AttachOptions.Fill, AttachOptions.Expand, 0, 0);		

		b = new Button ("Executable:");
                tableLayout.Attach (b, 0, 1, 4, 5, AttachOptions.Fill, AttachOptions.Expand, 0, 0);		
		
		b = new Button ("Window Name:");
                tableLayout.Attach (b, 0, 1, 5, 6, AttachOptions.Fill, AttachOptions.Expand, 0, 0);		
		
		b = new Button ("Window Class:");
                tableLayout.Attach (b, 0, 1, 6, 7, AttachOptions.Fill, AttachOptions.Expand, 0, 0);		
		
		b = new Button ("Startup notify:");
                tableLayout.Attach (b, 0, 1, 7, 8, AttachOptions.Fill, AttachOptions.Expand, 0, 0);		
		
		b = new Button ("Wait Exit:");
                tableLayout.Attach (b, 0, 1, 8, 9, AttachOptions.Fill, AttachOptions.Expand, 0, 0);
	
		b = new Button ("Select Icon");
		tableLayout.Attach (b, 1, 2, 0, 1, AttachOptions.Expand, AttachOptions.Expand, 0, 0);
				
		appname_entry = new Entry ();
                tableLayout.Attach (appname_entry, 1, 2, 1, 2);
		
		geninfo_entry = new Entry ();
                tableLayout.Attach (geninfo_entry, 1, 2, 2, 3);
		
		comments_entry = new Entry ();
                tableLayout.Attach (comments_entry, 1, 2, 3, 4);
		
		exe_entry = new Entry ();
                tableLayout.Attach (exe_entry, 1, 2, 4, 5);
		
		winname_entry = new Entry ();
                tableLayout.Attach (winname_entry, 1, 2, 5, 6);
		
		winclass_entry = new Entry ();
                tableLayout.Attach (winclass_entry, 1, 2, 6, 7);
		
		CheckButton start_cbox = new CheckButton ();
		start_cbox.Toggled += toggle_start_cbox;
                tableLayout.Attach (start_cbox, 1, 2, 7, 8);
		
		CheckButton wait_cbox= new CheckButton ();
		wait_cbox.Toggled += toggle_wait_cbox;
                tableLayout.Attach (wait_cbox, 1, 2, 8, 9);	
		
		HBox h = new HBox ();
		h.Spacing = 0;
		tableLayout.Attach (h, 0, 2, 9, 10);
		
		VBox v = new VBox ();		
		b = new Button ("Save");
		v.PackStart (b, true, false, 0);
		h.PackStart (v, true, false, 0);
		
		v = new VBox ();		
		b = new Button ("Cancel");
		v.PackStart (b, true, false, 0);
		h.PackStart (v, true, false, 0);
		
		w.Add (tableLayout);
		w.ShowAll ();
	}
开发者ID:emtees,项目名称:old-code,代码行数:85,代码来源:e_util_eap_edit.cs

示例7: GetTagDetailsWidget

            private Widget GetTagDetailsWidget()
            {
                string eco;
                GameViewer.GetOpeningName (game.
                               GetTagValue ("ECO",
                                    ""),
                               out eco);
                string[,] values = new string[,]
                {
                    {
                    Catalog.GetString ("Result"),
                            game.Result}
                    ,
                    {
                    Catalog.GetString ("Date"),
                            game.Date}
                    ,
                    {
                    Catalog.GetString ("Event"),
                            game.Event}
                    ,
                    {
                    Catalog.GetString ("Site"),
                            game.Site}
                    ,
                    {
                    Catalog.GetString ("ECO"), eco}
                };
                uint count = (uint) values.Length / 2;
                Table table = new Table (count, 2, false);
                table.ColumnSpacing = 10;
                for (uint i = 0; i < count; i++)
                  {
                      Label name = new Label ();
                      name.Xalign = 0;
                      name.Markup =
                          String.Format ("<b>{0}</b>",
                                 values[i,
                                    0]);
                      Label value = new Label ();
                      value.Xalign = 0;
                      value.Text = values[i, 1];
                      table.Attach (name, 0, 1, i, i + 1);
                      table.Attach (value, 1, 2, i,
                            i + 1);
                  }

                table.ShowAll ();
                return table;
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:50,代码来源:ChessGameView.cs

示例8: GameEditor

            public GameEditor(GameViewer viewer)
                : base(Catalog.
								    GetString
								    ("Rating"))
            {
                this.viewer = viewer;
                viewer.ChessGameWidget.GameLoadedEvent +=
                    OnGameLoaded;
                combo = new ComboBox (new string[]
                              {
                              Catalog.
                              GetString
                              ("Not interested"),
                              Catalog.
                              GetString
                              ("Average Game"),
                              Catalog.
                              GetString ("Good Game"),
                              Catalog.
                              GetString
                              ("Excellent Game"),
                              Catalog.
                              GetString ("Must Have")}
                );
                save = new Button (Stock.Save);
                save.Sensitive = false;
                save.Clicked += OnSave;
                combo.Changed +=
                    delegate (object o, EventArgs args)
                {
                    save.Sensitive = true;
                };

                ratings = new GameRating[]
                {
                GameRating.Ignore,
                        GameRating.Average,
                        GameRating.Good,
                        GameRating.Excellent,
                        GameRating.MustHave};
                tagsStore = new ListStore (typeof (string));
                tagsCombo = new ComboBoxEntry (tagsStore, 0);
                tagsCombo.Entry.Activated +=
                    OnTagsComboActivated;

                Table table = new Table (3, 2, false);
                table.RowSpacing = 2;
                table.ColumnSpacing = 2;
                uint row = 0, col = 0;
                Label label =
                    new Label (Catalog.
                           GetString ("My Rating"));
                label.Xalign = 0;
                label.Yalign = 0;
                table.Attach (label, col, col + 1, row,
                          row + 1);
                col++;
                table.Attach (combo, col, col + 1, row,
                          row + 1);

                label = new Label (Catalog.
                           GetString ("Tags"));
                label.Xalign = 0;
                label.Yalign = 0;
                col = 0;
                row++;
                table.Attach (label, col, col + 1, row,
                          row + 1);
                col++;
                table.Attach (tagsCombo, col, col + 1, row,
                          row + 1);

                col = 1;
                row++;
                Alignment align = new Alignment (1, 0, 0, 0);
                align.Add (save);
                table.Attach (align, col, col + 1, row,
                          row + 1);

                Add (table);

                ShowAll ();
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:83,代码来源:GameDbPlugin.cs

示例9: GetCollectionDetailsFrame

            private Frame GetCollectionDetailsFrame()
            {
                collectionEntry = new Entry ();
                ScrolledWindow scroll = new ScrolledWindow ();
                scroll.HscrollbarPolicy = PolicyType.Never;
                scroll.VscrollbarPolicy =
                    PolicyType.Automatic;

                description = new TextView ();
                description.WrapMode = WrapMode.Word;
                scroll.Add (description);

                addCollectionToggle =
                    new CheckButton (Catalog.
                             GetString
                             ("Create a collection"));
                addCollectionToggle.Toggled += OnToggled;
                addCollectionToggle.Active = false;
                addCollectionToggle.Toggle ();

                Frame frame = new Frame ();
                Table table = new Table (4, 2, false);
                Label label;
                uint row = 0;

                table.RowSpacing = table.ColumnSpacing = 4;

                table.Attach (addCollectionToggle, 0, 2, row,
                          row + 1);

                row++;
                label = new Label ();
                label.Markup =
                    Catalog.GetString ("<b>Title</b>");
                label.Xalign = 0;
                table.Attach (label, 0, 1, row, row + 1);
                table.Attach (collectionEntry, 1, 2, row,
                          row + 1);
                row++;
                label = new Label ();
                label.Xalign = 0;
                label.Markup =
                    Catalog.
                    GetString
                    ("<i><small>Create a collection with this title</small></i>");
                table.Attach (label, 0, 2, row, row + 1);

                label = new Label ();
                label.Markup =
                    Catalog.
                    GetString ("<b>Description</b>");
                label.Xalign = 0;
                row++;
                table.Attach (label, 0, 2, row, row + 1);

                row++;
                table.Attach (scroll, 0, 2, row, row + 1);
                frame.Add (table);
                return frame;
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:60,代码来源:GameDbPlugin.cs

示例10: AddToDbDialog

            public AddToDbDialog(Window parent)
                : base(Catalog.
								   GetString
								   ("Add games to database"),
								   parent,
								   DialogFlags.
								   Modal,
								   Stock.
								   Cancel,
								   ResponseType.
								   Cancel,
								   Stock.Ok,
								   ResponseType.
								   Ok)
            {
                tagsEntry = new Entry ();

                Label label;
                uint row = 0;
                Table table = new Table (3, 2, false);
                table.RowSpacing = table.ColumnSpacing = 4;

                label = new Label ();
                label.Markup =
                    Catalog.GetString ("<b>Tags</b>");
                label.Xalign = 0;
                table.Attach (label, 0, 1, row, row + 1);
                table.Attach (tagsEntry, 1, 2, row, row + 1);

                row++;
                label = new Label ();
                label.Markup =
                    Catalog.
                    GetString
                    ("<i><small>Comma separated list of tags</small></i>");
                label.Xalign = 0;
                table.Attach (label, 0, 2, row, row + 1);

                row++;
                table.Attach (GetCollectionDetailsFrame (), 0,
                          2, row, row + 1);
                table.ShowAll ();
                VBox.PackStart (table, true, true, 2);
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:44,代码来源:GameDbPlugin.cs

示例11: ChessGameInfoWidget

            public ChessGameInfoWidget()
            {
                box = new VBox ();
                titleLabel = new Label ();
                titleLabel.UseMarkup = true;

                resultLabel =
                    new Label (Catalog.
                           GetString
                           ("<b>Result</b>"));
                resultLabel.UseMarkup = true;
                dateLabel =
                    new Label (Catalog.
                           GetString ("<b>Date</b>"));
                dateLabel.UseMarkup = true;
                eventLabel =
                    new Label (Catalog.
                           GetString
                           ("<b>Event</b>"));
                eventLabel.UseMarkup = true;
                siteLabel =
                    new Label (Catalog.
                           GetString ("<b>Site</b>"));
                siteLabel.UseMarkup = true;

                resultValueLabel = new Label ();
                dateValueLabel = new Label ();
                eventValueLabel = new Label ();
                siteValueLabel = new Label ();

                titleLabel = new Label ();
                titleLabel.UseMarkup = true;

                Table table = new Table (5, 2, false);

                uint row = 0;
                  table.Attach (titleLabel, 0, 2, row,
                        row + 1);
                  titleLabel.Xalign = 0;

                  row++;
                  table.Attach (resultLabel, 0, 1, row,
                        row + 1);
                  resultLabel.Xalign = 0;
                  table.Attach (resultValueLabel, 1, 2, row,
                        row + 1);
                  resultValueLabel.Xalign = 0;

                  row++;
                  table.Attach (dateLabel, 0, 1, row,
                        row + 1);
                  dateLabel.Xalign = 0;
                  table.Attach (dateValueLabel, 1, 2, row,
                        row + 1);
                  dateValueLabel.Xalign = 0;

                  row++;
                  table.Attach (eventLabel, 0, 1, row,
                        row + 1);
                  eventLabel.Xalign = 0;
                  table.Attach (eventValueLabel, 1, 2, row,
                        row + 1);
                  eventValueLabel.Xalign = 0;

                  row++;
                  table.Attach (siteLabel, 0, 1, row,
                        row + 1);
                  siteLabel.Xalign = 0;
                  table.Attach (siteValueLabel, 1, 2, row,
                        row + 1);
                  siteValueLabel.Xalign = 0;

                ScrolledWindow win = new ScrolledWindow ();
                  win.HscrollbarPolicy = PolicyType.Automatic;
                  win.VscrollbarPolicy = PolicyType.Never;
                  win.AddWithViewport (table);

                  box.PackStart (win, false, false, 2);

                  otherTagsWidget =
                    new Expander (Catalog.
                              GetString
                              ("Other details"));
                  box.PackStart (otherTagsWidget, false,
                         false, 2);

                  box.ShowAll ();
                  Child = box;
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:89,代码来源:ChessGameInfoWidget.cs

示例12: UpdateOtherTags

            private void UpdateOtherTags(IList ignoreTags)
            {
                Table table =
                    new Table ((uint) game.TagList.Count,
                           2, false);

                uint i = 0;
                foreach (PGNTag tag in game.TagList)
                {
                    if (ignoreTags.Contains (tag.Name))
                        continue;

                    Label nameLabel =
                        new Label ("<b>" + tag.Name +
                               "</b>");
                    Label valueLabel =
                        new Label ((string) tag.
                               Value);
                    nameLabel.UseMarkup = true;
                    nameLabel.Xalign = 0;
                    valueLabel.Xalign = 0;
                    table.Attach (nameLabel, 0, 1, i,
                              i + 1);
                    table.Attach (valueLabel, 1, 2, i,
                              i + 1);
                    i++;
                }

                ScrolledWindow win = new ScrolledWindow ();
                win.HscrollbarPolicy = PolicyType.Automatic;
                win.VscrollbarPolicy = PolicyType.Automatic;
                win.AddWithViewport (table);
                win.ShowAll ();
                if (otherTagsWidget.Child != null)
                  {
                      otherTagsWidget.
                          Remove (otherTagsWidget.
                              Child);
                  }
                otherTagsWidget.Add (win);
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:41,代码来源:ChessGameInfoWidget.cs


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