The list view.
Inheritance: IContainer, IHasDesiredSize
コード例 #1
0
 public IContainer Process(XmlNode node, Action<UserInterfaceBehaviourEvent, object> eventCallback, out Action<XmlNode, IContainer> processChild)
 {
     var listView = new ListView();
     listView.SelectedItemChanged += (sender, args) =>
     {
         eventCallback(UserInterfaceBehaviourEvent.SelectedItemChanged, listView);
     };
     processChild = (xmlNode, container) =>
     {
         listView.AddChild(container);
     };
     return listView;
 }
コード例 #2
0
ファイル: MultiplayerWorld.cs プロジェクト: TreeSeed/Tychaia
        public MultiplayerWorld(ISkin skin)
        {
            this.Entities = new List<IEntity>();

            this.m_ServersListView = new ListView();
            this.m_ServersListView.AddChild(new ServerListItem { Text = "Loading servers...", Valid = false });
            this.m_ServersListView.SelectedItemChanged += this.ServersListViewOnSelectedItemChanged;

            var backButton = new Button { Text = "Back" };
            backButton.Click += (sender, args) => this.m_GameContext.SwitchWorld<TitleWorld>();

            var buttonContainer = new HorizontalContainer();
            buttonContainer.AddChild(new EmptyContainer(), "*");
            buttonContainer.AddChild(backButton, "100");
            buttonContainer.AddChild(new EmptyContainer(), "*");

            var verticalContainer = new VerticalContainer();
            verticalContainer.AddChild(new EmptyContainer(), "*");
            verticalContainer.AddChild(this.m_ServersListView, "370");
            verticalContainer.AddChild(new EmptyContainer(), "10");
            verticalContainer.AddChild(buttonContainer, "24");
            verticalContainer.AddChild(new EmptyContainer(), "*");

            var horizontalContainer = new HorizontalContainer();
            horizontalContainer.AddChild(new EmptyContainer(), "*");
            horizontalContainer.AddChild(verticalContainer, "300");
            horizontalContainer.AddChild(new EmptyContainer(), "*");

            var canvas = new Canvas();
            canvas.SetChild(horizontalContainer);

            this.m_CanvasEntity = new CanvasEntity(skin, canvas);

            this.m_QueryServersThread = new Thread(this.QueryServers) { Name = "Query Servers", IsBackground = true };
            this.m_QueryServersThread.Start();
        }
コード例 #3
0
ファイル: BasicSkin.cs プロジェクト: johnsonc/Protogame
 /// <summary>
 /// The draw list view.
 /// </summary>
 /// <param name="context">
 /// The context.
 /// </param>
 /// <param name="layout">
 /// The layout.
 /// </param>
 /// <param name="listView">
 /// The list view.
 /// </param>
 public void DrawListView(IRenderContext context, Rectangle layout, ListView listView)
 {
     this.DrawSunken(context, layout);
 }
コード例 #4
0
ファイル: TychaiaSkin.cs プロジェクト: TreeSeed/Tychaia
 public void DrawListView(IRenderContext context, Rectangle layout, ListView listView)
 {
     this.DrawUIBackground(context, layout);
     this.DrawUIBorder(context, layout, Side.Top);
     this.DrawUIBorder(context, layout, Side.Bottom);
     this.DrawUIBorder(context, layout, Side.Left);
     this.DrawUIBorder(context, layout, Side.Right);
     this.DrawUICorner(context, layout, Corner.TopLeft);
     this.DrawUICorner(context, layout, Corner.TopRight);
     this.DrawUICorner(context, layout, Corner.BottomLeft);
     this.DrawUICorner(context, layout, Corner.BottomRight);
 }