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


C# Table.Attach方法代码示例

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


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

示例1: DebugView

        public DebugView(Settings set, DebugManager mgr)
        {
            debugManager = mgr;
            layout = new Table(2, 2, false);
            runStop = new Button("Interrupt");
            command = new Entry();
            log = new ConsoleLog(set);

            command.Activated += OnCommand;
            runStop.Clicked += OnRunStop;

            layout.Attach(log.View, 0, 2, 0, 1,
              AttachOptions.Fill,
              AttachOptions.Expand | AttachOptions.Fill,
              4, 4);
            layout.Attach(command, 0, 1, 1, 2,
              AttachOptions.Fill | AttachOptions.Expand,
              AttachOptions.Fill,
              4, 4);
            layout.Attach(runStop, 1, 2, 1, 2,
              AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            runStop.SetSizeRequest(80, -1);

            command.Sensitive = false;
            runStop.Sensitive = false;

            mgr.MessageReceived += OnDebugOutput;
            mgr.DebuggerBusy += OnBusy;
            mgr.DebuggerReady += OnReady;
            mgr.DebuggerStarted += OnStarted;
            mgr.DebuggerExited += OnExited;
            layout.Destroyed += OnDestroy;
        }
开发者ID:dlbeer,项目名称:olishell,代码行数:34,代码来源:DebugView.cs

示例2: MatrixThresholdFilterDialog

        public MatrixThresholdFilterDialog(
            MatrixThresholdFilter existingModule)
            : base(existingModule)
        {
            module = modifiedModule as MatrixThresholdFilter;
            if (module == null) {
                modifiedModule = new MatrixThresholdFilter();
                module = modifiedModule as MatrixThresholdFilter;
            }

            matrixPanel = new ThresholdMatrixPanel(
                (uint)module.Matrix.Height,
                (uint)module.Matrix.Width);
            matrixPanel.Matrix = module.Matrix.DefinitionMatrix;
            matrixPanel.Scaled = !module.Matrix.Incremental;

            table = new Table(2, 1, false)
                { ColumnSpacing = 5, RowSpacing = 5, BorderWidth = 5 };
            table.Attach(new Label("Threshold matrix:") { Xalign = 0.0f },
                0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Shrink,
                0, 0);
            table.Attach(matrixPanel, 0, 1, 1, 2,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Fill | AttachOptions.Expand, 0, 0);
            table.ShowAll();
            VBox.PackStart(table);
        }
开发者ID:bzamecnik,项目名称:HalftoneLab,代码行数:27,代码来源:MatrixThresholdFilterDialog.cs

示例3: Tile

        public Tile ()
        {
            Table table = new Table (2, 2, false);
            table.ColumnSpacing = 6;
            table.RowSpacing = 2;
            table.BorderWidth = 2;

            PrimaryLabel = new Label ();
            SecondaryLabel = new Label ();

            table.Attach (image, 0, 1, 0, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            table.Attach (PrimaryLabel, 1, 2, 0, 1,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Shrink, 0, 0);
            table.Attach (SecondaryLabel, 1, 2, 1, 2,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Fill | AttachOptions.Expand, 0, 0);

            table.ShowAll ();
            Add (table);

            PrimaryLabel.Xalign = 0.0f;
            PrimaryLabel.Yalign = 0.0f;

            SecondaryLabel.Xalign = 0.0f;
            SecondaryLabel.Yalign = 0.0f;

            StyleSet += delegate {
                PrimaryLabel.ModifyFg (StateType.Normal, Style.Text (StateType.Normal));
                SecondaryLabel.ModifyFg (StateType.Normal, Hyena.Gui.GtkUtilities.ColorBlend (
                    Style.Foreground (StateType.Normal), Style.Background (StateType.Normal)));
            };

            Relief = ReliefStyle.None;
        }
开发者ID:haugjan,项目名称:banshee-hacks,代码行数:35,代码来源:Tile.cs

示例4: Info

        /// <summary>
        /// Initializes a new instance of the <see cref="Scrabble.GUI.Info"/> class.
        /// </summary>
        /// <param name='g'>
        /// G.
        /// </param>
        public Info(Game.Game g)
        {
            this.Label = "Score";
            this.BorderWidth = 5;
            this.game = g;

            this.HeightRequest = 99;
            this.WidthRequest = 120;

            scoresTable = new Gtk.Table( 6, 2, true );
            scoreValues = new Gtk.Label[ 6*2 ];
            for( int i=0; i < this.game.players.Length; i++) {
                scoreValues[ i ] = new Label( game.players[i].Name );
                scoreValues[ i+6 ] = new Label( "0" );
                scoresTable.Attach( scoreValues[i], 0 , 1, (uint) i, (uint) i+1);
                scoresTable.Attach( scoreValues[i+6] , 1, 2, (uint) i, (uint) i+1 );
            }
            for( int i=this.game.players.Length; i < 6; i++) {
                scoreValues[ i ] = new Label( );
                scoreValues[ i+6 ] = new Label( );
                scoresTable.Attach( scoreValues[i], 0 , 1, (uint) i, (uint) i+1);
                scoresTable.Attach( scoreValues[i+6] , 1, 2, (uint) i, (uint) i+1 );
            }
            scoresTable.BorderWidth = 3;
            this.Add( scoresTable );

            this.ShowAll();
        }
开发者ID:Kedrigern,项目名称:scrabble,代码行数:34,代码来源:info.cs

示例5: BuildDialogUI

        void BuildDialogUI()
        {
            // Add an HBox to the dialog's VBox.
              HBox hbox = new HBox (false, 8);
              hbox.BorderWidth = 8;
              this.VBox.PackStart (hbox, false, false, 0);

              // Add an Image widget to the HBox using a stock 'info' icon.
              Image stock = new Image (Stock.DialogInfo, IconSize.Dialog);
              hbox.PackStart (stock, false, false, 0);

              // Here we are using a Table to contain the other widgets.
              // Notice that the Table is added to the hBox.
              Table table = new Table (2, 2, false);
              table.RowSpacing = 4;
              table.ColumnSpacing = 4;
              hbox.PackStart (table, true, true, 0);

              Label label = new Label ("_Username");
              table.Attach (label, 0, 1, 0, 1);
              table.Attach (usernameEntry, 1, 2, 0, 1);
              label.MnemonicWidget = usernameEntry;

              label = new Label ("_Password");
              table.Attach (label, 0, 1, 1, 2);
              table.Attach (passwordEntry , 1, 2, 1, 2);
              label.MnemonicWidget = passwordEntry ;
              hbox.ShowAll ();

              // Add OK and Cancel Buttons.
              this.AddButton(Stock.Ok, ResponseType.Ok);
              this.AddButton(Stock.Cancel, ResponseType.Cancel);
        }
开发者ID:sergi,项目名称:Wakame,代码行数:33,代码来源:LoginDialog.cs

示例6: MainWindow

    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();

        Table table = new Table(2, 2, true);

        Add(table); 
        ShowAll();

        buttonView = new Button("View");
        // when this button is clicked, it'll run hello()
        buttonView.Clicked += (s, a) =>
        {
            View();
        };


        textviewView = new TextView();

        table.Attach(buttonView, 0, 2, 0, 1);
        table.Attach(textviewView, 0, 2, 1, 2);
        table.ShowAll();

        View();
    }
开发者ID:EifelMono,项目名称:NetAtmo,代码行数:25,代码来源:MainWindow.cs

示例7: Spec

        public Spec(InvoiceSpec ispec, Table table, uint row)
        {
            description = new Entry();
            number = new Entry();
            price = new Entry();
            total = new Entry();

            number.Changed += new EventHandler(UpdateTotal);
            price.Changed += new EventHandler(UpdateTotal);
            total.Changed += new EventHandler(TotalChanged);

            number.SetUsize(NumberEntryWidth, -2);
            price.SetUsize(NumberEntryWidth, -2);
            total.SetUsize(NumberEntryWidth, -2);
            description.SetUsize(300, -2);

            table.Attach(description, 0, 1, row, row+1,
                         AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0);
            table.Attach(number, 1, 2, row, row+1, 0, 0, 0, 0);
            table.Attach(price,  2, 3, row, row+1, 0, 0, 0, 0);
            table.Attach(total,  3, 4, row, row+1, 0, 0, 0, 0);

            description.Text =  ispec.beskrivning;
            if (ispec.antal.Length > 0)				  number.Text = ispec.antal;
            price.Text = ispec.styckpris;
            total.Text = ispec.belopp;
        }
开发者ID:nhoglund,项目名称:Faktureringsprogrammet,代码行数:27,代码来源:Spec.cs

示例8: AddNodeDialog

        public AddNodeDialog(SimulatorInterface simulatorInterface)
        {
            this.Build ();
            this.simulatorInterface = simulatorInterface;
            ScrolledWindow sw = new ScrolledWindow ();
            sw.ShadowType = ShadowType.EtchedIn;
            sw.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
            sw.HeightRequest = 250;

            VBox.PackStart (sw, true, true, 0);
            Table table = new Table ((uint)(BasicNode.NodeLabels.Length), 2, true);
            sw.AddWithViewport (table);
            for (int i = 0; i < BasicNode.NodeLabels.Length; i++)
            {
                labels.Add (new Label (BasicNode.NodeLabels[i]));
                table.Attach (labels[i], 0, 1, (uint)(i), (uint)(i) + 1);
                entries.Add (new SpinButton (0, 80, 1));
                entries[i].ClimbRate = 1;
                entries[i].Numeric = true;
                table.Attach (entries[i], 1, 2, (uint)(i), (uint)(i) + 1);
            }
            buttonOk.Clicked += new EventHandler (AddNode);
            buttonCancel.Clicked += new EventHandler (Cancel);
            this.SetDefaultSize (340, 300);
            this.Modal = true;
            this.ShowAll ();
        }
开发者ID:querino,项目名称:FrapeSchedSim,代码行数:27,代码来源:AddNodeDialog.cs

示例9: VectorErrorFilterDialog

        public VectorErrorFilterDialog(VectorErrorFilter existingModule)
            : base(existingModule)
        {
            module = modifiedModule as VectorErrorFilter;
            if (module == null) {
                modifiedModule = new VectorErrorFilter();
                module = modifiedModule as VectorErrorFilter;
            }

            vectorPanel = new ErrorVectorPanel((uint)module.Matrix.Width);
            vectorPanel.BareMatrix = module.Matrix.DefinitionMatrix;
            vectorPanel.Divisor = module.Matrix.Divisor;
            vectorPanel.UseCustomDivisor = false;
            vectorPanel.SourceOffsetX = module.Matrix.SourceOffsetX;

            table = new Table(2, 1, false)
                { ColumnSpacing = 5, RowSpacing = 5, BorderWidth = 5 };
            table.Attach(new Label("Error vector:") { Xalign = 0.0f },
                0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            table.Attach(vectorPanel, 0, 1, 1, 2,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Fill | AttachOptions.Expand, 0, 0);
            table.ShowAll();
            VBox.PackStart(table);
        }
开发者ID:bzamecnik,项目名称:HalftoneLab,代码行数:25,代码来源:VectorErrorFilterDialog.cs

示例10: HeightMapSizeDialog

		public HeightMapSizeDialog( DoneCallback source )
		{
            this.source = source;

			window = new Window ("Heightmap width and height:");
			window.SetDefaultSize (200, 100);

            Table table = new Table( 3, 2, false );
            table.BorderWidth = 20;
            table.RowSpacing = 20;
            table.ColumnSpacing = 20;
            window.Add(table);

            table.Attach(new Label("Width:"), 0, 1, 0, 1);
            table.Attach(new Label("Height:"), 0, 1, 1, 2);

            widthcombo = new Combo();
            widthcombo.PopdownStrings = new string[]{"4","8","12","16","20","24","28","32"};
            table.Attach(widthcombo, 1, 2, 0, 1);

            heightcombo = new Combo();
            heightcombo.PopdownStrings = new string[]{"4","8","12","16","20","24","28","32"};
            table.Attach(heightcombo, 1, 2, 1, 2);

			Button button = new Button (Stock.Ok);
			button.Clicked += new EventHandler (OnOkClicked);
			button.CanDefault = true;
			
            table.Attach(button, 1, 2, 2, 3);

            window.Modal = true;
            window.ShowAll();
		}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:33,代码来源:MainUI.cs

示例11: Nim

    public Nim()
        : base("Play Nim!")
    {
        SetDefaultSize(250, 230);
        SetPosition(WindowPosition.Center);
        DeleteEvent += delegate { Application.Quit(); } ;
        ModifyBg(StateType.Normal, new Gdk.Color(0,0,0));
        VBox vbox = new VBox(false, 2);

        Label indicator_text = new Label(indicator);
        Pango.FontDescription fontdesc= Pango.FontDescription.FromString("Times New Roman 15");
        indicator_text.ModifyFont(fontdesc);
        /*
        MenuBar mb = new MenuBar();
        Menu filemenu = new Menu();
        MenuItem file = new MenuItem("File");
        file.Submenu = filemenu;
        mb.Append(file);

        vbox.PackStart(mb, false, false, 0);
        */
        Table table = new Table(3,15,true);
        table.Attach(indicator_text,0,15,0,1);
        for( uint x=1; x<16; x++){
            uint y=x-1;
            table.Attach(new Button(String.Format("{0}",x)),y,x,1,2);
        }
        /*
        table.Attach(new Button("Cls"), 0,1,0,1);
        table.Attach(new Button("Bck"), 1,2,0,1);
        table.Attach(new Label(), 2,3,0,1);
        table.Attach(new Button("Close"),3,4,0,1);

        table.Attach(new Button("7"), 0,1,1,2);
        table.Attach(new Button("8"), 1,2,1,2);
        table.Attach(new Button("9"), 2,3,1,2);
        table.Attach(new Button("/"), 3,4,1,2);

        table.Attach(new Button("4"), 0,1,2,3);
        table.Attach(new Button("5"), 1,2,2,3);
        table.Attach(new Button("6"), 2,3,2,3);
        table.Attach(new Button("*"), 3,4,2,3);

        table.Attach(new Button("1"), 0,1,3,4);
        table.Attach(new Button("2"), 1,2,3,4);
        table.Attach(new Button("3"), 2,3,3,4);
        table.Attach(new Button("-"), 3,4,3,4);

        table.Attach(new Button("0"), 0,1,4,5);
        table.Attach(new Button("."), 1,2,4,5);
        table.Attach(new Button("="), 2,3,4,5);
        table.Attach(new Button("+"), 3,4,4,5);
        */
        //		vbox.PackStart(new Entry(), false, false, 0);
        vbox.PackEnd(table, true, true,0);

        Add(vbox);
        ShowAll();
    }
开发者ID:Jimmyscene,项目名称:Random,代码行数:59,代码来源:Nim.cs

示例12: CredentialsDialog

		public CredentialsDialog (URIish uri, IEnumerable<CredentialItem> credentials)
		{
			this.Build ();
			this.credentials = credentials;
			
			labelTop.Text = string.Format (labelTop.Text, uri.ToString ());
			
			Gtk.Table table = new Gtk.Table (0, 0, false);
			table.ColumnSpacing = 6;
			vbox.PackStart (table, true, true, 0);
			
			uint r = 0;
			Widget firstEditor = null;
			foreach (CredentialItem c in credentials) {
				Label lab = new Label (c.GetPromptText () + ":");
				lab.Xalign = 0;
				table.Attach (lab, 0, 1, r, r + 1);
				Table.TableChild tc = (Table.TableChild) table [lab];
				tc.XOptions = AttachOptions.Shrink;
				
				Widget editor = null;
				
				if (c is CredentialItem.YesNoType) {
					CredentialItem.YesNoType cred = (CredentialItem.YesNoType) c;
					CheckButton btn = new CheckButton ();
					editor = btn;
					btn.Toggled += delegate {
						cred.SetValue (btn.Active);
					};
				}
				else if (c is CredentialItem.StringType || c is CredentialItem.CharArrayType) {
					CredentialItem cred = c;
					Entry e = new Entry ();
					editor = e;
					e.ActivatesDefault = true;
					if (cred.IsValueSecure ())
						e.Visibility = false;
					e.Changed += delegate {
						if (cred is CredentialItem.StringType)
							((CredentialItem.StringType)cred).SetValue (e.Text);
						else
							((CredentialItem.CharArrayType)cred).SetValue (e.Text.ToCharArray ());
					};
				}
				if (editor != null) {
					table.Attach (editor, 1, 2, r, r + 1);
					tc = (Table.TableChild) table [lab];
					tc.XOptions = AttachOptions.Fill;
					if (firstEditor == null)
						firstEditor = editor;
				}
				
				r++;
			}
			table.ShowAll ();
			Focus = firstEditor;
			Default = buttonOk;
		}
开发者ID:nickname100,项目名称:monodevelop,代码行数:58,代码来源:CredentialsDialog.cs

示例13: AttachToTable

        public void AttachToTable(Table t, uint row, uint maxCols)
        {
            if(maxCols < 3)
                throw new ArgumentOutOfRangeException("maxCols", "The minimum number of columns required is 3.");

            t.Attach(Low, 0, 1, row, row + 1, AttachOptions.Shrink, AttachOptions.Fill | AttachOptions.Expand, 2, 6);
            t.Attach(Label, 1, maxCols - 1, row, row + 1, AttachOptions.Fill, AttachOptions.Fill | AttachOptions.Expand, 2, 6);
            t.Attach(High, maxCols - 1, maxCols, row, row + 1, AttachOptions.Shrink, AttachOptions.Fill | AttachOptions.Expand, 2, 6);
        }
开发者ID:Nemesis-Xero,项目名称:ds-level-ranger,代码行数:9,代码来源:LevelRangeWidget.cs

示例14: GetPreferenceTabWidget

		public override bool GetPreferenceTabWidget (	PreferencesDialog parent,
								out string tabLabel,
								out Gtk.Widget preferenceWidget)
		{
			
			Gtk.Label label;
			Gtk.SpinButton menuNoteCountSpinner;
			Gtk.Alignment align;
			int menuNoteCount;

			// Addin's tab caption
			tabLabel = Catalog.GetString ("Advanced");
			
			Gtk.VBox opts_list = new Gtk.VBox (false, 12);
			opts_list.BorderWidth = 12;
			opts_list.Show ();
			
			align = new Gtk.Alignment (0.5f, 0.5f, 0.0f, 1.0f);
			align.Show ();
			opts_list.PackStart (align, false, false, 0);

			Gtk.Table table = new Gtk.Table (1, 2, false);
			table.ColumnSpacing = 6;
			table.RowSpacing = 6;
			table.Show ();
			align.Add (table);


			// Menu Note Count option
			label = new Gtk.Label (Catalog.GetString ("Minimum number of notes to show in Recent list (maximum 18)"));

			label.UseMarkup = true;
			label.Justify = Gtk.Justification.Left;
			label.SetAlignment (0.0f, 0.5f);
			label.Show ();
			
			table.Attach (label, 0, 1, 0, 1);
		
			menuNoteCount = (int) Preferences.Get (Preferences.MENU_NOTE_COUNT);
			// we have a hard limit of 18 set, thus not allowing anything bigger than 18
			menuNoteCountSpinner = new Gtk.SpinButton (1, 18, 1);
			menuNoteCountSpinner.Value = menuNoteCount <= 18 ? menuNoteCount : 18;
			
			menuNoteCountSpinner.Show ();
			table.Attach (menuNoteCountSpinner, 1, 2, 0, 1);
			
			menuNoteCountSpinner.ValueChanged += UpdateMenuNoteCountPreference;
			
			if (opts_list != null) {
				preferenceWidget = opts_list;
				return true;
			} else {
				preferenceWidget = null;
				return false;
			}
		}
开发者ID:oluc,项目名称:tomboy,代码行数:56,代码来源:AdvancedPreferencesAddin.cs

示例15: AddLabeledEntry

        public Entry AddLabeledEntry(Table table, string title, uint top_attach, uint bottom_attach)
        {
            Label label = new Label(title);
            table.Attach(label, 0, 1, top_attach, bottom_attach);

            Entry entry = new Entry();
            entry.IsEditable = true;
            table.Attach(entry, 1, 2, top_attach, bottom_attach);

            return entry;
        }
开发者ID:Jeff-Lewis,项目名称:opentf,代码行数:11,代码来源:DialogBase.cs


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