Summary description for TryAWordDlg.
Inheritance: System.Windows.Forms.Form, IFWDisposable, IxWindow
Exemplo n.º 1
0
        /// <summary>
        /// Handles the xWorks message for Try A Word
        /// </summary>
        /// <param name="argument">The xCore Command object.</param>
        /// <returns>false</returns>
        public bool OnTryAWord(object argument)
        {
            CheckDisposed();

            if (m_dialog == null || m_dialog.IsDisposed)
            {
                m_dialog              = new TryAWordDlg();
                m_dialog.SizeChanged += (sender, e) =>
                {
                    if (m_dialog.WindowState != FormWindowState.Minimized)
                    {
                        m_prevWindowState = m_dialog.WindowState;
                    }
                };
                m_dialog.SetDlgInfo(m_mediator, m_propertyTable, CurrentWordform, this);
                var form = m_propertyTable.GetValue <FwXWindow>("window");
                m_dialog.Show(form);
                // This allows Keyman to work correctly on initial typing.
                // Marc Durdin suggested switching to a different window and back.
                // PostMessage gets into the queue after the dialog settles down, so it works.
                Win32.PostMessage(form.Handle, Win32.WinMsgs.WM_SETFOCUS, 0, 0);
                Win32.PostMessage(m_dialog.Handle, Win32.WinMsgs.WM_SETFOCUS, 0, 0);
            }
            else
            {
                if (m_dialog.WindowState == FormWindowState.Minimized)
                {
                    m_dialog.WindowState = m_prevWindowState;
                }
                else
                {
                    m_dialog.Activate();
                }
            }

            return(true);            // we handled this
        }
Exemplo n.º 2
0
		/// <summary>
		/// Handles the xWorks message for Try A Word
		/// </summary>
		/// <param name="argument">The xCore Command object.</param>
		/// <returns>false</returns>
		public bool OnTryAWord(object argument)
		{
			CheckDisposed();

			if (m_dialog == null || m_dialog.IsDisposed)
			{
				m_dialog = new TryAWordDlg();
				m_dialog.SizeChanged += (sender, e) =>
											{
												if (m_dialog.WindowState != FormWindowState.Minimized)
													m_prevWindowState = m_dialog.WindowState;
											};
				m_dialog.SetDlgInfo(m_mediator, CurrentWordform, this);
				var form = (FwXWindow) m_mediator.PropertyTable.GetValue("window");
				m_dialog.Show(form);
				// This allows Keyman to work correctly on initial typing.
				// Marc Durdin suggested switching to a different window and back.
				// PostMessage gets into the queue after the dialog settles down, so it works.
				Win32.PostMessage(form.Handle, Win32.WinMsgs.WM_SETFOCUS, 0, 0);
				Win32.PostMessage(m_dialog.Handle, Win32.WinMsgs.WM_SETFOCUS, 0, 0);
			}
			else
			{
				if (m_dialog.WindowState == FormWindowState.Minimized)
					m_dialog.WindowState = m_prevWindowState;
				else
					m_dialog.Activate();
			}

			return true; // we handled this
		}