當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。