Esempio n. 1
0
 public override void Disconnect()
 {
     if (active_entry != null)
     {
         Parent.Context.ReleaseTextEntry(active_entry);   // probably should not have to call this...
         active_entry = null;
     }
     base.Disconnect();
 }
Esempio n. 2
0
 public bool RequestTextEntry(ITextEntryTarget target)
 {
     if (activeTextTarget != null)
     {
         activeTextTarget.OnEndTextEntry();
         activeTextTarget = null;
     }
     if (target.OnBeginTextEntry())
     {
         activeTextTarget = target;
         return(true);
     }
     return(false);
 }
Esempio n. 3
0
 public void ReleaseTextEntry(ITextEntryTarget target)
 {
     if (target != null)
     {
         if (activeTextTarget != target && activeTextTarget == null)
         {
             throw new Exception("Cockpit.ReleaseTextEntry: text entry was not captured!");
         }
         if (activeTextTarget != target)
         {
             throw new Exception("Cockpit.ReleaseTextEntry: different ITextEntryTarget arleady active!");
         }
     }
     activeTextTarget.OnEndTextEntry();
     activeTextTarget = null;
     return;
 }
Esempio n. 4
0
        void begin_editing()
        {
            // start capturing input
            if (OverrideDefaultInputHandling == false)
            {
                HUDTextEntryTarget entry = new HUDTextEntryTarget(this);
                if (Parent.Context.RequestTextEntry(entry))
                {
                    active_entry = entry;
                    FUtil.SafeSendEvent(OnBeginTextEditing, this);
                    bgMesh.SetMaterial(activeBackgroundMaterial);
                    start_active_time = FPlatform.RealTime();
                    cursor_position   = text.Length;

                    entry.OnTextEditingEnded += (s, e) => {
                        bgMesh.SetMaterial(backgroundMaterial);
                        active_entry = null;
                        FUtil.SafeSendEvent(OnEndTextEditing, this);
                    };
                }
            }
        }