This commit is contained in:
2010-09-21 18:36:49 +00:00
parent 6634758e73
commit 22831cc08d
7 changed files with 144 additions and 132 deletions

View File

@@ -215,6 +215,7 @@ namespace Volian.Controls.Library
void btnInsStep_Click(object sender, EventArgs e)
{
DevComponents.DotNetBar.ButtonItem b = (DevComponents.DotNetBar.ButtonItem)sender;
if (b.Tag == null) return;
char [] sep = {' '};
string[] insdata = b.Tag.ToString().Split(sep);
if (insdata.Length != 2) return;
@@ -502,6 +503,23 @@ namespace Volian.Controls.Library
if (sdl != null && sdl.Count > 0)
{
Char kt = 'A'; // start with letter A for KeyTips
// if doing the insert substep button, check for substeps already there and if so must match type.
if (btn.Name == "btnInsSubstep")
{
if (MyItemInfo.Steps != null)
{
ItemInfo ichld = MyItemInfo.Steps[0];
btn.Click += new System.EventHandler(btnInsStep_Click);
Volian.Base.Library.vlnStackTrace.ShowStackLocal("btn", 2, 10);
btn.Tag = string.Format("{0} {1}", fromtype, ichld.MyContent.Type - 20000);
return;
}
else
{
btn.Tag = null;
btn.Click -= new System.EventHandler(btnInsStep_Click);
}
}
foreach (StepDataRetval sdr in sdl)
{
bool addit = true;
@@ -517,6 +535,7 @@ namespace Volian.Controls.Library
if (btn.Name == "btnInsHLS" && sd.Type == "RNOType") addit = false;
if (btn.Name == "btnInsCaut" && sd.Type.Length>=4 && sd.Type.Substring(0, 4) == "Note") addit = false;
if (btn.Name == "btnInsNote" && sd.Type.Length>=7 && sd.Type.Substring(0, 7) == "Caution") addit = false;
if (btn.Name == "btnInsSubstep" && MyItemInfo.Steps != null) addit = false;
if (addit)
{
DevComponents.DotNetBar.ButtonItem bi = new DevComponents.DotNetBar.ButtonItem("btn" + sd.Type, sd.Type);
@@ -578,6 +597,7 @@ namespace Volian.Controls.Library
}
}
}
rbnStepParts.Refresh();
}
#endregion
#region Insert Tab
@@ -838,6 +858,7 @@ namespace Volian.Controls.Library
ROFst newrofst = ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv.DocVersionAssociations[0], dv, roFstInfo);
StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("DisplayROUpdateROFST");
MyStepItem.MyStepPanel.OnTabDisplay(sender, args);
btnUpdROVal.Enabled = false;
}
Cursor = Cursors.Default;
}
@@ -846,17 +867,25 @@ namespace Volian.Controls.Library
{
btnUpdROVal.Enabled = false;
if (MyDVI.DocVersionAssociations.Count < 1) return;
ROFstInfo roFstInfo = MyDVI.DocVersionAssociations[0].MyROFst;
RODbInfo rdi = RODbInfo.Get(roFstInfo.RODbID);
string rofstPath = rdi.FolderPath + @"\ro.fst";
if (!File.Exists(rofstPath)) return;
FileInfo fiRofst = new FileInfo(rofstPath);
if (roFstInfo.DTS == fiRofst.LastWriteTime) return;
if (roFstInfo.DTS > fiRofst.LastWriteTime) return;
if (!NewerRoFst()) return;
btnUpdROVal.Enabled = true;
}
public bool NewerRoFst()
{
if (_MyDVI == null) return false;
ROFstInfo roFstInfo = _MyDVI.DocVersionAssociations[0].MyROFst;
RODbInfo rdi = RODbInfo.Get(roFstInfo.RODbID);
string rofstPath = rdi.FolderPath + @"\ro.fst";
if (!File.Exists(rofstPath)) return false;
FileInfo fiRofst = new FileInfo(rofstPath);
if (roFstInfo.DTS == fiRofst.LastWriteTime) return false;
if (roFstInfo.DTS > fiRofst.LastWriteTime) return false;
return true;
}
public void SetUpdRoValBtn(bool en)
{
btnUpdROVal.Enabled = en;
}
private void btnBookmarks_Click(object sender, EventArgs e)
{
StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("Bookmarks");