bug fixes and changes to search results reports, changes to wording on search panel for step types

This commit is contained in:
2011-07-11 19:57:01 +00:00
parent a0bcd7d9c0
commit daddf5d47c
3 changed files with 416 additions and 253 deletions

View File

@@ -999,6 +999,14 @@ namespace Volian.Controls.Library
SearchResults = null;
bool includeRTFformat = false;
bool includeSpecialChars = true;
// Build list of selected types that were searched
string typstr = null;
foreach (string s in lstCheckedStepTypesStr) typstr = typstr == null ? s : typstr + ", " + s;
TypesSelected = "Filtered By: " + ((typstr != null) ? typstr : "All Step Types");
//TypesSelected = "Step Types Searched: " + ((typstr != null) ? typstr : "all step types");
//TypesSelected = "Searched Step Types: " + ((typstr != null) ? typstr : "all step types");
//TypesSelected = (typstr != null) ? "Searched Step Types: " + typstr : "Searched All Step Types";
if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[0]) // Text Search
{
if (cbxSrchTypeUsage.Checked) // find just the usage of the selected types
@@ -1012,9 +1020,11 @@ namespace Volian.Controls.Library
}
else
{
string typstr = null;
foreach (string s in lstCheckedStepTypesStr) typstr = typstr==null?s:typstr + ", " + s;
ReportTitle = "Proms - Search by Type: " + typstr;
//string typstr = null;
//foreach (string s in lstCheckedStepTypesStr) typstr = typstr==null?s:typstr + ", " + s;
//ReportTitle = "Search for Selected Types"; //"Proms - Search by Type: " + typstr;
ReportTitle = "Step Element Report"; //"Proms - Search by Type: " + typstr;
TypesSelected = "Filtered By: " + typstr;
SearchString = null;
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, "", cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, ItemSearchIncludeLinks.Value, includeRTFformat, includeSpecialChars);
cmbResultsStyleIndex = 1; //display step locations in results
@@ -1029,8 +1039,11 @@ namespace Volian.Controls.Library
//}
//else
//{
ReportTitle = string.Format("Proms - {0} Search for '{1}'", cbxBooleanTxtSrch.Checked ? "Boolean" : "Text", TextSearchString);
//ReportTitle = string.Format("Proms - {0} Search for '{1}'", cbxBooleanTxtSrch.Checked ? "Boolean" : "Text", TextSearchString);
ReportTitle = string.Format("Search for '{0}'", TextSearchString);
SearchString = TextSearchString;
//TypesSelected = (typstr != null) ? "Searched Step Types: " + typstr : "Searched All Step Types";
//TypesSelected = "Searched Step Types: " + ((typstr != null) ? typstr : "All Step Types");
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, TextSearchString, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxIncROTextSrch.Checked ? ItemSearchIncludeLinks.Value : ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars);
cmbResultsStyleIndex = 3; // display step text in results
//}
@@ -1039,8 +1052,18 @@ namespace Volian.Controls.Library
else if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[1]) // Annotation Search
{
SearchString = null;
ReportTitle = string.Format("Proms - Annotation Search for '{0}'", cbxTextSearchAnnotation.Text);
//ReportTitle = string.Format("Proms - Annotation Search for '{0}'", cbxTextSearchAnnotation.Text);
if (cbxTextSearchAnnotation.Text == null || cbxTextSearchAnnotation.Text == "")
{
ReportTitle = string.Format("Find {0}{1}", cbxAnnoTypes.Text, (cbxAnnoTypes.SelectedIndex > 0)?" Annotations" : "" );
}
else
{
ReportTitle = string.Format("Search {0}{1} For '{2}'", cbxAnnoTypes.Text, (cbxAnnoTypes.SelectedIndex > 0) ? " Annotations" : "", cbxTextSearchAnnotation.Text);
}
//ReportTitle = string.Format("Search Annotations for '{0}'", cbxTextSearchAnnotation.Text);
//string srchStr = ConvertSpecialChars(cbxTextSearchAnnotation.Text);//cbxTextSearchAnnotation.Text;
//TypesSelected = "Searched Step Types: " + ((typstr != null) ? typstr : "All Step Types");
//SearchResults = ItemInfoList.GetListFromAnnotationSearch(dviSearchList, typeSearchList, textSearchString, srchStr, cbxCaseSensitiveAnnoText.Checked);
SearchResults = ItemInfoList.GetListFromAnnotationSearch(DVISearchList, TypeSearchList, AnnotationSearchType, cbxTextSearchAnnotation.Text, cbxCaseSensitiveAnnoText.Checked);
@@ -1050,7 +1073,9 @@ namespace Volian.Controls.Library
else if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[2]) // RO Search
{
SearchString = null;
ReportTitle = "Proms - Referenced Object Search";
//ReportTitle = "Proms - Referenced Object Search";
ReportTitle = string.Format("Search For Referenced Object:\n{0}", cmboTreeROs.Text);
//TypesSelected = "Searched Step Types: " + ((typstr != null) ? typstr : "All Step Types");
if (cbxFndUnLnkROVals.Enabled && cbxFndUnLnkROVals.Checked)
{
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, ROSearchList, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars);
@@ -1296,13 +1321,19 @@ namespace Volian.Controls.Library
n.Style = DevComponents.AdvTree.NodeStyles.Apple;
if (sd == null)
{
lstCheckedStepTypes.Add(0); //use zero to identify attachment search
lstCheckedStepTypesStr.Add("Accessory Sections");
if (!lstCheckedStepTypesStr.Contains("Accessory Sections"))
{
lstCheckedStepTypes.Add(0); //use zero to identify attachment search
lstCheckedStepTypesStr.Add("Accessory Sections");
}
}
else
{
lstCheckedStepTypes.Add((int)sd.Index);
lstCheckedStepTypesStr.Add(advTreeStepTypes.SelectedNode.Text);
if (!lstCheckedStepTypesStr.Contains(advTreeStepTypes.SelectedNode.Text))
{
lstCheckedStepTypes.Add((int)sd.Index);
lstCheckedStepTypesStr.Add(advTreeStepTypes.SelectedNode.Text);
}
}
}
else
@@ -1316,7 +1347,8 @@ namespace Volian.Controls.Library
else
{
lstCheckedStepTypes.Remove((int)sd.Index);
lstCheckedStepTypesStr.Remove(sd.Type);
//lstCheckedStepTypesStr.Remove(sd.Type);
lstCheckedStepTypesStr.Remove(advTreeStepTypes.SelectedNode.Text);
}
}
buildStepTypePannelTitle();
@@ -1334,19 +1366,20 @@ namespace Volian.Controls.Library
{
if (xpStepTypes.Expanded)
{
xpStepTypes.TitleText = "Select Types To Search";
xpStepTypes.TitleText = "Select Step Elements To Search";//"Select Types To Search";
advTreeStepTypes.Focus();
advTreeStepTypes.Nodes[0].SelectedCell = advTreeStepTypes.Nodes[0].Cells[0];
}
else
xpStepTypes.TitleText = "Click Here To Search By Types";
xpStepTypes.TitleText = "Click Here To Search By Step Element";//"Click Here To Search By Types";
xpStepTypes.TitleStyle.BackColor1.Color = saveXpStepTypeTitleColor;
}
else //lstCheckedStepTypes.Count > 0
{
// show how many selected whether pannel is expanded or not
xpStepTypes.TitleText = string.Format("{0} Step Styles Selected", lstCheckedStepTypes.Count);
//xpStepTypes.TitleText = string.Format("{0} Step Styles Selected", lstCheckedStepTypes.Count);
xpStepTypes.TitleText = string.Format("{0} Step Element{0} Selected", lstCheckedStepTypes.Count, (lstCheckedStepTypes.Count > 1)?"s":"");
xpStepTypes.TitleStyle.BackColor1.Color = Color.PapayaWhip;
}
}
@@ -1599,9 +1632,16 @@ namespace Volian.Controls.Library
get { return _SearchString; }
set { _SearchString = value; }
}
private string _TypesSelected;
public string TypesSelected
{
get { return _TypesSelected; }
set { _TypesSelected = value; }
}
private void btnPrnSrchRslts_Click(object sender, EventArgs e)
{
OnPrintRequest(new DisplaySearchEventArgs(ReportTitle, SearchString, lbSrchResults.DataSource as ICollection<ItemInfo>));
OnPrintRequest(new DisplaySearchEventArgs(ReportTitle, TypesSelected, SearchString, lbSrchResults.DataSource as ICollection<ItemInfo>));
}
private void panSearchButtons_Resize(object sender, EventArgs e)
{
@@ -1648,15 +1688,22 @@ namespace Volian.Controls.Library
get { return _SearchString; }
set { _SearchString = value; }
}
private string _TypesSelected;
public string TypesSelected
{
get { return _TypesSelected; }
set { _TypesSelected = value; }
}
private ICollection<ItemInfo> _MyItemInfoList;
public ICollection<ItemInfo> MyItemInfoList
{
get { return _MyItemInfoList; }
set { _MyItemInfoList = value; }
}
public DisplaySearchEventArgs(string reportTitle, string searchString, ICollection<ItemInfo> myItemInfoList)
public DisplaySearchEventArgs(string reportTitle, string typesSelected, string searchString, ICollection<ItemInfo> myItemInfoList)
{
_ReportTitle = reportTitle;
_TypesSelected = typesSelected;
_MyItemInfoList = myItemInfoList;
_SearchString = searchString;
}