예제 #1
0
파일: Hint.cs 프로젝트: ugurak/nemerle
        private void Show(IntPtr owner)
        {
            if (InputManager.Current.IsInMenuMode)
            {
                return;
            }

            if (_hintWindow != null)
            {
                throw new NotSupportedException("Hint already shown");
            }

            // subclass
            _hintSource           = new HintSource();
            _hintSource.Activate += Close;
            _hintSource.SubClass(owner);

            // create hint window
            var ht = HintRoot.Create(PlacementRect, _hintSource);

            _hintWindow = new HintWindow(this, ht)
            {
                Text = _text
            };
            _hintSource.HintWindow = _hintWindow;
            //new WindowInteropHelper(_hintWindow) { Owner = _hintSource.Owner };
            _hintWindow.Closed   += HintWindowClosed;
            _hintWindow.MaxHeight = 1200.0;            //System.Windows.Forms.Screen.FromRectangle(PlacementRect).WorkingArea.
            _wrapWidth            = 1200.0;

            _hintWindow.WrapWidth = _wrapWidth;
            _hintWindow.Show();
        }
예제 #2
0
파일: Hint.cs 프로젝트: ugurak/nemerle
 void HintWindowClosed(object sender, EventArgs e)
 {
     _hintSource.UnSubClass();
     _hintSource = null;
     _hintWindow = null;
     if (Closed != null)
     {
         Closed(this);
     }
 }
예제 #3
0
        private void ShowSubHint(FrameworkElement el, string hintText)
        {
            var ht = HintRoot.Create(el);

            foreach (HintWindow window in OwnedWindows)
            {
                if (!window._hintRoot.Equals(ht))
                {
                    window.Close();
                    continue;
                }

                ht.Dispose();
                return;
            }

            var wnd = new HintWindow(_hint, ht)
            {
                Text = hintText, Owner = this
            };

            wnd.Show();
        }
예제 #4
0
        private void ShowSubHint(FrameworkElement el, string hintText)
        {
            var ht = HintRoot.Create(el);

            foreach (HintWindow window in OwnedWindows)
            {
                if (!window._hintRoot.Equals(ht))
                {
                    window.Close();
                    continue;
                }

                ht.Dispose();
                return;
            }

            var wnd = new HintWindow(_hint, ht) { Text = hintText, Owner = this };
            wnd.Show();
        }
예제 #5
0
파일: Hint.cs 프로젝트: vestild/nemerle
        private void Show(IntPtr owner)
        {
            if (InputManager.Current.IsInMenuMode)
                return;

            if (_hintWindow != null)
                throw new NotSupportedException("Hint already shown");

            // subclass
            _hintSource = new HintSource();
            _hintSource.Activate += Close;
            _hintSource.SubClass(owner);

            // create hint window
            var ht = HintRoot.Create(PlacementRect, _hintSource);
            _hintWindow = new HintWindow(this, ht) { Text = _text };
            _hintSource.HintWindow = _hintWindow;
            //new WindowInteropHelper(_hintWindow) { Owner = _hintSource.Owner };
            _hintWindow.Closed += HintWindowClosed;
            _hintWindow.MaxHeight = 1200.0;//System.Windows.Forms.Screen.FromRectangle(PlacementRect).WorkingArea.
            _wrapWidth = 1200.0;

            _hintWindow.WrapWidth = _wrapWidth;
            _hintWindow.Show();
        }
예제 #6
0
파일: Hint.cs 프로젝트: vestild/nemerle
 void HintWindowClosed(object sender, EventArgs e)
 {
     _hintSource.UnSubClass();
     _hintSource = null;
     _hintWindow = null;
     if (Closed != null) Closed(this);
 }