Example #1
0
    static void OpenWindow()
    {
        HintWindow window = (HintWindow)GetWindow(typeof(HintWindow));

        window.minSize = new Vector2(250, 200);
        window.Show();
    }
Example #2
0
 protected override void Dispose(bool disposing)
 {
     if (hintWindow != null)
     {
         hintWindow.DestroyHandle();
     }
     hintWindow = null;
     base.Dispose(disposing);
 }
Example #3
0
        private void ExecuteOpenHelpCommand(Window window)
        {
            if (window == null)
            {
                return;
            }

            var hint = new HintWindow
            {
                Owner = window
            };

            hint.ShowDialog();
        }
Example #4
0
        public void Show(Rectangle elementRect)
        {
            if (ownerForm == null)
            {
                return;
            }

            if (hintWindow == null)
            {
                hintWindow = new HintWindow(IntPtr.Zero, this);
            }

            Measure(ref elementRect);
            hintWindow.Show(elementRect.X, elementRect.Y, elementRect.Width, elementRect.Height);
            if (visible)
            {
                hintWindow.Redraw();
            }
            visible = true;
        }
Example #5
0
        private void ExecuteOpenHintWindow(object arg)
        {
            if (!(arg is Button button))
            {
                return;
            }

            MainWindow mainWindow = GetMainWindow(button);

            if (mainWindow == null)
            {
                return;
            }

            var hint = new HintWindow
            {
                Owner = mainWindow
            };

            hint.ShowDialog();
        }
Example #6
0
        /// <summary>
        /// Show hint with given relation to given position
        /// </summary>
        /// <param name="pos">Position to show in screen coordinates</param>
        /// <param name="includeCursor">Shift hint down to not intersect with cursor</param>
        public void Show(Point pos, bool includeCursor = false)
        {
            if (ownerForm == null)
            {
                return;
            }

            if (hintWindow == null)
            {
                hintWindow = new HintWindow(IntPtr.Zero, this);
            }

            Size size;

            Measure(ref pos, out size, includeCursor);
            hintWindow.Show(pos.X, pos.Y, size.Width, size.Height);
            if (visible)
            {
                hintWindow.Redraw();
            }
            visible = true;
        }