예제 #1
0
        public override void Initial(FakeStruct mod, UIElement element, UIInitializer initializer)
        {
            base.Initial(mod, element, initializer);
            var txt = TextCom = element.GetComponentInChildren <TextBox>();

            textColor = txt.m_color;
            unsafe
            {
                if (mod != null)
                {
                    var ex = UIElementLoader.GetEventData(mod);
                    if (ex != null)
                    {
                        TextInputData *tp = (TextInputData *)ex.ip;
                        textColor      = tp->inputColor;
                        m_tipColor     = tp->tipColor;
                        PointColor     = tp->pointColor;
                        SelectionColor = tp->selectColor;
                        CharacterLimit = tp->CharacterLimit;
                        ReadOnly       = tp->ReadyOnly;
                        contentType    = tp->contentType;
                        lineType       = tp->lineType;
                        m_TipString    = mod.buffer.GetData(tp->tipString) as string;
                        m_InputString  = mod.buffer.GetData(tp->inputString) as string;
                    }
                    else
                    {
                        m_InputString = txt.Text;
                    }
                }
                else
                {
                    m_InputString = txt.Text;
                }
            }
            FullString.Reset(m_InputString, false);
            InputEvent = txt.RegEvent <InputBoxEvent>();
            InputEvent.Initial(null);
            InputEvent.input = this;
            Caret            = txt.GetComponentInChildren <HImage>();
#if UNITY_STANDALONE_WIN || UNITY_EDITOR
            TextCom.HorizontalOverflow = HorizontalWrapMode.Overflow;
#else
            TextCom.HorizontalOverflow = HorizontalWrapMode.Wrap;
#endif
            TextCom.VerticalOverflow = VerticalWrapMode.Overflow;
            SetShowText();
        }
예제 #2
0
        public override void Initial(FakeStruct mod, UIElement element, Initializer initializer)
        {
            base.Initial(mod, element, initializer);
            var txt = TextCom = element.GetComponentInChildren <HText>();

            textColor = txt.m_color;
            unsafe
            {
                if (mod != null)
                {
                    var ex = UITransfromLoader.GetEventData(mod);
                    if (ex != null)
                    {
                        TextInputData *tp = (TextInputData *)ex.ip;
                        textColor      = tp->inputColor;
                        m_tipColor     = tp->tipColor;
                        PointColor     = tp->pointColor;
                        SelectionColor = tp->selectColor;
                        CharacterLimit = tp->CharacterLimit;
                        ReadOnly       = tp->ReadyOnly;
                        contentType    = tp->contentType;
                        lineType       = tp->lineType;
                        m_TipString    = mod.buffer.GetData(tp->tipString) as string;
                        m_InputString  = mod.buffer.GetData(tp->inputString) as string;
                    }
                    else
                    {
                        m_InputString = txt.Text;
                    }
                }
                else
                {
                    m_InputString = txt.Text;
                }
            }
            FullString.FullString = m_InputString;
            InputEvent            = txt.RegEvent <InputBoxEvent>();
            InputEvent.Initial(null);
            InputEvent.input = this;
            Caret            = txt.GetComponentInChildren <HImage>();
        }