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

C# MyGuiControlBase类代码示例

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

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



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

示例1: Add

 public void Add(MyGuiControlBase leftControl, MyGuiControlBase rightControl)
 {
     var verticalSize = Math.Max(leftControl.Size.Y, rightControl.Size.Y);
     AddInternal(leftControl, MyAlignH.Left, MyAlignV.Center, false, verticalSize);
     AddInternal(rightControl, MyAlignH.Right, MyAlignV.Center, false, verticalSize);
     m_currentPosY += verticalSize;
 }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:7,代码来源:MyListLayouts.cs


示例2: GetNextFocusControl

 public override MyGuiControlBase GetNextFocusControl(MyGuiControlBase currentFocusControl, bool forwardMovement)
 {
     if (HasFocus)
         return Owner.GetNextFocusControl(this, forwardMovement);
     else
         return this;
 }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:7,代码来源:MyGuiScreenControlMenu.cs


示例3: ValueChanged

        protected override void ValueChanged(MyGuiControlBase sender)
        {
            base.ValueChanged(sender);

            MyRenderProxy.UpdateRenderQuality(
                MyRenderConstants.RenderQualityProfile.RenderQuality,
                MyRenderConstants.RenderQualityProfile.EnableCascadeBlending);
        }
开发者ID:ales-vilchytski,项目名称:SpaceEngineers,代码行数:8,代码来源:MyGuiScreenDebugRender.cs


