This commit is contained in:
2009-08-18 14:11:11 +00:00
parent b0c0a65af8
commit 6ba374729d
5 changed files with 90 additions and 43 deletions

View File

@@ -30,6 +30,7 @@ namespace Volian.Controls.Library
get { return _LibDocList; }
set { _LibDocList = value; }
}
private Color saveGroupPanelUsages;
#endregion
#region Constructors
public DisplayLibDocs()
@@ -37,6 +38,7 @@ namespace Volian.Controls.Library
InitializeComponent();
btnOpenLibDoc.Enabled = false;
btnDelLibDoc.Enabled = false;
saveGroupPanelUsages = groupPanelUsages.Style.BackColor;
}
DisplayTabControl _DisplayTabControl;
#endregion
@@ -46,6 +48,7 @@ namespace Volian.Controls.Library
{
_InitializingLibDocList = true;
listBoxLibDocs.Items.Clear();
groupPanelLibDocs.Style.BackColor = Color.Yellow;
btnSave.Enabled = false;
btnCancel.Enabled = false;
LibDocList = DocumentInfoList.GetLibraries(true);
@@ -60,6 +63,7 @@ namespace Volian.Controls.Library
private void listBoxLibDocs_Click(object sender, EventArgs e)
{
if (listBoxLibDocs.SelectedIndex == _SelectedLibDoc) return;
groupPanelLibDocs.Style.BackColor = Color.Orange;
_SelectedLibDoc = listBoxLibDocs.SelectedIndex;
listBoxUsages.Items.Clear();
tbComment.Clear();
@@ -77,6 +81,7 @@ namespace Volian.Controls.Library
// from usage list), otherwise disable buttons & list usages
DocumentInfo dicnt = LibDocList[_SelectedLibDoc];
ItemInfoList iil = dicnt.LibraryDocumentUsageList;
groupPanelUsages.Style.BackColor = dicnt.LibraryDocumentUsageList==null||dicnt.LibraryDocumentUsageList.Count==0 ? this.saveGroupPanelUsages : Color.LightGreen;
if (iil == null)
{
btnDelLibDoc.Enabled = true;
@@ -86,8 +91,7 @@ namespace Volian.Controls.Library
// Put the usages in the usage list for the selected library document.
btnDelLibDoc.Enabled = false;
btnOpenLibDoc.Enabled = false;
DocumentInfo di = LibDocList[_SelectedLibDoc];
foreach (ItemInfo ii in di.LibraryDocumentUsageList)
foreach (ItemInfo ii in dicnt.LibraryDocumentUsageList)
{
listBoxUsages.Items.Add(ii.MyProcedure.ToString() + " - " + ii.MyContent.Number + " " + ii.MyContent.Text);
}