- 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:
Rich
2011-03-11 15:49:39 +00:00
parent ddb2ea162f
commit 6029f6dd8b
8 changed files with 196 additions and 127 deletions

View File

@@ -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;