Пример #1
0
        /// --------------------------------------------------------------------------------
        /// <summary></summary>
        /// <param name="m">message to be filtered</param>
        /// <returns>true if the message is consumed, false to pass it on.</returns>
        /// --------------------------------------------------------------------------------
        public bool PreFilterMessage(ref Message m)
        {
            CheckDisposed();

            switch ((Win32.WinMsgs)m.Msg)
            {
            case Win32.WinMsgs.WM_NCLBUTTONDOWN:
            case Win32.WinMsgs.WM_NCLBUTTONUP:
            case Win32.WinMsgs.WM_LBUTTONDOWN:
            {
                // Make sure the popuptree hasn't been disposed of with out setting
                // the m_popupTree variable to null:
                if (m_popupTree.IsDisposed)
                {
                    return(false);                      // default case
                }
                // Handle any mouse left button activity.
                // Non-client areas include the title bar, menu bar, window borders,
                // and scroll bars. But the only one in our combo is the scroll bar.
                Control c = Control.FromHandle(m.HWnd);
                // Clicking anywhere in an FwListBox, including it's scroll bar,
                // behaves normally.
                if ((c == m_popupTree.m_treeView))
                {
                    return(false);
                }
                // Any other click is captured and causes the list box to go away.
                // Only do this if the popup tree is visible
                if (m_popupTree.Visible)
                {
                    m_popupTree.Hide();
                    return(true);
                }
                return(false);
            }

            default:
                return(false);
            }
        }
Пример #2
0
        internal void HideTree()
        {
            CheckDisposed();

            m_popupTree.Hide();
        }