- Removed Debug
- Don't resize grid when initializing - Use LoadGrid which adjusts the Grid Font - Only save contents if in edit mode Changes to Comments Added Property MySymbolFontName - Setup GoTo button to handle ROTable Grids - Support GoTo for ROTable Grids (MyFlexGrid.IsRoTable) - Restored code to handle Vertical Alignment - Added MyItemInfo property - Removed commented-out debug in DPI property - Support Font Override - Use DisplayText to do ReplaceWords - Set Text Color to Black (Change Links to Black) Use DebugOutput property rather than _DebugOutput field - Override Font for printing grids - Override Font for printing text
This commit is contained in:
parent
ddb2ea162f
commit
6029f6dd8b
@ -5,6 +5,7 @@ using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
//using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using VEPROMS.CSLA.Library;
|
||||
@ -45,12 +46,6 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
void MyFlexGrid_Resize(object sender, EventArgs e)
|
||||
{
|
||||
if (MyItemInfo != null && MyItemInfo.ItemID == 14)
|
||||
{
|
||||
//Console.WriteLine("{0},{1},{2}", MyFlexGrid.Height, MyStepRTB.ContentsRectangle.Height,MyFlexGrid.Rows[0].Height);
|
||||
if (MyFlexGrid.Height < MyStepRTB.ContentsRectangle.Height)
|
||||
MyFlexGrid.Height = 4 + MyStepRTB.ContentsRectangle.Height;
|
||||
}
|
||||
this.Size = new Size(MyFlexGrid.Width + GridMargin, MyFlexGrid.Height + GridMargin);
|
||||
AdjustTableWidthAndLocation();
|
||||
AdjustLocation();
|
||||
@ -475,9 +470,8 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
private void ConvertTableToGrid(string valtext)
|
||||
{
|
||||
VE_Font vefont = this.MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.Table.Font;
|
||||
Font GridFont = new Font(vefont.Family, (float)vefont.Size);
|
||||
MyFlexGrid.Font = GridFont;
|
||||
VE_Font vefont = MyItemInfo.GetItemFont();
|
||||
MyFlexGrid.Font = vefont.WindowsFont;
|
||||
MyFlexGrid.ParseTableFromText(valtext);
|
||||
MyFlexGrid.AutoSizeCols();
|
||||
MyFlexGrid.AutoSizeRows();
|
||||
@ -776,15 +770,24 @@ namespace Volian.Controls.Library
|
||||
get { return _Empty; }
|
||||
set { _Empty = value; }
|
||||
}
|
||||
private bool _Initializing = false;
|
||||
public bool Initializing
|
||||
{
|
||||
get { return _Initializing; }
|
||||
set { _Initializing = value; }
|
||||
}
|
||||
private bool _ActiveMode = false;
|
||||
public override void RefreshDisplay(bool activeMode)
|
||||
{
|
||||
_ActiveMode = activeMode;
|
||||
XmlDocument xd = new XmlDocument();
|
||||
xd.LoadXml(MyItemInfo.MyContent.MyGrid.Data);
|
||||
//XmlDocument xd = new XmlDocument();
|
||||
//xd.LoadXml(MyItemInfo.MyContent.MyGrid.Data);
|
||||
//using (StringReader sr = new StringReader())
|
||||
MyFlexGrid.Clear();
|
||||
MyFlexGrid.MergedRanges.Clear();
|
||||
MyFlexGrid.ReadXml(xd);
|
||||
Initializing = true;
|
||||
MyFlexGrid.LoadGrid(MyItemInfo);
|
||||
Initializing = false;
|
||||
MyFlexGrid.KeyActionTab = KeyActionEnum.MoveAcross;
|
||||
MyFlexGrid.AdjustGridControlSize();
|
||||
// When a grid is read from XML, all of the styles are updated to the values in the XML.
|
||||
@ -835,7 +838,7 @@ namespace Volian.Controls.Library
|
||||
public override void SetExpandAndExpander(ItemInfo itemInfo) { CanExpand = false; } // can't expand a table
|
||||
public override void SaveCurrentAndContents()
|
||||
{
|
||||
if (MyFlexGrid.Row >= 0 && MyFlexGrid.Col >= 0) // Only if a Cell is Selected
|
||||
if (MyFlexGrid.Row >= 0 && MyFlexGrid.Col >= 0 && MyStepRTB.EditMode) // Only if a Cell is Selected
|
||||
{
|
||||
int row = MyFlexGrid.Row;
|
||||
int col = MyFlexGrid.Col;
|
||||
|
@ -375,7 +375,7 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
Cursor tmp = Cursor.Current;
|
||||
Cursor.Current = Cursors.WaitCursor;
|
||||
int top = TopMostEditItem.Top;// This does'nt work - this is since the last time it was expanded.
|
||||
int top = TopMostEditItem.Top;// This doesn't work - this is since the last time it was expanded.
|
||||
Colapsing = true;
|
||||
// Hide Children
|
||||
HideChildren();
|
||||
|
@ -182,11 +182,35 @@ namespace Volian.Controls.Library
|
||||
OnEditModeChanged(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
private static string _MySymbolFontName;
|
||||
public static string MySymbolFontName
|
||||
{
|
||||
get { return StepRTB._MySymbolFontName; }
|
||||
set { StepRTB._MySymbolFontName = value; }
|
||||
}
|
||||
private static FontFamily _MyFontFamily = null;
|
||||
public static FontFamily MyFontFamily
|
||||
{
|
||||
get { return StepRTB._MyFontFamily; }
|
||||
set { StepRTB._MyFontFamily = value; }
|
||||
set
|
||||
{
|
||||
_MyFontFamily = value;
|
||||
if (value != null)
|
||||
{
|
||||
Font font;
|
||||
if (value.IsStyleAvailable(FontStyle.Regular))
|
||||
font = new Font(value, 10);
|
||||
else if (value.IsStyleAvailable(FontStyle.Bold))
|
||||
font = new Font(value, 10, FontStyle.Bold);
|
||||
else // (value.IsStyleAvailable(FontStyle.Italic))
|
||||
font = new Font(value, 10, FontStyle.Italic);
|
||||
using (StepRTB srtb = new StepRTB())
|
||||
{
|
||||
if (srtb.FontIsFixed(font)) _MySymbolFontName = "VESymbFix";
|
||||
else _MySymbolFontName = "Arial Unicode MS";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// use newer rich text box....
|
||||
//[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
|
||||
@ -316,7 +340,7 @@ namespace Volian.Controls.Library
|
||||
else
|
||||
{
|
||||
if (VlnSettings.DebugMode || VlnSettings.ProductionMode)
|
||||
_FormatFont = new Font(_MyFontFamily == null ? formatFont.FontFamily : _MyFontFamily, formatFont.Size, formatFont.Style);
|
||||
_FormatFont = new Font(MyFontFamily == null ? formatFont.FontFamily : MyFontFamily, formatFont.Size, formatFont.Style);
|
||||
else
|
||||
_FormatFont = new Font("Bookman Old Style", formatFont.Size, formatFont.Style);
|
||||
// TODO: Release Mode
|
||||
|
@ -243,7 +243,7 @@ namespace Volian.Controls.Library
|
||||
void _MyStepRTB_LinkChanged(object sender, StepPanelLinkEventArgs args)
|
||||
{
|
||||
// do all Transition and ReferencedObject menu items/buttons based on whether a 'link is selected' and the link type.
|
||||
btnCMGoTo.Enabled = btnGoTo.Enabled = _MyStepRTB.IsSelectionLinked(_MyStepRTB.SelectionStart, _MyStepRTB.SelectionLength);
|
||||
SetupGoToButton();
|
||||
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
|
||||
@ -255,6 +255,13 @@ namespace Volian.Controls.Library
|
||||
btnCMEditRO.Enabled = false;
|
||||
}
|
||||
}
|
||||
private void SetupGoToButton()
|
||||
{
|
||||
if (MyEditItem is GridItem && (MyEditItem as GridItem).MyFlexGrid.IsRoTable)
|
||||
btnCMGoTo.Enabled = btnGoTo.Enabled = true;
|
||||
else
|
||||
btnCMGoTo.Enabled = btnGoTo.Enabled = _MyStepRTB.IsSelectionLinked(_MyStepRTB.SelectionStart, _MyStepRTB.SelectionLength);
|
||||
}
|
||||
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.
|
||||
@ -418,7 +425,8 @@ namespace Volian.Controls.Library
|
||||
SetPasteButtonEnabled();
|
||||
|
||||
// do all Transition and ReferencedObject menu items/buttons based on whether a 'link is selected' and the link type.
|
||||
btnCMGoTo.Enabled = btnGoTo.Enabled = _MyStepRTB.IsSelectionLinked(_MyStepRTB.SelectionStart, _MyStepRTB.SelectionLength); //(_MyStepRTB.MyLinkText != null);
|
||||
//btnCMGoTo.Enabled = btnGoTo.Enabled = _MyStepRTB.IsSelectionLinked(_MyStepRTB.SelectionStart, _MyStepRTB.SelectionLength); //(_MyStepRTB.MyLinkText != null);
|
||||
SetupGoToButton();
|
||||
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
|
||||
@ -847,18 +855,30 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
// if on a transition, go to the selected transition 'to'. If on
|
||||
// a referenced object, bring up ReferencedObject Editor (for now, just put up a message box.
|
||||
if (_MyStepRTB.MyLinkText.IndexOf("Transition") > -1)
|
||||
if (_MyStepRTB.MyLinkText != null && _MyStepRTB.MyLinkText.IndexOf("Transition") > -1)
|
||||
{
|
||||
_MyEditItem.MyStepPanel.OnLinkClicked(sender, new StepPanelLinkEventArgs(_MyStepRTB.MyLinkText));
|
||||
}
|
||||
else
|
||||
{
|
||||
string roapp = Environment.GetEnvironmentVariable("roapp");
|
||||
LinkText lt = new LinkText(_MyStepRTB.MyLinkText);
|
||||
string args = "\"" + lt.MyRoUsageInfo.MyRODb.FolderPath + "\" " + lt.MyRoUsageInfo.ROID.ToLower();
|
||||
if (!Directory.Exists(lt.MyRoUsageInfo.MyRODb.FolderPath))
|
||||
string myROID;
|
||||
RODbInfo myRODB;
|
||||
if (MyFlexGrid != null && MyFlexGrid.IsRoTable)
|
||||
{
|
||||
MessageBox.Show(string.Format("RO Database directory does not exist: {0}", lt.MyRoUsageInfo.MyRODb.FolderPath));
|
||||
myROID = MyFlexGrid.ROID.ToLower();
|
||||
myRODB = RODbInfo.Get(MyFlexGrid.RODbId);
|
||||
}
|
||||
else
|
||||
{
|
||||
LinkText lt = new LinkText(_MyStepRTB.MyLinkText);
|
||||
myROID = lt.MyRoUsageInfo.ROID.ToLower();
|
||||
myRODB = lt.MyRoUsageInfo.MyRODb;
|
||||
}
|
||||
string roapp = Environment.GetEnvironmentVariable("roapp");
|
||||
string args = "\"" + myRODB.FolderPath + "\" " + myROID;
|
||||
if (!Directory.Exists(myRODB.FolderPath))
|
||||
{
|
||||
MessageBox.Show(string.Format("RO Database directory does not exist: {0}", myRODB.FolderPath));
|
||||
return;
|
||||
}
|
||||
System.Diagnostics.Process.Start(roapp, args);
|
||||
@ -1555,55 +1575,55 @@ namespace Volian.Controls.Library
|
||||
|
||||
private void btnTblDgnAlgnTxTopLeft_Click(object sender, EventArgs e)
|
||||
{
|
||||
MyFlexGrid.VerticalTopText();
|
||||
MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.LeftTop);
|
||||
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Left);
|
||||
}
|
||||
|
||||
private void btnTblDgnAlgnTxTopCenter_Click(object sender, EventArgs e)
|
||||
{
|
||||
MyFlexGrid.VerticalTopText();
|
||||
MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.CenterTop);
|
||||
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Center);
|
||||
}
|
||||
|
||||
private void btnTblDgnAlgnTxTopRight_Click(object sender, EventArgs e)
|
||||
{
|
||||
MyFlexGrid.VerticalTopText();
|
||||
MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.RightTop);
|
||||
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Right);
|
||||
}
|
||||
|
||||
private void btnTblDgnAlgnTxCenterLeft_Click(object sender, EventArgs e)
|
||||
{
|
||||
MyFlexGrid.VerticalCenterText();
|
||||
MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.LeftCenter);
|
||||
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Left);
|
||||
}
|
||||
|
||||
private void btnTblDgnAlgnTxCenterCenter_Click(object sender, EventArgs e)
|
||||
{
|
||||
MyFlexGrid.VerticalCenterText();
|
||||
MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.CenterCenter);
|
||||
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Center);
|
||||
}
|
||||
|
||||
private void btnTblDgnAlgnTxCenterRight_Click(object sender, EventArgs e)
|
||||
{
|
||||
MyFlexGrid.VerticalCenterText();
|
||||
MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.RightCenter);
|
||||
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Right);
|
||||
}
|
||||
|
||||
private void btnTblDgnAlgnTxBottomLeft_Click(object sender, EventArgs e)
|
||||
{
|
||||
MyFlexGrid.VerticalBottomText();
|
||||
MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.LeftBottom);
|
||||
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Left);
|
||||
}
|
||||
|
||||
private void btnTblDgnAlgnTxBottomCenter_Click(object sender, EventArgs e)
|
||||
{
|
||||
MyFlexGrid.VerticalBottomText();
|
||||
MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.CenterBottom);
|
||||
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Center);
|
||||
}
|
||||
|
||||
private void btnTblDgnAlgnTxBottomRight_Click(object sender, EventArgs e)
|
||||
{
|
||||
MyFlexGrid.VerticalBottomText();
|
||||
MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.RightBottom);
|
||||
MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Right);
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,12 @@ namespace Volian.Controls.Library
|
||||
// get { return _MyBorderDetail; }
|
||||
// set { _MyBorderDetail = value; }
|
||||
//}
|
||||
private ItemInfo _MyItemInfo;
|
||||
public ItemInfo MyItemInfo
|
||||
{
|
||||
get { return _MyItemInfo; }
|
||||
set { _MyItemInfo = value; }
|
||||
}
|
||||
[XmlIgnore]
|
||||
public bool HasVScroll
|
||||
{
|
||||
@ -129,10 +135,6 @@ 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
|
||||
@ -420,7 +422,26 @@ namespace Volian.Controls.Library
|
||||
// CellRange cr = GetMergedRange(row, col);
|
||||
// return (cr.r1 == row && cr.c1 == col);
|
||||
//}
|
||||
|
||||
private static Regex _ReplaceVESymbFix = new Regex(@"({\\f[0-9]+[^ ]* )(VESymbFix)(;})");
|
||||
private static Regex _ReplaceArialUnicodeMS = new Regex(@"({\\f[0-9]+[^ ]* )(Arial Unicode MS)(;})");
|
||||
private static Regex _ReplaceTextFont = new Regex(@"({\\f[0-9]+[^ ]* )(?((?!VESymbFix)(?!Arial Unicode MS))([^;]*)|(!!!!))(;})");
|
||||
public void LoadGrid(ItemInfo itemInfo)
|
||||
{
|
||||
MyItemInfo = itemInfo;
|
||||
string str = itemInfo.MyContent.MyGrid.Data;
|
||||
VE_Font vefont = MyItemInfo.GetItemFont();
|
||||
FontFamily ff = StepRTB.MyFontFamily ?? vefont.WindowsFont.FontFamily; // TODO: Does not change fixed font.
|
||||
if (StepRTB.MySymbolFontName != "VESymbFix")
|
||||
str = _ReplaceVESymbFix.Replace(str, "$1" + StepRTB.MySymbolFontName + "$3");
|
||||
if (StepRTB.MySymbolFontName != "Arial Unicode MS")
|
||||
str = _ReplaceArialUnicodeMS.Replace(str, "$1" + StepRTB.MySymbolFontName + "$3");
|
||||
str = _ReplaceTextFont.Replace(str, "$1" + ff.Name + "$4");
|
||||
using (StringReader sr = new StringReader(str))
|
||||
{
|
||||
ReadXml(sr);
|
||||
sr.Close();
|
||||
}
|
||||
}
|
||||
private void SetupGrid(int numrows, int numcols) //C1FlexGrid NewGrid()
|
||||
{
|
||||
// setup the default size of each cell in the table/grid
|
||||
@ -458,26 +479,20 @@ namespace Volian.Controls.Library
|
||||
|
||||
|
||||
_tableCellEditor = new TableCellEditor(this);
|
||||
//_tableCellEditor.ContentsResized += new ContentsResizedEventHandler(_tableCellEditor_ContentsResized);
|
||||
_tableCellEditor.HeightChanged += new StepRTBEvent(_tableCellEditor_HeightChanged);
|
||||
_clpbrdCpyPste = new TableClipBoardFuncts();
|
||||
|
||||
//this.Enter += new System.EventHandler(this.Grid_Enter);
|
||||
this.AfterResizeRow += new C1.Win.C1FlexGrid.RowColEventHandler(this.Grid_AfterResize);
|
||||
this.StartEdit += new C1.Win.C1FlexGrid.RowColEventHandler(this._StartEdit);
|
||||
this.AfterEdit += new C1.Win.C1FlexGrid.RowColEventHandler(this._AfterEdit);
|
||||
//this.LeaveEdit += new RowColEventHandler(VlnFlexGrid_LeaveEdit);
|
||||
this.AfterScroll += new C1.Win.C1FlexGrid.RangeEventHandler(this._AfterScroll);
|
||||
this.AfterResizeColumn += new C1.Win.C1FlexGrid.RowColEventHandler(this.Grid_AfterResize);
|
||||
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this._KeyPress);
|
||||
this.OwnerDrawCell += new OwnerDrawCellEventHandler(this.Grid_OwnerDrawCell);
|
||||
this.LeaveCell += new EventHandler(VlnFlexGrid_LeaveCell);
|
||||
|
||||
//this.ValidateEdit += new ValidateEditEventHandler(VlnFlexGrid_ValidateEdit);
|
||||
this.KeyDown += new KeyEventHandler(VlnFlexGrid_KeyDown);
|
||||
this.KeyUp +=new KeyEventHandler(VlnFlexGrid_KeyUp);
|
||||
this.SelChange += new EventHandler(VlnFlexGrid_SelChange);
|
||||
this.Resize += new EventHandler(VlnFlexGrid_Resize);
|
||||
TableCellEditor.EditMode = TableCellEditor.Visible; // need to comment out for compile for only jsj - 07FEB2011
|
||||
}
|
||||
|
||||
@ -512,20 +527,6 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VlnFlexGrid_Resize(object sender, EventArgs e)
|
||||
{
|
||||
if (TableCellEditor.Visible)
|
||||
Volian.Base.Library.vlnStackTrace.ShowStackLocal("VlnFlexGrid_Resize", 1);
|
||||
}
|
||||
void VlnFlexGrid_SelChange(object sender, EventArgs e)
|
||||
{
|
||||
// Possibilities
|
||||
// Selection is a single cell
|
||||
// It is part of a range
|
||||
// It is
|
||||
//Console.WriteLine("Where Am I {0} {1} {2}", Selection, GetMergedRange(Row, Col), Selection.Equals(GetMergedRange(Row, Col)));
|
||||
}
|
||||
void VlnFlexGrid_KeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Control)
|
||||
@ -625,6 +626,12 @@ namespace Volian.Controls.Library
|
||||
cr.UserData = _rtf.Height;
|
||||
int hAdjust = 0;
|
||||
int hDiff = e.Bounds.Height - _rtf.Height;
|
||||
if (hDiff < 0)
|
||||
{
|
||||
Rows[e.Row].Height = _rtf.Height + 4;
|
||||
AdjustGridControlSize();
|
||||
hDiff = 0;
|
||||
}
|
||||
if (e.Style != null)
|
||||
{
|
||||
switch (e.Style.TextAlign)
|
||||
@ -645,7 +652,14 @@ namespace Volian.Controls.Library
|
||||
break;
|
||||
}
|
||||
}
|
||||
_rtf.ForeColor = e.Style.ForeColor;
|
||||
if (IsRoTable)
|
||||
{
|
||||
_rtf.ForeColor = Color.Red;
|
||||
}
|
||||
else
|
||||
{
|
||||
_rtf.ForeColor = e.Style.ForeColor;
|
||||
}
|
||||
_rtf.BackColor = e.Style.BackColor;
|
||||
_rtf.Render(e.Graphics, new Rectangle(e.Bounds.X+1,e.Bounds.Y + hAdjust,e.Bounds.Width-3,e.Bounds.Height));
|
||||
//CellRange cr = GetCellRange(e.Row, e.Col);
|
||||
@ -740,7 +754,11 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
CellRange tmp = this.GetCellRange(rw, col, rw, col);
|
||||
string StyleName = string.Format("R{0}C{1}Style", rw, col);
|
||||
CellStyle cs = this.Styles.Add(StyleName, tmp.Style);
|
||||
CellStyle cs = null;
|
||||
if (Styles.Contains(StyleName))
|
||||
cs = Styles[StyleName];
|
||||
else
|
||||
cs = this.Styles.Add(StyleName, tmp.Style);
|
||||
cs.TextAlign = newAlign;
|
||||
tmp.Style = cs;
|
||||
}
|
||||
@ -773,64 +791,64 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
public void VerticalCenterText()
|
||||
{
|
||||
StepRTB myStepRTB = new StepRTB();
|
||||
CellRange selRange = this.Selection;
|
||||
for (int r = selRange.r1; r <= selRange.r2; r++)
|
||||
for (int c = selRange.c1; c <= selRange.c2; c++)
|
||||
{
|
||||
CellRange mr = this.GetMergedRange(r, c);
|
||||
if (mr.r1 == r)
|
||||
{
|
||||
int editHeight = (int)mr.UserData;
|
||||
int cellHeight = GetCellHeight(mr.r1, mr.c1);
|
||||
if (editHeight < cellHeight)
|
||||
{
|
||||
myStepRTB.Rtf = (string)mr.Data;
|
||||
RTBAPI.SetSpaceBefore(myStepRTB, (cellHeight - editHeight) / 2);
|
||||
PutCellRTFString(mr.r1, mr.c1, myStepRTB.Rtf);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void VerticalTopText()
|
||||
{
|
||||
StepRTB myStepRTB = new StepRTB();
|
||||
CellRange selRange = this.Selection;
|
||||
for (int r = selRange.r1; r <= selRange.r2; r++)
|
||||
for (int c = selRange.c1; c <= selRange.c2; c++)
|
||||
{
|
||||
CellRange mr = this.GetMergedRange(r, c);
|
||||
if (mr.r1 == r)
|
||||
{
|
||||
myStepRTB.Rtf = (string)mr.Data;
|
||||
RTBAPI.SetSpaceBefore(myStepRTB, 0);
|
||||
PutCellRTFString(mr.r1, mr.c1, myStepRTB.Rtf);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void VerticalBottomText()
|
||||
{
|
||||
StepRTB myStepRTB = new StepRTB();
|
||||
CellRange selRange = this.Selection;
|
||||
for (int r = selRange.r1; r <= selRange.r2; r++)
|
||||
for (int c = selRange.c1; c <= selRange.c2; c++)
|
||||
{
|
||||
CellRange mr = this.GetMergedRange(r, c);
|
||||
if (mr.r1 == r)
|
||||
{
|
||||
int editHeight = (int)mr.UserData;
|
||||
int cellHeight = GetCellHeight(mr.r1, mr.c1);
|
||||
if (editHeight < cellHeight)
|
||||
{
|
||||
myStepRTB.Rtf = (string)mr.Data;
|
||||
RTBAPI.SetSpaceBefore(myStepRTB, (cellHeight - editHeight));
|
||||
PutCellRTFString(mr.r1, mr.c1, myStepRTB.Rtf);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//public void VerticalCenterText()
|
||||
//{
|
||||
// StepRTB myStepRTB = new StepRTB();
|
||||
// CellRange selRange = this.Selection;
|
||||
// for (int r = selRange.r1; r <= selRange.r2; r++)
|
||||
// for (int c = selRange.c1; c <= selRange.c2; c++)
|
||||
// {
|
||||
// CellRange mr = this.GetMergedRange(r, c);
|
||||
// if (mr.r1 == r)
|
||||
// {
|
||||
// int editHeight = (int)mr.UserData;
|
||||
// int cellHeight = GetCellHeight(mr.r1, mr.c1);
|
||||
// if (editHeight < cellHeight)
|
||||
// {
|
||||
// myStepRTB.Rtf = (string)mr.Data;
|
||||
// RTBAPI.SetSpaceBefore(myStepRTB, (cellHeight - editHeight) / 2);
|
||||
// PutCellRTFString(mr.r1, mr.c1, myStepRTB.Rtf);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//public void VerticalTopText()
|
||||
//{
|
||||
// StepRTB myStepRTB = new StepRTB();
|
||||
// CellRange selRange = this.Selection;
|
||||
// for (int r = selRange.r1; r <= selRange.r2; r++)
|
||||
// for (int c = selRange.c1; c <= selRange.c2; c++)
|
||||
// {
|
||||
// CellRange mr = this.GetMergedRange(r, c);
|
||||
// if (mr.r1 == r)
|
||||
// {
|
||||
// myStepRTB.Rtf = (string)mr.Data;
|
||||
// RTBAPI.SetSpaceBefore(myStepRTB, 0);
|
||||
// PutCellRTFString(mr.r1, mr.c1, myStepRTB.Rtf);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//public void VerticalBottomText()
|
||||
//{
|
||||
// StepRTB myStepRTB = new StepRTB();
|
||||
// CellRange selRange = this.Selection;
|
||||
// for (int r = selRange.r1; r <= selRange.r2; r++)
|
||||
// for (int c = selRange.c1; c <= selRange.c2; c++)
|
||||
// {
|
||||
// CellRange mr = this.GetMergedRange(r, c);
|
||||
// if (mr.r1 == r)
|
||||
// {
|
||||
// int editHeight = (int)mr.UserData;
|
||||
// int cellHeight = GetCellHeight(mr.r1, mr.c1);
|
||||
// if (editHeight < cellHeight)
|
||||
// {
|
||||
// myStepRTB.Rtf = (string)mr.Data;
|
||||
// RTBAPI.SetSpaceBefore(myStepRTB, (cellHeight - editHeight));
|
||||
// PutCellRTFString(mr.r1, mr.c1, myStepRTB.Rtf);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
//public void SetupCellStyles()
|
||||
//{
|
||||
@ -871,6 +889,7 @@ namespace Volian.Controls.Library
|
||||
/// </summary>
|
||||
public void AdjustGridControlSize()
|
||||
{
|
||||
if (Parent is GridItem ? (Parent as GridItem).Initializing : false ) return;
|
||||
int difW = this.Width - this.ClientSize.Width;
|
||||
int difH = this.Height - this.ClientSize.Height;
|
||||
int wid = 0;
|
||||
|
@ -135,6 +135,8 @@ namespace Volian.Print.Library
|
||||
float w = MyTable.ColLeft[cr.c2 + 1] - MyTable.ColLeft[cr.c1];
|
||||
float h = MyTable.RowTop[cr.r2 + 1] - MyTable.RowTop[cr.r1];
|
||||
string str = MyFlexGrid.GetCellRTFString(r, c)??string.Empty;
|
||||
DisplayText dt = new DisplayText(MyFlexGrid.MyItemInfo, str, false);
|
||||
str = dt.StartText;
|
||||
using (StepRTB myRTB = new StepRTB())
|
||||
{
|
||||
myRTB.Width = (int)w;
|
||||
@ -143,7 +145,8 @@ namespace Volian.Print.Library
|
||||
myRTB.Rtf = str.Replace(@"\~", @"\u160?");
|
||||
else
|
||||
myRTB.Text = str;
|
||||
//myRTB.ForeColor = System.Drawing.Color.Red;
|
||||
myRTB.SelectAll();
|
||||
myRTB.SelectionColor = System.Drawing.Color.Black;
|
||||
str = myRTB.Rtf;
|
||||
}
|
||||
iTextSharp.text.Paragraph myPara = RtfToParagraph(str);
|
||||
@ -254,7 +257,8 @@ namespace Volian.Print.Library
|
||||
if (cr.Style == null || cr.Style.Border.Style != BorderStyleEnum.None)
|
||||
{
|
||||
myColumnText.Canvas.Rectangle(left + x, top - y, w, -h);
|
||||
myColumnText.Canvas.SetColorStroke(iTextSharp.text.Color.BLACK);
|
||||
iTextSharp.text.Color lineColor = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Black));
|
||||
myColumnText.Canvas.SetColorStroke(lineColor);
|
||||
myColumnText.Canvas.SetLineWidth(.5F);
|
||||
if (cr.Style != null && cr.Style.Border.Style == BorderStyleEnum.Dotted)
|
||||
{
|
||||
|
@ -297,7 +297,7 @@ namespace Volian.Print.Library
|
||||
_MyHelper.Rev = _Rev;
|
||||
_MyHelper.RevDate = _RevDate;
|
||||
_MyHelper.Watermark = _Watermark;
|
||||
_MyHelper.DoZoomOMatic = _DebugOutput;
|
||||
_MyHelper.DoZoomOMatic = DebugOutput;
|
||||
OnStatusChanged("After Set PageEvent", PromsPrinterStatusType.SetPageEvent);
|
||||
}
|
||||
else
|
||||
|
@ -769,11 +769,7 @@ namespace Volian.Print.Library
|
||||
if (itemInfo.MyContent.MyGrid != null)
|
||||
{
|
||||
VlnFlexGrid myFlexGrid = new VlnFlexGrid(1,1);
|
||||
using (StringReader sr = new StringReader(itemInfo.MyContent.MyGrid.Data))
|
||||
{
|
||||
myFlexGrid.ReadXml(sr);
|
||||
sr.Close();
|
||||
}
|
||||
myFlexGrid.LoadGrid(itemInfo);
|
||||
MyGrid = new vlnTable(myFlexGrid, cb);
|
||||
Height = MyGrid.Height;
|
||||
Width = MyGrid.Width;
|
||||
@ -1039,7 +1035,10 @@ namespace Volian.Print.Library
|
||||
{
|
||||
_RtfSB = new StringBuilder();
|
||||
DisplayText vlntxt = new DisplayText(itemInfo, E_EditPrintMode.Print, E_ViewMode.View, true, E_FieldToEdit.StepText, false);
|
||||
_RtfSB.Append(AddFontTable(vlntxt.TextFont.WindowsFont));
|
||||
System.Drawing.Font myFont = vlntxt.TextFont.WindowsFont;
|
||||
if (!itemInfo.IsTable && StepRTB.MyFontFamily != null)
|
||||
myFont = new System.Drawing.Font(StepRTB.MyFontFamily, myFont.Size, myFont.Style);
|
||||
_RtfSB.Append(AddFontTable(myFont));
|
||||
_RtfSB.Append(vlntxt.StartText);
|
||||
_RtfSB.Append("}");
|
||||
return _RtfSB.ToString();
|
||||
|
Loading…
x
Reference in New Issue
Block a user