This commit is contained in:
parent
a67f3dc6c7
commit
b43ea73257
@ -175,6 +175,20 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (ROID.StartsWith("FFFF")) return string.Format("Invalid Unit RO '{0}'", ROID);
|
if (ROID.StartsWith("FFFF")) return string.Format("Invalid Unit RO '{0}'", ROID);
|
||||||
return string.Format("Invalid 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)
|
public rochild GetRoChild(string ROID)
|
||||||
{
|
{
|
||||||
if (dicRos == null) ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup);
|
if (dicRos == null) ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup);
|
||||||
|
@ -83,6 +83,9 @@ namespace Volian.Controls.Library
|
|||||||
CopyStep();
|
CopyStep();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case Keys.Delete:
|
||||||
|
MyFlexGrid.ClearSelectedCellText();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void SetMenu(string contentMenu)
|
void SetMenu(string contentMenu)
|
||||||
@ -90,7 +93,7 @@ namespace Volian.Controls.Library
|
|||||||
if (contentMenu == null)
|
if (contentMenu == null)
|
||||||
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ClearContextMenu();
|
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ClearContextMenu();
|
||||||
else if (contentMenu == "OpenContextMenu")
|
else if (contentMenu == "OpenContextMenu")
|
||||||
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetContextMenu();
|
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetGridCellContextMenu(); //.SetContextMenu();
|
||||||
else
|
else
|
||||||
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetShortCutContextMenu(contentMenu);
|
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetShortCutContextMenu(contentMenu);
|
||||||
}
|
}
|
||||||
@ -174,10 +177,15 @@ namespace Volian.Controls.Library
|
|||||||
void MyFlexGrid_Click(object sender, EventArgs e)
|
void MyFlexGrid_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MyFlexGrid.Focus();
|
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)
|
void MyStepRTB_EditModeChanged(object sender, EventArgs args)
|
||||||
{
|
{
|
||||||
AdjustColorsForEditMode();
|
AdjustColorsForEditMode();
|
||||||
|
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetRibbonForGrid();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AdjustColorsForEditMode()
|
private void AdjustColorsForEditMode()
|
||||||
|
@ -69,6 +69,15 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfEdit);
|
_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)
|
public void OpenContextMenu(Point loc)
|
||||||
{
|
{
|
||||||
btnCMRtfEdit.Popup(loc);
|
btnCMRtfEdit.Popup(loc);
|
||||||
@ -87,8 +96,17 @@ namespace Volian.Controls.Library
|
|||||||
switch (_MyStepRTB.FieldToEdit)
|
switch (_MyStepRTB.FieldToEdit)
|
||||||
{
|
{
|
||||||
case E_FieldToEdit.StepText:
|
case E_FieldToEdit.StepText:
|
||||||
|
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);
|
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfEdit);
|
||||||
_DefaultContextMenu = btnCMRtfEdit;
|
_DefaultContextMenu = btnCMRtfEdit;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case E_FieldToEdit.Text:
|
case E_FieldToEdit.Text:
|
||||||
case E_FieldToEdit.Number:
|
case E_FieldToEdit.Number:
|
||||||
@ -104,7 +122,8 @@ namespace Volian.Controls.Library
|
|||||||
//_MyStepRTB.KeyUp += new KeyEventHandler(_MyStepRTB_KeyUp); //+= new KeyEventHandler(MyStepRTB_SelectionChanged);
|
//_MyStepRTB.KeyUp += new KeyEventHandler(_MyStepRTB_KeyUp); //+= new KeyEventHandler(MyStepRTB_SelectionChanged);
|
||||||
_MyStepRTB.SelectionChanged += new EventHandler(_MyStepRTB_SelectionChanged);
|
_MyStepRTB.SelectionChanged += new EventHandler(_MyStepRTB_SelectionChanged);
|
||||||
//_MyStepRTB.ModeChange += new StepRTBModeChangeEvent(_MyStepRTB_ModeChange);
|
//_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);
|
_MyStepRTB.LinkChanged += new StepRTBLinkEvent(_MyStepRTB_LinkChanged);
|
||||||
// Add symbols into the tab ribbon based on format selection. For now, only add symbols once
|
// 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
|
// because all symbols are same!!! If we start defining different symbols in different formats
|
||||||
@ -124,6 +143,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
BuildSymbolGallery(sl, galleryContainerSymbolsCM);
|
BuildSymbolGallery(sl, galleryContainerSymbolsCM);
|
||||||
BuildSymbolGallery(sl, galleryContainerSymbolsCM3);
|
BuildSymbolGallery(sl, galleryContainerSymbolsCM3);
|
||||||
|
BuildSymbolGallery(sl, galleryContainerSymbolsGrid);
|
||||||
}
|
}
|
||||||
SetButtonAndMenuEnabling(true);
|
SetButtonAndMenuEnabling(true);
|
||||||
SetStepButtonAndMenuEnabling(true);
|
SetStepButtonAndMenuEnabling(true);
|
||||||
@ -133,6 +153,18 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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)
|
void _MyStepRTB_SelectionChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SetButtonAndMenuEnabling(false);
|
SetButtonAndMenuEnabling(false);
|
||||||
@ -223,16 +255,17 @@ namespace Volian.Controls.Library
|
|||||||
btnCMEditRO.Enabled = false;
|
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.
|
// 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
|
// ex. Positon on a substep, press <shift><F6> <N> <S> <S>, to list the substep types
|
||||||
//_MyStepRTB.KeyUp -=new KeyEventHandler(_MyStepRTB_KeyUp);
|
//_MyStepRTB.KeyUp -=new KeyEventHandler(_MyStepRTB_KeyUp);
|
||||||
//_MyStepRTB.MouseUp -= new MouseEventHandler(_MyStepRTB_MouseUp);
|
//_MyStepRTB.MouseUp -= new MouseEventHandler(_MyStepRTB_MouseUp);
|
||||||
_MyStepRTB.SelectionChanged -= new EventHandler(_MyStepRTB_SelectionChanged);
|
_MyStepRTB.SelectionChanged -= new EventHandler(_MyStepRTB_SelectionChanged);
|
||||||
_MyStepRTB.Leave -= new EventHandler(MyStepRTB_Leave);
|
_MyStepRTB.Leave -= new EventHandler(_MyStepRTB_Leave);
|
||||||
_MyStepRTB.LinkChanged -= new StepRTBLinkEvent(_MyStepRTB_LinkChanged);
|
_MyStepRTB.LinkChanged -= new StepRTBLinkEvent(_MyStepRTB_LinkChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void btnInsStep_Click(object sender, EventArgs e)
|
void btnInsStep_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
DevComponents.DotNetBar.ButtonItem b = (DevComponents.DotNetBar.ButtonItem)sender;
|
DevComponents.DotNetBar.ButtonItem b = (DevComponents.DotNetBar.ButtonItem)sender;
|
||||||
@ -308,6 +341,13 @@ namespace Volian.Controls.Library
|
|||||||
btnUnderline.Enabled = btnCMUnderline.Enabled = (!((_MyStepRTB.MyStyleFont.Style & E_Style.Underline) == E_Style.Underline));
|
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));
|
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)
|
private void SetButtonMenuEnabledDisabledOnSelection(bool setting)
|
||||||
{
|
{
|
||||||
btnCMBold.Enabled = btnBold.Enabled = setting;
|
btnCMBold.Enabled = btnBold.Enabled = setting;
|
||||||
@ -455,13 +495,20 @@ namespace Volian.Controls.Library
|
|||||||
// if on procedure, 'Delete' buttons should be disabled.
|
// if on procedure, 'Delete' buttons should be disabled.
|
||||||
btnDelelete.Enabled = btnDelStep.Enabled = !MyItemInfo.IsProcedure;
|
btnDelelete.Enabled = btnDelStep.Enabled = !MyItemInfo.IsProcedure;
|
||||||
btnCpyStp.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();
|
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 on procedure or section, 'change type' & 'insert' buttons should be disabled.
|
||||||
if (MyItemInfo.IsProcedure || MyItemInfo.IsSection)
|
if (MyItemInfo.IsProcedure || MyItemInfo.IsSection)
|
||||||
@ -1447,13 +1494,13 @@ namespace Volian.Controls.Library
|
|||||||
MyFlexGrid.ClipBoardCopySelection();
|
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
|
// create new rows before current position and copy clipboard data
|
||||||
MyFlexGrid.ClipBoardPasteRows(VlnFlexGrid.enmPastePos.Before);
|
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
|
// create new rows after current position and copy clipboard data
|
||||||
MyFlexGrid.ClipBoardPasteRows(VlnFlexGrid.enmPastePos.After);
|
MyFlexGrid.ClipBoardPasteRows(VlnFlexGrid.enmPastePos.After);
|
||||||
@ -1465,12 +1512,12 @@ namespace Volian.Controls.Library
|
|||||||
MyFlexGrid.ClipBoardPasteRows(VlnFlexGrid.enmPastePos.Replace);
|
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);
|
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);
|
MyFlexGrid.ClipBoardPasteColumns(VlnFlexGrid.enmPastePos.After);
|
||||||
}
|
}
|
||||||
@ -1484,50 +1531,96 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
MyFlexGrid.ClipBoardPasteIntoSelection();
|
MyFlexGrid.ClipBoardPasteIntoSelection();
|
||||||
}
|
}
|
||||||
private void btnTblDgnClear_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
MyFlexGrid.ClearSelectedCellText();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Table Grid Delete
|
#region Table Grid Delete
|
||||||
private void btnTblDgnDeleteRow_Click(object sender, EventArgs e)
|
private void btnTblDgnRemoveRow_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MyFlexGrid.RemoveSelectedRow();
|
MyFlexGrid.RemoveSelectedRow();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnTblDgnDeleteColumn_Click(object sender, EventArgs e)
|
private void btnTblDgnRemoveColumn_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MyFlexGrid.RemoveSelectedColumn();
|
MyFlexGrid.RemoveSelectedColumn();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnTblDgnDeleteSelected_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
MyFlexGrid.RemoveSelectedCells();
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Table Grid Cell Style
|
#region Table Grid Cell Style
|
||||||
|
|
||||||
private void cpHighlight_SelectedColorChanged(object sender, EventArgs e)
|
//private void cpHighlight_SelectedColorChanged(object sender, EventArgs e)
|
||||||
{
|
//{
|
||||||
string strColor = string.Format("{0}, {1}, {2};", cpTblDgnHighlight.SelectedColor.R, cpTblDgnHighlight.SelectedColor.G, cpTblDgnHighlight.SelectedColor.B);
|
// string strColor = string.Format("{0}, {1}, {2};", cpTblDgnHighlight.SelectedColor.R, cpTblDgnHighlight.SelectedColor.G, cpTblDgnHighlight.SelectedColor.B);
|
||||||
MyFlexGrid.ChangeBackgroundColor(strColor);
|
// 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);
|
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);
|
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);
|
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
|
#endregion
|
||||||
#region Table Grid Merge/Split
|
#region Table Grid Merge/Split
|
||||||
private void btnTblDgnSplitCells_ToRows_Click(object sender, EventArgs e)
|
private void btnTblDgnSplitCells_ToRows_Click(object sender, EventArgs e)
|
||||||
@ -1547,41 +1640,56 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Table Grid Design
|
#region Table Grid Design
|
||||||
private void btnTblDgnInsertRowBefore_Click(object sender, EventArgs e)
|
private void btnTblDgnInsertRowAbove_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MyFlexGrid.InsertRowBefore();
|
MyFlexGrid.InsertRowBefore();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnTblDgnInsertRowAfter_Click(object sender, EventArgs e)
|
private void btnTblDgnInsertRowBelow_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MyFlexGrid.InsertRowAfter();
|
MyFlexGrid.InsertRowAfter();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnTblDgnInsertColumnBefore_Click(object sender, EventArgs e)
|
private void btnTblDgnInsertColumnAbove_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MyFlexGrid.InsertColumnBefore();
|
MyFlexGrid.InsertColumnBefore();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnTblDgnInsertColumnAfter_Click(object sender, EventArgs e)
|
private void btnTblDgnInsertColumnBelow_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MyFlexGrid.InsertColumnAfter();
|
MyFlexGrid.InsertColumnAfter();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ToggleTableDesignButtons(bool enable)
|
public void ToggleTableDesignButtons(bool enable)
|
||||||
{
|
{
|
||||||
cpTblDgnHighlight.Enabled = enable;
|
|
||||||
btnTblDgnAlignText.Enabled = enable;
|
btnTblDgnAlignText.Enabled = enable;
|
||||||
btnTblDgnClear.Enabled = enable;
|
|
||||||
btnTblDgnCopy.Enabled = enable;
|
btnTblDgnCopy.Enabled = enable;
|
||||||
btnTblDgnDelete.Enabled = enable;
|
btnTblDgnRemove.Enabled = enable;
|
||||||
btnTblDgnGridStyle.Enabled = enable;
|
btnTblDgnGridStyle.Enabled = enable;
|
||||||
btnTblDgnInsertColumn.Enabled = enable;
|
btnTblDgnInsertColumn.Enabled = enable;
|
||||||
btnTblDgnInsertRow.Enabled = enable;
|
btnTblDgnInsertRow.Enabled = enable;
|
||||||
btnTblDgnMergeCells.Enabled = enable;
|
btnTblDgnMergeCells.Enabled = enable;
|
||||||
btnTblDgnPaste.Enabled = enable;
|
btnTblDgnPaste.Enabled = enable;
|
||||||
btnTblDgnSplitCells.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)
|
private void btnTblDgnAdjustSize_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@ -1634,7 +1742,6 @@ namespace Volian.Controls.Library
|
|||||||
private void btnTblDgnGridStyleNone_Click(object sender, EventArgs e)
|
private void btnTblDgnGridStyleNone_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MyFlexGrid.ChangeCellBorder(MyFlexGrid.Selection, C1.Win.C1FlexGrid.BorderStyleEnum.None);
|
MyFlexGrid.ChangeCellBorder(MyFlexGrid.Selection, C1.Win.C1FlexGrid.BorderStyleEnum.None);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnTblDgnGridStyleFlat_Click(object sender, EventArgs e)
|
private void btnTblDgnGridStyleFlat_Click(object sender, EventArgs e)
|
||||||
@ -1673,75 +1780,10 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
#endregion
|
#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 enum E_FieldToEdit { StepText, Text, Number };
|
||||||
public class StepTabRibbonEventArgs : EventArgs
|
public class StepTabRibbonEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
@ -1759,5 +1801,5 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public delegate void StepTabRibbonEvent(object sender, StepTabRibbonEventArgs args);
|
public delegate void StepTabRibbonEvent(object sender, StepTabRibbonEventArgs args);
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
BIN
PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs
generated
BIN
PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs
generated
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -129,6 +129,10 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
_DPI = value;
|
_DPI = value;
|
||||||
}
|
}
|
||||||
|
//if (value == 120)
|
||||||
|
// Console.WriteLine("Test");
|
||||||
|
// if(!(TableCellEditor is StepRTB))
|
||||||
|
// Console.WriteLine("{0}",TableCellEditor.GetType().Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#region Grid Initialize
|
#region Grid Initialize
|
||||||
@ -1585,8 +1589,8 @@ namespace Volian.Controls.Library
|
|||||||
public void ClearSelectedCellText()
|
public void ClearSelectedCellText()
|
||||||
{
|
{
|
||||||
CellRange cr = this.Selection;
|
CellRange cr = this.Selection;
|
||||||
DialogResult dr = MessageBox.Show("Clear Selected cells?", "Clear", MessageBoxButtons.YesNo);
|
//DialogResult dr = MessageBox.Show("Clear Selected cells?", "Clear", MessageBoxButtons.YesNo);
|
||||||
if (dr == DialogResult.Yes)
|
//if (dr == DialogResult.Yes)
|
||||||
cr.Clear(ClearFlags.Content);
|
cr.Clear(ClearFlags.Content);
|
||||||
}
|
}
|
||||||
public void SetupCellUserData()
|
public void SetupCellUserData()
|
||||||
@ -1616,7 +1620,11 @@ namespace Volian.Controls.Library
|
|||||||
this.MergedRanges.Add(this.Selection);
|
this.MergedRanges.Add(this.Selection);
|
||||||
this.Invalidate();
|
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)
|
public void SplitSelection(bool bSplitCols)
|
||||||
{
|
{
|
||||||
C1.Win.C1FlexGrid.CellRange sel = this.GetMergedRange(this.Selection.r1, this.Selection.c1);
|
C1.Win.C1FlexGrid.CellRange sel = this.GetMergedRange(this.Selection.r1, this.Selection.c1);
|
||||||
@ -1772,8 +1780,11 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
this.MergedRanges.Clear();
|
this.MergedRanges.Clear();
|
||||||
foreach (CellRange r in crc)
|
foreach (CellRange r in crc)
|
||||||
|
{
|
||||||
|
if ((r.r1 != r.r2) || (r.c1 != r.c2))
|
||||||
this.MergedRanges.Add(r);
|
this.MergedRanges.Add(r);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void AdjustMergedColumns(int col, bool left, bool removing)
|
private void AdjustMergedColumns(int col, bool left, bool removing)
|
||||||
{
|
{
|
||||||
@ -1839,8 +1850,11 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
this.MergedRanges.Clear();
|
this.MergedRanges.Clear();
|
||||||
foreach (CellRange r in crc)
|
foreach (CellRange r in crc)
|
||||||
|
{
|
||||||
|
if ((r.r1 != r.r2) || (r.c1 != r.c2))
|
||||||
this.MergedRanges.Add(r);
|
this.MergedRanges.Add(r);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private bool RowIsInMergeRange(int row)
|
private bool RowIsInMergeRange(int row)
|
||||||
{
|
{
|
||||||
@ -1866,9 +1880,9 @@ namespace Volian.Controls.Library
|
|||||||
if (col >= 0)
|
if (col >= 0)
|
||||||
{
|
{
|
||||||
CellRange cr = this.Selection;
|
CellRange cr = this.Selection;
|
||||||
rtn = true;
|
//rtn = true;
|
||||||
int r = cr.r1;
|
int r = cr.r1;
|
||||||
while (rtn && (r <= cr.r2))
|
while (!rtn && (r <= cr.r2))
|
||||||
{
|
{
|
||||||
int idx = this.MergedRanges.IndexOf(col, r);
|
int idx = this.MergedRanges.IndexOf(col, r);
|
||||||
rtn = (idx > -1);
|
rtn = (idx > -1);
|
||||||
@ -1969,67 +1983,113 @@ namespace Volian.Controls.Library
|
|||||||
|
|
||||||
public void RemoveSelectedColumn()
|
public void RemoveSelectedColumn()
|
||||||
{
|
{
|
||||||
this.SelectionMode = SelectionModeEnum.Column;
|
string msg = "";
|
||||||
this.Select(this.Selection.r1, this.Selection.c1);
|
string title = "";
|
||||||
DialogResult dr = MessageBox.Show("Remove this column?", "Remove Column", MessageBoxButtons.YesNo);
|
CellRange saveCR = Selection;
|
||||||
if (dr == DialogResult.Yes)
|
this.SelectionMode = SelectionModeEnum.ColumnRange;
|
||||||
RemoveColumns(this.Selection.r1, this.Selection.c1, 1);
|
//this.Select(this.Selection.r1, this.Selection.c1);
|
||||||
|
this.Select(0,Selection.c1,Rows.Count-1,Selection.c2);
|
||||||
this.SelectionMode = SelectionModeEnum.Default;
|
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()
|
public void RemoveSelectedRow()
|
||||||
{
|
{
|
||||||
this.SelectionMode = SelectionModeEnum.Row;
|
string msg = "";
|
||||||
this.Select(this.Selection.r1, this.Selection.c1);
|
string title = "";
|
||||||
DialogResult dr = MessageBox.Show("Remove this Row?", "Remove Row", MessageBoxButtons.YesNo);
|
CellRange saveCR = Selection;
|
||||||
if (dr == DialogResult.Yes)
|
this.SelectionMode = SelectionModeEnum.RowRange;
|
||||||
this.RemoveRows(this.Selection.r1, this.Selection.c1, 1);
|
//this.Select(this.Selection.r1, this.Selection.c1,);
|
||||||
|
this.Select(Selection.r1,0,Selection.r2,Cols.Count-1);
|
||||||
this.SelectionMode = SelectionModeEnum.Default;
|
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)
|
private void RemoveRows(int strow, int stcol, int cnt)
|
||||||
{
|
{
|
||||||
|
bool mergedRow = false;
|
||||||
for (int i = 0; i < cnt; i++)
|
for (int i = 0; i < cnt; i++)
|
||||||
{
|
{
|
||||||
if (this.RowIsInMergeRange(strow))
|
//if (this.RowIsInMergeRange(strow))
|
||||||
{
|
//{
|
||||||
for (int cl = 0; cl < this.Cols.Count; cl++)
|
for (int cl = 0; cl < this.Cols.Count && !mergedRow; cl++)
|
||||||
{
|
{
|
||||||
int idx = this.MergedRanges.IndexOf(strow, cl);
|
int idx = this.MergedRanges.IndexOf(strow, cl);
|
||||||
if (idx > -1)
|
if (idx > -1)
|
||||||
{
|
{
|
||||||
CellRange cr = this.MergedRanges[idx];
|
CellRange cr = this.MergedRanges[idx];
|
||||||
if (cr.r1 < cr.r2)
|
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++;
|
cl++;
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
this.Rows.Remove(strow);
|
this.Rows.Remove(strow);
|
||||||
this.AdjustMergedRows(strow, false, true);
|
this.AdjustMergedRows(strow, false, true);
|
||||||
|
if (mergedRow)
|
||||||
|
{
|
||||||
|
cnt++;
|
||||||
|
mergedRow = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.AdjustGridControlSize();
|
this.AdjustGridControlSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RemoveColumns(int strow, int stcol, int cnt)
|
private void RemoveColumns(int strow, int stcol, int cnt)
|
||||||
{
|
{
|
||||||
|
bool mergedCol = false;
|
||||||
for (int i = 0; i < cnt; i++)
|
for (int i = 0; i < cnt; i++)
|
||||||
{
|
{
|
||||||
if (this.ColIsInMergeRange(stcol))
|
//if (this.ColIsInMergeRange(stcol))
|
||||||
{
|
//{
|
||||||
for (int rw = 0; rw < this.Rows.Count; rw++)
|
for (int rw = 0; rw < this.Rows.Count && !mergedCol; rw++)
|
||||||
{
|
{
|
||||||
int idx = this.MergedRanges.IndexOf(rw, stcol);
|
int idx = this.MergedRanges.IndexOf(rw, stcol);
|
||||||
if (idx > -1)
|
if (idx > -1)
|
||||||
{
|
{
|
||||||
CellRange cr = this.MergedRanges[idx];
|
CellRange cr = this.MergedRanges[idx];
|
||||||
if (cr.c1 < cr.c2)
|
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.Cols.Remove(stcol);
|
||||||
this.AdjustMergedColumns(stcol, false, true);
|
this.AdjustMergedColumns(stcol, false, true);
|
||||||
|
if (mergedCol)
|
||||||
|
{
|
||||||
|
cnt++;
|
||||||
|
mergedCol = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.AdjustGridControlSize();
|
this.AdjustGridControlSize();
|
||||||
}
|
}
|
||||||
|
@ -76,10 +76,10 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Public Methods
|
#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]);
|
float hAdjust = hNew - (RowTop[row2 + 1] - RowTop[row1]);
|
||||||
for (int r = row; r < MyFlexGrid.Rows.Count; r++)
|
for (int r = row2; r < MyFlexGrid.Rows.Count; r++)
|
||||||
RowTop[r + 1] += hAdjust;
|
RowTop[r + 1] += hAdjust;
|
||||||
}
|
}
|
||||||
public void ToPdf(iTextSharp.text.pdf.ColumnText myColumnText, float left, float top)
|
public void ToPdf(iTextSharp.text.pdf.ColumnText myColumnText, float left, float top)
|
||||||
@ -147,7 +147,7 @@ namespace Volian.Print.Library
|
|||||||
str = myRTB.Rtf;
|
str = myRTB.Rtf;
|
||||||
}
|
}
|
||||||
iTextSharp.text.Paragraph myPara = RtfToParagraph(str);
|
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;
|
myPara.MultipliedLeading = 1.2F;
|
||||||
myColumnText1.AddElement(myPara);
|
myColumnText1.AddElement(myPara);
|
||||||
//myColumnText1.Canvas.SetColorFill(iTextSharp.text.BaseColor.RED);
|
//myColumnText1.Canvas.SetColorFill(iTextSharp.text.BaseColor.RED);
|
||||||
@ -156,7 +156,7 @@ namespace Volian.Print.Library
|
|||||||
float posAfter = myColumnText1.YLine;
|
float posAfter = myColumnText1.YLine;
|
||||||
float hContent = 4 + posBefore - posAfter;
|
float hContent = 4 + posBefore - posAfter;
|
||||||
if (hContent > h)
|
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));
|
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);
|
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.AddElement(MyPara);
|
||||||
myColumnText1.Go();
|
myColumnText1.Go();
|
||||||
myColumnText.Canvas.RestoreState();
|
myColumnText.Canvas.RestoreState();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user