本文整理汇总了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;
}
示例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--;
}
示例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));
//.........这里部分代码省略.........