Example #1
0
		/// <summary>
		/// Constructor.
		/// </summary>
		public BaseGoDlg()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			this.helpProvider = new System.Windows.Forms.HelpProvider();
			if (FwApp.App != null)
				this.helpProvider.HelpNamespace = FwApp.App.HelpFile;
			this.helpProvider.SetHelpNavigator(this, System.Windows.Forms.HelpNavigator.Topic);
			this.helpProvider.SetShowHelp(this, true);

			m_vernHvos = new Set<int>();
			m_analHvos = new Set<int>();

			// NB: Don't set this here, because the fake writing system factory
			// will cause an assert down in VwPropertyStore.
			//m_tbForm.Text = "";
			m_tbForm.TextChanged += new EventHandler(m_tbForm_TextChanged);

			// Reset Tab indices of direct child controls of the form.
			ResetTabOrder();

			// If called indirectly from Data Notebook (C++ code), disable the Help since it
			// depends on FwApp.App and FwApp.App.HelpFile.
			// (At one point we also hid the OK button, but it is useful in case the user
			// types something which does have matches and wants to see it.)
			if (FwApp.App == null)
			{
				btnHelp.Enabled = false;
			}

			m_tbForm.KeyDown += new KeyEventHandler(m_tbForm_KeyDown);
			// Now position the searching animation just above the list
			m_searchAnimtation = new SIL.FieldWorks.Resources.SearchingAnimation();
			m_searchAnimtation.Top = matchingEntries.Top - m_searchAnimtation.Height - 5;
			m_searchAnimtation.Left = matchingEntries.Right - m_searchAnimtation.Width - 10;

			// The standard localization code doesn't work, so set these explicitly.
			btnClose.Text = SIL.FieldWorks.LexText.Controls.LexTextControls.ksCancel;
			btnHelp.Text = SIL.FieldWorks.LexText.Controls.LexTextControls.ks_Help_;
			btnInsert.Text = SIL.FieldWorks.LexText.Controls.LexTextControls.ks_Create_;
			label1.Text = SIL.FieldWorks.LexText.Controls.LexTextControls.ks_WritingSystem_;
			label2.Text = SIL.FieldWorks.LexText.Controls.LexTextControls.ksLexicalEntries;

			// remove our initial matching items control, so our clients can add their own.
			this.RemoveInitialMatchingItemsControl();
		}
Example #2
0
		/// <summary>
		/// Constructor.
		/// </summary>
		public InsertEntryDlg()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			// Figure out where to locate the dlg.
			object obj = SettingsKey.GetValue("InsertX");
			if (obj != null)
			{
				int x = (int)obj;
				int y = (int)SettingsKey.GetValue("InsertY");
				int width = (int)SettingsKey.GetValue("InsertWidth", Width);
				int height = (int)SettingsKey.GetValue("InsertHeight", Height);
				Rectangle rect = new Rectangle(x, y, width, height);
				ScreenUtils.EnsureVisibleRect(ref rect);
				DesktopBounds = rect;
				StartPosition = FormStartPosition.Manual;
			}

			helpProvider = new System.Windows.Forms.HelpProvider();
			if (FwApp.App != null)
			{
				helpProvider.HelpNamespace = FwApp.App.HelpFile;
				helpProvider.SetHelpKeyword(this, FwApp.App.GetHelpString(s_helpTopic, 0));
			}
			else
			{
				btnHelp.Enabled = false;
			}
			helpProvider.SetHelpNavigator(this, System.Windows.Forms.HelpNavigator.Topic);

			m_searchAnimtation = new SIL.FieldWorks.Resources.SearchingAnimation();
			// We will add it to controls when we want to show it.
			matchingEntries.SearchingChanged += new EventHandler(matchingEntries_SearchingChanged);

			AdjustWidthForLinkLabelGroupBox();
		}