This commit is contained in:
2011-03-17 18:57:05 +00:00
parent b9ce843421
commit 7ac571fdd5
4 changed files with 604 additions and 333 deletions

View File

@@ -125,6 +125,7 @@ namespace Volian.Controls.Library
if (_MyEditItem != null) _MyEditItem.Leave += new EventHandler(_MyEditItem_Leave);
//_MyStepRTB.Leave += new EventHandler(_MyStepRTB_Leave);
_MyStepRTB.LinkChanged += new StepRTBLinkEvent(_MyStepRTB_LinkChanged);
if (MyFlexGrid != null) MyFlexGrid.CopyOptionChanged += new VlnFlexGridEvent(MyFlexGrid_CopyOptionChanged);
// Add symbols into the tab ribbon based on format selection. For now, only add symbols once
// because all symbols are same!!! If we start defining different symbols in different formats
// this will have to change, i.e. remove the second part of 'if' statement.
@@ -163,6 +164,36 @@ namespace Volian.Controls.Library
_MyEditItem.Leave += new EventHandler(_MyEditItem_Leave);
//_MyStepRTB.Leave -= new EventHandler(_MyStepRTB_Leave);
_MyStepRTB.LinkChanged -= new StepRTBLinkEvent(_MyStepRTB_LinkChanged);
if (MyFlexGrid != null) MyFlexGrid.CopyOptionChanged -= new VlnFlexGridEvent(MyFlexGrid_CopyOptionChanged);
}
void MyFlexGrid_CopyOptionChanged(object sender, EventArgs args)
{
btnTblDgnPaste.Enabled = true;
btnCmGridPaste.Enabled = true;
switch (VlnFlexGrid.MyCopyInfo.MyCopyOption)
{
case GridCopyOption.Row:
btnTblDgnPasteRow.Visible = true;
btnCmGridPasteRow.Visible = true;
btnTblDgnPasteColumn.Visible = false;
btnCmGridPasteCol.Visible = false;
break;
case GridCopyOption.Column:
btnTblDgnPasteRow.Visible = false;
btnCmGridPasteRow.Visible = false;
btnTblDgnPasteColumn.Visible = true;
btnCmGridPasteCol.Visible = true;
break;
case GridCopyOption.Selection:
btnTblDgnPasteRow.Visible = false;
btnCmGridPasteRow.Visible = false;
btnTblDgnPasteColumn.Visible = false;
btnCmGridPasteCol.Visible = false;
break;
default:
break;
}
}
void _MyStepRTB_SelectionChanged(object sender, EventArgs e)
@@ -1501,23 +1532,23 @@ namespace Volian.Controls.Library
#region Table Grid Copy/Paste
private void btnTblDgnCopyRow_Click(object sender, EventArgs e)
{
MyFlexGrid.ClipBoardCopyRow();
MyFlexGrid.CopyRow();
}
private void btnTblDgnCopyColumn_Click(object sender, EventArgs e)
{
MyFlexGrid.ClipBoardCopyColumn();
MyFlexGrid.CopyColumn();
}
private void btnTblDgnCopySelection_Click(object sender, EventArgs e)
{
MyFlexGrid.ClipBoardCopySelection();
MyFlexGrid.CopyCellSelection();
}
private void btnTblDgnPasteRowAbove_Click(object sender, EventArgs e)
{
// create new rows before current position and copy clipboard data
MyFlexGrid.ClipBoardPasteRows(VlnFlexGrid.enmPastePos.Before);
MyFlexGrid.PasteRows(VlnFlexGrid.enmPastePos.Before);
GridItem tmp = MyEditItem as GridItem;
if (tmp!=null) tmp.SavePastedCellRoTran();
}
@@ -1525,7 +1556,7 @@ namespace Volian.Controls.Library
private void btnTblDgnPasteRowBelow_Click(object sender, EventArgs e)
{
// create new rows after current position and copy clipboard data
MyFlexGrid.ClipBoardPasteRows(VlnFlexGrid.enmPastePos.After);
MyFlexGrid.PasteRows(VlnFlexGrid.enmPastePos.After);
GridItem tmp = MyEditItem as GridItem;
if (tmp != null) tmp.SavePastedCellRoTran();
}
@@ -1533,35 +1564,35 @@ namespace Volian.Controls.Library
private void btnTblDgnPasteReplaceRow_Click(object sender, EventArgs e)
{
// replace rows with current clipboard data starting as current row
MyFlexGrid.ClipBoardPasteRows(VlnFlexGrid.enmPastePos.Replace);
MyFlexGrid.PasteRows(VlnFlexGrid.enmPastePos.Replace);
GridItem tmp = MyEditItem as GridItem;
if (tmp != null) tmp.SavePastedCellRoTran();
}
private void btnTblDgnPasteColumnLeft_Click(object sender, EventArgs e)
{
MyFlexGrid.ClipBoardPasteColumns(VlnFlexGrid.enmPastePos.Before);
MyFlexGrid.PasteColumns(VlnFlexGrid.enmPastePos.Before);
GridItem tmp = MyEditItem as GridItem;
if (tmp != null) tmp.SavePastedCellRoTran();
}
private void btnTblDgnPasteColumnRight_Click(object sender, EventArgs e)
{
MyFlexGrid.ClipBoardPasteColumns(VlnFlexGrid.enmPastePos.After);
MyFlexGrid.PasteColumns(VlnFlexGrid.enmPastePos.After);
GridItem tmp = MyEditItem as GridItem;
if (tmp != null) tmp.SavePastedCellRoTran();
}
private void btnTblDgnPasteColumnReplace_Click(object sender, EventArgs e)
{
MyFlexGrid.ClipBoardPasteColumns(VlnFlexGrid.enmPastePos.Replace);
MyFlexGrid.PasteColumns(VlnFlexGrid.enmPastePos.Replace);
GridItem tmp = MyEditItem as GridItem;
if (tmp != null) tmp.SavePastedCellRoTran();
}
private void btnTblDgnPasteIntoSelection_Click(object sender, EventArgs e)
{
MyFlexGrid.ClipBoardPasteIntoSelection();
MyFlexGrid.PasteCopiedCells();
GridItem tmp = MyEditItem as GridItem;
if (tmp != null) tmp.SavePastedCellRoTran();
}
@@ -1641,20 +1672,6 @@ namespace Volian.Controls.Library
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Right);
}
//private void btnTblDgnAlignLeft_Click(object sender, EventArgs e)
//{
// MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Left);
//}
//private void btnTblDgnAlignCentered_Click(object sender, EventArgs e)
//{
// MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Center);
//}
//private void btnTblDgnAlignRight_Click(object sender, EventArgs e)
//{
// MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Right);
//}
#endregion
#region Table Grid Merge/Split
private void btnTblDgnSplitCells_ToRows_Click(object sender, EventArgs e)
@@ -1703,7 +1720,8 @@ namespace Volian.Controls.Library
btnTblDgnInsertColumn.Enabled = enable;
btnTblDgnInsertRow.Enabled = enable;
btnTblDgnMergeCells.Enabled = enable;
btnTblDgnPaste.Enabled = enable;
btnCmGridPaste.Enabled =
btnTblDgnPaste.Enabled = ((VlnFlexGrid.MyCopyInfo.MyCopiedFlexGrid != null) && enable);
btnTblDgnSplitCells.Enabled = enable;
}
public void SetRibbonForGrid()