Inheritance: IContainer, IHasDesiredSize
コード例 #1
0
ファイル: BasicSkin.cs プロジェクト: johnsonc/Protogame
 /// <summary>
 /// The draw single container.
 /// </summary>
 /// <param name="context">
 /// The context.
 /// </param>
 /// <param name="layout">
 /// The layout.
 /// </param>
 /// <param name="singleContainer">
 /// The single container.
 /// </param>
 public void DrawSingleContainer(IRenderContext context, Rectangle layout, SingleContainer singleContainer)
 {
     this.DrawSunken(context, layout);
 }
コード例 #2
0
 /// <summary>
 /// The draw single container.
 /// </summary>
 /// <param name="context">
 /// The context.
 /// </param>
 /// <param name="layout">
 /// The layout.
 /// </param>
 /// <param name="singleContainer">
 /// The single container.
 /// </param>
 public void DrawSingleContainer(IRenderContext context, Rectangle layout, SingleContainer singleContainer)
 {
     this.DrawSunken(context, layout);
 }
コード例 #3
0
ファイル: AssetEditor.cs プロジェクト: johnsonc/Protogame
 /// <summary>
 /// The finish layout.
 /// </summary>
 /// <param name="editorContainer">
 /// The editor container.
 /// </param>
 /// <param name="assetManager">
 /// The asset manager.
 /// </param>
 public virtual void FinishLayout(SingleContainer editorContainer, IAssetManager assetManager)
 {
 }
コード例 #4
0
ファイル: AssetEditor.cs プロジェクト: johnsonc/Protogame
 /// <summary>
 /// The build layout.
 /// </summary>
 /// <param name="editorContainer">
 /// The editor container.
 /// </param>
 /// <param name="assetManager">
 /// The asset manager.
 /// </param>
 public abstract void BuildLayout(SingleContainer editorContainer, IAssetManager assetManager);
コード例 #5
0
ファイル: TychaiaSkin.cs プロジェクト: TreeSeed/Tychaia
 public void DrawSingleContainer(IRenderContext context, Rectangle layout, SingleContainer singleContainer)
 {
 }
コード例 #6
0
        public IContainer Process(XmlNode node, Action <UserInterfaceBehaviourEvent, object> eventCallback, out Action <XmlNode, IContainer> processChild)
        {
            IContainer container;

            switch (node?.Attributes?["type"]?.Value)
            {
            case "horizontal":
                var horizontalContainer = new HorizontalContainer();
                processChild = (childNode, childContainer) =>
                {
                    horizontalContainer.AddChild(childContainer, childNode?.Attributes?["width"]?.Value ?? "*");
                };
                container = horizontalContainer;
                break;

            case "vertical":
                var verticalContainer = new VerticalContainer();
                processChild = (childNode, childContainer) =>
                {
                    verticalContainer.AddChild(childContainer, childNode?.Attributes?["height"]?.Value ?? "*");
                };
                container = verticalContainer;
                break;

            case "single":
                var singleContainer = new SingleContainer();
                processChild = (childNode, childContainer) =>
                {
                    singleContainer.SetChild(childContainer);
                };
                container = singleContainer;
                break;

            case "scrollable":
                var scrollableContainer = new ScrollableContainer();
                processChild = (childNode, childContainer) =>
                {
                    scrollableContainer.SetChild(childContainer);
                };
                container = scrollableContainer;
                break;

            case "relative":
                var relativeContainer = new RelativeContainer();
                processChild = (childNode, childContainer) =>
                {
                    relativeContainer.AddChild(childContainer, new Rectangle(
                                                   GetAttribute(childNode, "x"),
                                                   GetAttribute(childNode, "y"),
                                                   GetAttribute(childNode, "width"),
                                                   GetAttribute(childNode, "height")));
                };
                container = relativeContainer;
                break;

            case "adjusted":
                var adjustedContainer = new AdjustedContainer(new Point(
                                                                  GetAttribute(node, "anchorX"),
                                                                  GetAttribute(node, "anchorY")));
                processChild = (childNode, childContainer) =>
                {
                    adjustedContainer.AddChild(childContainer, new Rectangle(
                                                   GetAttribute(childNode, "x"),
                                                   GetAttribute(childNode, "y"),
                                                   GetAttribute(childNode, "width"),
                                                   GetAttribute(childNode, "height")));
                };
                container = adjustedContainer;
                break;

            case "empty":
                container    = new EmptyContainer();
                processChild = (childNode, childContainer) => { };
                break;

            default:
                processChild = (childNode, childContainer) => { };
                return(null);
            }

            return(container);
        }