Exemplo n.º 1
0
        public override void Initialize()
        {
            base.Initialize();

            TabContainer container   = Register(new TabContainer(Context, "province_tabs", new UniRectangle(0, 150, 1.0f, new UniScalar(1, -150))));
            Tab          overiewTab  = container.RegisterTab(new Tab(Context, "province_overview_tab", "Overview"));
            Tab          economyTab  = container.RegisterTab(new Tab(Context, "province_economy_tab", "Economy"));
            Tab          politicsTab = container.RegisterTab(new Tab(Context, "province_politics_tab", "Politics"));

            container.SetOffset(256 - container.TabTitleSpacing);

            new PositionLayout(this, 250, 150 + container.TabHeight - 6, HorizontalAlignment.Left, VerticalAlignment.Top, new Padding(3))
            .Create(_provinceMap = new ProvinceMap(Context, ShowProvinceFromMap))
            .Right(40, VerticalAlignment.Top, new Padding(3))
            .Create(_provinceName = new Label(Context, "province_name"));

            _settlementScrollableContainer =
                new ScrollableContainer <SettlementScrollableItem, Settlement>(Context, "settlements", 4,
                                                                               c => new SettlementScrollableItem(c, _settlementDetailPanel));
            new PositionLayout(overiewTab, _settlementScrollableContainer.Size.X, _settlementScrollableContainer.Size.Y,
                               HorizontalAlignment.Center, VerticalAlignment.Bottom)
            .Create(_settlementScrollableContainer);

            new PositionLayout(this, 20, 20, HorizontalAlignment.Right, VerticalAlignment.Top, new Padding(3))
            .Create(new IconButton(Context, "close_button", () => Visible = false));
        }