This commit is contained in:
parent
fbce101db9
commit
0fafccf62c
@ -8,6 +8,7 @@ using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Accentra.Controls;
|
||||
|
||||
namespace Volian.Controls.Library
|
||||
{
|
||||
@ -315,6 +316,7 @@ namespace Volian.Controls.Library
|
||||
btnIndent.Enabled = setting;
|
||||
btnDelelete.Enabled = btnDelStep.Enabled = setting;
|
||||
btnSpell.Enabled = setting;
|
||||
//rtabTableGridTools.Visible = setting;
|
||||
}
|
||||
private void SetButtonAndMenuEnabling(bool docontextmenus)
|
||||
{
|
||||
@ -424,6 +426,10 @@ namespace Volian.Controls.Library
|
||||
// if on procedure, 'Delete' buttons should be disabled.
|
||||
btnDelelete.Enabled = btnDelStep.Enabled = ! MyItemInfo.IsProcedure;
|
||||
btnCpyStp.Enabled = !MyItemInfo.IsProcedure;
|
||||
//if (rtabTableGridTools.Visible && rtabTableGridTools.Checked && !MyItemInfo.IsTable)
|
||||
// rtabHome.Select();
|
||||
//rtabTableGridTools.Visible = MyItemInfo.IsTable; // turn on/off Table Design (Grid) ribbon tab grouping
|
||||
|
||||
// if on procedure or section, 'change type' & 'insert' buttons should be disabled.
|
||||
if (MyItemInfo.IsProcedure || MyItemInfo.IsSection)
|
||||
{
|
||||
@ -497,6 +503,8 @@ namespace Volian.Controls.Library
|
||||
if (btnInsRNO.Enabled) GalleryForSubTypes(MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.RNO, sd, btnInsRNO, 0, btnCMInsRNO, docontextmenus);
|
||||
|
||||
btnInsTrans.Enabled = btnCMTransition.Enabled = btnInsRO.Enabled = btnCMRO.Enabled = true;
|
||||
|
||||
//_RibbonControl.Refresh(); // jsj- added this because Table Design ribbon tab grouping was not going away when not on a table step type
|
||||
}
|
||||
/// <summary>
|
||||
/// set up a gallery of step types whose parent are defined by input StepData. Can be below
|
||||
@ -1270,6 +1278,308 @@ namespace Volian.Controls.Library
|
||||
if (MyItemInfo == null) return; // if creating a pdf before rtb exists, return;
|
||||
OnPrintRequest(new StepTabRibbonEventArgs(MyItemInfo.MyProcedure));
|
||||
}
|
||||
#region Table Grid
|
||||
#region TablePicker code
|
||||
// TODO: for tables
|
||||
//private void btnInsTable_Click(object sender, EventArgs e)
|
||||
//{
|
||||
// Point loc = btnInsTable.DisplayRectangle.Location;
|
||||
// loc.X += 300;
|
||||
// int top = this.Top + (btnInsTable.Size.Height * 2);
|
||||
// TablePickerDlg(sender, e, loc, top);
|
||||
//}
|
||||
|
||||
private VlnFlexGrid CreateNewTable()
|
||||
{
|
||||
Point pt = Cursor.Position;
|
||||
int left = pt.X;
|
||||
VlnFlexGrid grd = null;
|
||||
TablePicker tpdlg = new TablePicker();
|
||||
tpdlg.Location = pt;
|
||||
tpdlg.Left = left;
|
||||
DialogResult dr = tpdlg.ShowDialog();
|
||||
//tpdlg.Show();
|
||||
//while (tpdlg.Visible)
|
||||
//{
|
||||
// Application.DoEvents();
|
||||
// System.Threading.Thread.Sleep(0);
|
||||
//}
|
||||
if (dr == DialogResult.OK)
|
||||
{
|
||||
// Creat a new grid
|
||||
grd = new VlnFlexGrid();
|
||||
grd.Rows.Count = tpdlg.SelectedRows;
|
||||
grd.Cols.Count = tpdlg.SelectedColumns;
|
||||
}
|
||||
return grd;
|
||||
}
|
||||
//private void InitializeNewGrid(C1FlexGrid grd)
|
||||
//{
|
||||
// int numCols = grd.Cols.Count - 1;
|
||||
// int numRows = grd.Rows.Count - 1;
|
||||
|
||||
// string defText = "";
|
||||
// if (textBoxX1.Text.Length > 0)
|
||||
// defText = textBoxX1.Text;
|
||||
// else
|
||||
// defText = textBoxX1.WatermarkText;
|
||||
// grd.SetData(grd.GetCellRange(0, 0, numRows, numCols), defText);
|
||||
//}
|
||||
#endregion
|
||||
#region Table Grid Copy/Paste
|
||||
private void btnTblDgnCopyRow_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.ClipBoardCopyRow();
|
||||
}
|
||||
|
||||
private void btnTblDgnCopyColumn_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.ClipBoardCopyColumn();
|
||||
}
|
||||
|
||||
private void btnTblDgnCopySelection_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.ClipBoardCopySelection();
|
||||
}
|
||||
|
||||
private void btnTblDgnPasteRowBefore_Click(object sender, EventArgs e)
|
||||
{
|
||||
// create new rows before current position and copy clipboard data
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.ClipBoardPasteRows(VlnFlexGrid.enmPastePos.Before);
|
||||
}
|
||||
|
||||
private void btnTblDgnPasteRowAfter_Click(object sender, EventArgs e)
|
||||
{
|
||||
// create new rows after current position and copy clipboard data
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.ClipBoardPasteRows(VlnFlexGrid.enmPastePos.After);
|
||||
}
|
||||
|
||||
private void btnTblDgnPasteReplaceRow_Click(object sender, EventArgs e)
|
||||
{
|
||||
// replace rows with current clipboard data starting as current row
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.ClipBoardPasteRows(VlnFlexGrid.enmPastePos.Replace);
|
||||
}
|
||||
|
||||
private void btnTblDgnPasteColumnBefore_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.ClipBoardPasteColumns(VlnFlexGrid.enmPastePos.Before);
|
||||
}
|
||||
|
||||
private void btnTblDgnPasteColumnAfter_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.ClipBoardPasteColumns(VlnFlexGrid.enmPastePos.After);
|
||||
}
|
||||
|
||||
private void btnTblDgnPasteColumnReplace_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); //= rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.ClipBoardPasteColumns(VlnFlexGrid.enmPastePos.Replace);
|
||||
}
|
||||
|
||||
private void btnTblDgnPasteIntoSelection_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.ClipBoardPasteIntoSelection();
|
||||
}
|
||||
#endregion
|
||||
#region Table Grid Delete
|
||||
private void btnTblDgnDeleteRow_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); //= rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.RemoveSelectedRow();
|
||||
}
|
||||
|
||||
private void btnTblDgnDeleteColumn_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.RemoveSelectedColumn();
|
||||
}
|
||||
|
||||
private void btnTblDgnDeleteSelected_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.RemoveSelectedCells();
|
||||
}
|
||||
#endregion
|
||||
#region Table Grid Cell Style
|
||||
|
||||
private void cpHighlight_SelectedColorChanged(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid();
|
||||
string strColor = string.Format("{0}, {1}, {2};", cpTblDgnHighlight.SelectedColor.R, cpTblDgnHighlight.SelectedColor.G, cpTblDgnHighlight.SelectedColor.B);
|
||||
grd.ChangeBackgroundColor(strColor);
|
||||
}
|
||||
|
||||
private void btnTblDgnAlignLeft_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); ; // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.RTFTextAlignment(grd.Selection, HorizontalAlignment.Left);
|
||||
}
|
||||
|
||||
private void btnTblDgnAlignCentered_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); ; // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.RTFTextAlignment(grd.Selection, HorizontalAlignment.Center);
|
||||
}
|
||||
|
||||
private void btnTblDgnAlignRight_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); ; // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.RTFTextAlignment(grd.Selection, HorizontalAlignment.Right);
|
||||
}
|
||||
#endregion
|
||||
#region Table Grid Merge/Split
|
||||
private void btnTblDgnSplitCells_ToRows_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3; //GetActiveGrid();
|
||||
grd.SplitSelection(false);
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void btnTblDgnSplitCellsToCols_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3; //GetActiveGrid();
|
||||
grd.SplitSelection(true);
|
||||
}
|
||||
|
||||
private void btnTblDgnMergeCells_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3; //GetActiveGrid();
|
||||
grd.MergeSelection();
|
||||
}
|
||||
#endregion
|
||||
#region Table Grid Design
|
||||
private void btnTblDgnInsertRowBefore_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.InsertRowBefore();
|
||||
}
|
||||
|
||||
private void btnTblDgnInsertRowAfter_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.InsertRowAfter();
|
||||
}
|
||||
|
||||
private void btnTblDgnInsertColumnBefore_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.InsertColumnBefore();
|
||||
}
|
||||
|
||||
private void btnTblDgnInsertColumnAfter_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.InsertColumnAfter();
|
||||
}
|
||||
|
||||
private void btnTblDgnAdjustSize_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid();// rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
if (grd.Cols.Fixed == 0)
|
||||
{
|
||||
// set all the rows and columns to Fixed so that user can adjust the row/column size
|
||||
grd.Cols.Fixed = grd.Cols.Count;
|
||||
grd.Rows.Fixed = grd.Rows.Count;
|
||||
}
|
||||
else
|
||||
{
|
||||
// set grid back to "normal" mode
|
||||
grd.Cols.Fixed = 0;
|
||||
grd.Rows.Fixed = 0;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Table Grid Border
|
||||
private void btnTblDgnTableBorderNone_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.SetTableBorder(C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None);
|
||||
}
|
||||
|
||||
private void btnTblDgnTableBorderFixedSingle_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.SetTableBorder(C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.FixedSingle);
|
||||
}
|
||||
|
||||
private void btnTblDgnTableBorderFixed3D_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.SetTableBorder(C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Fixed3D);
|
||||
}
|
||||
|
||||
private void btnTblDgnTableBorderLight3D_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.SetTableBorder(C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D);
|
||||
}
|
||||
|
||||
private void btnTblDgnTableBorderXPThemes_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.SetTableBorder(C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.XpThemes);
|
||||
}
|
||||
#endregion
|
||||
#region Table Grid Grid Style
|
||||
private void btnTblDgnGridStyleNone_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid();//rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.ChangeCellBorder(grd.Selection, C1.Win.C1FlexGrid.BorderStyleEnum.None);
|
||||
|
||||
}
|
||||
|
||||
private void btnTblDgnGridStyleFlat_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.ChangeCellBorder(grd.Selection, C1.Win.C1FlexGrid.BorderStyleEnum.Flat);
|
||||
}
|
||||
|
||||
private void btnTblDgnGridStyleDouble_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.ChangeCellBorder(grd.Selection, C1.Win.C1FlexGrid.BorderStyleEnum.Double);
|
||||
}
|
||||
|
||||
private void btnTblDgnGridStyleRaised_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.ChangeCellBorder(grd.Selection, C1.Win.C1FlexGrid.BorderStyleEnum.Raised);
|
||||
}
|
||||
|
||||
private void btnTblDgnGridStyleInset_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.ChangeCellBorder(grd.Selection, C1.Win.C1FlexGrid.BorderStyleEnum.Inset);
|
||||
}
|
||||
|
||||
private void btnTblDgnGridStyleGroove_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.ChangeCellBorder(grd.Selection, C1.Win.C1FlexGrid.BorderStyleEnum.Groove);
|
||||
}
|
||||
|
||||
private void btnTblDgnGridStyleFillet_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.ChangeCellBorder(grd.Selection, C1.Win.C1FlexGrid.BorderStyleEnum.Fillet);
|
||||
}
|
||||
|
||||
private void btnTblDgnGridStyleDotted_Click(object sender, EventArgs e)
|
||||
{
|
||||
VlnFlexGrid grd = new VlnFlexGrid(); ; // = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3;
|
||||
grd.ChangeCellBorder(grd.Selection, C1.Win.C1FlexGrid.BorderStyleEnum.Dotted);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
public enum E_FieldToEdit { StepText, Text, Number };
|
||||
public class StepTabRibbonEventArgs : EventArgs
|
||||
|
BIN
PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs
generated
BIN
PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs
generated
Binary file not shown.
@ -120,14 +120,20 @@
|
||||
<metadata name="superTooltipRibbon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<data name="btnDelelete.SuperTooltip" xml:space="preserve">
|
||||
<value>Will delete the current step and any of its substseps, RNOs, etc. Checks whether any transitions are pointing to this step from outside the step and if found, does not allow delete, but prompts user with list of transitions.</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="btnInsRO.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<data name="btnCut.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAScQAA
|
||||
EnEB89x6jgAAAIBJREFUOE/FU9ESgCAIy///aAMU0DDYSxecV6KOObB1squRs3VyNY1Z4OWHATYTFHI1
|
||||
gp0RXdm+vlGoLC5zPowCHDeiAGkmhMHnAEFpDwwRjcFKV++/6xyLVgEk2UfhnuVTNsVBa5Njk8xV6c1k
|
||||
hNwGBmaHAP5n4G8q6gFdoZLjBpE7j5KJdaRlAAAAAElFTkSuQmCC
|
||||
EnEB89x6jgAAASBJREFUOE+lU7ERwjAMFCOwQmbJCKFIQQtFGorccS5oUnApU9B4hayQFViBFVgh/Ecm
|
||||
Z8cmcAd3wlEkvaV/ZTOOo/z1I8DbRIoBtvXfLeJ2GZuLtZMCf9c2BYDYgfEfACxATBYlSvEUOX0FaEUI
|
||||
YPtF62ft7rY+go5hHgrS7NxYWy2uCRzxE3DgCnKRjskP56Orkv45yU2asKMbpcPJ2839ozKfJTMgbSKU
|
||||
t0ekztKvaA7ibixOyvoLADqYiGMXHIUWy7uQa+cSuZGUDb7FswWYwclx9oES/hqzGAmV1UTdSPiQ8Uqw
|
||||
DCdiNtgFHwAtVpjbIvESaA4ZqUrP2xELFPEBUMwlqmH7iDiNNQAph2DskIMaIF16YfCVIoZOmtyveQF9
|
||||
2CVVWYKhQwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="btnListUsers.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
@ -180,19 +186,13 @@
|
||||
hNwGBmaHAP5n4G8q6gFdoZLjBpE7j5KJdaRlAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="btnDelelete.SuperTooltip" xml:space="preserve">
|
||||
<value>Will delete the current step and any of its substseps, RNOs, etc. Checks whether any transitions are pointing to this step from outside the step and if found, does not allow delete, but prompts user with list of transitions.</value>
|
||||
</data>
|
||||
<data name="btnCut.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<data name="btnInsRO.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAScQAA
|
||||
EnEB89x6jgAAASBJREFUOE+lU7ERwjAMFCOwQmbJCKFIQQtFGorccS5oUnApU9B4hayQFViBFVgh/Ecm
|
||||
Z8cmcAd3wlEkvaV/ZTOOo/z1I8DbRIoBtvXfLeJ2GZuLtZMCf9c2BYDYgfEfACxATBYlSvEUOX0FaEUI
|
||||
YPtF62ft7rY+go5hHgrS7NxYWy2uCRzxE3DgCnKRjskP56Orkv45yU2asKMbpcPJ2839ozKfJTMgbSKU
|
||||
t0ekztKvaA7ibixOyvoLADqYiGMXHIUWy7uQa+cSuZGUDb7FswWYwclx9oES/hqzGAmV1UTdSPiQ8Uqw
|
||||
DCdiNtgFHwAtVpjbIvESaA4ZqUrP2xELFPEBUMwlqmH7iDiNNQAph2DskIMaIF16YfCVIoZOmtyveQF9
|
||||
2CVVWYKhQwAAAABJRU5ErkJggg==
|
||||
EnEB89x6jgAAAIBJREFUOE/FU9ESgCAIy///aAMU0DDYSxecV6KOObB1squRs3VyNY1Z4OWHATYTFHI1
|
||||
gp0RXdm+vlGoLC5zPowCHDeiAGkmhMHnAEFpDwwRjcFKV++/6xyLVgEk2UfhnuVTNsVBa5Njk8xV6c1k
|
||||
hNwGBmaHAP5n4G8q6gFdoZLjBpE7j5KJdaRlAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="btnCMCut.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
|
@ -28,7 +28,15 @@ namespace Volian.Controls.Library
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// VlnFlexGrid
|
||||
//
|
||||
this.Rows.DefaultSize = 19;
|
||||
((System.ComponentModel.ISupportInitialize)(this)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -16,6 +16,8 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
private TableCellEditor _tableCellEditor;
|
||||
private TableClipBoardFuncts _clpbrdCpyPste;
|
||||
private int _minSplitColWidth = 10;
|
||||
private int _minSplitRowHeight = 20;
|
||||
|
||||
#region Grid Initialize
|
||||
|
||||
@ -54,7 +56,7 @@ namespace Volian.Controls.Library
|
||||
this.Cols.Fixed = 0;
|
||||
|
||||
this.DrawMode = DrawModeEnum.OwnerDraw;
|
||||
this.ScrollBars = ScrollBars.None;
|
||||
this.ScrollBars = ScrollBars.None;
|
||||
|
||||
// grid styles
|
||||
this.Styles.EmptyArea.BackColor = Color.Transparent;
|
||||
@ -62,7 +64,7 @@ namespace Volian.Controls.Library
|
||||
this.Styles.Normal.Border.Color = Color.Black;
|
||||
this.Styles.Normal.TextAlign = C1.Win.C1FlexGrid.TextAlignEnum.LeftCenter;
|
||||
|
||||
SetupCellStyles();
|
||||
//SetupCellStyles();
|
||||
|
||||
this.FocusRect = FocusRectEnum.Solid;
|
||||
this.Styles.Highlight.BackColor = Color.LightCyan;
|
||||
@ -125,26 +127,28 @@ namespace Volian.Controls.Library
|
||||
|
||||
#region Grid and Cell Styles
|
||||
|
||||
//public void CellBackgroundYellow()
|
||||
//{
|
||||
// CellRange cr = this.Selection;
|
||||
// cr.Style = this.Styles["Yellow"];
|
||||
//}
|
||||
|
||||
public void ChangeBackgroundColor(string bckgndColor)
|
||||
{
|
||||
CellRange cr = this.Selection;
|
||||
string stylename = string.Format("R{0}C{1}Style", cr.r1, cr.c1);
|
||||
if (!bckgndColor.EndsWith(";"))
|
||||
bckgndColor+=";";
|
||||
string strBckgndColor = string.Format("BackColor:{0}", bckgndColor);
|
||||
CellStyle cs = this.Styles.Add(stylename, cr.Style);
|
||||
cs.ParseString(strBckgndColor);
|
||||
cr.Style = cs;
|
||||
|
||||
for (int rw = cr.r1; rw <= cr.r2; rw++)
|
||||
for (int cl = cr.c1; cl <= cr.c2; cl++)
|
||||
{
|
||||
CellRange tmp = this.GetCellRange(rw, cl, rw, cl);
|
||||
string StyleName = string.Format("R{0}C{1}Style", rw, cl);
|
||||
CellStyle cs = this.Styles.Add(StyleName, tmp.Style);
|
||||
cs.ParseString(strBckgndColor);
|
||||
tmp.Style = cs;
|
||||
}
|
||||
}
|
||||
|
||||
public void ToggleCellTextAlignment()
|
||||
{
|
||||
// only used in test program
|
||||
CellRange cr = this.Selection;
|
||||
StepRTB srtb = new StepRTB();
|
||||
srtb.Rtf = this.GetCellRTFString(cr.r1, cr.c1);
|
||||
@ -157,119 +161,71 @@ namespace Volian.Controls.Library
|
||||
this.PutCellRTFString(cr.r1, cr.c1, srtb.Rtf);
|
||||
}
|
||||
|
||||
public void TableBorderNone()
|
||||
public void RTFTextAlignment(CellRange cr, HorizontalAlignment ha)
|
||||
{
|
||||
this.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None;
|
||||
StepRTB srtb = new StepRTB();
|
||||
for (int rw = cr.r1; rw <= cr.r2; rw++)
|
||||
for (int cl = cr.c1; cl <= cr.c2; cl++)
|
||||
{
|
||||
srtb.Rtf = this.GetCellRTFString(rw, cl);
|
||||
srtb.SelectAll();
|
||||
srtb.SelectionAlignment = ha;
|
||||
this.PutCellRTFString(rw, cl, srtb.Rtf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetTableBorder(C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum border)
|
||||
{
|
||||
this.BorderStyle = border;
|
||||
this.AdjustGridControlSize();
|
||||
}
|
||||
|
||||
public void TableBorderFixedSingle()
|
||||
|
||||
public void ChangeCellBorder(CellRange cr, BorderStyleEnum newBorder)
|
||||
{
|
||||
this.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.FixedSingle;
|
||||
this.AdjustGridControlSize();
|
||||
for (int rw = cr.r1; rw <= cr.r2; rw++)
|
||||
for (int col = cr.c1; col <= cr.c2; col++)
|
||||
{
|
||||
CellRange tmp = this.GetCellRange(rw, col, rw, col);
|
||||
string StyleName = string.Format("R{0}C{1}Style", rw, col);
|
||||
CellStyle cs = this.Styles.Add(StyleName, tmp.Style);
|
||||
cs.Border.Style = newBorder;
|
||||
tmp.Style = cs;
|
||||
}
|
||||
}
|
||||
|
||||
public void TableBorderFixed3d()
|
||||
{
|
||||
this.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Fixed3D;
|
||||
this.AdjustGridControlSize();
|
||||
}
|
||||
|
||||
//public void SetupCellStyles()
|
||||
//{
|
||||
// //CellStyle cs;
|
||||
|
||||
public void TableBorderLight3D()
|
||||
{
|
||||
this.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
|
||||
this.AdjustGridControlSize();
|
||||
}
|
||||
|
||||
public void TableBorderXpThemes()
|
||||
{
|
||||
this.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.XpThemes;
|
||||
this.AdjustGridControlSize();
|
||||
}
|
||||
|
||||
private CellRange GetSelectedCellRange()
|
||||
{
|
||||
return this.GetCellRange(this.Selection.TopRow, this.Selection.LeftCol, this.Selection.BottomRow, this.Selection.RightCol);
|
||||
}
|
||||
|
||||
public void SelectedCellsBorderNone()
|
||||
{
|
||||
CellRange cr = GetSelectedCellRange();
|
||||
cr.Style = this.Styles["None"];
|
||||
}
|
||||
|
||||
public void SelectedCellsBorderFlat()
|
||||
{
|
||||
CellRange cr = this.GetCellRange(this.Selection.TopRow, this.Selection.LeftCol, this.Selection.BottomRow, this.Selection.RightCol);
|
||||
cr.Style = this.Styles["Flat"];
|
||||
}
|
||||
|
||||
public void SelectedCellsBorderDouble()
|
||||
{
|
||||
CellRange cr = this.GetCellRange(this.Selection.TopRow, this.Selection.LeftCol, this.Selection.BottomRow, this.Selection.RightCol);
|
||||
cr.Style = this.Styles["Double"];
|
||||
}
|
||||
|
||||
public void SelectedCellsBorderRaised()
|
||||
{
|
||||
CellRange cr = this.GetCellRange(this.Selection.TopRow, this.Selection.LeftCol, this.Selection.BottomRow, this.Selection.RightCol);
|
||||
cr.Style = this.Styles["Raised"];
|
||||
}
|
||||
|
||||
public void SelectedCellsBorderInset()
|
||||
{
|
||||
CellRange cr = this.GetCellRange(this.Selection.TopRow, this.Selection.LeftCol, this.Selection.BottomRow, this.Selection.RightCol);
|
||||
cr.Style = this.Styles["Inset"];
|
||||
}
|
||||
|
||||
public void SelectedCellsBorderGroove()
|
||||
{
|
||||
CellRange cr = this.GetCellRange(this.Selection.TopRow, this.Selection.LeftCol, this.Selection.BottomRow, this.Selection.RightCol);
|
||||
cr.Style = this.Styles["Groove"];
|
||||
}
|
||||
|
||||
public void SelectedCellsBorderFillet()
|
||||
{
|
||||
CellRange cr = this.GetCellRange(this.Selection.TopRow, this.Selection.LeftCol, this.Selection.BottomRow, this.Selection.RightCol);
|
||||
cr.Style = this.Styles["Fillet"];
|
||||
}
|
||||
|
||||
public void SelectedCellsBorderDotted()
|
||||
{
|
||||
CellRange cr = this.GetCellRange(this.Selection.TopRow, this.Selection.LeftCol, this.Selection.BottomRow, this.Selection.RightCol);
|
||||
cr.Style = this.Styles["Dotted"];
|
||||
}
|
||||
|
||||
public void SetupCellStyles()
|
||||
{
|
||||
CellStyle cs;
|
||||
|
||||
//cs = this.Styles.Add("Dotted");
|
||||
//cs.Border.Style = BorderStyleEnum.Dotted;
|
||||
//cs = this.Styles.Add("Double");
|
||||
//cs.Border.Style = BorderStyleEnum.Double;
|
||||
//cs = this.Styles.Add("Fillet");
|
||||
//cs.Border.Style = BorderStyleEnum.Fillet;
|
||||
//cs = this.Styles.Add("Flat");
|
||||
//cs.Border.Style = BorderStyleEnum.Flat;
|
||||
//cs = this.Styles.Add("Groove");
|
||||
//cs.Border.Style = BorderStyleEnum.Groove;
|
||||
//cs = this.Styles.Add("Inset");
|
||||
//cs.Border.Style = BorderStyleEnum.Inset;
|
||||
//cs = this.Styles.Add("None");
|
||||
//cs.Border.Style = BorderStyleEnum.None;
|
||||
//cs = this.Styles.Add("Raised");
|
||||
//cs.Border.Style = BorderStyleEnum.Raised;
|
||||
//cs = this.Styles.Add("CenterRight");
|
||||
//cs.TextAlign = TextAlignEnum.RightCenter; //.LeftCenter; // this is being ignored - probably due to RTF conversion
|
||||
//cs = this.Styles.Add("Yellow");
|
||||
//cs.BackColor = Color.Yellow;
|
||||
//cs = this.Styles.Add("Margins");
|
||||
//cs.Margins.Bottom = 5;
|
||||
//cs.Margins.Top = 10;
|
||||
//cs.Margins.Left = 15;
|
||||
//cs.Margins.Right = 20;
|
||||
}
|
||||
// //cs = this.Styles.Add("Dotted");
|
||||
// //cs.Border.Style = BorderStyleEnum.Dotted;
|
||||
// //cs = this.Styles.Add("Double");
|
||||
// //cs.Border.Style = BorderStyleEnum.Double;
|
||||
// //cs = this.Styles.Add("Fillet");
|
||||
// //cs.Border.Style = BorderStyleEnum.Fillet;
|
||||
// //cs = this.Styles.Add("Flat");
|
||||
// //cs.Border.Style = BorderStyleEnum.Flat;
|
||||
// //cs = this.Styles.Add("Groove");
|
||||
// //cs.Border.Style = BorderStyleEnum.Groove;
|
||||
// //cs = this.Styles.Add("Inset");
|
||||
// //cs.Border.Style = BorderStyleEnum.Inset;
|
||||
// //cs = this.Styles.Add("None");
|
||||
// //cs.Border.Style = BorderStyleEnum.None;
|
||||
// //cs = this.Styles.Add("Raised");
|
||||
// //cs.Border.Style = BorderStyleEnum.Raised;
|
||||
// //cs = this.Styles.Add("CenterRight");
|
||||
// //cs.TextAlign = TextAlignEnum.RightCenter; //.LeftCenter; // this is being ignored - probably due to RTF conversion
|
||||
// //cs = this.Styles.Add("Yellow");
|
||||
// //cs.BackColor = Color.Yellow;
|
||||
// //cs = this.Styles.Add("Margins");
|
||||
// //cs.Margins.Bottom = 5;
|
||||
// //cs.Margins.Top = 10;
|
||||
// //cs.Margins.Left = 15;
|
||||
// //cs.Margins.Right = 20;
|
||||
//}
|
||||
#endregion //Grid and Cell Styles
|
||||
|
||||
#region Grid Size Adjustments
|
||||
@ -543,19 +499,93 @@ namespace Volian.Controls.Library
|
||||
|
||||
public void MergeSelection()
|
||||
{
|
||||
//string tstr = "";
|
||||
//C1.Win.C1FlexGrid.CellRange sel = this.Selection;
|
||||
//tstr = sel.Clip; // clip hold the data for the selected cells (used for un-merge)
|
||||
this.MergedRanges.Add(this.Selection);
|
||||
this.Invalidate();
|
||||
}
|
||||
|
||||
public void SplitSelection()
|
||||
public void SplitSelection(bool bSplitCols)
|
||||
{
|
||||
C1.Win.C1FlexGrid.CellRange sel = this.GetMergedRange(this.Selection.r1, this.Selection.c1);
|
||||
if (this.MergedRanges.Contains(sel))
|
||||
this.MergedRanges.Remove(sel);
|
||||
this.Invalidate();
|
||||
else //split cells
|
||||
{
|
||||
if (bSplitCols)
|
||||
SplitSelectionColumns();
|
||||
else
|
||||
SplitSelectionRows();
|
||||
}
|
||||
this.Refresh();
|
||||
this.AdjustGridControlSize();
|
||||
}
|
||||
|
||||
private void SplitSelectionColumns()
|
||||
{
|
||||
CellRange cr = this.Selection;
|
||||
int numSelCols = (cr.c2 - cr.c1) + 1;
|
||||
// for each column in the selection, add a new column
|
||||
for (int c = cr.c2; c >= cr.c1; c--)
|
||||
InsertColumnAfter();
|
||||
// include new columns in selection
|
||||
this.Select(cr.r1, cr.c1, cr.r2, cr.c2 + numSelCols);
|
||||
cr = this.Selection;
|
||||
for (int r = 0; r < this.Rows.Count; r++)
|
||||
for (int c = cr.c1; c <= cr.c2; c += 2)
|
||||
{
|
||||
if (!this.IsCellSelected(r, c))
|
||||
{
|
||||
//this.Select(r, c, r, c + 1);
|
||||
CellRange tcr = this.GetCellRange(r, c, r, c+1);
|
||||
this.MergedRanges.Add(tcr);
|
||||
}
|
||||
}
|
||||
//this.Select(cr);
|
||||
// Adjust selected column widths
|
||||
for (int c = cr.c1; c <= cr.c2; c++)
|
||||
{
|
||||
int recWidth = this.GetCellRect(cr.r1, c).Width;
|
||||
this.Cols[c].Width = Math.Max(recWidth / 2, _minSplitColWidth);
|
||||
//Console.WriteLine("Cell[{0},{1}].Width = {2}", cr.r1, c, recWidth);
|
||||
}
|
||||
}
|
||||
|
||||
private void SplitSelectionRows()
|
||||
{
|
||||
CellRange cr = this.Selection;
|
||||
int numSelRows = (cr.r2 - cr.r1) + 1;
|
||||
//Console.WriteLine("numSelRows = {0}", numSelRows);
|
||||
//Console.WriteLine("Inital Selection [{0},{1}] - [{2},{3}]", cr.r1, cr.c1, cr.r2, cr.c2);
|
||||
// for each row in the selection, add a new row
|
||||
for (int r = cr.r2; r >= cr.r1; r--)
|
||||
{
|
||||
//Console.WriteLine("Inserted new Row at [{0},{1}]", r, cr.c1);
|
||||
InsertRowAfter();
|
||||
}
|
||||
// include new rows in selection
|
||||
this.Select(cr.r1, cr.c1, cr.r2 + numSelRows, cr.c2);
|
||||
cr = this.Selection;
|
||||
//Console.WriteLine(" After Insert [{0},{1}] - [{2},{3}]", cr.r1, cr.c1, cr.r2, cr.c2);
|
||||
for (int c = 0; c < this.Cols.Count; c++)
|
||||
for (int r = cr.r1; r <= cr.r2; r += 2)
|
||||
{
|
||||
if (!this.IsCellSelected(r, c))
|
||||
{
|
||||
CellRange tcr = this.GetCellRange(r, c, r + 1, c);
|
||||
this.MergedRanges.Add(tcr);
|
||||
//Console.WriteLine("cellrange {0}", tcr);
|
||||
//Console.WriteLine("merge [{0},{1}] - [{2},{3}]", r, c, r + 1, c);
|
||||
}
|
||||
}
|
||||
// Adjust selected Row Heights
|
||||
for (int r = cr.r1; r <= cr.r2; r++)
|
||||
{
|
||||
int recHeight = this.GetCellRect(r, cr.c1).Height;
|
||||
this.Rows[r].Height = Math.Max(recHeight / 2, _minSplitRowHeight);
|
||||
//Console.WriteLine("Cell[{0},{1}].Height = {2}", r, cr.c1, recHeight);
|
||||
}
|
||||
|
||||
//foreach (CellRange crng in this.MergedRanges)
|
||||
// Console.WriteLine("merge ranges [{0},{1}] - [{2},{3}]", crng.r1, crng.c1, crng.r2, crng.c2);
|
||||
}
|
||||
|
||||
private void AdjustMergedRows(int row, bool above, bool removing)
|
||||
@ -740,11 +770,18 @@ namespace Volian.Controls.Library
|
||||
private int GetRowInsertPosition(Boolean before)
|
||||
{
|
||||
int rtnrow;
|
||||
CellRange cr = this.Selection;
|
||||
CellRange selcr = this.Selection;
|
||||
CellRange cr = selcr;
|
||||
int idx = this.MergedRanges.IndexOf(cr.r1, cr.c2);
|
||||
if (idx > -1)
|
||||
cr = this.MergedRanges[idx]; // we want first or last row in merge range
|
||||
rtnrow = (before) ? cr.r1 : cr.r2;
|
||||
// The following is an adjustment needed when we are copying an entire row that includes some merged cells
|
||||
if (selcr.c1 != selcr.c2)
|
||||
{
|
||||
while (!before && rtnrow > selcr.r2) rtnrow--;
|
||||
while (before && rtnrow < selcr.r2) rtnrow++;
|
||||
}
|
||||
|
||||
return rtnrow;
|
||||
}
|
||||
@ -752,12 +789,18 @@ namespace Volian.Controls.Library
|
||||
private int GetColInsertPosition(Boolean before)
|
||||
{
|
||||
int rtncol;
|
||||
CellRange cr = this.Selection;
|
||||
CellRange selcr = this.Selection;
|
||||
CellRange cr = selcr;
|
||||
int idx = this.MergedRanges.IndexOf(cr.r1, cr.c2);
|
||||
if (idx > -1)
|
||||
cr = this.MergedRanges[idx]; // we want the first of last col in merge range
|
||||
rtncol = (before) ? cr.c1 : cr.c2;
|
||||
|
||||
// The following is an adjustment needed when we are copying an entire column that includes some merged cells
|
||||
if (selcr.r1 != selcr.r2)
|
||||
{
|
||||
while (!before && rtncol > selcr.c2) rtncol--;
|
||||
while (before && rtncol < selcr.c2) rtncol++;
|
||||
}
|
||||
return rtncol;
|
||||
}
|
||||
|
||||
@ -765,6 +808,8 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
int newcol = this.GetColInsertPosition(true);
|
||||
this.Cols.Insert(newcol);
|
||||
// set new column width to same width as column from where it was inserted
|
||||
this.Cols[newcol].Width = this.Cols[newcol + 1].Width;
|
||||
this.AdjustMergedColumns(newcol, true, false);
|
||||
this.AdjustGridControlSize();
|
||||
}
|
||||
@ -776,6 +821,8 @@ namespace Volian.Controls.Library
|
||||
this.Cols.Add(1);
|
||||
else
|
||||
this.Cols.Insert(colidx + 1);
|
||||
// set new column width to same width as column from where it was inserted
|
||||
this.Cols[colidx + 1].Width = this.Cols[colidx].Width;
|
||||
this.AdjustMergedColumns(colidx + 1, false, false);
|
||||
this.AdjustGridControlSize();
|
||||
}
|
||||
@ -784,6 +831,8 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
int newrow = this.GetRowInsertPosition(true);
|
||||
this.Rows.Insert(newrow);
|
||||
// set new row Height to same heidht as row from where it was inserted
|
||||
this.Rows[newrow].Height = this.Rows[newrow+1].Height;
|
||||
this.AdjustMergedRows(newrow, true, false);
|
||||
this.AdjustGridControlSize();
|
||||
}
|
||||
@ -795,6 +844,8 @@ namespace Volian.Controls.Library
|
||||
this.Rows.Add(1);
|
||||
else
|
||||
this.Rows.Insert(rowidx + 1);
|
||||
// set new row Height to same heidht as row from where it was inserted
|
||||
this.Rows[rowidx + 1].Height = this.Rows[rowidx].Height;
|
||||
this.AdjustMergedRows(rowidx + 1, false, false);
|
||||
this.AdjustGridControlSize();
|
||||
}
|
||||
@ -978,6 +1029,11 @@ namespace Volian.Controls.Library
|
||||
|
||||
if (aryCellList != null && aryCellList.Count > 0)
|
||||
{
|
||||
// Since we're pasting an entire row, make sure the current selection includes
|
||||
// all the columns to ensure proper logic path when inserting a new (empty) row
|
||||
this.SelectionMode = SelectionModeEnum.Row;
|
||||
this.Select(this.Selection.r1, 0, this.Selection.r2, this.Cols.Count - 1, true);
|
||||
this.SelectionMode = SelectionModeEnum.Default;
|
||||
// get row/column starting position in which new rows will be added
|
||||
int startrow = this.Selection.r1 + ((pp == enmPastePos.After) ? 1 : 0);
|
||||
int startcol = this.Selection.c1;
|
||||
@ -1004,19 +1060,24 @@ namespace Volian.Controls.Library
|
||||
|
||||
if (aryCellList != null && aryCellList.Count > 0)
|
||||
{
|
||||
// Since we're pasting an entire column, make sure the current selection includes
|
||||
// all the rows to ensure proper logic path when inserting a new (empty) column
|
||||
this.SelectionMode = SelectionModeEnum.Column;
|
||||
this.Select(0, this.Selection.c1, this.Rows.Count - 1, this.Selection.c2, true);
|
||||
this.SelectionMode = SelectionModeEnum.Default;
|
||||
// get row/column starting position in which new rows will be added
|
||||
int startrow = 0;//grd.Selection.r1+((pp == enmPastePos.After) ? 1 : 0);
|
||||
int startcol = this.Selection.c1 + ((pp == enmPastePos.After) ? 1 : 0);
|
||||
// get the number of rows needed based on what was save to the clipboard
|
||||
// get the number of columns needed based on what was save to the clipboard
|
||||
int numcols = Math.Max(1, (aryCellList.Count / this.Rows.Count));
|
||||
// insert that number of new rows.
|
||||
if (pp != enmPastePos.Replace) // insert new rows before or after
|
||||
// insert that number of new columns.
|
||||
if (pp != enmPastePos.Replace) // insert new columns before or after
|
||||
for (int c = 0; c < numcols; c++)
|
||||
if (pp == enmPastePos.After) // create new rows after
|
||||
if (pp == enmPastePos.After) // create new columns after
|
||||
this.InsertColumnAfter();
|
||||
else
|
||||
this.InsertColumnBefore();
|
||||
// copy each grid cell text (aryCellList) into the newly inserted rows
|
||||
// copy each grid cell text (aryCellList) into the newly inserted colmns
|
||||
this.CopyTextFromCellRange(aryCellList, startrow, startcol, startrow + this.Rows.Count - 1, startcol + numcols - 1);
|
||||
this.AdjustGridControlSize();
|
||||
}
|
||||
@ -1417,6 +1478,22 @@ namespace Volian.Controls.Library
|
||||
|
||||
}
|
||||
#endregion //Bug Work Around
|
||||
|
||||
//public void CenterTheCellText()
|
||||
//{
|
||||
// // Cannot use this type of text allignment with RTF text cells
|
||||
// CellRange cr = this.Selection;
|
||||
// for (int rw = cr.r1; rw <= cr.r2; rw++)
|
||||
// for (int col = cr.c1; col <= cr.c2; col++)
|
||||
// {
|
||||
// CellRange tmp = this.GetCellRange(rw, col, rw, col);
|
||||
// string StyleName = string.Format("R{0}C{1}Style", rw, col);
|
||||
// CellStyle cs = this.Styles.Add(StyleName, tmp.Style);
|
||||
// cs.TextAlign = TextAlignEnum.CenterCenter;
|
||||
// tmp.Style = cs;
|
||||
// }
|
||||
|
||||
//}
|
||||
}
|
||||
#region RTF Class for Cell rendering
|
||||
class RTF : StepRTB //RichTextBox
|
||||
@ -1811,6 +1888,7 @@ namespace Volian.Controls.Library
|
||||
// Clip get the value (text) of all the cells in the selected range
|
||||
// This is saved as one RTF string.
|
||||
Clipboard.SetDataObject(cr.Clip, true); // the "true" make the copy persistent
|
||||
//Console.WriteLine("\nClip: '{0}' \n'{1}'", cr.Clip,cr.DataDisplay);
|
||||
}
|
||||
|
||||
public ArrayList Get()
|
||||
@ -1829,40 +1907,77 @@ namespace Volian.Controls.Library
|
||||
// This function will separate each cell text and place them in an array.
|
||||
// This allow the clipboard information to be pasted independently from
|
||||
// how it was selected.
|
||||
|
||||
|
||||
// Bug fix: the CellRange.Clip (see cr.clip in the Put() function above) is replacing
|
||||
// new lines with spaces. We need to put them back.
|
||||
instr = instr.Replace(@"}} \", "}}\r\n\\");
|
||||
string tstr = ""; // this will contain the parsed out cell text
|
||||
ArrayList arylstCellStrings = new ArrayList();
|
||||
int sidx = 0; // start index
|
||||
int tidx = 0;
|
||||
if (instr != null)
|
||||
{
|
||||
int idx = instr.IndexOf("\r\n\t"); // cell boarder
|
||||
if (idx < 0) idx = instr.IndexOf("\r\n\r"); // new line (needed for multiple lines in one cell)
|
||||
int idx = instr.IndexOf(@"{\rtf",sidx+1); // cell boarder
|
||||
while (idx > 0)
|
||||
{
|
||||
tstr = instr.Substring(sidx, idx - sidx);
|
||||
tidx = tstr.IndexOf("\r\n\r");
|
||||
if (tidx > 0)
|
||||
{
|
||||
idx = instr.IndexOf("\r\n\r", sidx);
|
||||
tstr = instr.Substring(sidx, idx - sidx);
|
||||
}
|
||||
arylstCellStrings.Add(tstr.Substring(tstr.IndexOf("{\\rtf")));
|
||||
sidx = idx + 3;
|
||||
if (sidx < instr.Length)
|
||||
{
|
||||
idx = instr.IndexOf("\r\n\t", sidx);
|
||||
if (idx < 0) idx = instr.IndexOf("\r\n\r", sidx);
|
||||
}
|
||||
tstr = tstr.Substring(0, tstr.LastIndexOf('}') + 1);
|
||||
//Console.WriteLine("\ntstr: '{0}'", tstr);
|
||||
arylstCellStrings.Add(tstr);
|
||||
sidx = idx;
|
||||
idx = instr.IndexOf(@"{\rtf",sidx+1);
|
||||
}
|
||||
if (sidx < instr.Length)
|
||||
{
|
||||
tstr = instr.Substring(sidx);
|
||||
arylstCellStrings.Add(tstr.Substring(tstr.IndexOf("{\\rtf")));
|
||||
arylstCellStrings.Add(tstr);
|
||||
}
|
||||
}
|
||||
return arylstCellStrings;
|
||||
}
|
||||
|
||||
//private ArrayList GetCellStrings(string instr)
|
||||
//{
|
||||
// // The table cells placed on the clipboard is saved as one long RTF string.
|
||||
// // "\r\n\t" defines a cell border
|
||||
// // "\r\n\r" defines beginning of next line (row)
|
||||
// // This function will separate each cell text and place them in an array.
|
||||
// // This allow the clipboard information to be pasted independently from
|
||||
// // how it was selected.
|
||||
|
||||
// string tstr = ""; // this will contain the parsed out cell text
|
||||
// ArrayList arylstCellStrings = new ArrayList();
|
||||
// int sidx = 0; // start index
|
||||
// int tidx = 0;
|
||||
// if (instr != null)
|
||||
// {
|
||||
// int idx = instr.IndexOf("\r\n\t"); // cell boarder
|
||||
// if (idx < 0) idx = instr.IndexOf("\r\n\r"); // new line (needed for multiple lines in one cell)
|
||||
// while (idx > 0)
|
||||
// {
|
||||
// tstr = instr.Substring(sidx, idx - sidx);
|
||||
// tidx = tstr.IndexOf("\r\n\r");
|
||||
// if (tidx > 0)
|
||||
// {
|
||||
// idx = instr.IndexOf("\r\n\r", sidx);
|
||||
// tstr = instr.Substring(sidx, idx - sidx);
|
||||
// }
|
||||
// arylstCellStrings.Add(tstr.Substring(tstr.IndexOf("{\\rtf")));
|
||||
// sidx = idx + 3;
|
||||
// if (sidx < instr.Length)
|
||||
// {
|
||||
// idx = instr.IndexOf("\r\n\t", sidx);
|
||||
// if (idx < 0) idx = instr.IndexOf("\r\n\r", sidx);
|
||||
// }
|
||||
// }
|
||||
// if (sidx < instr.Length)
|
||||
// {
|
||||
// tstr = instr.Substring(sidx);
|
||||
// arylstCellStrings.Add(tstr.Substring(tstr.IndexOf("{\\rtf")));
|
||||
// }
|
||||
// }
|
||||
// return arylstCellStrings;
|
||||
//}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
|
123
PROMS/Volian.Controls.Library/VlnFlexGrid.resx
Normal file
123
PROMS/Volian.Controls.Library/VlnFlexGrid.resx
Normal file
@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
</root>
|
Loading…
x
Reference in New Issue
Block a user