Changed logic so that for first secttion we use ItemInfo.InsertChild (this handles lots of things)
This commit is contained in:
parent
7dbc0ddfe5
commit
396cada699
@ -730,7 +730,9 @@ namespace Volian.Controls.Library
|
|||||||
|
|
||||||
void mi_Click(object sender, EventArgs e)
|
void mi_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MenuItem mi = (MenuItem)sender;
|
MenuItem mi = sender as MenuItem;
|
||||||
|
if (mi == null)
|
||||||
|
return;
|
||||||
switch (mi.Text)
|
switch (mi.Text)
|
||||||
{
|
{
|
||||||
case "Open":
|
case "Open":
|
||||||
@ -1163,7 +1165,7 @@ namespace Volian.Controls.Library
|
|||||||
if (!hasMetaSubs) doPseudo = true;
|
if (!hasMetaSubs) doPseudo = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
using (Section section = Section.MakeSection(_LastItemInfo, _LastItemInfo.LastChild(E_FromType.Section), null, "New Section", 10000))
|
using(Section section = CreateNewSection())
|
||||||
{
|
{
|
||||||
ShowBrokenRules(section.BrokenRulesCollection);
|
ShowBrokenRules(section.BrokenRulesCollection);
|
||||||
SetLastValues(SectionInfo.Get(section.ItemID));
|
SetLastValues(SectionInfo.Get(section.ItemID));
|
||||||
@ -1262,7 +1264,13 @@ namespace Volian.Controls.Library
|
|||||||
OnNodeInsert(this, new vlnTreeEventArgs(SelectedNode));
|
OnNodeInsert(this, new vlnTreeEventArgs(SelectedNode));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private Section CreateNewSection()
|
||||||
|
{
|
||||||
|
if(_LastItemInfo.LastChild(E_FromType.Section) != null)
|
||||||
|
return Section.MakeSection(_LastItemInfo, _LastItemInfo.LastChild(E_FromType.Section), null, "New Section", 10000);
|
||||||
|
ItemInfo iii = _LastItemInfo.InsertChild(E_FromType.Section, 10000, "New Section", null);
|
||||||
|
return Section.Get(iii.ItemID);
|
||||||
|
}
|
||||||
private VETreeNode InsertChildStep(VETreeNode tn)
|
private VETreeNode InsertChildStep(VETreeNode tn)
|
||||||
{
|
{
|
||||||
// If parent step is open in editor, use the OnInsertItemInfo to insert step & add RTBItems to step editor panel
|
// If parent step is open in editor, use the OnInsertItemInfo to insert step & add RTBItems to step editor panel
|
||||||
|
Loading…
x
Reference in New Issue
Block a user