C# (CSharp) SIL.FieldWorks.FdoUi TypeAheadSupportVc - 2 examples found. These are the top rated real world C# (CSharp) examples of SIL.FieldWorks.FdoUi.TypeAheadSupportVc extracted from open source projects. You can rate examples to help us improve the quality of examples.
Related
Related in langs
TypeAheadSupportVc is a view constructor used to display a (typically real) object reference property in a mode that allows the user to type part of an identifying string in order to make a selection. Typical call code: // Member variable of main VC, typically. TypeAheadSupportVc m_tasvc; // (In constructor of main VC, or similar place.) m_tasvc = new TypeAheadSupportVc((int)LexSense.LexSenseTags.kflidSemanticDomain, m_cache); m_tasvc.InitXXX(...); // Optional, choose any appropriate method if further Init required. // (As part of Display method or similar, where type-ahead property is wanted. m_tasvc.Insert(IVwEnv vwenv, int hvo); // atomic m_tasbc.InsertSeq(IVwEnv vwenv, int hvo); // sequence (or collection) -- not yet fully implemented? At least not tested. To make things work properly, the client must also override OnKeyPress and (after checking that no update is in progress) arrange to call m_tasvc.OnKeyPress(EditingHelper, e, ModifierKeys, m_vwGraphics). If this returns true, the normal call to base.OnKeyPress should be omitted. protected override void OnKeyPress(KeyPressEventArgs e) { if (DataUpdateMonitor.IsUpdateInProgress(DataAccess)) return; //throw this event away using (new HoldGraphics(this)) { if (m_vc.TasVc.OnKeyPress(EditingHelper, e, ModifierKeys, m_vwGraphics)) return; } base.OnKeyPress(e); } The client should also override SelectionChanged and (among any other behavior) calle m_tasvc.SelectionChanged(rootb, sel). This is used to expand any selection that covers more than one item in the sequence to cover the whole of the items partly selected. Finally, the client should override OnLoseFocus and (among any other behavior) call m_tasvc.LoseFocus(rootb); Similarly OnGotFocus(rootb).