• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# GUI.MyGuiControlGrid类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Sandbox.Graphics.GUI.MyGuiControlGrid的典型用法代码示例。如果您正苦于以下问题:C# MyGuiControlGrid类的具体用法?C# MyGuiControlGrid怎么用?C# MyGuiControlGrid使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MyGuiControlGrid类属于Sandbox.Graphics.GUI命名空间,在下文中一共展示了MyGuiControlGrid类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: MakeInventoryGrid

 private MyGuiControlGrid MakeInventoryGrid(MyInventory inventory)
 {
     var grid = new MyGuiControlGrid();
     grid.Name = "InventoryGrid";
     grid.VisualStyle = MyGuiControlGridStyleEnum.Inventory;
     grid.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP;
     grid.ColumnsCount = 7;
     grid.RowsCount = 1;
     grid.ShowTooltipWhenDisabled = true;
     grid.UserData = inventory;
     return grid;
 }
开发者ID:Krulac,项目名称:SpaceEngineers,代码行数:12,代码来源:MyGuiControlInventoryOwner.cs


示例2: Init

        public void Init(IMyGuiControlsParent controlsParent, MyCubeGrid grid)
        {
            if (grid == null)
            {
                ShowError(MySpaceTexts.ScreenTerminalError_ShipNotConnected, controlsParent);
                return;
            }

            grid.RaiseGridChanged();
            m_assemblerKeyCounter = 0;
            m_assemblersByKey.Clear();
            foreach (var block in grid.GridSystems.TerminalSystem.Blocks)
            {
                var assembler = block as MyAssembler;
                if (assembler == null) continue;
                if (!assembler.HasLocalPlayerAccess()) continue;

                m_assemblersByKey.Add(m_assemblerKeyCounter++, assembler);
            }

            m_controlsParent = controlsParent;
            m_terminalSystem = grid.GridSystems.TerminalSystem;

            m_blueprintsArea = (MyGuiControlScrollablePanel)controlsParent.Controls.GetControlByName("BlueprintsScrollableArea");
            m_queueArea = (MyGuiControlScrollablePanel)controlsParent.Controls.GetControlByName("QueueScrollableArea");
            m_inventoryArea = (MyGuiControlScrollablePanel)controlsParent.Controls.GetControlByName("InventoryScrollableArea");
            m_blueprintsBgPanel = controlsParent.Controls.GetControlByName("BlueprintsBackgroundPanel");
            m_blueprintsLabel = controlsParent.Controls.GetControlByName("BlueprintsLabel");
            m_comboboxAssemblers = (MyGuiControlCombobox)controlsParent.Controls.GetControlByName("AssemblersCombobox");
            m_blueprintsGrid = (MyGuiControlGrid)m_blueprintsArea.ScrolledControl;
            m_queueGrid = (MyGuiControlGrid)m_queueArea.ScrolledControl;
            m_inventoryGrid = (MyGuiControlGrid)m_inventoryArea.ScrolledControl;
            m_materialsList = (MyGuiControlComponentList)controlsParent.Controls.GetControlByName("MaterialsList");
            m_repeatCheckbox = (MyGuiControlCheckbox)controlsParent.Controls.GetControlByName("RepeatCheckbox");
            m_slaveCheckbox = (MyGuiControlCheckbox)controlsParent.Controls.GetControlByName("SlaveCheckbox");
            m_disassembleAllButton = (MyGuiControlButton)controlsParent.Controls.GetControlByName("DisassembleAllButton");
            m_controlPanelButton = (MyGuiControlButton)controlsParent.Controls.GetControlByName("ControlPanelButton");
            m_inventoryButton = (MyGuiControlButton)controlsParent.Controls.GetControlByName("InventoryButton");

            {
                var assemblingButton = (MyGuiControlRadioButton)controlsParent.Controls.GetControlByName("AssemblingButton");
                var disassemblingButton = (MyGuiControlRadioButton)controlsParent.Controls.GetControlByName("DisassemblingButton");
                assemblingButton.Key = (int)AssemblerMode.Assembling;
                disassemblingButton.Key = (int)AssemblerMode.Disassembling;
                m_modeButtonGroup.Add(assemblingButton);
                m_modeButtonGroup.Add(disassemblingButton);
            }

            foreach (var entry in m_assemblersByKey)
            {
                if (entry.Value.IsFunctional == false)
                {
                    m_incompleteAssemblerName.Clear();
                    m_incompleteAssemblerName.AppendStringBuilder(entry.Value.CustomName);
                    m_incompleteAssemblerName.AppendStringBuilder(MyTexts.Get(MySpaceTexts.Terminal_BlockIncomplete));
                    m_comboboxAssemblers.AddItem(entry.Key, m_incompleteAssemblerName);
                }
                else
                {
                    m_comboboxAssemblers.AddItem(entry.Key, entry.Value.CustomName);
                }
            }
            m_comboboxAssemblers.ItemSelected += Assemblers_ItemSelected;

            m_comboboxAssemblers.SelectItemByIndex(0);

            m_dragAndDrop = new MyGuiControlGridDragAndDrop(MyGuiConstants.DRAG_AND_DROP_BACKGROUND_COLOR,
                                                            MyGuiConstants.DRAG_AND_DROP_TEXT_COLOR,
                                                            0.7f,
                                                            MyGuiConstants.DRAG_AND_DROP_TEXT_OFFSET, true);
            controlsParent.Controls.Add(m_dragAndDrop);
            m_dragAndDrop.DrawBackgroundTexture = false;
            m_dragAndDrop.ItemDropped += dragDrop_OnItemDropped;

            RefreshBlueprints();
            Assemblers_ItemSelected();

            RegisterEvents();

            if (m_assemblersByKey.Count == 0)
                ShowError(MySpaceTexts.ScreenTerminalError_NoAssemblers, controlsParent);
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:82,代码来源:MyTerminalProductionController.cs


示例3: OnSelectedItemChanged

 private void OnSelectedItemChanged(MyGuiControlGrid arg1, MyGuiControlGrid.EventArgs arg2)
 {
     OnGridMouseOverIndexChanged(arg1, arg2);
 }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:4,代码来源:MyGuiScreenCubeBuilder.cs


示例4: FillGridItem

 public override void FillGridItem(MyGuiControlGrid.Item gridItem)
 {
     if (MyFakes.ENABLE_GATHERING_SMALL_BLOCK_FROM_GRID)
         if (m_lastAmount > 0)
             gridItem.AddText(String.Format("{0}x", m_lastAmount), MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM);
         else
             gridItem.ClearText(MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM);
 }
开发者ID:Chrus,项目名称:SpaceEngineers,代码行数:8,代码来源:MyToolbarItemCubeBlock.cs


示例5: grid_ItemDoubleClicked

        private void grid_ItemDoubleClicked(MyGuiControlGrid sender, MyGuiControlGrid.EventArgs eventArgs)
        {
            if (MyInput.Static.IsAnyShiftKeyPressed() ||
                MyInput.Static.IsAnyCtrlKeyPressed())
                return;

            var item = (MyPhysicalInventoryItem)sender.GetItemAt(eventArgs.ItemIndex).UserData;
            bool transfered = TransferToOppositeFirst(item);
            RefreshSelectedInventoryItem();
            //MyAudio.Static.PlayCue(transfered ? MySoundCuesEnum.HudMouseClick : MySoundCuesEnum.HudUnable);
        }
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:11,代码来源:MyTerminalInventoryController.cs


示例6: grid_ItemSelected

        private void grid_ItemSelected(MyGuiControlGrid sender, MyGuiControlGrid.EventArgs eventArgs)
        {
            var sourceGrid = (MyGuiControlGrid)sender;
            if (m_focusedGridControl != null &&
                m_focusedGridControl != sourceGrid)
            {
                m_focusedGridControl.SelectedIndex = null;
            }

            m_focusedGridControl = sourceGrid;
            m_focusedOwnerControl = (MyGuiControlInventoryOwner)sourceGrid.Owner;

            RefreshSelectedInventoryItem();
        }
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:14,代码来源:MyTerminalInventoryController.cs


示例7: inventoryGrid_MouseOverIndexChanged

        void inventoryGrid_MouseOverIndexChanged(MyGuiControlGrid control, MyGuiControlGrid.EventArgs args)
        {
            Debug.Assert(control == m_inventoryGrid);

            if (CurrentAssemblerMode == AssemblerMode.Assembling)
                return;

            RefreshMaterialsPreview();
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:9,代码来源:MyTerminalProductionController.cs


示例8: IsToolbarGrid

 public bool IsToolbarGrid(MyGuiControlGrid grid)
 {
     return m_toolbarItemsGrid == grid;
 }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:4,代码来源:MyGuiControlToolbar.cs


示例9: RecreateControls

        private void RecreateControls(bool contructor)
        {
            m_toolbarItemsGrid = new MyGuiControlGrid()
            {
                OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM,
                VisualStyle = MyGuiControlGridStyleEnum.Toolbar,
                ColumnsCount = MyToolbarComponent.CurrentToolbar.SlotCount + 1,
                RowsCount = 1
            };
            m_toolbarItemsGrid.ItemDoubleClicked += grid_ItemDoubleClicked;
            m_toolbarItemsGrid.ItemClickedWithoutDoubleClick += grid_ItemClicked;

            m_selectedItemLabel = new MyGuiControlLabel();
            m_colorVariantPanel = new MyGuiControlPanel(size: new Vector2(0.1f, 0.025f));
            m_colorVariantPanel.BackgroundTexture = MyGuiConstants.TEXTURE_GUI_BLANK;

            m_contextMenu = new MyGuiControlContextMenu();
            m_contextMenu.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM;
            m_contextMenu.Deactivate();
            m_contextMenu.ItemClicked += contextMenu_ItemClicked;

            Elements.Add(m_colorVariantPanel);
            Elements.Add(m_selectedItemLabel);
            Elements.Add(m_toolbarItemsGrid);
            Elements.Add(m_contextMenu);

            m_colorVariantPanel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM;
            m_selectedItemLabel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM;
            m_toolbarItemsGrid.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM;
            m_contextMenu.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM;

            RefreshInternals();
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:33,代码来源:MyGuiControlToolbar.cs


示例10: StartDragging

 /// <summary>
 /// Starts dragging item
 /// </summary>
 /// <param name="dropHandleType">On which action released drop event</param>
 /// <param name="draggingItem">Item which is dragging</param>
 /// <param name="draggingFrom">Information about item's origin</param>
 public void StartDragging(MyDropHandleType dropHandleType, MySharedButtonsEnum dragButton, MyGuiControlGrid.Item draggingItem, MyDragAndDropInfo draggingFrom, bool includeTooltip = true)
 {
     m_currentDropHandleType = dropHandleType;
     m_dragButton = dragButton;
     m_draggingGridItem = draggingItem;
     m_draggingFrom = draggingFrom;
     m_toolTip = (includeTooltip) ? draggingItem.ToolTip : null;
 }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:14,代码来源:MyGuiControlGridDragAndDrop.cs


示例11: SetGridItemAt

        protected virtual void SetGridItemAt(int slot, MyToolbarItem item, string[] icons, string subicon, String tooltip, MyGuiControlGrid.ColoredIcon? symbol = null, bool clear = false)
        {
            var gridItem = m_toolbarItemsGrid.GetItemAt(slot);

            if (gridItem == null)
            {
                gridItem = new MyGuiControlGrid.Item(
                    icons: icons,
                    subicon: subicon,
                    toolTip: tooltip,
                    userData: item);
                //By Gregory: Changed to IconText for weapon check MyToolbarItemWeapon IconText override
                //if (item != null)
                //    gridItem.AddText(item.IconText, MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
                //else
                //    gridItem.ClearText(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
                //gridItem.Enabled = (item != null) ? item.Enabled : true;
                //if (symbol.HasValue)
                //    gridItem.AddIcon(symbol.Value, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP);
                m_toolbarItemsGrid.SetItemAt(slot, gridItem);
            }
            else
            {
                gridItem.UserData = item;
                gridItem.Icons = icons;
                gridItem.SubIcon = subicon;
                if (gridItem.ToolTip == null)
                    gridItem.ToolTip = new MyToolTips();
                gridItem.ToolTip.ToolTips.Clear();
                gridItem.ToolTip.AddToolTip(tooltip);
                //By Gregory: Changed to IconText for weapon check MyToolbarItemWeapon IconText override
                //if (item != null)
                //    gridItem.AddText(item.IconText, MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
                //else
                //    gridItem.ClearText(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
                //gridItem.Enabled = (item != null) ? item.Enabled : true;
                //if (symbol.HasValue)
                //    gridItem.AddIcon(symbol.Value, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP);
            }

            if (item == null || clear)
                gridItem.ClearAllText();

            if (DrawNumbers)
                gridItem.AddText(MyToolbarComponent.GetSlotControlText(slot));

            if (item != null)
                item.FillGridItem(gridItem);

            gridItem.Enabled = (item != null) ? item.Enabled : true;
            if (symbol.HasValue)
                gridItem.AddIcon(symbol.Value, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP);

        }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:54,代码来源:MyGuiControlToolbar.cs


示例12: MakeScreenWithIconGrid

        private static void MakeScreenWithIconGrid()
        {
            var screen = new TmpScreen();
            var grid = new MyGuiControlGrid();
            screen.Controls.Add(grid);
            grid.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER;
            grid.VisualStyle = MyGuiControlGridStyleEnum.Inventory;
            grid.RowsCount = 12;
            grid.ColumnsCount = 18;
            foreach (var definition in MyDefinitionManager.Static.GetAllDefinitions())
            {
                grid.Add(new MyGuiControlGrid.Item(
                    icon: definition.Icon,
                    toolTip: definition.DisplayNameText));
            }

            MyGuiSandbox.AddScreen(screen);
        }
开发者ID:stanhebben,项目名称:SpaceEngineers,代码行数:18,代码来源:MyMartinDebugInputComponent.cs


示例13: OnGridMouseOverIndexChanged

        private void OnGridMouseOverIndexChanged(MyGuiControlGrid myGuiControlGrid, MyGuiControlGrid.EventArgs eventArgs)
        {
           
            if (m_gridBlocks.Visible)
            {
                MyGuiControlGrid.Item gridItem = m_gridBlocks.MouseOverItem ?? m_gridBlocks.SelectedItem;

                if (gridItem == null)
                {
                    m_blockInfoList.InitControls(new MyGuiControlBase[] { });
                    return;
                }

                GridItemUserData userData = gridItem.UserData as GridItemUserData;
                if (userData == null)
                    return;

                MyObjectBuilder_ToolbarItemCubeBlock itemData = userData.ItemData as MyObjectBuilder_ToolbarItemCubeBlock;
                if (itemData == null)
                    return;

                MyDefinitionBase definition;
                if (MyDefinitionManager.Static.TryGetDefinition(itemData.DefinitionId, out definition))
                {
                    var group = MyDefinitionManager.Static.GetDefinitionGroup((definition as MyCubeBlockDefinition).BlockPairName);

                    if (MyCubeBuilder.Static.CubeBuilderState.CubeSizeMode == MyCubeSize.Small &&
                        MyCubeBuilder.Static.IsCubeSizeAvailable(group.Small))
                    {
                        m_blockInfoList.InitControls(GenerateBlockInfos(group.Small, ref m_blockInfoStyle));
                    }
                    else if (MyCubeBuilder.Static.CubeBuilderState.CubeSizeMode == MyCubeSize.Large &&
                        MyCubeBuilder.Static.IsCubeSizeAvailable(group.Large))
                    {
                        m_blockInfoList.InitControls(GenerateBlockInfos(group.Large, ref m_blockInfoStyle));
                    }
                    else
                    {
                        bool blockSizeLarge = MyCubeBuilder.Static.CubeBuilderState.CubeSizeMode == MyCubeSize.Large;
                        m_blockInfoList.InitControls(new MyGuiControlBase[]
                        {
                            GenerateSizeInfoLabel(blockSizeLarge),
                            GenerateSizeNotAvailableText(blockSizeLarge)
                        });
                    }
                }
                
            }
            else
            {
                m_blockInfoList.InitControls(new MyGuiControlBase[] { });
            }
        }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:53,代码来源:MyGuiScreenCubeBuilder.cs


示例14: queueGrid_ItemClicked

        void queueGrid_ItemClicked(MyGuiControlGrid control, MyGuiControlGrid.EventArgs args)
        {
            Debug.Assert(control == m_queueGrid);

            // Changing queue in auto-disassembling mode is forbidden.
            if (CurrentAssemblerMode == AssemblerMode.Disassembling && m_selectedAssembler.RepeatEnabled)
                return;

            if (args.Button == MySharedButtonsEnum.Secondary)
                m_selectedAssembler.RemoveQueueItemRequest(args.ItemIndex);
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:11,代码来源:MyTerminalProductionController.cs


示例15: queueGrid_ItemDragged

 void queueGrid_ItemDragged(MyGuiControlGrid control, MyGuiControlGrid.EventArgs args)
 {
     StartDragging(MyDropHandleType.MouseRelease, control, ref args);
 }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:4,代码来源:MyTerminalProductionController.cs


示例16: grid_ItemClicked

        private void grid_ItemClicked(MyGuiControlGrid sender, MyGuiControlGrid.EventArgs eventArgs)
        {
            if (eventArgs.Button == MySharedButtonsEnum.Secondary)
            {
                int slot = eventArgs.ColumnIndex;
                var toolbar = MyToolbarComponent.CurrentToolbar;
                MyToolbarItem item = toolbar.GetSlotItem(slot);
                if (item == null) return;

                //right clicks in multifunctional items should trigger their menus (if they have more than 0 options)
                if (item is MyToolbarItemActions)
                {
                    var actionList = (item as MyToolbarItemActions).PossibleActions(ShownToolbar.ToolbarType);
                    if (actionList.Count > 0)
                    {
                        m_contextMenu.CreateNewContextMenu();
                        foreach (var action in actionList)
                            m_contextMenu.AddItem(action.Name, icon: action.Icon, userData: action.Id);

                        m_contextMenu.AddItem(MyTexts.Get(MySpaceTexts.BlockAction_RemoveFromToolbar));
                        m_contextMenu.Enabled = true;
                        m_contextMenuItemIndex = toolbar.SlotToIndex(slot);
                    }
                    else
                        RemoveToolbarItem(eventArgs.ColumnIndex);
                }
                else
                    RemoveToolbarItem(eventArgs.ColumnIndex);
            }

            if (m_shownToolbar.IsValidIndex(eventArgs.ColumnIndex))
                m_shownToolbar.ActivateItemAtSlot(eventArgs.ColumnIndex, true);
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:33,代码来源:MyGuiControlToolbar.cs


示例17: queueGrid_MouseOverIndexChanged

 void queueGrid_MouseOverIndexChanged(MyGuiControlGrid control, MyGuiControlGrid.EventArgs args)
 {
     Debug.Assert(control == m_queueGrid);
     RefreshMaterialsPreview();
 }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:5,代码来源:MyTerminalProductionController.cs


示例18: grid_ItemDoubleClicked

        private void grid_ItemDoubleClicked(MyGuiControlGrid sender, MyGuiControlGrid.EventArgs eventArgs)
        {
            RemoveToolbarItem(eventArgs.ColumnIndex);

            if (m_shownToolbar.IsValidIndex(eventArgs.ColumnIndex))
                m_shownToolbar.ActivateItemAtSlot(eventArgs.ColumnIndex);
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:7,代码来源:MyGuiControlToolbar.cs


示例19: StartDragging

        private void StartDragging(MyDropHandleType dropHandlingType, MyGuiControlGrid gridControl, ref MyGuiControlGrid.EventArgs args)
        {
            m_dragAndDropInfo = new MyDragAndDropInfo();
            m_dragAndDropInfo.Grid = gridControl;
            m_dragAndDropInfo.ItemIndex = args.ItemIndex;

            DisableInvalidWhileDragging();

            var draggingItem = m_dragAndDropInfo.Grid.GetItemAt(m_dragAndDropInfo.ItemIndex);
            m_dragAndDrop.StartDragging(dropHandlingType, args.Button, draggingItem, m_dragAndDropInfo, includeTooltip: false);
        }
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:11,代码来源:MyTerminalInventoryController.cs


示例20: CreateProductionPageControls

        private void CreateProductionPageControls(MyGuiControlTabPage productionPage)
        {
            productionPage.Name = "PageProduction";
            productionPage.TextEnum = MySpaceTexts.TerminalTab_Production;

            float columnSpacing = 0.03f;
            float controlSpacing = 0.01f;
            float smallBackgroundPanelHeight = 0.05f;
            float largeBackgroundPanelHeight = 0.08f;

            var assemblersCombobox = new MyGuiControlCombobox(
                position: -0.5f * productionPage.Size + new Vector2(0f, controlSpacing))
                {
                    OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP,
                    Name = "AssemblersCombobox"
                };

            var blueprintsBackgroundPanel = new MyGuiControlPanel(
                position: assemblersCombobox.Position + new Vector2(0f, assemblersCombobox.Size.Y + controlSpacing),
                size: new Vector2(1f, largeBackgroundPanelHeight),
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP)
                {
                    BackgroundTexture = MyGuiConstants.TEXTURE_RECTANGLE_DARK,
                    Name = "BlueprintsBackgroundPanel",
                };

            var blueprintsLabel = new MyGuiControlLabel(
                position: blueprintsBackgroundPanel.Position + new Vector2(controlSpacing, controlSpacing),
                text: MyTexts.GetString(MySpaceTexts.ScreenTerminalProduction_Blueprints),
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP)
                {
                    Name = "BlueprintsLabel"
                };
            var blueprintsGrid = new MyGuiControlGrid()
            {
                VisualStyle = MyGuiControlGridStyleEnum.Toolbar,
                RowsCount = MyTerminalProductionController.BLUEPRINT_GRID_ROWS,
                ColumnsCount = 4,
                OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP
            };

            var blueprintsScrollableArea = new MyGuiControlScrollablePanel(
                scrolledControl: blueprintsGrid)
                {
                    Name = "BlueprintsScrollableArea",
                    ScrollbarVEnabled = true,
                    Position = blueprintsBackgroundPanel.Position + new Vector2(0f, blueprintsBackgroundPanel.Size.Y),
                    OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP,
                    BackgroundTexture = MyGuiConstants.TEXTURE_SCROLLABLE_LIST,
                    Size = new Vector2(blueprintsBackgroundPanel.Size.X, 0.5f),
                    ScrolledAreaPadding = new MyGuiBorderThickness(0.005f),
                };
            blueprintsScrollableArea.FitSizeToScrolledControl();
            assemblersCombobox.Size = new Vector2(blueprintsScrollableArea.Size.X, assemblersCombobox.Size.Y);
            blueprintsBackgroundPanel.Size = new Vector2(blueprintsScrollableArea.Size.X, largeBackgroundPanelHeight);
            blueprintsGrid.RowsCount = 20;

            productionPage.Controls.Add(assemblersCombobox);
            productionPage.Controls.Add(blueprintsBackgroundPanel);
            productionPage.Controls.Add(blueprintsLabel);
            productionPage.Controls.Add(blueprintsScrollableArea);

            var materialsBackgroundPanel = new MyGuiControlPanel(
                position: blueprintsBackgroundPanel.Position + new Vector2(blueprintsBackgroundPanel.Size.X + columnSpacing, 0f),
                size: new Vector2(blueprintsBackgroundPanel.Size.X, smallBackgroundPanelHeight),
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP)
                {
                    BackgroundTexture = MyGuiConstants.TEXTURE_RECTANGLE_DARK
                };

            var materialsLabel = new MyGuiControlLabel(
                position: materialsBackgroundPanel.Position + new Vector2(controlSpacing, controlSpacing),
                text: MyTexts.GetString(MySpaceTexts.ScreenTerminalProduction_StoredMaterials),
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP
            );

            var materialsList = new MyGuiControlComponentList()
            {
                Position = materialsBackgroundPanel.Position + new Vector2(0f, materialsBackgroundPanel.Size.Y),
                Size = new Vector2(materialsBackgroundPanel.Size.X, blueprintsBackgroundPanel.Size.Y + blueprintsScrollableArea.Size.Y - materialsBackgroundPanel.Size.Y),
                OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP,
                BackgroundTexture = MyGuiConstants.TEXTURE_RECTANGLE_NEUTRAL,
                Name = "MaterialsList",
            };

            productionPage.Controls.Add(materialsBackgroundPanel);
            productionPage.Controls.Add(materialsLabel);
            productionPage.Controls.Add(materialsList);

            var assemblingButton = new MyGuiControlRadioButton(
                position: materialsBackgroundPanel.Position + new Vector2(materialsBackgroundPanel.Size.X + columnSpacing, 0f),
                size: new Vector2(200f, 48f) / MyGuiConstants.GUI_OPTIMAL_SIZE)
                {
                    OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP,
                    Icon = MyGuiConstants.TEXTURE_BUTTON_ICON_COMPONENT,
                    IconOriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
                    TextAlignment = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_CENTER,
                    Text = MyTexts.Get(MySpaceTexts.ScreenTerminalProduction_AssemblingButton),
                    Name = "AssemblingButton",
                };
//.........这里部分代码省略.........
开发者ID:Chrus,项目名称:SpaceEngineers,代码行数:101,代码来源:MyGuiScreenTerminal.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# GUI.MyGuiControlLabel类代码示例发布时间:2022-05-26
下一篇:
C# GUI.MyGuiControlCombobox类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap