Page Num Transition (for grids)

This commit is contained in:
2014-01-22 12:06:56 +00:00
parent cfb0981a22
commit 4e445bbe20
9 changed files with 245 additions and 26 deletions

View File

@@ -50,7 +50,7 @@ namespace Volian.Controls.Library
// use the following if user selects 'cancel' button
private ItemInfo _SavCurItemFrom;
private int _SavTranFmtIndx;
private bool _ModExistingPageNum = false;
private bool _DoingRange = false; // flags if in 'range' transition mode
private VETreeNode _RangeNode1;
private VETreeNode _RangeNode2;
@@ -580,6 +580,24 @@ namespace Volian.Controls.Library
}
else
cbIncStepNum.Visible = false;
// if this format has the transition flag for UseTransitionModifier, i.e. page numbers included in transition text,
// then make visible the checkbox & set based on data.
// and transition type has to be (tranType==1||tranType==2||tranType==4))
cbPageNum.Visible = _CurItemFrom.ActiveFormat.PlantFormat.FormatData.TransData.UseTransitionModifier &&
(_CurItemFrom.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[indx].Type == 1 ||
_CurItemFrom.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[indx].Type == 2 ||
_CurItemFrom.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[indx].Type == 4);
if (cbPageNum.Visible)
{
cbPageNum.Checked = false;
if (CurTrans != null)
{
TransitionConfig tc = new TransitionConfig(CurTrans.Config);
cbPageNum.Checked = _ModExistingPageNum = tc != null && tc.Transition_Formatted.ToUpper() == "TRUE";
}
}
}
#endregion
#region Events
@@ -866,7 +884,15 @@ namespace Volian.Controls.Library
btnTranSave.Enabled = allowSave;
if (CurTrans != null)
{
if (CurTrans.ToID == selii.ItemID) btnTranCancel.Enabled = btnTranSave.Enabled = false;
if (CurTrans.ToID == selii.ItemID)
{
// if the checkbox for including a page number (UseTransitionModifier flag is true)
// then need to check if this has been changed, and allow a save/cancel if so.
if (cbPageNum.Visible && _ModExistingPageNum != cbPageNum.Checked)
btnTranCancel.Enabled = btnTranSave.Enabled = true;
else
btnTranCancel.Enabled = btnTranSave.Enabled = false;
}
else
{
btnTranCancel.Enabled = true;
@@ -1010,7 +1036,8 @@ namespace Volian.Controls.Library
MessageBox.Show(sb.ToString());
return;
}
trantxt = TransitionText.GetResolvedText(MyRTB.MyItemInfo, listBoxTranFmt.SelectedIndex,toItem,rangeItem ?? toItem);
bool doTranmod = this.cbPageNum.Checked;
trantxt = TransitionText.GetResolvedText(MyRTB.MyItemInfo, listBoxTranFmt.SelectedIndex, toItem, rangeItem ?? toItem, doTranmod);
int ss = MyRTB.SelectionStart;// Remember where the link is being added
int sl = MyRTB.SelectionLength;
MyRTB.OnReturnToEditor(this, new EventArgs());
@@ -1126,6 +1153,11 @@ namespace Volian.Controls.Library
{
tvTran.Enabled=cbIncStepNum.Checked;
}
private void cbPageNum_CheckedChanged(object sender, EventArgs e)
{
if (_ModExistingPageNum != cbPageNum.Checked)
btnTranCancel.Enabled = btnTranSave.Enabled = true;
}
}
public class TransItem
{