search logic
This commit is contained in:
@@ -35,32 +35,32 @@ namespace Volian.Controls.Library
|
||||
#region Events
|
||||
private void cbAnnoType_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateAnnotationSearchResults();
|
||||
UpdateAnnotationSearchResults();
|
||||
}
|
||||
|
||||
private void lbResults_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_LoadingList)
|
||||
{
|
||||
_AnnotationDetails.CurrentAnnotation = lbResults.SelectedValue as AnnotationInfo;
|
||||
if (_AnnotationDetails.CurrentAnnotation != null)
|
||||
_TabControl.OpenItem(_AnnotationDetails.CurrentAnnotation.MyItem); // open the corresponding procedure text
|
||||
_AnnotationDetails.FindCurrentAnnotation(); // position to corresponding row in annotation grid
|
||||
}
|
||||
}
|
||||
private void lbResults_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_LoadingList)
|
||||
{
|
||||
_AnnotationDetails.CurrentAnnotation = lbResults.SelectedValue as AnnotationInfo;
|
||||
if (_AnnotationDetails.CurrentAnnotation != null)
|
||||
_TabControl.OpenItem(_AnnotationDetails.CurrentAnnotation.MyItem); // open the corresponding procedure text
|
||||
_AnnotationDetails.FindCurrentAnnotation(); // position to corresponding row in annotation grid
|
||||
}
|
||||
}
|
||||
|
||||
private int LastResultsMouseOverIndex = -1;
|
||||
private void lbResults_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
int ResultsMouseOverIndex = lbResults.IndexFromPoint(e.Location);
|
||||
if (ResultsMouseOverIndex != -1 && ResultsMouseOverIndex != LastResultsMouseOverIndex)
|
||||
{
|
||||
AnnotationInfo ai = lbResults.Items[ResultsMouseOverIndex] as AnnotationInfo;
|
||||
toolTip1.SetToolTip(lbResults, ai.MyItem.Path); // display location of corresponding procedure text in a tooltip
|
||||
LastResultsMouseOverIndex = ResultsMouseOverIndex;
|
||||
}
|
||||
private int LastResultsMouseOverIndex = -1;
|
||||
private void lbResults_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
int ResultsMouseOverIndex = lbResults.IndexFromPoint(e.Location);
|
||||
if (ResultsMouseOverIndex != -1 && ResultsMouseOverIndex != LastResultsMouseOverIndex)
|
||||
{
|
||||
AnnotationInfo ai = lbResults.Items[ResultsMouseOverIndex] as AnnotationInfo;
|
||||
toolTip1.SetToolTip(lbResults, ai.MyItem.Path); // display location of corresponding procedure text in a tooltip
|
||||
LastResultsMouseOverIndex = ResultsMouseOverIndex;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region LoadControlData
|
||||
@@ -69,22 +69,22 @@ namespace Volian.Controls.Library
|
||||
_AnnotationDetails = annotationDetails;
|
||||
cbAnnoType.DisplayMember = "Name";
|
||||
cbAnnoType.DataSource = AnnotationTypeInfoList.Get();
|
||||
lbResults.MouseMove += new MouseEventHandler(lbResults_MouseMove);
|
||||
lbResults.MouseMove += new MouseEventHandler(lbResults_MouseMove);
|
||||
_TabControl = tc;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region VariousSupportMethods
|
||||
public void UpdateAnnotationSearchResults()
|
||||
{
|
||||
AnnotationTypeInfo ati = cbAnnoType.SelectedValue as AnnotationTypeInfo;
|
||||
_LoadingList = true;
|
||||
lbResults.DisplayMember = "SearchText";
|
||||
lbResults.DataSource = ati.AnnotationTypeAnnotations;
|
||||
lbResults.SelectedIndex = -1;
|
||||
LastResultsMouseOverIndex = -1;
|
||||
_LoadingList = false;
|
||||
}
|
||||
public void UpdateAnnotationSearchResults()
|
||||
{
|
||||
AnnotationTypeInfo ati = cbAnnoType.SelectedValue as AnnotationTypeInfo;
|
||||
_LoadingList = true;
|
||||
lbResults.DisplayMember = "SearchText";
|
||||
lbResults.DataSource = ati.AnnotationTypeAnnotations;
|
||||
lbResults.SelectedIndex = -1;
|
||||
LastResultsMouseOverIndex = -1;
|
||||
_LoadingList = false;
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user