From b328a490bba800ee26f8cbc321e3ceeb3cda729d Mon Sep 17 00:00:00 2001 From: Remington Wells Date: Tue, 10 Mar 2026 14:37:05 -0600 Subject: [PATCH 01/28] Remington's UI|Initial Commit --- SampleData/EdoloSample/EdoloSample.sprj | 41 ++- .../People/Awi Heole/Awi Heole.person | 5 +- .../Sessions/ETR009/ETR009.session | 32 +- .../Sessions/ETR009/ETR009_Careful.mp3.meta | 26 +- .../Sessions/ETR009/ETR009_Tiny.mp4.meta | 26 +- src/SayMore/Model/Project.cs | 2 +- .../UI/ElementListScreen/ElementListScreen.cs | 34 +- .../SessionsListScreen.Designer.cs | 4 +- .../ElementListScreen/SessionsListScreen.cs | 3 + .../UI/LowLevelControls/ListPanel.Designer.cs | 302 ++++++++++-------- src/SayMore/UI/LowLevelControls/ListPanel.cs | 78 +++++ .../UI/LowLevelControls/ListPanel.resx | 19 +- 12 files changed, 363 insertions(+), 209 deletions(-) diff --git a/SampleData/EdoloSample/EdoloSample.sprj b/SampleData/EdoloSample/EdoloSample.sprj index 6d7bb66cb..5ab7cece7 100644 --- a/SampleData/EdoloSample/EdoloSample.sprj +++ b/SampleData/EdoloSample/EdoloSample.sprj @@ -1,23 +1,22 @@ - + - - - - - Edolo Sample - - The Etoro, or Edolo, are a tribe and ethnic group of the Southern Highlands Province of Papua New Guinea. Their territory comprises the southern slopes of Mt. Sisa, along the southern edge of the central mountain range of New Guinea, near the Papuan Plateau. - etr: Edolo - - Southern Highlands Province - Papua New Guinea - Oceania - - None - - - - - - + + + + + Edolo Sample + + The Etoro, or Edolo, are a tribe and ethnic group of the Southern Highlands Province of Papua New Guinea. Their territory comprises the southern slopes of Mt. Sisa, along the southern edge of the central mountain range of New Guinea, near the Papuan Plateau. + etr: Edolo + eng: English + + Southern Highlands Province + Papua New Guinea + Oceania + + None + + + + \ No newline at end of file diff --git a/SampleData/EdoloSample/People/Awi Heole/Awi Heole.person b/SampleData/EdoloSample/People/Awi Heole/Awi Heole.person index d01dd24ef..628df0ee2 100644 --- a/SampleData/EdoloSample/People/Awi Heole/Awi Heole.person +++ b/SampleData/EdoloSample/People/Awi Heole/Awi Heole.person @@ -1,4 +1,4 @@ - + etr:Edolo Huya @@ -10,7 +10,8 @@ Male Grade 2 Subsistence Farmer + false - Huya + Huya \ No newline at end of file diff --git a/SampleData/EdoloSample/Sessions/ETR009/ETR009.session b/SampleData/EdoloSample/Sessions/ETR009/ETR009.session index c83b66f92..bf937c34d 100644 --- a/SampleData/EdoloSample/Sessions/ETR009/ETR009.session +++ b/SampleData/EdoloSample/Sessions/ETR009/ETR009.session @@ -1,7 +1,7 @@ - - + + The story behind how we catch fish with poison bark - Awi Heole; Ilawi Amosa + Awi Heole; Hatton; Ilawi Amosa narrative Open Huya @@ -10,4 +10,30 @@ 2010-06-06 hello Incoming + + + Awi Heole + participant + 0001-01-01 + + + + Ilawi Amosa + participant + 0001-01-01 + + + + Hatton + recorder + 2010-09-10 + + + + Awi Heole + speaker + 2010-09-10 + + + \ No newline at end of file diff --git a/SampleData/EdoloSample/Sessions/ETR009/ETR009_Careful.mp3.meta b/SampleData/EdoloSample/Sessions/ETR009/ETR009_Careful.mp3.meta index 552887242..59816861e 100644 --- a/SampleData/EdoloSample/Sessions/ETR009/ETR009_Careful.mp3.meta +++ b/SampleData/EdoloSample/Sessions/ETR009/ETR009_Careful.mp3.meta @@ -1,22 +1,22 @@ - + Shure X2u A/D, into GoldWave Sure SM10A Headset mono This was downgraded to low bit-rate mp3 to keep the SayMore installer from getting huge. - - Hatton - recorder - 2010-09-10 - - - - Awi Heole - speaker - 2010-09-10 - - + + Hatton + recorder + 2010-09-10 + + + + Awi Heole + speaker + 2010-09-10 + + 00:00:25 44100 Hz diff --git a/SampleData/EdoloSample/Sessions/ETR009/ETR009_Tiny.mp4.meta b/SampleData/EdoloSample/Sessions/ETR009/ETR009_Tiny.mp4.meta index eea6611ea..136a19d4d 100644 --- a/SampleData/EdoloSample/Sessions/ETR009/ETR009_Tiny.mp4.meta +++ b/SampleData/EdoloSample/Sessions/ETR009/ETR009_Tiny.mp4.meta @@ -1,22 +1,24 @@ - + Zoom Q3 Built-in - 30 This was downgraded to small picture and low bit-rate mp3 to keep the SayMore installer from getting huge. - - Hatton - recorder - 2010-09-10 - - + + Hatton + recorder + 2010-09-10 + + - 00:00:10 - stereo - 48000 Hz - 96 kbps 218 kbps 176 x 144 30 frames/second + + 30 + 00:00:10 + stereo + 48000 Hz + 96 kbps + \ No newline at end of file diff --git a/src/SayMore/Model/Project.cs b/src/SayMore/Model/Project.cs index 5d71ed929..7d0204ee1 100644 --- a/src/SayMore/Model/Project.cs +++ b/src/SayMore/Model/Project.cs @@ -660,7 +660,7 @@ public void DisplayInitialArchiveSummary( throw new OperationCanceledException(); var element = (kvp.Key.StartsWith("\n") || kvp.Key.Length > 0 ? LocalizationManager.GetString("DialogBoxes.ArchivingDlg.ContributorElementName", "Contributor") : - LocalizationManager.GetString("DialogBoxes.ArchivingDlg.SessionElementName", "Sessions")); + LocalizationManager.GetString("DialogBoxes.ArchivingDlg.SessionElementName", "Sessionsg")); model.DisplayMessage(string.Format(fmt, element, (kvp.Key.StartsWith("\n") || kvp.Key.Length > 0 ? kvp.Key.Substring(1) : Title)), ArchivingDlgViewModel.MessageType.Progress); diff --git a/src/SayMore/UI/ElementListScreen/ElementListScreen.cs b/src/SayMore/UI/ElementListScreen/ElementListScreen.cs index 363580ab9..af05836fa 100644 --- a/src/SayMore/UI/ElementListScreen/ElementListScreen.cs +++ b/src/SayMore/UI/ElementListScreen/ElementListScreen.cs @@ -45,6 +45,17 @@ public partial class ElementListScreen : UserControl where T : ProjectElement protected Dictionary _tabControls = new Dictionary(); + /// ------------------------------------------------------------------------------------ + /// + /// Handle a search request from the list panel by reloading the element list + /// filtered by the search text coming from the panel. + /// + private void HandleSearchRequested(object sender, EventArgs e) + { + // Forward the current search text to the overload of LoadElementList that accepts a searchParam. + LoadElementList(null, _elementsListPanel?.SearchText); + } + /// ------------------------------------------------------------------------------------ public ToolStripMenuItem MainMenuItem { get; } @@ -80,6 +91,7 @@ protected void Initialize(Control tabControlHostControl, _elementsListPanel = elementsListPanel; _elementsListPanel.NewButtonClicked += HandleAddingNewElement; _elementsListPanel.DeleteButtonClicked += HandleDeletingSelectedElements; + _elementsListPanel.SearchRequested += HandleSearchRequested; _elementsListPanel.ListControl = _elementsGrid; _componentFilesControl = componentGrid; @@ -214,15 +226,28 @@ private bool HandleFilesAddedToComponentGrid(string[] files) /// ------------------------------------------------------------------------------------ protected virtual void LoadElementList() { - LoadElementList(null); + // Backward-compatible parameterless call - forwards to the overload that + // now accepts an optional search parameter. + LoadElementList(null, null); } /// ------------------------------------------------------------------------------------ - protected virtual void LoadElementList(object itemToSelectAfterLoad) + protected virtual void LoadElementList(object itemToSelectAfterLoad, string searchParam = null) { - _elementsGrid.Items = _model.Elements.OrderBy(x => x.Id); + // Start with all elements, ordered by id + IEnumerable items = _model.Elements.OrderBy(x => x.Id); + + // If a search parameter was provided, restrict to elements whose Id + // contains the search text (case-insensitive). + if (!string.IsNullOrWhiteSpace(searchParam)) + { + items = items.Where(x => !string.IsNullOrEmpty(x.Id) && + x.Id.IndexOf(searchParam, StringComparison.OrdinalIgnoreCase) >= 0); + } + + _elementsGrid.Items = items; - if (_model.Elements.Any()) + if (items.Any()) { switch (itemToSelectAfterLoad) { @@ -560,6 +585,7 @@ protected override void Dispose(bool disposing) _elementsGrid.SelectedElementChanged -= HandleSelectedElementChanged; _elementsListPanel.NewButtonClicked -= HandleAddingNewElement; _elementsListPanel.DeleteButtonClicked -= HandleDeletingSelectedElements; + _elementsListPanel.SearchRequested -= HandleSearchRequested; var frm = FindForm(); if (frm != null) diff --git a/src/SayMore/UI/ElementListScreen/SessionsListScreen.Designer.cs b/src/SayMore/UI/ElementListScreen/SessionsListScreen.Designer.cs index b45438eaa..50ed6e465 100644 --- a/src/SayMore/UI/ElementListScreen/SessionsListScreen.Designer.cs +++ b/src/SayMore/UI/ElementListScreen/SessionsListScreen.Designer.cs @@ -112,7 +112,7 @@ private void InitializeComponent() this._sessionsListPanel.ShowColumnChooserButton = true; this._sessionsListPanel.Size = new System.Drawing.Size(182, 350); this._sessionsListPanel.TabIndex = 0; - this._sessionsListPanel.Text = "Sessions"; + this._sessionsListPanel.Text = "Sessionsbc"; // // _componentsSplitter // @@ -209,7 +209,7 @@ private void InitializeComponent() public string NameForUsageReporting { - get { return "Sessions"; } + get { return "Sessionsc"; } } } } diff --git a/src/SayMore/UI/ElementListScreen/SessionsListScreen.cs b/src/SayMore/UI/ElementListScreen/SessionsListScreen.cs index d59a897f7..53f667df2 100644 --- a/src/SayMore/UI/ElementListScreen/SessionsListScreen.cs +++ b/src/SayMore/UI/ElementListScreen/SessionsListScreen.cs @@ -31,6 +31,9 @@ public SessionsListScreen(ElementListViewModel presentationModel, _newSessionsFromFileDlgViewModel = newSessionsFromFileDlgViewModel; InitializeComponent(); + // Show the search box for sessions list only + _sessionsListPanel.ShowSearchBar = true; + if (DesignMode) return; diff --git a/src/SayMore/UI/LowLevelControls/ListPanel.Designer.cs b/src/SayMore/UI/LowLevelControls/ListPanel.Designer.cs index f052ab11b..ee8fced72 100644 --- a/src/SayMore/UI/LowLevelControls/ListPanel.Designer.cs +++ b/src/SayMore/UI/LowLevelControls/ListPanel.Designer.cs @@ -18,147 +18,166 @@ partial class ListPanel /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ListPanel)); - this.locExtender = new L10NSharp.UI.L10NSharpExtender(this.components); - this._outerPanel = new SIL.Windows.Forms.Widgets.EnhancedPanel(); - this._buttonsFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel(); - this._buttonNew = new System.Windows.Forms.Button(); - this._headerLabel = new SIL.Windows.Forms.Widgets.HeaderLabel(); - this._buttonColChooser = new SayMore.UI.LowLevelControls.ColumnChooserButton(); - ((System.ComponentModel.ISupportInitialize)(this.locExtender)).BeginInit(); - this._outerPanel.SuspendLayout(); - this._buttonsFlowLayoutPanel.SuspendLayout(); - this._headerLabel.SuspendLayout(); - this.SuspendLayout(); - // - // locExtender - // - this.locExtender.LocalizationManagerId = "SayMore"; - this.locExtender.PrefixForNewItems = null; - // - // _outerPanel - // - this._outerPanel.BackColor = System.Drawing.SystemColors.Window; - this._outerPanel.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179))))); - this._outerPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this._outerPanel.ClipTextForChildControls = true; - this._outerPanel.ControlReceivingFocusOnMnemonic = null; - this._outerPanel.Controls.Add(this._buttonsFlowLayoutPanel); - this._outerPanel.Controls.Add(this._headerLabel); - this._outerPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this._outerPanel.DoubleBuffered = true; - this._outerPanel.DrawOnlyBottomBorder = false; - this._outerPanel.DrawOnlyTopBorder = false; - this._outerPanel.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World); - this._outerPanel.ForeColor = System.Drawing.SystemColors.ControlText; - this.locExtender.SetLocalizableToolTip(this._outerPanel, null); - this.locExtender.SetLocalizationComment(this._outerPanel, null); - this.locExtender.SetLocalizationPriority(this._outerPanel, L10NSharp.LocalizationPriority.NotLocalizable); - this.locExtender.SetLocalizingId(this._outerPanel, "UI.ListPanel._outerPanel"); - this._outerPanel.Location = new System.Drawing.Point(0, 0); - this._outerPanel.MnemonicGeneratesClick = false; - this._outerPanel.Name = "_outerPanel"; - this._outerPanel.PaintExplorerBarBackground = false; - this._outerPanel.Size = new System.Drawing.Size(170, 277); - this._outerPanel.TabIndex = 1; - // - // _buttonsFlowLayoutPanel - // - this._buttonsFlowLayoutPanel.AutoSize = true; - this._buttonsFlowLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this._buttonsFlowLayoutPanel.Controls.Add(this._buttonNew); - this._buttonsFlowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Bottom; - this._buttonsFlowLayoutPanel.Location = new System.Drawing.Point(0, 239); - this._buttonsFlowLayoutPanel.Name = "_buttonsFlowLayoutPanel"; - this._buttonsFlowLayoutPanel.Padding = new System.Windows.Forms.Padding(2); - this._buttonsFlowLayoutPanel.Size = new System.Drawing.Size(168, 36); - this._buttonsFlowLayoutPanel.TabIndex = 3; - this._buttonsFlowLayoutPanel.TabStop = true; - this._buttonsFlowLayoutPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.HandleButtonPanelPaint); - // - // _buttonNew - // - this._buttonNew.AutoSize = true; - this._buttonNew.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.locExtender.SetLocalizableToolTip(this._buttonNew, null); - this.locExtender.SetLocalizationComment(this._buttonNew, "Button for adding new sessions and people"); - this.locExtender.SetLocalizingId(this._buttonNew, "CommonToMultipleViews.ElementList.NewButtonText"); - this._buttonNew.Location = new System.Drawing.Point(5, 5); - this._buttonNew.MinimumSize = new System.Drawing.Size(75, 26); - this._buttonNew.Name = "_buttonNew"; - this._buttonNew.Size = new System.Drawing.Size(75, 26); - this._buttonNew.TabIndex = 0; - this._buttonNew.Text = "&New"; - this._buttonNew.UseVisualStyleBackColor = true; - this._buttonNew.Click += new System.EventHandler(this.HandleNewButtonClick); - // - // _headerLabel - // - this._headerLabel.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179))))); - this._headerLabel.ClipTextForChildControls = true; - this._headerLabel.ControlReceivingFocusOnMnemonic = null; - this._headerLabel.Controls.Add(this._buttonColChooser); - this._headerLabel.Dock = System.Windows.Forms.DockStyle.Top; - this._headerLabel.DoubleBuffered = true; - this._headerLabel.DrawOnlyBottomBorder = false; - this._headerLabel.DrawOnlyTopBorder = false; - this._headerLabel.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World); - this._headerLabel.ForeColor = System.Drawing.SystemColors.ControlText; - this.locExtender.SetLocalizableToolTip(this._headerLabel, null); - this.locExtender.SetLocalizationComment(this._headerLabel, "Do not translate - Localized in subclass"); - this.locExtender.SetLocalizationPriority(this._headerLabel, L10NSharp.LocalizationPriority.NotLocalizable); - this.locExtender.SetLocalizingId(this._headerLabel, "UI.ListPanel._headerLabel"); - this._headerLabel.Location = new System.Drawing.Point(0, 0); - this._headerLabel.MinimumSize = new System.Drawing.Size(165, 2); - this._headerLabel.MnemonicGeneratesClick = false; - this._headerLabel.Name = "_headerLabel"; - this._headerLabel.PaintExplorerBarBackground = false; - this._headerLabel.ShowWindowBackgroundOnTopAndRightEdge = true; - this._headerLabel.Size = new System.Drawing.Size(168, 23); - this._headerLabel.TabIndex = 0; - this._headerLabel.Text = "Change this text"; - this._headerLabel.Paint += new System.Windows.Forms.PaintEventHandler(this.HandleHeaderPanelPaint); - // - // _buttonColChooser - // - this._buttonColChooser.Anchor = System.Windows.Forms.AnchorStyles.Right; - this._buttonColChooser.BackColor = System.Drawing.Color.Transparent; - this._buttonColChooser.CanBeChecked = false; - this._buttonColChooser.Checked = false; - this._buttonColChooser.DrawEmpty = false; - this._buttonColChooser.DrawLeftArrowButton = false; - this._buttonColChooser.DrawRightArrowButton = false; - this._buttonColChooser.Font = new System.Drawing.Font("Marlett", 9F); - this._buttonColChooser.Image = ((System.Drawing.Image)(resources.GetObject("_buttonColChooser.Image"))); - this.locExtender.SetLocalizableToolTip(this._buttonColChooser, "Choose Columns"); - this.locExtender.SetLocalizationComment(this._buttonColChooser, null); - this.locExtender.SetLocalizingId(this._buttonColChooser, "CommonToMultipleViews.ElementList.ColumnChooserButton"); - this._buttonColChooser.Location = new System.Drawing.Point(149, 2); - this._buttonColChooser.Name = "_buttonColChooser"; - this._buttonColChooser.Size = new System.Drawing.Size(20, 20); - this._buttonColChooser.TabIndex = 0; - // - // ListPanel - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this._outerPanel); - this.DoubleBuffered = true; - this.locExtender.SetLocalizableToolTip(this, null); - this.locExtender.SetLocalizationComment(this, null); - this.locExtender.SetLocalizationPriority(this, L10NSharp.LocalizationPriority.NotLocalizable); - this.locExtender.SetLocalizingId(this, "ListPanel.ListPanel"); - this.MinimumSize = new System.Drawing.Size(125, 0); - this.Name = "ListPanel"; - this.Size = new System.Drawing.Size(170, 277); - ((System.ComponentModel.ISupportInitialize)(this.locExtender)).EndInit(); - this._outerPanel.ResumeLayout(false); - this._outerPanel.PerformLayout(); - this._buttonsFlowLayoutPanel.ResumeLayout(false); - this._buttonsFlowLayoutPanel.PerformLayout(); - this._headerLabel.ResumeLayout(false); - this.ResumeLayout(false); + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ListPanel)); + this.locExtender = new L10NSharp.UI.L10NSharpExtender(this.components); + this._outerPanel = new SIL.Windows.Forms.Widgets.EnhancedPanel(); + this._buttonsFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel(); + this._buttonNew = new System.Windows.Forms.Button(); + this._headerLabel = new SIL.Windows.Forms.Widgets.HeaderLabel(); + this._buttonColChooser = new SayMore.UI.LowLevelControls.ColumnChooserButton(); + this._searchTextBox = new System.Windows.Forms.TextBox(); + ((System.ComponentModel.ISupportInitialize)(this.locExtender)).BeginInit(); + this._outerPanel.SuspendLayout(); + this._buttonsFlowLayoutPanel.SuspendLayout(); + this._headerLabel.SuspendLayout(); + this.SuspendLayout(); + // + // locExtender + // + this.locExtender.LocalizationManagerId = "SayMore"; + this.locExtender.PrefixForNewItems = null; + // + // _outerPanel + // + this._outerPanel.BackColor = System.Drawing.SystemColors.Window; + this._outerPanel.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179))))); + this._outerPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this._outerPanel.ClipTextForChildControls = true; + this._outerPanel.ControlReceivingFocusOnMnemonic = null; + this._outerPanel.Controls.Add(this._buttonsFlowLayoutPanel); + this._outerPanel.Controls.Add(this._headerLabel); + this._outerPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this._outerPanel.DoubleBuffered = true; + this._outerPanel.DrawOnlyBottomBorder = false; + this._outerPanel.DrawOnlyTopBorder = false; + this._outerPanel.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World); + this._outerPanel.ForeColor = System.Drawing.SystemColors.ControlText; + this.locExtender.SetLocalizableToolTip(this._outerPanel, null); + this.locExtender.SetLocalizationComment(this._outerPanel, null); + this.locExtender.SetLocalizationPriority(this._outerPanel, L10NSharp.LocalizationPriority.NotLocalizable); + this.locExtender.SetLocalizingId(this._outerPanel, "UI.ListPanel._outerPanel"); + this._outerPanel.Location = new System.Drawing.Point(0, 0); + this._outerPanel.MnemonicGeneratesClick = false; + this._outerPanel.Name = "_outerPanel"; + this._outerPanel.PaintExplorerBarBackground = false; + this._outerPanel.Size = new System.Drawing.Size(405, 317); + this._outerPanel.TabIndex = 1; + // + // _buttonsFlowLayoutPanel + // + this._buttonsFlowLayoutPanel.AutoSize = true; + this._buttonsFlowLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this._buttonsFlowLayoutPanel.Controls.Add(this._buttonNew); + this._buttonsFlowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Bottom; + this._buttonsFlowLayoutPanel.Location = new System.Drawing.Point(0, 279); + this._buttonsFlowLayoutPanel.Name = "_buttonsFlowLayoutPanel"; + this._buttonsFlowLayoutPanel.Padding = new System.Windows.Forms.Padding(2); + this._buttonsFlowLayoutPanel.Size = new System.Drawing.Size(403, 36); + this._buttonsFlowLayoutPanel.TabIndex = 3; + this._buttonsFlowLayoutPanel.TabStop = true; + this._buttonsFlowLayoutPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.HandleButtonPanelPaint); + // + // _buttonNew + // + this._buttonNew.AutoSize = true; + this._buttonNew.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.locExtender.SetLocalizableToolTip(this._buttonNew, null); + this.locExtender.SetLocalizationComment(this._buttonNew, "Button for adding new sessions and people"); + this.locExtender.SetLocalizingId(this._buttonNew, "CommonToMultipleViews.ElementList.NewButtonText"); + this._buttonNew.Location = new System.Drawing.Point(5, 5); + this._buttonNew.MinimumSize = new System.Drawing.Size(75, 26); + this._buttonNew.Name = "_buttonNew"; + this._buttonNew.Size = new System.Drawing.Size(75, 26); + this._buttonNew.TabIndex = 0; + this._buttonNew.Text = "&New"; + this._buttonNew.UseVisualStyleBackColor = true; + this._buttonNew.Click += new System.EventHandler(this.HandleNewButtonClick); + // + // _headerLabel + // + this._headerLabel.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179))))); + this._headerLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this._headerLabel.ClipTextForChildControls = true; + this._headerLabel.ControlReceivingFocusOnMnemonic = null; + this._headerLabel.Controls.Add(this._buttonColChooser); + this._headerLabel.Controls.Add(this._searchTextBox); + this._headerLabel.Dock = System.Windows.Forms.DockStyle.Top; + this._headerLabel.DoubleBuffered = true; + this._headerLabel.DrawOnlyBottomBorder = false; + this._headerLabel.DrawOnlyTopBorder = false; + this._headerLabel.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World); + this._headerLabel.ForeColor = System.Drawing.SystemColors.ControlText; + this.locExtender.SetLocalizableToolTip(this._headerLabel, null); + this.locExtender.SetLocalizationComment(this._headerLabel, "Do not translate - Localized in subclass"); + this.locExtender.SetLocalizationPriority(this._headerLabel, L10NSharp.LocalizationPriority.NotLocalizable); + this.locExtender.SetLocalizingId(this._headerLabel, "UI.ListPanel._headerLabel"); + this._headerLabel.Location = new System.Drawing.Point(0, 0); + this._headerLabel.MinimumSize = new System.Drawing.Size(165, 2); + this._headerLabel.MnemonicGeneratesClick = false; + this._headerLabel.Name = "_headerLabel"; + this._headerLabel.PaintExplorerBarBackground = false; + this._headerLabel.ShowWindowBackgroudOnTopAndRightEdge = true; + this._headerLabel.ShowWindowBackgroundOnTopAndRightEdge = true; + this._headerLabel.Size = new System.Drawing.Size(403, 23); + this._headerLabel.TabIndex = 0; + this._headerLabel.Text = "Change this text"; + this._headerLabel.Paint += new System.Windows.Forms.PaintEventHandler(this.HandleHeaderPanelPaint); + // + // _buttonColChooser + // + this._buttonColChooser.Anchor = System.Windows.Forms.AnchorStyles.Right; + this._buttonColChooser.BackColor = System.Drawing.Color.Transparent; + this._buttonColChooser.CanBeChecked = false; + this._buttonColChooser.Checked = false; + this._buttonColChooser.DrawEmpty = false; + this._buttonColChooser.DrawLeftArrowButton = false; + this._buttonColChooser.DrawRightArrowButton = false; + this._buttonColChooser.Font = new System.Drawing.Font("Marlett", 9F); + this._buttonColChooser.Image = ((System.Drawing.Image)(resources.GetObject("_buttonColChooser.Image"))); + this.locExtender.SetLocalizableToolTip(this._buttonColChooser, "Choose Columns"); + this.locExtender.SetLocalizationComment(this._buttonColChooser, null); + this.locExtender.SetLocalizingId(this._buttonColChooser, "CommonToMultipleViews.ElementList.ColumnChooserButton"); + this._buttonColChooser.Location = new System.Drawing.Point(384, 2); + this._buttonColChooser.Name = "_buttonColChooser"; + this._buttonColChooser.Size = new System.Drawing.Size(20, 20); + this._buttonColChooser.TabIndex = 0; + // + // _searchTextBox + // + this._searchTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this._searchTextBox.Dock = System.Windows.Forms.DockStyle.Right; + this.locExtender.SetLocalizableToolTip(this._searchTextBox, null); + this.locExtender.SetLocalizationComment(this._searchTextBox, null); + this.locExtender.SetLocalizingId(this._searchTextBox, "ListPanel._searchTextBox"); + this._searchTextBox.Location = new System.Drawing.Point(221, 0); + this._searchTextBox.Margin = new System.Windows.Forms.Padding(2); + this._searchTextBox.Name = "_searchTextBox"; + this._searchTextBox.Size = new System.Drawing.Size(180, 23); + this._searchTextBox.TabIndex = 1; + this._searchTextBox.TextChanged += new System.EventHandler(this._searchTextBox_TextChanged); + // + // ListPanel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this._outerPanel); + this.DoubleBuffered = true; + this.locExtender.SetLocalizableToolTip(this, null); + this.locExtender.SetLocalizationComment(this, null); + this.locExtender.SetLocalizationPriority(this, L10NSharp.LocalizationPriority.NotLocalizable); + this.locExtender.SetLocalizingId(this, "ListPanel.ListPanel"); + this.MinimumSize = new System.Drawing.Size(125, 0); + this.Name = "ListPanel"; + this.Size = new System.Drawing.Size(405, 317); + ((System.ComponentModel.ISupportInitialize)(this.locExtender)).EndInit(); + this._outerPanel.ResumeLayout(false); + this._outerPanel.PerformLayout(); + this._buttonsFlowLayoutPanel.ResumeLayout(false); + this._buttonsFlowLayoutPanel.PerformLayout(); + this._headerLabel.ResumeLayout(false); + this._headerLabel.PerformLayout(); + this.ResumeLayout(false); } @@ -170,5 +189,6 @@ private void InitializeComponent() public System.Windows.Forms.Button _buttonNew; private System.Windows.Forms.FlowLayoutPanel _buttonsFlowLayoutPanel; private ColumnChooserButton _buttonColChooser; + private System.Windows.Forms.TextBox _searchTextBox; } } diff --git a/src/SayMore/UI/LowLevelControls/ListPanel.cs b/src/SayMore/UI/LowLevelControls/ListPanel.cs index 0883e4752..13655c269 100644 --- a/src/SayMore/UI/LowLevelControls/ListPanel.cs +++ b/src/SayMore/UI/LowLevelControls/ListPanel.cs @@ -19,6 +19,17 @@ public partial class ListPanel : UserControl public event EventHandler NewButtonClicked; public event EventHandler DeleteButtonClicked; + /// + /// Raised when the text in the search box changes. + /// + public event EventHandler SearchTextChanged; + + /// + /// Raised when the user types in the search box and a search should be performed. + /// Only fired when there are three or more characters in the search box. + /// + public event EventHandler SearchRequested; + private readonly List