This commit is contained in:
John Jenko 2011-03-10 13:32:26 +00:00
parent a67f3dc6c7
commit b43ea73257
7 changed files with 775 additions and 645 deletions

View File

@ -175,6 +175,20 @@ namespace VEPROMS.CSLA.Library
if (ROID.StartsWith("FFFF")) return string.Format("Invalid Unit RO '{0}'", ROID);
return string.Format("Invalid RO '{0}'",ROID);
}
public rochild GetRoChild12(string ROID16)
{
string ROID = ROID16.Substring(0, 12);
if (dicRos == null) ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup);
// Use the ROID to get the value from the dictionary
if (dicRos.ContainsKey(ROID))
{
rochild rochld = (rochild)dicRos[ROID];
return rochld;
}
rochild tmp = new rochild();
tmp.ID = -1;
return tmp;
}
public rochild GetRoChild(string ROID)
{
if (dicRos == null) ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup);

View File

@ -83,6 +83,9 @@ namespace Volian.Controls.Library
CopyStep();
}
break;
case Keys.Delete:
MyFlexGrid.ClearSelectedCellText();
break;
}
}
void SetMenu(string contentMenu)
@ -90,7 +93,7 @@ namespace Volian.Controls.Library
if (contentMenu == null)
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ClearContextMenu();
else if (contentMenu == "OpenContextMenu")
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetContextMenu();
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetGridCellContextMenu(); //.SetContextMenu();
else
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetShortCutContextMenu(contentMenu);
}
@ -174,10 +177,15 @@ namespace Volian.Controls.Library
void MyFlexGrid_Click(object sender, EventArgs e)
{
MyFlexGrid.Focus();
//MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ToggleTableDesignButtons(false);
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetRibbonForGrid();
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetTableButtonsForMergeRangeSelection();
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetGridContextMenu();
}
void MyStepRTB_EditModeChanged(object sender, EventArgs args)
{
AdjustColorsForEditMode();
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetRibbonForGrid();
}
private void AdjustColorsForEditMode()

View File

