Initialize Borders from FlexGrid selection

Eliminate SelChange funtions during Initialization
Eliminate Moving GridItem to the Left and Right on selection
Fixed a bug where SelectedEditItem was null
Eliminate SelChange funtions during Initialization
Use FlexGrid CellRange (Selection) to Get and Set Range Borders
Added Unknown value to GridLinePattern enum
Set Range Borders based upon CellRange (Selection)
This commit is contained in:
Rich
2011-03-22 15:05:22 +00:00
parent 81b22109e6
commit a03970cd09
6 changed files with 95 additions and 19 deletions

View File

@@ -200,6 +200,8 @@ namespace Volian.Controls.Library
private string _OrigRtf; // used to store original rtf to allow for 'escape' key restore
void MyFlexGrid_SelChange(object sender, EventArgs e)
{
if (Initializing) return;
//Volian.Base.Library.vlnStackTrace.ShowStackLocal("MyFlexGrid_SelChange {0}",MyFlexGrid.Selection);
RTBLastFocus = false;
MyStepRTB.Visible = false; // Hide the editor if the Selection Changes
if (MyFlexGrid.Selection.IsSingleCell && MyFlexGrid.Row >= 0 && MyFlexGrid.Col >= 0)
@@ -268,8 +270,6 @@ namespace Volian.Controls.Library
this.MyStepRTB.RoInsert += new StepRTBRoEvent(MyStepRTB_RoInsert);
this.MyFlexGrid.AdjustPastedText += new VlnFlexGridPasteEvent(MyFlexGrid_AdjustPastedText);
}
void MyStepRTB_RoInsert(object sender, StepRTBRoEventArgs args)
{
if (MyFlexGrid.IsRoTable)
@@ -302,8 +302,9 @@ namespace Volian.Controls.Library
//_MyStepRTB.Font = MyStepData.Font.WindowsFont;
//ItemWidth = (int)GetTableWidth(MyStepRTB.Font, MyItemInfo.MyContent.Text, true);
//ItemWidth = MyFlexGrid.Width;
ItemLocation = new Point(50, _MyParentEditItem.Bottom);
ItemLocation = TableLocation(_MyParentEditItem, MyStepSectionLayoutData, ItemWidth);
//ItemLocation = new Point(50, _MyParentEditItem.Bottom);
Point newLocation = TableLocation(_MyParentEditItem, MyStepSectionLayoutData, ItemWidth);
if (!newLocation.Equals(ItemLocation)) ItemLocation = newLocation;
}
public override void SetToolTip(string tip)
{
@@ -483,10 +484,12 @@ namespace Volian.Controls.Library
{
VE_Font vefont = MyItemInfo.GetItemFont();
MyFlexGrid.Font = vefont.WindowsFont;
Initializing = true;
MyFlexGrid.ParseTableFromText(valtext);
MyFlexGrid.AutoSizeCols();
MyFlexGrid.AutoSizeRows();
MyFlexGrid.MakeRTFcells();
Initializing = false;
}
private bool FinishSave(string searchableText)
{