This commit is contained in:
parent
2ec5e1b8dc
commit
271c1ce923
@ -1927,7 +1927,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
protected void SetupEditItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand, EditItem nextEditItem)
|
protected void SetupEditItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand, EditItem nextEditItem)
|
||||||
{
|
{
|
||||||
if (itemInfo.ItemID == 10366) Console.WriteLine("Here");
|
//if (itemInfo.ItemID == 10366) Console.WriteLine("Here");
|
||||||
//if (itemInfo.ItemID == 225) _MyStepRTB.Resize += new EventHandler(_MyStepRTB_Resize);
|
//if (itemInfo.ItemID == 225) _MyStepRTB.Resize += new EventHandler(_MyStepRTB_Resize);
|
||||||
//_MyStepRTB.MyRTBItem = this;
|
//_MyStepRTB.MyRTBItem = this;
|
||||||
//// TIMING: DisplayItem.TimeIt("CSLARTB InitComp");
|
//// TIMING: DisplayItem.TimeIt("CSLARTB InitComp");
|
||||||
|
@ -46,6 +46,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
void MyFlexGrid_Resize(object sender, EventArgs e)
|
void MyFlexGrid_Resize(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
if (MyFlexGrid.ReadingXml) return;
|
||||||
this.Size = new Size(MyFlexGrid.Width + GridMargin, MyFlexGrid.Height + GridMargin);
|
this.Size = new Size(MyFlexGrid.Width + GridMargin, MyFlexGrid.Height + GridMargin);
|
||||||
AdjustTableWidthAndLocation();
|
AdjustTableWidthAndLocation();
|
||||||
AdjustLocation();
|
AdjustLocation();
|
||||||
@ -202,10 +203,11 @@ namespace Volian.Controls.Library
|
|||||||
private string _OrigRtf; // used to store original rtf to allow for 'escape' key restore
|
private string _OrigRtf; // used to store original rtf to allow for 'escape' key restore
|
||||||
void MyFlexGrid_SelChange(object sender, EventArgs e)
|
void MyFlexGrid_SelChange(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (Initializing) return;
|
//if (Initializing) return;
|
||||||
//Volian.Base.Library.vlnStackTrace.ShowStackLocal("MyFlexGrid_SelChange {0}",MyFlexGrid.Selection);
|
//Volian.Base.Library.vlnStackTrace.ShowStackLocal("MyFlexGrid_SelChange {0}",MyFlexGrid.Selection);
|
||||||
RTBLastFocus = false;
|
RTBLastFocus = false;
|
||||||
MyStepRTB.Visible = false; // Hide the editor if the Selection Changes
|
MyStepRTB.Visible = false; // Hide the editor if the Selection Changes
|
||||||
|
if (Initializing) return;
|
||||||
if (MyFlexGrid.Selection.IsSingleCell && MyFlexGrid.Row >= 0 && MyFlexGrid.Col >= 0)
|
if (MyFlexGrid.Selection.IsSingleCell && MyFlexGrid.Row >= 0 && MyFlexGrid.Col >= 0)
|
||||||
{
|
{
|
||||||
object obj = MyFlexGrid[MyFlexGrid.Row, MyFlexGrid.Col];
|
object obj = MyFlexGrid[MyFlexGrid.Row, MyFlexGrid.Col];
|
||||||
@ -334,6 +336,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
public override void RefreshContent()
|
public override void RefreshContent()
|
||||||
{
|
{
|
||||||
|
_ActiveMode = MyFlexGrid.ContainsFocus;
|
||||||
using (Grid myGrid = MyItemInfo.MyContent.MyGrid.Get())
|
using (Grid myGrid = MyItemInfo.MyContent.MyGrid.Get())
|
||||||
{
|
{
|
||||||
MyItemInfo.MyContent.MyGrid.ResetContent(myGrid);
|
MyItemInfo.MyContent.MyGrid.ResetContent(myGrid);
|
||||||
@ -562,8 +565,8 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
Focus();
|
Focus();
|
||||||
MyFlexGrid.Focus();
|
MyFlexGrid.Focus();
|
||||||
if (!MyFlexGrid.IsRoTable) // Table ROs are none editable - don't select a table cell
|
//if (!MyFlexGrid.IsRoTable) // Table ROs are none editable - don't select a table cell
|
||||||
MyFlexGrid.Select(0, 0);
|
// MyFlexGrid.Select(0, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -438,6 +438,7 @@ namespace Volian.Controls.Library
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
lastEI.SaveContents();
|
lastEI.SaveContents();
|
||||||
|
if (!(lastEI.MyItemInfo.IsTable))
|
||||||
lastEI.RefreshDisplay(false);
|
lastEI.RefreshDisplay(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -446,8 +447,11 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
_SelectedEditItem.RefreshDisplay(true);
|
_SelectedEditItem.RefreshDisplay(true);
|
||||||
if (_SelectedItemInfo.ItemID != value.MyItemInfo.ItemID)
|
if (_SelectedItemInfo.ItemID != value.MyItemInfo.ItemID)
|
||||||
|
{
|
||||||
|
ExpandAsNeeded(value.MyItemInfo);
|
||||||
SelectedItemInfo = value.MyItemInfo;
|
SelectedItemInfo = value.MyItemInfo;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (lastEI != null)
|
if (lastEI != null)
|
||||||
lastEI.IdentifyMe(false);
|
lastEI.IdentifyMe(false);
|
||||||
}
|
}
|
||||||
|
@ -524,6 +524,12 @@ namespace Volian.Controls.Library
|
|||||||
CellRange cr = GetMergedRange(row, col);
|
CellRange cr = GetMergedRange(row, col);
|
||||||
return (cr.r1 == row && cr.c1 == col);
|
return (cr.r1 == row && cr.c1 == col);
|
||||||
}
|
}
|
||||||
|
private bool _ReadingXml = false;
|
||||||
|
|
||||||
|
public bool ReadingXml
|
||||||
|
{
|
||||||
|
get { return _ReadingXml; }
|
||||||
|
}
|
||||||
private static Regex _ReplaceVESymbFix = new Regex(@"({\\f[0-9]+[^ ]* )(VESymbFix)(;})");
|
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 _ReplaceArialUnicodeMS = new Regex(@"({\\f[0-9]+[^ ]* )(Arial Unicode MS)(;})");
|
||||||
private static Regex _ReplaceTextFont = new Regex(@"({\\f[0-9]+[^ ]* )(?((?!VESymbFix)(?!Arial Unicode MS))([^;]*)|(!!!!))(;})");
|
private static Regex _ReplaceTextFont = new Regex(@"({\\f[0-9]+[^ ]* )(?((?!VESymbFix)(?!Arial Unicode MS))([^;]*)|(!!!!))(;})");
|
||||||
@ -555,12 +561,17 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
Clear();
|
Clear();
|
||||||
MergedRanges.Clear();
|
MergedRanges.Clear();
|
||||||
|
_ReadingXml = true;
|
||||||
|
//Console.WriteLine("LoadGrid - Before ReadXML");
|
||||||
using (StringReader sr = new StringReader(str))
|
using (StringReader sr = new StringReader(str))
|
||||||
{
|
{
|
||||||
ReadXml(sr);
|
ReadXml(sr);
|
||||||
this.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None;
|
this.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None;
|
||||||
sr.Close();
|
sr.Close();
|
||||||
}
|
}
|
||||||
|
//Console.WriteLine("LoadGrid - After ReadXML");
|
||||||
|
_ReadingXml = false;
|
||||||
|
Select(-1, -1); // this keeps the cell from being selected when the grid is first displayed
|
||||||
Visible = true;
|
Visible = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -617,8 +628,33 @@ namespace Volian.Controls.Library
|
|||||||
this.KeyDown += new KeyEventHandler(VlnFlexGrid_KeyDown);
|
this.KeyDown += new KeyEventHandler(VlnFlexGrid_KeyDown);
|
||||||
this.KeyUp +=new KeyEventHandler(VlnFlexGrid_KeyUp);
|
this.KeyUp +=new KeyEventHandler(VlnFlexGrid_KeyUp);
|
||||||
TableCellEditor.EditMode = TableCellEditor.Visible; // need to comment out for compile for only jsj - 07FEB2011
|
TableCellEditor.EditMode = TableCellEditor.Visible; // need to comment out for compile for only jsj - 07FEB2011
|
||||||
|
this.MouseDown += new MouseEventHandler(VlnFlexGrid_MouseDown);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VlnFlexGrid_MouseDown(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
int left = 0;
|
||||||
|
int top = 0;
|
||||||
|
int col = 0;
|
||||||
|
int row = 0;
|
||||||
|
while (e.X > left && col < Cols.Count)
|
||||||
|
{
|
||||||
|
left += Cols[col].Width > 0 ? Cols[col].Width : Cols.DefaultSize;
|
||||||
|
col++;
|
||||||
|
}
|
||||||
|
while (e.Y > top && row < Rows.Count)
|
||||||
|
{
|
||||||
|
top += Rows[row].Height > 0 ? Rows[row].Height : Rows.DefaultSize;
|
||||||
|
row++;
|
||||||
|
}
|
||||||
|
col--;
|
||||||
|
row--;
|
||||||
|
//Console.WriteLine("Mousedown Row, Col [{0},{1}]", row, col);
|
||||||
|
Select(row, col);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void _tableCellEditor_HeightChanged(object sender, EventArgs args)
|
void _tableCellEditor_HeightChanged(object sender, EventArgs args)
|
||||||
{
|
{
|
||||||
if (_tableCellEditor._initializingEdit || !_tableCellEditor.Visible) return;
|
if (_tableCellEditor._initializingEdit || !_tableCellEditor.Visible) return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user