Beispiel #1
0
        public TextInput(TextInputProps textInputProps) : base(textInputProps)
        {
            p_UseMultiLine = textInputProps.UseMultiLine;

            p_Padding = new Vector2(20, 20);

            if (textInputProps.UseMultiLine && textInputProps.Size.Y == -1)
            {
                p_size.Y *= 4;
            }

            LimitBySize = !p_UseMultiLine;

            TextParagraph = UiManager.DefaultParagraph(string.Empty, p_UseMultiLine ? Anchor.TopLeft : Anchor.CenterLeft);
            TextParagraph.p_HiddenInternalEntity = true;
            AddChild(TextParagraph, true);

            PlaceHolderParagraph = UiManager.DefaultParagraph(string.Empty, p_UseMultiLine ? Anchor.TopLeft : Anchor.CenterLeft);
            PlaceHolderParagraph.p_HiddenInternalEntity = true;
            AddChild(PlaceHolderParagraph, true);

            if (p_UseMultiLine)
            {
                p_scrollBar = new VerticalScrollBar(new SliderProps {
                    Min = 0, Max = 0, EntityAnchor = Anchor.CenterRight, LocalPosition = new Vector2(-8, 0), Size = new Vector2(10, 0)
                });
                p_scrollBar.Value   = 0;
                p_scrollBar.Visible = false;
                p_scrollBar.p_HiddenInternalEntity = true;
                AddChild(p_scrollBar, false);
            }

            TextParagraph.WarpsWords        = p_UseMultiLine;
            PlaceHolderParagraph.WarpsWords = p_UseMultiLine;

            MultiColorParagraph colorTextParagraph = TextParagraph as MultiColorParagraph;

            if (colorTextParagraph != null)
            {
                colorTextParagraph.EnableColorInstructions = false;
            }
        }
Beispiel #2
0
        public SelectList(SelectListProps selectlistProps) : base(selectlistProps)
        {
            p_Padding = new Vector2(30, 22);

            p_scrollbar = new VerticalScrollBar(new SliderProps
            {
                EntityName    = Name + ": ScrollBar",
                Min           = 0,
                Max           = 10,
                Size          = new Vector2(10, 0),
                EntityAnchor  = Anchor.CenterRight,
                LocalPosition = new Vector2(-12, 0)
            });

            p_scrollbar.Value   = 0;
            p_scrollbar.Visible = false;
            p_scrollbar.p_HiddenInternalEntity = true;
            AddChild(p_scrollbar);

            p_selectedParagraphImage = selectlistProps.SelectedOptionsImageTexture;
        }
Beispiel #3
0
 private void UpdateOverFlowMode()
 {
     if (p_OverFlowMode == PanelOverflowBehavior.VerticalScroll)
     {
         if (p_ScrollBar == null)
         {
             p_ScrollBar = new VerticalScrollBar(new SliderProps {
                 Max = 0, Min = 0, EntityAnchor = Anchor.TopRight
             }, true)
             {
                 Size                   = new Vector2(10, 0),
                 ScaledPadding          = Vector2.Zero,
                 AdjustMaxAutomatically = true,
                 Name                   = "ScrollBar",
                 p_HiddenInternalEntity = true,
             };
             bool prev_needToSortChildren = p_NeedToSortChildren;
             AddChild(p_ScrollBar);
             p_NeedToSortChildren = prev_needToSortChildren;
         }
     }
 }