本文整理匯總了C#中OpenRA.Widgets.ScrollPanelWidget.AddChild方法的典型用法代碼示例。如果您正苦於以下問題:C# ScrollPanelWidget.AddChild方法的具體用法?C# ScrollPanelWidget.AddChild怎麽用?C# ScrollPanelWidget.AddChild使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OpenRA.Widgets.ScrollPanelWidget
的用法示例。
在下文中一共展示了ScrollPanelWidget.AddChild方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AddReplay
void AddReplay(ScrollPanelWidget list, string filename, ScrollItemWidget template)
{
var item = ScrollItemWidget.Setup(template,
() => currentReplay != null && currentReplay.Filename == filename,
() => SelectReplay(filename));
var f = Path.GetFileName(filename);
item.Get<LabelWidget>("TITLE").GetText = () => f;
list.AddChild(item);
}
示例2: PopulateObjectivesList
void PopulateObjectivesList(MissionObjectives mo, ScrollPanelWidget parent, ContainerWidget template)
{
parent.RemoveChildren();
foreach (var o in mo.Objectives.OrderBy(o => o.Type))
{
var objective = o; // Work around the loop closure issue in older versions of C#
var widget = template.Clone();
var label = widget.Get<LabelWidget>("OBJECTIVE_TYPE");
label.GetText = () => objective.Type == ObjectiveType.Primary ? "Primary" : "Secondary";
var checkbox = widget.Get<CheckboxWidget>("OBJECTIVE_STATUS");
checkbox.IsChecked = () => objective.State != ObjectiveState.Incomplete;
checkbox.GetCheckType = () => objective.State == ObjectiveState.Completed ? "checked" : "crossed";
checkbox.GetText = () => objective.Description;
parent.AddChild(widget);
}
}
示例3: AddAsset
void AddAsset(ScrollPanelWidget list, string filepath, ScrollItemWidget template)
{
var filename = Path.GetFileName(filepath);
var item = ScrollItemWidget.Setup(template,
() => currentFilename == filename,
() => { LoadAsset(filename); });
item.Get<LabelWidget>("TITLE").GetText = () => filepath;
item.IsVisible = () =>
{
bool visible;
if (assetVisByName.TryGetValue(filepath, out visible))
return visible;
visible = FilterAsset(filepath);
assetVisByName.Add(filepath, visible);
return visible;
};
list.AddChild(item);
}
示例4: AddAsset
void AddAsset(ScrollPanelWidget list, string filepath, ScrollItemWidget template)
{
var sprite = Path.GetFileNameWithoutExtension(filepath);
var item = ScrollItemWidget.Setup(template,
() => spriteImage.Image == sprite,
() => LoadAsset(sprite));
item.Get<LabelWidget>("TITLE").GetText = () => filepath;
list.AddChild(item);
}
示例5: AddReplay
void AddReplay(ScrollPanelWidget list, string filename, LabelWidget template)
{
var entry = template.Clone() as LabelWidget;
entry.Id = "REPLAY_";
entry.GetText = () => " {0}".F(Path.GetFileName(filename));
entry.GetBackground = () => (CurrentReplay == filename) ? "dialog2" : null;
entry.OnMouseDown = mi => { if (mi.Button != MouseButton.Left) return false; CurrentReplay = filename; return true; };
entry.IsVisible = () => true;
list.AddChild(entry);
}
示例6: AddAsset
void AddAsset(ScrollPanelWidget list, string filepath, ScrollItemWidget template)
{
var filename = Path.GetFileName(filepath);
var item = ScrollItemWidget.Setup(template,
() => spriteWidget.Image == filename,
() => { filenameInput.Text = filename; LoadAsset(filename); });
item.Get<LabelWidget>("TITLE").GetText = () => filepath;
list.AddChild(item);
}