示例4: MyRichLabel

        public MyRichLabel(MyGuiControlBase parent, float maxLineWidth, float minLineHeight, int? linesCountMax = null)
        {
            m_parent = parent;
            m_maxLineWidth = maxLineWidth;
            m_minLineHeight = minLineHeight;
            m_helperSb = new StringBuilder(256);
            m_visibleLinesCount = linesCountMax == null ? int.MaxValue : linesCountMax.Value;

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


示例5: ValueChanged

 protected override void ValueChanged(MyGuiControlBase sender)
 {
     var settings = new MyRenderFogSettings()
     {
         FogMultiplier = MySector.FogProperties.FogMultiplier,
         FogColor = MySector.FogProperties.FogColor,
         FogDensity = MySector.FogProperties.FogDensity
     };
     MyRenderProxy.UpdateFogSettings(ref settings);
     MyRenderProxy.SetSettingsDirty();
 }
开发者ID:rem02,项目名称:SpaceEngineers,代码行数:11,代码来源:MyGuiScreenDebugRenderEnvironmentAmbient.cs


示例6: AddInternal

 private void AddInternal(MyGuiControlBase control, MyAlignH alignH, MyAlignV alignV, bool advance, float verticalSize)
 {
     control.OriginAlign = (MyGuiDrawAlignEnum)(3 * (int)alignH + (int)alignV);
     int alignHSign = (-1 + (int)alignH);
     var offsetV = verticalSize * 0.5f * (int)alignV;
     control.Position = new Vector2(
         alignHSign * (0.5f * m_parentSize.X - m_horizontalPadding),
         m_currentPosY + offsetV);
     m_currentPosY += (advance) ? (verticalSize - offsetV) : 0f;
     m_parent.Controls.Add(control);
 }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:11,代码来源:MyListLayouts.cs


示例7: Add

 public void Add(MyGuiControlBase control, MyAlignH alignH, MyAlignV alignV, int row, int col, int rowSpan = 1, int colSpan = 1)
 {
     var min = new Vector2(m_prefixScanX[col], m_prefixScanY[row]);
     var max = new Vector2(m_prefixScanX[col + colSpan], m_prefixScanY[row + rowSpan]);
     var size = max - min;
     control.Position = new Vector2(
         min.X + size.X * 0.5f * (int)alignH,
         min.Y + size.Y * 0.5f * (int)alignV);
     control.OriginAlign = (MyGuiDrawAlignEnum)(3 * (int)alignH + (int)alignV);
     m_parent.Controls.Add(control);
 }
开发者ID:leandro1129,项目名称:SpaceEngineers,代码行数:11,代码来源:MyLayoutTable.cs


示例8: MyScrollbar

 protected MyScrollbar(MyGuiControlBase control,
     MyGuiCompositeTexture normalTexture,
     MyGuiCompositeTexture highlightTexture,
     MyGuiCompositeTexture backgroundTexture)
 {
     OwnerControl       = control;
     m_normalTexture    = normalTexture;
     m_highlightTexture = highlightTexture;
     m_backgroundTexture = backgroundTexture;
     RefreshInternals();
 }
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:11,代码来源:MyScrollbar.cs


示例9: ValueChanged

        protected override void ValueChanged(MyGuiControlBase sender)
        {
            base.ValueChanged(sender);

            VRageRender.MyRenderProxy.UpdateHDRSettings(
                MyPostProcessHDR.DebugHDRChecked,
                MyPostProcessHDR.Exposure,
                MyPostProcessHDR.Threshold,
                MyPostProcessHDR.BloomIntensity,
                MyPostProcessHDR.BloomIntensityBackground,
                MyPostProcessHDR.VerticalBlurAmount,
                MyPostProcessHDR.HorizontalBlurAmount,
                (int)MyPostProcessHDR.NumberOfBlurPasses
                );
        }
开发者ID:stanhebben,项目名称:SpaceEngineers,代码行数:15,代码来源:MyGuiScreenDebugRenderHDR.cs


示例10: MyGuiControlBlockProperty

        public MyGuiControlBlockProperty(String title, String tooltip, MyGuiControlBase propertyControl,
            MyGuiControlBlockPropertyLayoutEnum layout = MyGuiControlBlockPropertyLayoutEnum.Vertical, bool showExtraInfo = true)
            : base(toolTip: tooltip, canHaveFocus: true, isActiveControl: false, allowFocusingElements: true)
        {
            const float LABEL_TEXT_SCALE = MyGuiConstants.DEFAULT_TEXT_SCALE * 0.95f;
            m_title = new MyGuiControlLabel(text: title, textScale: LABEL_TEXT_SCALE);
            if (title.Length > 0)
            {
                Elements.Add(m_title);
            }
            
            m_extraInfo = new MyGuiControlLabel(textScale: LABEL_TEXT_SCALE);
            if (showExtraInfo)
            {
                Elements.Add(m_extraInfo);
            }

            m_propertyControl = propertyControl;
            Elements.Add(m_propertyControl);

            titleHeight = title.Length > 0 || showExtraInfo ? m_title.Size.Y : 0;

            m_layout = layout;
            switch (layout)
            {
                case MyGuiControlBlockPropertyLayoutEnum.Horizontal:                    
                    MinSize = new Vector2(m_propertyControl.Size.X + m_title.Size.X * 1.1f, Math.Max(m_propertyControl.Size.Y, 2.1f * titleHeight));
                    Size = MinSize;

                    m_title.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP;
                    m_propertyControl.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP;
                    m_extraInfo.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP;
                    break;
                case MyGuiControlBlockPropertyLayoutEnum.Vertical:
                    MinSize = new Vector2(Math.Max(m_propertyControl.Size.X, m_title.Size.X), m_propertyControl.Size.Y + titleHeight * 1.1f);
                    Size = MinSize;

                    m_title.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP;
                    m_propertyControl.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP;
                    m_extraInfo.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP;
                    break;
            }

            RefreshPositionsAndSizes();

            m_extraInfo.Text = "";
            m_extraInfo.Visible = false;
        }
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:48,代码来源:MyGuiControlBlockProperty.cs


示例11: ValueChanged

        protected override void ValueChanged(MyGuiControlBase sender)
        {
            base.ValueChanged(sender);

            VRageRender.MyRenderProxy.UpdateAntiAliasSettings(
                MyPostProcessAntiAlias.Enabled
                );

            VRageRender.MyRenderProxy.UpdateFogSettings(
               MySector.FogProperties.EnableFog,
               MySector.FogProperties.FogNear,
               MySector.FogProperties.FogFar,
               MySector.FogProperties.FogMultiplier,
               MySector.FogProperties.FogBacklightMultiplier,
               MySector.FogProperties.FogColor);
        }
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:16,代码来源:MyGuiScreenDebugRenderGlobalFX.cs


示例12: ValueChanged

 protected override void ValueChanged(MyGuiControlBase sender)
 {
     base.ValueChanged(sender);
 }
开发者ID:ales-vilchytski,项目名称:SpaceEngineers,代码行数:4,代码来源:MyGuiScreenDebugRender3.cs


示例13: inventoryControl_SizeChanged

 private void inventoryControl_SizeChanged(MyGuiControlBase obj)
 {
     ((MyGuiControlList)obj.Owner).Recalculate();
 }
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:4,代码来源:MyTerminalInventoryController.cs


示例14: HandleTextInputBuffered

        private void HandleTextInputBuffered(ref MyGuiControlBase ret)
        {
            const char BACKSPACE = '\b';
            bool textChanged = false;
            foreach (var character in MyInput.Static.TextInput)
            {
                if (IsSkipCharacter((MyKeys)character))
                    continue;
                if (Char.IsControl(character))
                {
                    if (character == BACKSPACE)
                    {
                        if (m_selection.Length == 0)
                            ApplyBackspace();
                        else
                            m_selection.EraseText(this);
                        
                        textChanged = true;
                    }
                }
                else
                {
                    if (m_selection.Length > 0)
                        m_selection.EraseText(this);

                    InsertChar(character);
                    textChanged = true;
                }
            }

            // Unbuffered Delete because it's not delivered as a message through Win32 message loop.
            if (m_keyThrottler.GetKeyStatus(MyKeys.Delete) == ThrottledKeyStatus.PRESSED_AND_READY)
            {
                if (m_selection.Length == 0)
                    ApplyDelete();
                else
                    m_selection.EraseText(this);

                textChanged = true;
            }

            if (textChanged)
            {
                OnTextChanged();
                ret = this;
            }
        }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:47,代码来源:MyGuiControlTextbox.cs


示例15: HandleNewMousePress

        private void HandleNewMousePress(ref MyGuiControlBase captureInput)
        {
            bool cursorInItems = m_itemsRectangle.Contains(MyGuiManager.MouseCursorPosition);

            if (MyInput.Static.IsNewPrimaryButtonReleased() || MyInput.Static.IsNewSecondaryButtonReleased())
            {
                if (cursorInItems)
                {
                    int? mouseOverIndex = ComputeIndex(MyGuiManager.MouseCursorPosition);
                    if (!IsValidIndex(mouseOverIndex.Value))
                        mouseOverIndex = null;

                    SelectMouseOverItem(mouseOverIndex);

                    if (SelectedIndex.HasValue && m_itemClicked.HasValue && m_lastClick.HasValue && mouseOverIndex.HasValue)
                    {
                        if (MyGuiManager.TotalTimeInMilliseconds - m_lastClick.Value < MyGuiConstants.CLICK_RELEASE_DELAY && m_itemClicked.Value.ItemIndex == mouseOverIndex.Value)
                        {
                            captureInput = this;
                            MySharedButtonsEnum button = MySharedButtonsEnum.None;
                            if (MyInput.Static.IsNewPrimaryButtonReleased())
                                button = MySharedButtonsEnum.Primary;
                            else if (MyInput.Static.IsNewSecondaryButtonReleased())
                                button = MySharedButtonsEnum.Secondary;

                            EventArgs args;
                            MakeEventArgs(out args, SelectedIndex.Value, button);

                            var handler = ItemReleased;
                            if (handler != null)
                                handler(this, args);
                        }
                    }
                }
                m_itemClicked = null;
                m_lastClick = null;
            }

            if (MyInput.Static.IsAnyNewMouseOrJoystickPressed() && cursorInItems)
            {
                m_lastClick = MyGuiManager.TotalTimeInMilliseconds;

                int? mouseOverIndex = ComputeIndex(MyGuiManager.MouseCursorPosition);
                if (!IsValidIndex(mouseOverIndex.Value))
                    mouseOverIndex = null;
                SelectMouseOverItem(mouseOverIndex);

                captureInput = this;
                if (SelectedIndex.HasValue && (ItemClicked != null || ItemClickedWithoutDoubleClick != null))
                {
                    MySharedButtonsEnum button = MySharedButtonsEnum.None;
                    if (MyInput.Static.IsNewPrimaryButtonPressed())
                        button = MySharedButtonsEnum.Primary;
                    else if (MyInput.Static.IsNewSecondaryButtonPressed())
                        button = MySharedButtonsEnum.Secondary;

                    EventArgs args;
                    MakeEventArgs(out args, SelectedIndex.Value, button);
                    var handler = ItemClicked;
                    if (handler != null)
                        handler(this, args);

                    m_singleClickEvents = args;
                    m_itemClicked = args;

                    if (MyInput.Static.IsAnyCtrlKeyPressed() || MyInput.Static.IsAnyShiftKeyPressed())
                        MyGuiSoundManager.PlaySound(GuiSounds.Item);
                }
            }

            if (MyInput.Static.IsNewPrimaryButtonPressed() && cursorInItems)
            {
                if (!m_doubleClickStarted.HasValue)
                {
                    m_doubleClickStarted = MyGuiManager.TotalTimeInMilliseconds;
                    m_doubleClickFirstPosition = MyGuiManager.MouseCursorPosition;
                }
                else if ((MyGuiManager.TotalTimeInMilliseconds - m_doubleClickStarted.Value) <= MyGuiConstants.DOUBLE_CLICK_DELAY &&
                         (m_doubleClickFirstPosition - MyGuiManager.MouseCursorPosition).Length() <= 0.005f)
                {
                    if (SelectedIndex.HasValue && TryGetItemAt(SelectedIndex.Value) != null && ItemDoubleClicked != null)
                    {
                        //Cancel click event when we double click
                        m_singleClickEvents = null;

                        EventArgs args;
                        MakeEventArgs(out args, SelectedIndex.Value, MySharedButtonsEnum.Primary);
                        Debug.Assert(GetItemAt(args.ItemIndex) != null, "Double click should not be reported when clicking on empty position.");
                        ItemDoubleClicked(this, args);
                        MyGuiSoundManager.PlaySound(GuiSounds.Item);
                    }

                    m_doubleClickStarted = null;
                    captureInput = this;
                }
            }
        }
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:97,代码来源:MyGuiControlGrid.cs


示例16: HandleTextInputBuffered

        protected void HandleTextInputBuffered(ref MyGuiControlBase ret)
        {
            bool textChanged = false;
            foreach (var character in MyInput.Static.TextInput)
            {
                if (Char.IsControl(character))
                {
                    if (character == CTLR_Z)
                    {
                        Undo();
                        m_currentCarriageLine = CalculateNewCarriageLine(CarriagePositionIndex);
                        m_currentCarriageColumn = GetCarriageColumn(CarriagePositionIndex);
                    }
                    else if (character == CTLR_Y)
                    {
                        Redo();
                        m_currentCarriageLine = CalculateNewCarriageLine(CarriagePositionIndex);
                        m_currentCarriageColumn = GetCarriageColumn(CarriagePositionIndex);
                    }
                    else if (character == BACKSPACE)
                    {
                        AddToUndo(m_text.ToString());
                        if (m_selection.Length == 0)
                        {
                            ApplyBackspace();
                        }
                        else
                        {
                            m_selection.EraseText(this);            
                        }
                        m_currentCarriageLine = CalculateNewCarriageLine(CarriagePositionIndex);
                        m_currentCarriageColumn = GetCarriageColumn(CarriagePositionIndex);
                        textChanged = true;
                    }
                    else if (character == '\r')
                    {
                        AddToUndo(m_text.ToString());
                        InsertChar(NEW_LINE);
                        textChanged = true;
                        m_currentCarriageLine = CalculateNewCarriageLine(CarriagePositionIndex);
                        m_currentCarriageColumn = GetCarriageColumn(CarriagePositionIndex);
                    }
                    else if (character == TAB)
                    {
                        AddToUndo(m_text.ToString());
                        for (int i = 0; i < 4; ++i)
                        {
                            InsertChar(' ');
                        }
                        textChanged = true;
                    }
                }
                else
                {
                    AddToUndo(m_text.ToString());
                    if (m_selection.Length > 0)
                    {
                        m_selection.EraseText(this);
                    }

                    InsertChar(character);
  
                    textChanged = true;
                }
            }

            // Unbuffered Delete because it's not delivered as a message through Win32 message loop.
            if (MyInput.Static.IsKeyPress(MyKeys.Delete) && IsEnoughDelay(MyMultilineTextKeys.DELETE, MyGuiConstants.TEXTBOX_MOVEMENT_DELAY))
            {
                m_currentCarriageColumn = GetCarriageColumn(CarriagePositionIndex);
                AddToUndo(m_text.ToString());
                if (m_selection.Length == 0)
                    ApplyDelete();
                else
                    m_selection.EraseText(this);

                UpdateLastKeyPressTimes(MyMultilineTextKeys.DELETE);
                textChanged = true;
            }

            if (textChanged)
            {
                OnTextChanged();
                m_currentCarriageColumn = GetCarriageColumn(CarriagePositionIndex);
                ret = this;
            }
        }
开发者ID:leandro1129,项目名称:SpaceEngineers,代码行数:87,代码来源:MyGuiControlMultilineEditableText.cs


示例17: GetNextFocusControl

        public override MyGuiControlBase GetNextFocusControl(MyGuiControlBase currentFocusControl, bool forwardMovement)
        {
            Debug.Assert(currentFocusControl != null);

            var visibleControls = Controls.GetVisibleControls();

            // Pretend that both Controls and Elements are in single array.
            int totalCount = visibleControls.Count + Elements.Count;

            int idxCurrent = visibleControls.IndexOf(currentFocusControl);
            if (idxCurrent == -1)
            {
                idxCurrent = Elements.IndexOf(currentFocusControl);
                if (idxCurrent != -1)
                    idxCurrent += visibleControls.Count;
            }

            if (!forwardMovement && idxCurrent == -1)
                idxCurrent = totalCount;

            // Single loop for both forward and backward movement, but terminating condition would be pain to write in for loop.
            int i = (forwardMovement) ? (idxCurrent + 1)
                                      : (idxCurrent - 1);
            int step = (forwardMovement) ? +1 : -1;
            while((forwardMovement && i < totalCount) ||
                  (!forwardMovement && i >= 0))
            {
                int idx = i;
                if (idx < visibleControls.Count)
                {
                    var visibleControl = visibleControls[idx];
                    if (MyGuiScreenBase.CanHaveFocusRightNow(visibleControl))
                    {
                        if (visibleControl is MyGuiControlParent || !visibleControl.IsActiveControl)
                            return visibleControl.GetFocusControl(forwardMovement);
                        else
                            return visibleControl;
                    }
                }
                else
                {
                    idx -= visibleControls.Count;
                    if (MyGuiScreenBase.CanHaveFocusRightNow(Elements[idx]))
                        return Elements[idx];
                }

                i += step;
            }

            return Owner.GetNextFocusControl(this, forwardMovement);
        }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:51,代码来源:MyGuiControlParent.cs


示例18: ResetPart

 private void ResetPart(MyGuiControlBase sender)
 {
     var instances = MySession.Static.VoxelMaps.Instances;
     foreach (var voxelMap in instances)
     {
         if (!(voxelMap is MyVoxelPhysics))
         {
             var octree = voxelMap.Storage as MyOctreeStorage;
             var worldAabb = voxelMap.PositionComp.WorldAABB;
             BoundingBoxD resetAabb;
             resetAabb.Min = worldAabb.Min + worldAabb.Size * 0.25f;
             resetAabb.Max = worldAabb.Max - worldAabb.Size * 0.25f;
             if (octree != null)
                 octree.ResetOutsideBorders(voxelMap, resetAabb);
         }
     }
 }
开发者ID:Krulac,项目名称:SpaceEngineers,代码行数:17,代码来源:MyGuiScreenDebugVoxels.cs


示例19: HandleMouseDrag

 private void HandleMouseDrag(ref MyGuiControlBase captureInput, MySharedButtonsEnum button, ref bool isDragging)
 {
     if (MyInput.Static.IsNewButtonPressed(button))
     {
         isDragging = true;
         m_mouseDragStartPosition = MyGuiManager.MouseCursorPosition;
     }
     else if (MyInput.Static.IsButtonPressed(button))
     {
         if (isDragging && SelectedItem != null)
         {
             Vector2 mouseDistanceFromLastUpdate = MyGuiManager.MouseCursorPosition - m_mouseDragStartPosition;
             if (mouseDistanceFromLastUpdate.Length() != 0.0f)
             {
                 if (ItemDragged != null)
                 {
                     var dragIdx = ComputeIndex(MyGuiManager.MouseCursorPosition);
                     if (IsValidIndex(dragIdx) && GetItemAt(dragIdx) != null)
                     {
                         EventArgs args;
                         MakeEventArgs(out args, dragIdx, button);
                         ItemDragged(this, args);
                     }
                 }
                 isDragging = false;
             }
             captureInput = this;
         }
     }
     else
     {
         isDragging = false;
     }
 }
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:34,代码来源:MyGuiControlGrid.cs


示例20: MyGuiControlScrollablePanel

 public MyGuiControlScrollablePanel(MyGuiControlBase scrolledControl)
 {
     Name = "ScrollablePanel";
     ScrolledControl = scrolledControl;
 }
开发者ID:leandro1129,项目名称:SpaceEngineers,代码行数:5,代码来源:MyGuiControlScrollablePanel.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# MyGuiDrawAlignEnum类代码示例发布时间:2022-05-24
下一篇:
C# MyEntity类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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