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


C# ScrollPanelWidget.AddChild方法代码示例

本文整理汇总了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);
 }
开发者ID:sonygod,项目名称:OpenRA-Dedicated-20120504,代码行数:9,代码来源:ReplayBrowserLogic.cs

示例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);
            }
        }
开发者ID:ushardul,项目名称:OpenRA,代码行数:20,代码来源:GameInfoObjectivesLogic.cs

示例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);
        }
开发者ID:RobotCaleb,项目名称:OpenRA,代码行数:20,代码来源:AssetBrowserLogic.cs

示例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);
        }
开发者ID:TiriliPiitPiit,项目名称:OpenRA,代码行数:10,代码来源:AssetBrowserLogic.cs

示例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);
 }
开发者ID:FMode,项目名称:OpenRA,代码行数:10,代码来源:ReplayBrowserDelegate.cs

示例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);
        }
开发者ID:Generalcamo,项目名称:OpenRA,代码行数:10,代码来源:AssetBrowserLogic.cs


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