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(); }
public bool RequestTextEntry(ITextEntryTarget target) { if (activeTextTarget != null) { activeTextTarget.OnEndTextEntry(); activeTextTarget = null; } if (target.OnBeginTextEntry()) { activeTextTarget = target; return(true); } return(false); }
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; }
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); }; } } }