@ -27,8 +27,8 @@ namespace Volian.Controls.Library
public EditItem MyEditItem
{
get { return _MyEditItem; }
set
{
set
{
_MyEditItem = value;
if (value != null)
{
@ -57,7 +57,7 @@ namespace Volian.Controls.Library
}
}
private ItemInfo MyItemInfo
{ get { return _MyStepRTB==null?null:_MyStepRTB.MyItemInfo; } }
{ get { return _MyStepRTB == null ? null : _MyStepRTB.MyItemInfo; } }
private DevComponents.DotNetBar.ButtonItem _DefaultContextMenu;
@ -69,6 +69,15 @@ namespace Volian.Controls.Library
{
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfEdit);
}
public void SetGridCellContextMenu()
{
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfCellEdit);
}
public void SetGridContextMenu()
{
if (rtabTableGridTools.Visible)
_ContextMenuBar.SetContextMenuEx(MyFlexGrid, btnCMGrid);
}
public void OpenContextMenu(Point loc)
{
btnCMRtfEdit.Popup(loc);
@ -78,8 +87,8 @@ namespace Volian.Controls.Library
public StepRTB MyStepRTB
{
get { return _MyStepRTB; }
set
{
set
{
_MyStepRTB = value;
if (value != null)
{
@ -87,8 +96,17 @@ namespace Volian.Controls.Library
switch (_MyStepRTB.FieldToEdit)
{
case E_FieldToEdit.StepText:
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfEdit);
_DefaultContextMenu = btnCMRtfEdit;
if (MyFlexGrid != null)
{
// This happends when the FlexGrid (table) is slected (not when you edit a table cell)
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfCellEdit);
_DefaultContextMenu = btnCMRtfCellEdit;
}
else
{
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfEdit);
_DefaultContextMenu = btnCMRtfEdit;
}
break;
case E_FieldToEdit.Text:
case E_FieldToEdit.Number:
@ -104,7 +122,8 @@ namespace Volian.Controls.Library
//_MyStepRTB.KeyUp += new KeyEventHandler(_MyStepRTB_KeyUp); //+= new KeyEventHandler(MyStepRTB_SelectionChanged);
_MyStepRTB.SelectionChanged += new EventHandler(_MyStepRTB_SelectionChanged);
//_MyStepRTB.ModeChange += new StepRTBModeChangeEvent(_MyStepRTB_ModeChange);
_MyStepRTB.Leave += new EventHandler(MyStepRTB_Leave);
_MyEditItem.Leave += new EventHandler(_MyEditItem_Leave);
//_MyStepRTB.Leave += new EventHandler(_MyStepRTB_Leave);
_MyStepRTB.LinkChanged += new StepRTBLinkEvent(_MyStepRTB_LinkChanged);
// 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
@ -124,15 +143,28 @@ namespace Volian.Controls.Library
}
BuildSymbolGallery(sl, galleryContainerSymbolsCM);
BuildSymbolGallery(sl, galleryContainerSymbolsCM3);
BuildSymbolGallery(sl, galleryContainerSymbolsGrid);
}
SetButtonAndMenuEnabling(true);
SetStepButtonAndMenuEnabling(true);
_MyLastFormatID = MyItemInfo.ActiveFormat.FormatID;
}
}
}
void _MyEditItem_Leave(object sender, EventArgs e)
{
// The following two lines were replaced by the third line so that the Ribbon KeyTips will work properly.
// ex. Positon on a substep, press <shift><F6> <N> <S> <S>, to list the substep types
//_MyStepRTB.KeyUp -=new KeyEventHandler(_MyStepRTB_KeyUp);
//_MyStepRTB.MouseUp -= new MouseEventHandler(_MyStepRTB_MouseUp);
_MyStepRTB.SelectionChanged -= new EventHandler(_MyStepRTB_SelectionChanged);
_MyEditItem.Leave += new EventHandler(_MyEditItem_Leave);
//_MyStepRTB.Leave -= new EventHandler(_MyStepRTB_Leave);
_MyStepRTB.LinkChanged -= new StepRTBLinkEvent(_MyStepRTB_LinkChanged);
}
void _MyStepRTB_SelectionChanged(object sender, EventArgs e)
{
SetButtonAndMenuEnabling(false);
@ -197,7 +229,7 @@ namespace Volian.Controls.Library
public bool Expanded
{
get { return _RibbonControl.Expanded; }
set{ _RibbonControl.Expanded = value; }
set { _RibbonControl.Expanded = value; }
}
#endregion
#region Events
@ -223,21 +255,22 @@ namespace Volian.Controls.Library
btnCMEditRO.Enabled = false;
}
}
void MyStepRTB_Leave(object sender, EventArgs e)
void _MyStepRTB_Leave(object sender, EventArgs e)
{
// The following two lines were replaced by the third line so that the Ribbon KeyTips will work properly.
// ex. Positon on a substep, press <shift><F6> <N> <S> <S>, to list the substep types
//_MyStepRTB.KeyUp -=new KeyEventHandler(_MyStepRTB_KeyUp);
//_MyStepRTB.MouseUp -= new MouseEventHandler(_MyStepRTB_MouseUp);
_MyStepRTB.SelectionChanged -=new EventHandler(_MyStepRTB_SelectionChanged);
_MyStepRTB.Leave -= new EventHandler(MyStepRTB_Leave);
_MyStepRTB.SelectionChanged -= new EventHandler(_MyStepRTB_SelectionChanged);
_MyStepRTB.Leave -= new EventHandler(_MyStepRTB_Leave);
_MyStepRTB.LinkChanged -= new StepRTBLinkEvent(_MyStepRTB_LinkChanged);
}
void btnInsStep_Click(object sender, EventArgs e)
{
DevComponents.DotNetBar.ButtonItem b = (DevComponents.DotNetBar.ButtonItem)sender;
if (b.Tag == null) return;
char [] sep = {' '};
char[] sep = { ' ' };
string[] insdata = b.Tag.ToString().Split(sep);
if (insdata.Length != 2) return;
int fromtype = Convert.ToInt32(insdata[0]);
@ -251,7 +284,7 @@ namespace Volian.Controls.Library
EditItem hlsEditItem = _MyEditItem;
while (!hlsEditItem.MyItemInfo.IsHigh)
hlsEditItem = hlsEditItem.ActiveParent;
hlsEditItem.AddSiblingAfter((int ?)contenttype,true);
hlsEditItem.AddSiblingAfter((int?)contenttype, true);
}
else
{
@ -308,6 +341,13 @@ namespace Volian.Controls.Library
btnUnderline.Enabled = btnCMUnderline.Enabled = (!((_MyStepRTB.MyStyleFont.Style & E_Style.Underline) == E_Style.Underline));
btnItalics.Enabled = btnCMItalics.Enabled = (!((_MyStepRTB.MyStyleFont.Style & E_Style.Italics) == E_Style.Italics));
}
public void SetTableButtonsForMergeRangeSelection()
{
if (MyFlexGrid != null)
{
btnTblDgnMergeCells.Enabled = btnCmGridMergeCells.Enabled = !MyFlexGrid.IsInMergeRange();
}
}
private void SetButtonMenuEnabledDisabledOnSelection(bool setting)
{
btnCMBold.Enabled = btnBold.Enabled = setting;
@ -352,7 +392,7 @@ namespace Volian.Controls.Library
else
{
SetButtonMenuEnabledDisabledOnSelection(true);
if (_MyStepRTB.SelectionFont != null)
{
btnCMBold.Checked = btnBold.Checked = RTBAPI.IsBold(_MyStepRTB);
@ -373,7 +413,7 @@ namespace Volian.Controls.Library
}
// all selected copy while in either Edit or View mode
btnCMCopy.Enabled = btnCopy.Enabled = _MyStepRTB.SelectionLength > 0;
// paste step only available if a step was copied. Also, check for valid types:
SetPasteButtonEnabled();
@ -381,7 +421,7 @@ namespace Volian.Controls.Library
btnCMGoTo.Enabled = btnGoTo.Enabled = _MyStepRTB.IsSelectionLinked(_MyStepRTB.SelectionStart, _MyStepRTB.SelectionLength); //(_MyStepRTB.MyLinkText != null);
if (btnCMGoTo.Enabled == true && _MyStepRTB.MyLinkText != null) // must have some link test, use it to set edit of transition or ro...
{
btnCMEditTran.Enabled = _MyStepRTB.MyLinkText.IndexOf("Transition")>-1; // selected link must be a transition
btnCMEditTran.Enabled = _MyStepRTB.MyLinkText.IndexOf("Transition") > -1; // selected link must be a transition
btnCMEditRO.Enabled = _MyStepRTB.MyLinkText.IndexOf("ReferencedObject") > -1; // selected link must be ro
}
else
@ -410,9 +450,9 @@ namespace Volian.Controls.Library
// when doing 'substep' part of paste, need to check if format allows subsection.
}
else if (tmp.MyDisplayTabControl.MyCopyStep.IsCautionPart || tmp.MyDisplayTabControl.MyCopyStep.IsNotePart)
// Part type of copied step must be same as Part type of destination, with exceptions of caution/note and step/rno
// can be pasted into each other.
// Part types are procedure - 1, section = 2, step = 6, caution = 3, note = 4, RNO (IsRNO), = 5 table/figure = 7.
// Part type of copied step must be same as Part type of destination, with exceptions of caution/note and step/rno
// can be pasted into each other.
// Part types are procedure - 1, section = 2, step = 6, caution = 3, note = 4, RNO (IsRNO), = 5 table/figure = 7.
btnPasteBefore.Enabled = btnPasteAfter.Enabled = btnPasteReplace.Enabled = (MyItemInfo.IsCautionPart || MyItemInfo.IsNotePart);
else if (tmp.MyDisplayTabControl.MyCopyStep.IsRNOPart || tmp.MyDisplayTabControl.MyCopyStep.IsStepPart)
btnPasteBefore.Enabled = btnPasteAfter.Enabled = btnPasteReplace.Enabled = (MyItemInfo.IsRNOPart || MyItemInfo.IsStepPart);
@ -437,7 +477,7 @@ namespace Volian.Controls.Library
DocVersionInfo dvi = MyEditItem.MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo;
if (dvi == null) return;
if (dvi.VersionType > 127)
btnCMEditMode1.Enabled = btnEditMode.Enabled = false; // in approved
btnCMEditMode1.Enabled = btnEditMode.Enabled = false; // in approved
if (dvi.VersionType > 127 || MyEditItem.MyStepPanel.VwMode == E_ViewMode.View)
{
SetButtonMenuEnabledDisabledOnStepType(false);
@ -453,21 +493,28 @@ namespace Volian.Controls.Library
btnInsPgBrk.Enabled = MyItemInfo.IsHigh;
btnEditMode.Checked = btnCMEditMode1.Checked = MyEditItem.MyStepPanel.VwMode == E_ViewMode.View;
// if on procedure, 'Delete' buttons should be disabled.
btnDelelete.Enabled = btnDelStep.Enabled = ! MyItemInfo.IsProcedure;
btnDelelete.Enabled = btnDelStep.Enabled = !MyItemInfo.IsProcedure;
btnCpyStp.Enabled = !MyItemInfo.IsProcedure;
if (!(MyEditItem is GridItem) && rtabTableGridTools.Checked)
// Only display the table edit tools if in a grid (table) and that grid (table) is not an RO Table.
GridItem tmpGridItm = MyEditItem as GridItem;
if (btnTblDgnAdjustSize.Checked)
{
btnTblDgnAdjustSize.Checked = false;
ToggleTableDesignButtons(true);
}
rtabTableGridTools.Visible = tmpGridItm != null && !tmpGridItm.MyFlexGrid.IsRoTable;
// If no longer on a table (grid) or the newly selectd table is an RO table
// then select the Home tab (since the Table tab is not visable)
if ((!(MyEditItem is GridItem) && rtabTableGridTools.Checked) || !rtabTableGridTools.Visible)
{
rtabHome.Select();
}
// Only display the table edit tools if in a grid (table) and that grid (table) is not an RO Table.
GridItem tmpGridItm = MyEditItem as GridItem;
rtabTableGridTools.Visible = tmpGridItm != null && !tmpGridItm.MyFlexGrid.IsRoTable;
// if on procedure or section, 'change type' & 'insert' buttons should be disabled.
if (MyItemInfo.IsProcedure || MyItemInfo.IsSection)
{
btnChgTyp.Enabled = false;
btnInsCaut.Enabled = btnInsNote.Enabled = btnInsRNO.Enabled = btnInsFig.Enabled =
btnInsTable.Enabled = btnInsSubstep.Enabled = btnInsBefore.Enabled = btnInsAfter.Enabled = false;
// if on a procedure or section title, don't allow for insert of ROs or Transitions:
@ -492,7 +539,7 @@ namespace Volian.Controls.Library
actable = sd.StepEditData.AcTable;
if (actable == null) actable = 0;
btnInsHLS.Enabled = true;
btnInsCaut.Enabled = (actable & E_AccStep.AddingCaution)>0;
btnInsCaut.Enabled = (actable & E_AccStep.AddingCaution) > 0;
btnInsNote.Enabled = (actable & E_AccStep.AddingNote) > 0;
btnInsRNO.Enabled = (actable & E_AccStep.AddingRNO) > 0;
btnInsFig.Enabled = (actable & E_AccStep.AddingTable) > 0;
@ -520,12 +567,12 @@ namespace Volian.Controls.Library
btnCMInsRNO.SubItems.Clear();
}
btnInsRNO.Enabled = btnCMInsRNO.Enabled = btnInsRNO.Enabled && (MyItemInfo.RNOs==null || MyItemInfo.RNOs.Count==0); // don't insert an RNO if has an RNO
btnInsRNO.Enabled = btnCMInsRNO.Enabled = btnInsRNO.Enabled && (MyItemInfo.RNOs == null || MyItemInfo.RNOs.Count == 0); // don't insert an RNO if has an RNO
// if (rno is enabled, set the tag:
if (btnInsRNO.Enabled)
btnInsRNO.Tag = string.Format("{0} {1}", (int)E_FromTypes.RNOs, MyEditItem.MyItemInfo.ActiveFormat.PlantFormat.FormatData.GetIndexFromType("RNOType"));
// add subitems depending on whether parent type is enabled:
if (btnInsHLS.Enabled) GalleryForSubTypes(MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.HLS, sd, btnInsHLS, 0, btnCMInsHLS, docontextmenus);
if (btnInsCaut.Enabled) GalleryForSubTypes(MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.Caution, sd, btnInsCaut, (int)E_FromType.Caution, btnCMInsCaution, docontextmenus);
@ -534,7 +581,7 @@ namespace Volian.Controls.Library
if (btnInsTable.Enabled) GalleryForSubTypes(MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.Table, sd, btnInsTable, (int)E_FromType.Table, btnCMInsTable, docontextmenus);
if (btnInsSubstep.Enabled) GalleryForSubTypes(MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.Substep, sd, btnInsSubstep, (int)E_FromType.Step, btnCMInsSubStps, docontextmenus);
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
@ -588,8 +635,8 @@ namespace Volian.Controls.Library
// if high level step, don't put the rno button on
// if caution don't add note button (the StepGetLevelTypes method returns cautions/notes together
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 == "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)
{
@ -679,7 +726,7 @@ namespace Volian.Controls.Library
{
_MyStepRTB.InsertIndent(MyEditItem.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IndentToken);
}
#endregion
#endregion
#region Home Tab
private void btnPaste_Click(object sender, EventArgs e)
{
@ -703,7 +750,7 @@ namespace Volian.Controls.Library
myDO.SetText(_MyStepRTB.SelectedText);
Clipboard.SetDataObject(myDO);
_MyStepRTB.SelectedText = "";
}
}
private void btnCopy_Click(object sender, EventArgs e)
{
Clipboard.Clear();
@ -824,47 +871,47 @@ namespace Volian.Controls.Library
}
#endregion
#region RHM debug
//#if DEBUG
// // The following code generates an XML output for the selected item for print testing.
// private void btnPageBreak_Click(object sender, EventArgs e)
// {
// // This is here temporarily to get a node and all of it's children for print testing.
// OutputAllChildren(MyRTBItem);
// }
// private void OutputAllChildren(RTBItem myRTBItem)
// {
// OutputAllChildren(myRTBItem.MyBeforeRTBItems);
// OutputStepInfo(myRTBItem);
// OutputAllChildren(myRTBItem.MyAfterRTBItems);
// OutputAllChildren(myRTBItem.MyRNORTBItems);
// }
// private void OutputStepInfo(RTBItem myRTBItem)
// {
// Label lbl = myRTBItem.MyLabel;
// if (lbl.Text.Trim() != "")
// Console.WriteLine("<text x='{0}In' y='{1}In' font-family='{2}' font-size='{3}Pt'>{4}</text>",
// ToInches(myRTBItem.Left + lbl.Left), ToInches(myRTBItem.Top + lbl.Top),
// lbl.Font.FontFamily.Name,lbl.Font.SizeInPoints,lbl.Text);
// StepRTB rtb = myRTBItem.MyStepRTB;
// Console.WriteLine("<foreignObject x='{0}In' y='{1}In' width='{2}In' " +
// "requiredExtensions='http://Volian.Com/EmbeddedRTF'>{3}</foreignObject>",
// ToInches(myRTBItem.Left + rtb.Left), ToInches(myRTBItem.Top + rtb.Top), ToInches(rtb.Width), myRTBItem.MyItemInfo.MyContent.Text);
//// ToInches(myRTBItem.Left + rtb.Left), ToInches(myRTBItem.Top + rtb.Top), ToInches(rtb.Width), rtb.Rtf);
// }
// private float ToInches(int val)
// {
// return Convert.ToSingle(val)/96F;
// }
//#if DEBUG
// // The following code generates an XML output for the selected item for print testing.
// private void btnPageBreak_Click(object sender, EventArgs e)
// {
// // This is here temporarily to get a node and all of it's children for print testing.
// OutputAllChildren(MyRTBItem);
// }
// private void OutputAllChildren(RTBItem myRTBItem)
// {
// OutputAllChildren(myRTBItem.MyBeforeRTBItems);
// OutputStepInfo(myRTBItem);
// OutputAllChildren(myRTBItem.MyAfterRTBItems);
// OutputAllChildren(myRTBItem.MyRNORTBItems);
// }
// private void OutputStepInfo(RTBItem myRTBItem)
// {
// Label lbl = myRTBItem.MyLabel;
// if (lbl.Text.Trim() != "")
// Console.WriteLine("<text x='{0}In' y='{1}In' font-family='{2}' font-size='{3}Pt'>{4}</text>",
// ToInches(myRTBItem.Left + lbl.Left), ToInches(myRTBItem.Top + lbl.Top),
// lbl.Font.FontFamily.Name,lbl.Font.SizeInPoints,lbl.Text);
// StepRTB rtb = myRTBItem.MyStepRTB;
// Console.WriteLine("<foreignObject x='{0}In' y='{1}In' width='{2}In' " +
// "requiredExtensions='http://Volian.Com/EmbeddedRTF'>{3}</foreignObject>",
// ToInches(myRTBItem.Left + rtb.Left), ToInches(myRTBItem.Top + rtb.Top), ToInches(rtb.Width), myRTBItem.MyItemInfo.MyContent.Text);
//// ToInches(myRTBItem.Left + rtb.Left), ToInches(myRTBItem.Top + rtb.Top), ToInches(rtb.Width), rtb.Rtf);
// }
// private float ToInches(int val)
// {
// return Convert.ToSingle(val)/96F;
// }
// private void OutputAllChildren(List<RTBItem> list)
// {
// if(list != null)
// foreach (RTBItem itm in list)
// OutputAllChildren(itm);
// }
// private void OutputAllChildren(List<RTBItem> list)
// {
// if(list != null)
// foreach (RTBItem itm in list)
// OutputAllChildren(itm);
// }
//#endif
//#endif
private void btnToggleEditView_Click(object sender, EventArgs e)
{
MyEditItem.MyStepPanel.VwMode = MyEditItem.MyStepPanel.VwMode == E_ViewMode.Edit ? E_ViewMode.View : E_ViewMode.Edit;
@ -884,7 +931,7 @@ namespace Volian.Controls.Library
MessageBox.Show("Could not find path to Ro Editor, check 'roapp' environment variable");
return;
}
if (MyDVI==null||MyDVI.DocVersionAssociationCount < 1)
if (MyDVI == null || MyDVI.DocVersionAssociationCount < 1)
{
MessageBox.Show("Could not find associated path for ro data.");
return;
@ -927,7 +974,7 @@ namespace Volian.Controls.Library
return;
}
Cursor = Cursors.WaitCursor;
using (DocVersion dv = DocVersion.Get(MyDVI.VersionID))
{
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
@ -1057,17 +1104,17 @@ namespace Volian.Controls.Library
DialogResult result = MessageBox.Show(msg, "Verify Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
if (!si.IsStepSection)
{
WordSectionEventArgs args = new WordSectionEventArgs(si);
MyEditItem.MyStepPanel.OnWordSectionClose(sender, args);
}
MyEditItem.RemoveItem();
if (!si.IsStepSection)
if (!si.IsStepSection)
{
WordSectionEventArgs args = new WordSectionEventArgs(si);
MyEditItem.MyStepPanel.OnWordSectionDeleted(sender, args);
MyEditItem.MyStepPanel.OnWordSectionDeleted(sender, args);
}
}
return;
@ -1227,8 +1274,8 @@ namespace Volian.Controls.Library
if (MyItemInfo.IsHigh)
{
if (MyEditItem != null && MyEditItem.NextDownEditItem != null && MyEditItem.NextDownEditItem.MyItemInfo.MyParent.Equals(MyEditItem.MyItemInfo))
//if (MyRTBItem.NextDownRTBItem.MyItemInfo.MyParent.ItemID == MyRTBItem.MyItemInfo.ItemID) //.Equals(MyRTBItem.MyItemInfo))
{
//if (MyRTBItem.NextDownRTBItem.MyItemInfo.MyParent.ItemID == MyRTBItem.MyItemInfo.ItemID) //.Equals(MyRTBItem.MyItemInfo))
{
MyStepRTB.StepRTB_ArrowPressed(E_ArrowKeys.CtrlDown);
InsertSiblingBeforeOrAfter("before");
}
@ -1307,7 +1354,7 @@ namespace Volian.Controls.Library
if (nextDownEditItem != null && nextDownEditItem.MyItemInfo.MyParent.ItemID == MyEditItem.MyID)
{
MyStepRTB.StepRTB_ArrowPressed(E_ArrowKeys.CtrlDown);
if(skipTable) MyStepRTB.StepRTB_ArrowPressed(E_ArrowKeys.CtrlDown);
if (skipTable) MyStepRTB.StepRTB_ArrowPressed(E_ArrowKeys.CtrlDown);
InsertSiblingBeforeOrAfter("before");
}
else
@ -1369,7 +1416,7 @@ namespace Volian.Controls.Library
private void btnPasteReplace_Click(object sender, EventArgs e)
{
StepTabPanel tmp = Parent as StepTabPanel;
if (tmp.MyDisplayTabControl.MyCopyStep==null) return;
if (tmp.MyDisplayTabControl.MyCopyStep == null) return;
EditItem oldEditItem = MyEditItem;
MyEditItem = MyEditItem.PasteReplace(tmp.MyDisplayTabControl.MyCopyStep.ItemID);
if (MyEditItem.MyItemInfo.ItemID != oldEditItem.MyItemInfo.ItemID) oldEditItem.Dispose();
@ -1447,13 +1494,13 @@ namespace Volian.Controls.Library
MyFlexGrid.ClipBoardCopySelection();
}
private void btnTblDgnPasteRowBefore_Click(object sender, EventArgs e)
private void btnTblDgnPasteRowAbove_Click(object sender, EventArgs e)
{
// create new rows before current position and copy clipboard data
MyFlexGrid.ClipBoardPasteRows(VlnFlexGrid.enmPastePos.Before);
}
private void btnTblDgnPasteRowAfter_Click(object sender, EventArgs e)
private void btnTblDgnPasteRowBelow_Click(object sender, EventArgs e)
{
// create new rows after current position and copy clipboard data
MyFlexGrid.ClipBoardPasteRows(VlnFlexGrid.enmPastePos.After);
@ -1465,12 +1512,12 @@ namespace Volian.Controls.Library
MyFlexGrid.ClipBoardPasteRows(VlnFlexGrid.enmPastePos.Replace);
}
private void btnTblDgnPasteColumnBefore_Click(object sender, EventArgs e)
private void btnTblDgnPasteColumnLeft_Click(object sender, EventArgs e)
{
MyFlexGrid.ClipBoardPasteColumns(VlnFlexGrid.enmPastePos.Before);
}
private void btnTblDgnPasteColumnAfter_Click(object sender, EventArgs e)
private void btnTblDgnPasteColumnRight_Click(object sender, EventArgs e)
{
MyFlexGrid.ClipBoardPasteColumns(VlnFlexGrid.enmPastePos.After);
}
@ -1484,50 +1531,96 @@ namespace Volian.Controls.Library
{
MyFlexGrid.ClipBoardPasteIntoSelection();
}
private void btnTblDgnClear_Click(object sender, EventArgs e)
{
MyFlexGrid.ClearSelectedCellText();
}
#endregion
#region Table Grid Delete
private void btnTblDgnDeleteRow_Click(object sender, EventArgs e)
private void btnTblDgnRemoveRow_Click(object sender, EventArgs e)
{
MyFlexGrid.RemoveSelectedRow();
}
private void btnTblDgnDeleteColumn_Click(object sender, EventArgs e)
private void btnTblDgnRemoveColumn_Click(object sender, EventArgs e)
{
MyFlexGrid.RemoveSelectedColumn();
}
private void btnTblDgnDeleteSelected_Click(object sender, EventArgs e)
{
MyFlexGrid.RemoveSelectedCells();
}
#endregion
#region Table Grid Cell Style
private void cpHighlight_SelectedColorChanged(object sender, EventArgs e)
{
string strColor = string.Format("{0}, {1}, {2};", cpTblDgnHighlight.SelectedColor.R, cpTblDgnHighlight.SelectedColor.G, cpTblDgnHighlight.SelectedColor.B);
MyFlexGrid.ChangeBackgroundColor(strColor);
}
//private void cpHighlight_SelectedColorChanged(object sender, EventArgs e)
//{
// string strColor = string.Format("{0}, {1}, {2};", cpTblDgnHighlight.SelectedColor.R, cpTblDgnHighlight.SelectedColor.G, cpTblDgnHighlight.SelectedColor.B);
// MyFlexGrid.ChangeBackgroundColor(strColor);
//}
private void btnTblDgnAlignLeft_Click(object sender, EventArgs e)
private void btnTblDgnAlgnTxTopLeft_Click(object sender, EventArgs e)
{
MyFlexGrid.VerticalTopText();
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Left);
}
private void btnTblDgnAlignCentered_Click(object sender, EventArgs e)
private void btnTblDgnAlgnTxTopCenter_Click(object sender, EventArgs e)
{
MyFlexGrid.VerticalTopText();
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Center);
}
private void btnTblDgnAlignRight_Click(object sender, EventArgs e)
private void btnTblDgnAlgnTxTopRight_Click(object sender, EventArgs e)
{
MyFlexGrid.VerticalTopText();
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Right);
}
private void btnTblDgnAlgnTxCenterLeft_Click(object sender, EventArgs e)
{
MyFlexGrid.VerticalCenterText();
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Left);
}
private void btnTblDgnAlgnTxCenterCenter_Click(object sender, EventArgs e)
{
MyFlexGrid.VerticalCenterText();
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Center);
}
private void btnTblDgnAlgnTxCenterRight_Click(object sender, EventArgs e)
{
MyFlexGrid.VerticalCenterText();
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Right);
}
private void btnTblDgnAlgnTxBottomLeft_Click(object sender, EventArgs e)
{
MyFlexGrid.VerticalBottomText();
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Left);
}
private void btnTblDgnAlgnTxBottomCenter_Click(object sender, EventArgs e)
{
MyFlexGrid.VerticalBottomText();
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Center);
}
private void btnTblDgnAlgnTxBottomRight_Click(object sender, EventArgs e)
{
MyFlexGrid.VerticalBottomText();
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)
@ -1547,41 +1640,56 @@ namespace Volian.Controls.Library
}
#endregion
#region Table Grid Design
private void btnTblDgnInsertRowBefore_Click(object sender, EventArgs e)
private void btnTblDgnInsertRowAbove_Click(object sender, EventArgs e)
{
MyFlexGrid.InsertRowBefore();
}
private void btnTblDgnInsertRowAfter_Click(object sender, EventArgs e)
private void btnTblDgnInsertRowBelow_Click(object sender, EventArgs e)
{
MyFlexGrid.InsertRowAfter();
}
private void btnTblDgnInsertColumnBefore_Click(object sender, EventArgs e)
private void btnTblDgnInsertColumnAbove_Click(object sender, EventArgs e)
{
MyFlexGrid.InsertColumnBefore();
}
private void btnTblDgnInsertColumnAfter_Click(object sender, EventArgs e)
private void btnTblDgnInsertColumnBelow_Click(object sender, EventArgs e)
{
MyFlexGrid.InsertColumnAfter();
}
private void ToggleTableDesignButtons(bool enable)
public void ToggleTableDesignButtons(bool enable)
{
cpTblDgnHighlight.Enabled = enable;
btnTblDgnAlignText.Enabled = enable;
btnTblDgnClear.Enabled = enable;
btnTblDgnCopy.Enabled = enable;
btnTblDgnDelete.Enabled = enable;
btnTblDgnRemove.Enabled = enable;
btnTblDgnGridStyle.Enabled = enable;
btnTblDgnInsertColumn.Enabled = enable;
btnTblDgnInsertRow.Enabled = enable;
btnTblDgnMergeCells.Enabled = enable;
btnTblDgnPaste.Enabled = enable;
btnTblDgnSplitCells.Enabled = enable;
btnTblDgnTableBorder.Enabled = enable;
btnTblDgnAdjustSize.Checked = !enable;
}
public void SetRibbonForGrid()
{
// set to true if editing cell, otherwise false for grids
bool enable = (MyFlexGrid.Editor != null);
btnPaste.Enabled = enable;
btnCopy.Enabled = enable;
btnCut.Enabled = enable;
btnBold.Enabled = enable;
btnItalics.Enabled = enable;
btnUnderline.Enabled = enable;
btnSubscript.Enabled = enable;
btnSuperscript.Enabled = enable;
btnChgCase.Enabled = enable;
btnInsHrdSpc.Enabled = enable;
btnSymbols.Enabled = enable;
btnIndent.Enabled = enable;
btnInsTrans.Enabled = enable;
btnInsRO.Enabled = enable;
}
private void btnTblDgnAdjustSize_Click(object sender, EventArgs e)
{
@ -1634,7 +1742,6 @@ namespace Volian.Controls.Library
private void btnTblDgnGridStyleNone_Click(object sender, EventArgs e)
{
MyFlexGrid.ChangeCellBorder(MyFlexGrid.Selection, C1.Win.C1FlexGrid.BorderStyleEnum.None);
}
private void btnTblDgnGridStyleFlat_Click(object sender, EventArgs e)
@ -1673,75 +1780,10 @@ namespace Volian.Controls.Library
}
#endregion
private void btnTblDgnDeleteRow_Click_1(object sender, EventArgs e)
{
MyFlexGrid.RemoveSelectedRow();
}
private void btnTblDgnDeleteColumn_Click_1(object sender, EventArgs e)
{
MyFlexGrid.RemoveSelectedColumn();
}
private void btnTblDgnDeleteSelected_Click_1(object sender, EventArgs e)
{
MyFlexGrid.RemoveSelectedCells();
}
private void btnTblDgnAlgnTxTopLeft_Click(object sender, EventArgs e)
{
MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.LeftTop);
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Left);
}
private void btnTblDgnAlgnTxTopCenter_Click(object sender, EventArgs e)
{
MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.CenterTop);
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Center);
}
private void btnTblDgnAlgnTxTopRight_Click(object sender, EventArgs e)
{
MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.RightTop);
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Right);
}
private void btnTblDgnAlgnTxCenterLeft_Click(object sender, EventArgs e)
{
MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.LeftCenter);
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Left);
}
private void btnTblDgnAlgnTxCenterCenter_Click(object sender, EventArgs e)
{
MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.CenterCenter);
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Center);
}
private void btnTblDgnAlgnTxCenterRight_Click(object sender, EventArgs e)
{
MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.RightCenter);
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Right);
}
private void btnTblDgnAlgnTxBottomLeft_Click(object sender, EventArgs e)
{
MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.LeftBottom);
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Left);
}
private void btnTblDgnAlgnTxBottomCenter_Click(object sender, EventArgs e)
{
MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.CenterBottom);
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Center);
}
private void btnTblDgnAlgnTxBottomRight_Click(object sender, EventArgs e)
{
MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.RightBottom);
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Right);
}
}
public enum E_FieldToEdit { StepText, Text, Number };
public class StepTabRibbonEventArgs : EventArgs
{
@ -1759,5 +1801,5 @@ namespace Volian.Controls.Library
}
}
public delegate void StepTabRibbonEvent(object sender, StepTabRibbonEventArgs args);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -129,6 +129,10 @@ namespace Volian.Controls.Library
{
_DPI = value;
}
//if (value == 120)
// Console.WriteLine("Test");
// if(!(TableCellEditor is StepRTB))
// Console.WriteLine("{0}",TableCellEditor.GetType().Name);
}
}
#region Grid Initialize
@ -1585,8 +1589,8 @@ namespace Volian.Controls.Library
public void ClearSelectedCellText()
{
CellRange cr = this.Selection;
DialogResult dr = MessageBox.Show("Clear Selected cells?", "Clear", MessageBoxButtons.YesNo);
if (dr == DialogResult.Yes)
//DialogResult dr = MessageBox.Show("Clear Selected cells?", "Clear", MessageBoxButtons.YesNo);
//if (dr == DialogResult.Yes)
cr.Clear(ClearFlags.Content);
}
public void SetupCellUserData()
@ -1616,7 +1620,11 @@ namespace Volian.Controls.Library
this.MergedRanges.Add(this.Selection);
this.Invalidate();
}
public bool IsInMergeRange()
{
C1.Win.C1FlexGrid.CellRange sel = GetMergedRange(this.Selection.r1, this.Selection.c1);
return MergedRanges.Contains(sel);
}
public void SplitSelection(bool bSplitCols)
{
C1.Win.C1FlexGrid.CellRange sel = this.GetMergedRange(this.Selection.r1, this.Selection.c1);
@ -1772,7 +1780,10 @@ namespace Volian.Controls.Library
}
this.MergedRanges.Clear();
foreach (CellRange r in crc)
this.MergedRanges.Add(r);
{
if ((r.r1 != r.r2) || (r.c1 != r.c2))
this.MergedRanges.Add(r);
}
}
private void AdjustMergedColumns(int col, bool left, bool removing)
@ -1839,7 +1850,10 @@ namespace Volian.Controls.Library
}
this.MergedRanges.Clear();
foreach (CellRange r in crc)
{
if ((r.r1 != r.r2) || (r.c1 != r.c2))
this.MergedRanges.Add(r);
}
}
private bool RowIsInMergeRange(int row)
@ -1866,9 +1880,9 @@ namespace Volian.Controls.Library
if (col >= 0)
{
CellRange cr = this.Selection;
rtn = true;
//rtn = true;
int r = cr.r1;
while (rtn && (r <= cr.r2))
while (!rtn && (r <= cr.r2))
{
int idx = this.MergedRanges.IndexOf(col, r);
rtn = (idx > -1);
@ -1969,67 +1983,113 @@ namespace Volian.Controls.Library
public void RemoveSelectedColumn()
{
this.SelectionMode = SelectionModeEnum.Column;
this.Select(this.Selection.r1, this.Selection.c1);
DialogResult dr = MessageBox.Show("Remove this column?", "Remove Column", MessageBoxButtons.YesNo);
if (dr == DialogResult.Yes)
RemoveColumns(this.Selection.r1, this.Selection.c1, 1);
string msg = "";
string title = "";
CellRange saveCR = Selection;
this.SelectionMode = SelectionModeEnum.ColumnRange;
//this.Select(this.Selection.r1, this.Selection.c1);
this.Select(0,Selection.c1,Rows.Count-1,Selection.c2);
this.SelectionMode = SelectionModeEnum.Default;
if (Selection.c1 != Selection.c2)
{
msg = "Remove selected columns?";
title = "Delete Columns";
}
else
{
msg = "Remove this column?";
title = "Delete Column";
}
DialogResult dr = MessageBox.Show(msg, title, MessageBoxButtons.YesNo);
if (dr == DialogResult.Yes)
RemoveSelectedCells();//RemoveColumns(this.Selection.r1, this.Selection.c1, 1);
else
Select(saveCR);
}
public void RemoveSelectedRow()
{
this.SelectionMode = SelectionModeEnum.Row;
this.Select(this.Selection.r1, this.Selection.c1);
DialogResult dr = MessageBox.Show("Remove this Row?", "Remove Row", MessageBoxButtons.YesNo);
if (dr == DialogResult.Yes)
this.RemoveRows(this.Selection.r1, this.Selection.c1, 1);
string msg = "";
string title = "";
CellRange saveCR = Selection;
this.SelectionMode = SelectionModeEnum.RowRange;
//this.Select(this.Selection.r1, this.Selection.c1,);
this.Select(Selection.r1,0,Selection.r2,Cols.Count-1);
this.SelectionMode = SelectionModeEnum.Default;
if (Selection.r1 != Selection.r2)
{
msg = "Remove selected rows?";
title = "Delete Rows";
}
else
{
msg = "Remove this row?";
title = "Delete Row";
}
DialogResult dr = MessageBox.Show(msg, title, MessageBoxButtons.YesNo);
if (dr == DialogResult.Yes)
this.RemoveSelectedCells();//this.RemoveRows(this.Selection.r1, this.Selection.c1, 1);
else
Select(saveCR);
}
private void RemoveRows(int strow, int stcol, int cnt)
{
bool mergedRow = false;
for (int i = 0; i < cnt; i++)
{
if (this.RowIsInMergeRange(strow))
{
for (int cl = 0; cl < this.Cols.Count; cl++)
//if (this.RowIsInMergeRange(strow))
//{
for (int cl = 0; cl < this.Cols.Count && !mergedRow; cl++)
{
int idx = this.MergedRanges.IndexOf(strow, cl);
if (idx > -1)
{
CellRange cr = this.MergedRanges[idx];
if (cr.r1 < cr.r2)
this[cr.r1 + 1, cr.c1] = this[cr.r1, cr.c1];
mergedRow = true;
//this[cr.r1 + 1, cr.c1] = this[cr.r1, cr.c1];
}
cl++;
}
}
//}
this.Rows.Remove(strow);
this.AdjustMergedRows(strow, false, true);
if (mergedRow)
{
cnt++;
mergedRow = false;
}
}
this.AdjustGridControlSize();
}
private void RemoveColumns(int strow, int stcol, int cnt)
{
bool mergedCol = false;
for (int i = 0; i < cnt; i++)
{
if (this.ColIsInMergeRange(stcol))
{
for (int rw = 0; rw < this.Rows.Count; rw++)
//if (this.ColIsInMergeRange(stcol))
//{
for (int rw = 0; rw < this.Rows.Count && !mergedCol; rw++)
{
int idx = this.MergedRanges.IndexOf(rw, stcol);
if (idx > -1)
{
CellRange cr = this.MergedRanges[idx];
if (cr.c1 < cr.c2)
this[cr.r1, cr.c1 + 1] = this[cr.r1, cr.c1];
mergedCol = true;
//this[cr.r1, cr.c1 + 1] = this[cr.r1, cr.c1];
}
}
}
}
//}
this.Cols.Remove(stcol);
this.AdjustMergedColumns(stcol, false, true);
if (mergedCol)
{
cnt++;
mergedCol = false;
}
}
this.AdjustGridControlSize();
}

View File

@ -76,10 +76,10 @@ namespace Volian.Print.Library
}
#endregion
#region Public Methods
public void AdjustRowTop(int row, float hNew)
public void AdjustRowTop(int row1, int row2, float hNew)
{
float hAdjust = hNew - (RowTop[row + 1] - RowTop[row]);
for (int r = row; r < MyFlexGrid.Rows.Count; r++)
float hAdjust = hNew - (RowTop[row2 + 1] - RowTop[row1]);
for (int r = row2; r < MyFlexGrid.Rows.Count; r++)
RowTop[r + 1] += hAdjust;
}
public void ToPdf(iTextSharp.text.pdf.ColumnText myColumnText, float left, float top)
@ -147,7 +147,7 @@ namespace Volian.Print.Library
str = myRTB.Rtf;
}
iTextSharp.text.Paragraph myPara = RtfToParagraph(str);
myColumnText1.SetSimpleColumn(0, 0, w - 4, MyContentByte.PdfDocument.PageSize.Top); // Padding = 4
myColumnText1.SetSimpleColumn(0, 0, w - 2, MyContentByte.PdfDocument.PageSize.Top); // Padding = 4
myPara.MultipliedLeading = 1.2F;
myColumnText1.AddElement(myPara);
//myColumnText1.Canvas.SetColorFill(iTextSharp.text.BaseColor.RED);
@ -156,7 +156,7 @@ namespace Volian.Print.Library
float posAfter = myColumnText1.YLine;
float hContent = 4 + posBefore - posAfter;
if (hContent > h)
MyTable.AdjustRowTop(cr.r2, hContent);
MyTable.AdjustRowTop(cr.r1, cr.r2, hContent);
Add(new vlnCell(cr.r1, cr.c1, cr.r2, cr.c2, MyTable, myPara, hContent));
}
}
@ -290,7 +290,7 @@ namespace Volian.Print.Library
}
}
iTextSharp.text.pdf.ColumnText myColumnText1 = new iTextSharp.text.pdf.ColumnText(myColumnText.Canvas);
myColumnText1.SetSimpleColumn(2 + left + x, top - y - h, left + x + w - 2, -1 + top - y - hAdjust); // 2 == Default Padding
myColumnText1.SetSimpleColumn(1 + left + x, top - y - h, left + x + w, 1 + top - y - hAdjust); // 2 == Default Padding
myColumnText1.AddElement(MyPara);
myColumnText1.Go();
myColumnText.Canvas.RestoreState();