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);
|
||||
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);
|
||||
|
@ -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()
|
||||
|
@ -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);
|
||||
@ -87,8 +96,17 @@ namespace Volian.Controls.Library
|
||||
switch (_MyStepRTB.FieldToEdit)
|
||||
{
|
||||
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);
|
||||
_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,6 +143,7 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
BuildSymbolGallery(sl, galleryContainerSymbolsCM);
|
||||
BuildSymbolGallery(sl, galleryContainerSymbolsCM3);
|
||||
BuildSymbolGallery(sl, galleryContainerSymbolsGrid);
|
||||
}
|
||||
SetButtonAndMenuEnabling(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)
|
||||
{
|
||||
SetButtonAndMenuEnabling(false);
|
||||
@ -223,16 +255,17 @@ 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.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;
|
||||
@ -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;
|
||||
@ -455,13 +495,20 @@ namespace Volian.Controls.Library
|
||||
// if on procedure, 'Delete' buttons should be disabled.
|
||||
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)
|
||||
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
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;
|
||||
}
|
||||
//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,8 +1780,11 @@ 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 void AdjustMergedColumns(int col, bool left, bool removing)
|
||||
{
|
||||
@ -1839,8 +1850,11 @@ 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();
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user