Exemple #1
0
 private void m_tree_TreeLoad(object sender, EventArgs e)
 {
     if (m_pOSPopupTreeManager == null)
     {
         m_pOSPopupTreeManager              = new POSPopupTreeManager(m_tree, m_cache, List, m_cache.LangProject.DefaultAnalysisWritingSystem, false, m_mediator, (Form)m_mediator.PropertyTable.GetValue("window"));
         m_pOSPopupTreeManager.AfterSelect += new TreeViewEventHandler(m_pOSPopupTreeManager_AfterSelect);
     }
     m_pOSPopupTreeManager.LoadPopupTree(0);
 }
Exemple #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="obj">CmObject that is being displayed.</param>
        /// <param name="flid">The field identifier for the attribute we are displaying.</param>
        /// // cache, obj, flid, node, persistenceProvider, stringTbl
        public AtomicReferencePOSSlice(FdoCache cache, ICmObject obj, int flid,
                                       IPersistenceProvider persistenceProvider, Mediator mediator)
            : base(new UserControl(), cache, obj, flid)
        {
            IVwStylesheet  stylesheet = FontHeightAdjuster.StyleSheetFromMediator(mediator);
            IWritingSystem defAnalWs  = m_cache.ServiceLocator.WritingSystems.DefaultAnalysisWritingSystem;

            m_tree = new TreeCombo();
            m_tree.WritingSystemFactory = cache.WritingSystemFactory;
            m_tree.WritingSystemCode    = defAnalWs.Handle;
            m_tree.Font       = new System.Drawing.Font(defAnalWs.DefaultFontName, 10);
            m_tree.StyleSheet = stylesheet;
            if (!Application.RenderWithVisualStyles)
            {
                m_tree.HasBorder = false;
            }
            // We embed the tree combo in a layer of UserControl, so it can have a fixed width
            // while the parent window control is, as usual, docked 'fill' to work with the splitter.
            m_tree.Dock  = DockStyle.Left;
            m_tree.Width = 200;
            Control.Controls.Add(m_tree);
            if (m_pOSPopupTreeManager == null)
            {
                ICmPossibilityList list;
                int ws;
                if (obj is IReversalIndexEntry)
                {
                    var rie = obj as IReversalIndexEntry;
                    list = rie.ReversalIndex.PartsOfSpeechOA;
                    ws   = m_cache.ServiceLocator.WritingSystemManager.GetWsFromStr(rie.ReversalIndex.WritingSystem);
                }
                else
                {
                    list = m_cache.LanguageProject.PartsOfSpeechOA;
                    ws   = m_cache.ServiceLocator.WritingSystems.DefaultAnalysisWritingSystem.Handle;
                }
                m_tree.WritingSystemCode           = ws;
                m_pOSPopupTreeManager              = new POSPopupTreeManager(m_tree, m_cache, list, ws, false, mediator, (Form)mediator.PropertyTable.GetValue("window"));
                m_pOSPopupTreeManager.AfterSelect += m_pOSPopupTreeManager_AfterSelect;
            }
            try
            {
                m_handlingMessage = true;
                m_pOSPopupTreeManager.LoadPopupTree(POS == null ? 0 : POS.Hvo);
            }
            finally
            {
                m_handlingMessage = false;
            }
            Control.Height = m_tree.PreferredHeight;
            // m_tree has sensible PreferredHeight once the text is set, UserControl does not.
            // we need to set the Height after m_tree.Text has a value set to it.
        }
Exemple #3
0
 private void m_tree_TreeLoad(object sender, EventArgs e)
 {
     if (m_pOSPopupTreeManager == null)
     {
         m_pOSPopupTreeManager = new POSPopupTreeManager(m_tree,
                                                         m_cache,
                                                         List,
                                                         m_cache.ServiceLocator.WritingSystems.DefaultAnalysisWritingSystem.Handle,
                                                         false,
                                                         m_mediator,
                                                         PropTable,
                                                         PropTable.GetValue <Form>("window"));
         m_pOSPopupTreeManager.AfterSelect += m_pOSPopupTreeManager_AfterSelect;
     }
     m_pOSPopupTreeManager.LoadPopupTree(0);
 }