internal override void Initial(FakeStruct mod)
        {
            var txt = TextCom = Context as HText;

            textColor = txt.m_color;
            unsafe
            {
                var ex = mod.buffer.GetData(((TransfromData *)mod.ip)->ex) as FakeStruct;
                if (ex != null)
                {
                    TextInputData *tp = (TextInputData *)ex.ip;
                    textColor      = tp->inputColor;
                    m_tipColor     = tp->tipColor;
                    PointColor     = tp->pointColor;
                    SelectionColor = tp->selectColor;
                    m_TipString    = mod.buffer.GetData(tp->tipString) as string;
                    var str = mod.buffer.GetData(tp->inputString) as string;
                    str             = ValidateString(str);
                    Text.FullString = str;
                }
                else
                {
                    string str = txt.Text;
                    str             = ValidateString(str);
                    Text.FullString = str;
                }
            }
            AutoColor = false;
            GetPreferredHeight();
        }
    public unsafe override object ToBufferData(DataBuffer data)
    {
        FakeStruct     fake = new FakeStruct(data, TextInputData.ElementSize);
        TextInputData *sp   = (TextInputData *)fake.ip;

        sp->inputColor  = inputColor;
        sp->tipColor    = tipColor;
        sp->pointColor  = pointColor;
        sp->selectColor = selectColor;
        sp->inputString = data.AddData(InputString);
        sp->tipString   = data.AddData(TipString);
        return(fake);
    }
Example #3
0
    public unsafe override void LoadFromBuffer(FakeStruct fake, Initializer initializer)
    {
        TextInputData *sp = (TextInputData *)fake.ip;

        inputColor     = sp->inputColor;
        tipColor       = sp->tipColor;
        pointColor     = sp->pointColor;
        selectColor    = sp->selectColor;
        InputString    = fake.buffer.GetData(sp->inputString) as string;
        TipString      = fake.buffer.GetData(sp->tipString) as string;
        CharacterLimit = sp->CharacterLimit;
        ReadyOnly      = sp->ReadyOnly;
        contentType    = sp->contentType;
        lineType       = sp->lineType;
    }
Example #4
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();
        }
Example #5
0
    public unsafe override object ToBufferData(DataBuffer data)
    {
        FakeStruct     fake = new FakeStruct(data, TextInputData.ElementSize);
        TextInputData *sp   = (TextInputData *)fake.ip;

        sp->inputColor     = inputColor;
        sp->tipColor       = tipColor;
        sp->pointColor     = pointColor;
        sp->selectColor    = selectColor;
        sp->inputString    = data.AddData(InputString);
        sp->tipString      = data.AddData(TipString);
        sp->CharacterLimit = CharacterLimit;
        sp->ReadyOnly      = ReadyOnly;
        sp->contentType    = contentType;
        sp->lineType       = lineType;
        return(fake);
    }
Example #6
0
    public unsafe override void ToBufferData(DataBuffer db, UITransfromData *data)
    {
        FakeStruct     fake = new FakeStruct(db, TextInputData.ElementSize);
        TextInputData *sp   = (TextInputData *)fake.ip;

        sp->inputColor     = inputColor;
        sp->tipColor       = tipColor;
        sp->pointColor     = pointColor;
        sp->selectColor    = selectColor;
        sp->inputString    = db.AddData(InputString);
        sp->tipString      = db.AddData(TipString);
        sp->CharacterLimit = CharacterLimit;
        sp->ReadyOnly      = ReadyOnly;
        sp->contentType    = contentType;
        sp->lineType       = lineType;
        data->eve          = db.AddData(fake);
    }
 internal override void Initial(FakeStruct mod)
 {
     TextCom   = Context as HText;
     AutoColor = false;
     unsafe
     {
         var ex = mod.buffer.GetData(((TransfromData *)mod.ip)->ex) as FakeStruct;
         if (ex != null)
         {
             TextInputData *tp = (TextInputData *)ex.ip;
             PointColor     = tp->pointColor;
             SelectionColor = tp->selectColor;
         }
     }
     Text.FullString = TextCom.Text;
     GetPreferredHeight();
 }
Example #8
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>();
        }
Example #9
0
    public unsafe override void ToBufferData(DataBuffer db, huqiang.Core.UIData.UIElementData *data)
    {
        FakeStruct     fake = new FakeStruct(db, TextInputData.ElementSize);
        TextInputData *sp   = (TextInputData *)fake.ip;

        sp->inputColor     = inputColor;
        sp->tipColor       = tipColor;
        sp->pointColor     = pointColor;
        sp->selectColor    = selectColor;
        sp->inputString    = db.AddData(InputString);
        sp->tipString      = db.AddData(TipString);
        sp->CharacterLimit = CharacterLimit;
        sp->ReadyOnly      = ReadyOnly;
        sp->contentType    = contentType;
        sp->lineType       = lineType;
        data->eve          = db.AddData(fake);
        int type  = db.AddData("TextInputHelper");
        int index = db.AddData(fake);

        data->eve = type << 16 | index;
    }
Example #10
0
        protected override void Initial()
        {
            var txt = TextCom = Context.GetComponent <TextElement>();

            InputString = txt.text;
            textColor   = txt.data.color;
            var fake = txt.model.GetExtand() as FakeStruct;

            if (fake != null)
            {
                unsafe
                {
                    TextInputData *tp = (TextInputData *)fake.ip;
                    textColor      = tp->inputColor;
                    m_tipColor     = tp->tipColor;
                    InputString    = fake.buffer.GetData(tp->inputString) as string;
                    TipString      = fake.buffer.GetData(tp->tipString) as string;
                    PointColor     = tp->pointColor;
                    SelectionColor = tp->selectColor;
                }
            }
            AutoColor = false;
        }