Fixed ScrollToCenter logic for EditItems

Use ScrollToCenter logic when text is changed or textbox is resized.
This commit is contained in:
Rich
2012-12-04 19:56:34 +00:00
parent a6e07e9b52
commit 44396a7200
2 changed files with 15 additions and 3 deletions

View File

@@ -217,18 +217,21 @@ namespace Volian.Controls.Library
//// TIMING: DisplayItem.TimeIt("CSLARTB Top");
InitializeComponent();// TODO: Performance 25%
SetupEditItem(itemInfo, myStepPanel, myParentEditItem, myChildRelation, expand, null, false);
MyStepRTB.TextChanged += new EventHandler(MyStepRTB_TextChanged);
}
public RTBItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand, EditItem nextEditItem)
{
//// TIMING: DisplayItem.TimeIt("CSLARTB Top");
InitializeComponent();// TODO: Performance 25%
SetupEditItem(itemInfo, myStepPanel, myParentEditItem, myChildRelation, expand, nextEditItem, false);
MyStepRTB.TextChanged += new EventHandler(MyStepRTB_TextChanged);
}
public RTBItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand, bool addFirstChld)
{
//// TIMING: DisplayItem.TimeIt("CSLARTB Top");
InitializeComponent();// TODO: Performance 25%
SetupEditItem(itemInfo, myStepPanel, myParentEditItem, myChildRelation, expand, null, addFirstChld);
MyStepRTB.TextChanged += new EventHandler(MyStepRTB_TextChanged);
}
//private void SetupRTBItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand, EditItem nextEditItem)
//{
@@ -353,7 +356,14 @@ namespace Volian.Controls.Library
void _MyStepRTB_Resize(object sender, EventArgs e)
{
if (MyStepPanel != null && this == MyStepPanel.SelectedEditItem)
MyStepPanel.ScrollControlIntoView(this);
ScrollToCenter();
//MyStepPanel.ScrollControlIntoView(this);
}
void MyStepRTB_TextChanged(object sender, EventArgs e)
{
if (MyStepPanel != null && this == MyStepPanel.SelectedEditItem)
ScrollToCenter();
//MyStepPanel.ScrollControlIntoView(this);
}
private Label lblHeader = null;
private Label lblFooter = null;