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


C# Table.Remove方法代码示例

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


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

示例1: LoadControlTable

        private void LoadControlTable(Table table, bool advanced)
        {
            while(table.Children.Length > 0) {
                table.Remove(table.Children[0]);
            }

            table.Resize(1, 1);

            table.RowSpacing = 5;
            table.ColumnSpacing = 12;

            uint y = 0;

            foreach(PipelineVariable variable in profile.Pipeline) {
                if(advanced != variable.Advanced) {
                    continue;
                }

                Label label = new Label();
                label.Show();
                label.Markup = String.Format("<b>{0}:</b>", GLib.Markup.EscapeText(variable.Name));
                label.Xalign = 0.0f;

                try {
                    Widget control = BuildControl(variable);
                    if(control == null) {
                        throw new ApplicationException("Control could not be created");
                    }

                    variable_widgets.Add(variable.Id, control);

                    if(variable.ControlType != PipelineVariableControlType.Check) {
                        variable_widgets.Add(".label." + variable.Id, label);
                    }

                    control.Show();

                    table.Resize(y + 1, 2);

                    if(variable.ControlType != PipelineVariableControlType.Check) {
                        table.Attach(label, 0, 1, y, y + 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
                    }

                    table.Attach(control, 1, 2, y, y + 1,
                        control is ComboBox ? AttachOptions.Fill : AttachOptions.Fill | AttachOptions.Expand,
                        AttachOptions.Fill, 0,
                        (uint)(variable.ControlType == PipelineVariableControlType.Check ? 2 : 0));

                    y++;
                } catch {
                }
            }

            foreach(Widget widget in variable_widgets.Values) {
                if(widget is PipelineVariableComboBox) {
                    OnComboChanged(widget, EventArgs.Empty);
                } else if(widget is CheckButton) {
                    (widget as CheckButton).Toggle();
                }
            }

            table.Visible = y > 0;
        }
开发者ID:knocte,项目名称:banshee,代码行数:63,代码来源:ProfileConfigurationDialog.cs

示例2: TableRemoveRow

		static void TableRemoveRow (Table table, uint row, Widget column1, Widget column2, bool destroy)
		{
			uint rows = table.NRows;
			
			foreach (var child in table.Children) {
				var tr = (Table.TableChild) table[child];
				uint bottom = tr.BottomAttach;
				uint top = tr.TopAttach;
				
				if (top >= row && top < rows) {
					tr.BottomAttach = bottom - 1;
					tr.TopAttach = top - 1;
				}
			}
			
			if (column1 != null) {
				table.Remove (column1);
				if (destroy)
					column1.Destroy ();
			}
			
			if (column2 != null) {
				table.Remove (column2);
				if (destroy)
					column2.Destroy ();
			}
			
			table.NRows--;
		}
开发者ID:nieve,项目名称:monodevelop,代码行数:29,代码来源:FindInFilesDialog.cs

示例3: SetWarpIndex

        // Load the i'th warp in the current map.
        void SetWarpIndex(int i)
        {
            List<WarpSourceData> sourceDataList = sourceGroup.GetMapWarpSourceData(map);

            indexSpinButton.Adjustment.Lower = -1;
            indexSpinButton.Adjustment.Upper = sourceDataList.Count-1;

            if (i > indexSpinButton.Adjustment.Upper)
                i = (int)indexSpinButton.Adjustment.Upper;

            indexSpinButton.Value = i;

            valueEditorContainer.Remove(valueEditorContainer.Child);

            if (i == -1) {
                SetDestIndex(-1,-1);
                return;
            }

            Gtk.HBox hbox = new Gtk.HBox();

            WarpSourceData warpSourceData = sourceDataList[i];

            if (warpSourceData.WarpSourceType == WarpSourceType.StandardWarp)
                SetDestIndex(warpSourceData.DestGroup, warpSourceData.DestIndex);

            sourceEditor = new ValueReferenceEditor(Project,
                    warpSourceData);

            Alignment a = new Alignment(0,0,0,0);
            a.Add(sourceEditor);
            hbox.Add(a);

            if (warpSourceData.WarpSourceType == WarpSourceType.PointerWarp) {
                Table table = new Table(1, 1, false);
                table.ColumnSpacing = 6;
                table.RowSpacing = 6;

                SpinButton pointerSpinButton = new SpinButton(0,10,1);

                EventHandler valueChangedHandler = delegate(object sender, EventArgs e) {
                    WarpSourceData pointedData = warpSourceData.GetPointedWarp();

                    pointerSpinButton.Adjustment.Lower = 0;
                    pointerSpinButton.Adjustment.Upper = warpSourceData.GetPointedChainLength()-1;

                    if (pointerSpinButton.ValueAsInt > pointerSpinButton.Adjustment.Upper) {
                        pointerSpinButton.Value = pointerSpinButton.Adjustment.Upper;
                    }
                    int index = pointerSpinButton.ValueAsInt;

                    while (index > 0) {
                        pointedData = pointedData.GetNextWarp();
                        index--;
                    }

                    table.Remove(destEditor);

                    destEditor = new ValueReferenceEditor(Project, pointedData);

                    destEditor.AddDataModifiedHandler(delegate() {
                            SetDestIndex(pointedData.DestGroup, pointedData.DestIndex);
                        });

                    table.Attach(destEditor, 0, 2, 1, 2);

                    SetDestIndex(pointedData.DestGroup, pointedData.DestIndex);
                };

                pointerSpinButton.ValueChanged += valueChangedHandler;

                // Button which, when clicked, adds a new PointedData to the
                // "chain".
                Gtk.Button addPointedWarpButton =
                    new Gtk.Button(new Gtk.Image(Gtk.Stock.Add, Gtk.IconSize.Button));

                addPointedWarpButton.Clicked += delegate(object sender, EventArgs e) {
                    WarpSourceData pointedData = warpSourceData.GetPointedWarp();

                    while (pointedData.GetNextWarp() != null) {
                        pointedData = pointedData.GetNextWarp();
                    }

                    WarpSourceData nextData = new WarpSourceData(Project,
                            WarpSourceData.WarpCommands[(int)WarpSourceType.PointedWarp],
                            WarpSourceData.DefaultValues[(int)WarpSourceType.PointedWarp],
                            pointedData.FileParser,
                            new List<int>{-1});
                    pointedData.SetNextWarp(nextData);

                    pointerSpinButton.Adjustment.Upper++;
                    pointerSpinButton.Value = warpSourceData.GetPointedChainLength()-1;
                    valueChangedHandler(null, null);
                };

                // Button which removes a PointedData from the "chain", unless
                // there is only one remaining.
                Gtk.Button removePointedWarpButton =
                    new Gtk.Button(new Gtk.Image(Gtk.Stock.Remove, Gtk.IconSize.Button));
//.........这里部分代码省略.........
开发者ID:Drenn1,项目名称:LynnaLab,代码行数:101,代码来源:WarpEditor.cs


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