Fixed ItemSelected so that Comment works properly.

Added code back in so that Word displays properly.
Allow the same document to be opened after Word hang
This commit is contained in:
Rich
2008-02-08 10:31:30 +00:00
parent 52a735e08c
commit 3c79833edf
5 changed files with 87 additions and 22 deletions

View File

@@ -431,7 +431,10 @@ namespace Volian.Controls.Library
_DisplayRTB.Top = 3;
this.Paint += new PaintEventHandler(vlnCSLARTB_Paint);
this.BackColorChanged += new EventHandler(vlnCSLARTB_BackColorChanged);
_DisplayRTB.Enter += new EventHandler(_DisplayRTB_Enter);
//_DisplayRTB.Enter += new EventHandler(_DisplayRTB_Enter);
//_DisplayRTB.Leave += new EventHandler(_DisplayRTB_Leave);
_DisplayRTB.GotFocus += new EventHandler(_DisplayRTB_GotFocus);
_DisplayRTB.LostFocus += new EventHandler(_DisplayRTB_LostFocus);
_DisplayRTB.MouseClick += new MouseEventHandler(_DisplayRTB_MouseClick);
if (item != null)
{
@@ -533,11 +536,26 @@ namespace Volian.Controls.Library
{
_DisplayRTB.Select();
}
void _DisplayRTB_Enter(object sender, EventArgs e)
//void _DisplayRTB_Enter(object sender, EventArgs e)
//{
// _Panel._ItemSelected = _MyItem;
// _Panel.OnItemSelectedChanged(sender, new DisplayPanelEventArgs(this, null));
//}
void _DisplayRTB_LostFocus(object sender, EventArgs e)
{
_Panel._ItemSelected = null;
_Panel.OnItemSelectedChanged(sender, null);
}
void _DisplayRTB_GotFocus(object sender, EventArgs e)
{
_Panel._ItemSelected = _MyItem;
_Panel.OnItemSelectedChanged(sender, new DisplayPanelEventArgs(this, null));
}
//void _DisplayRTB_Leave(object sender, EventArgs e)
//{
// _Panel._ItemSelected = null;
// _Panel.OnItemSelectedChanged(sender, null);
//}
public void AutoExpand()
{
Expand(_Type >= 20000);
@@ -573,6 +591,9 @@ namespace Volian.Controls.Library
public void ItemShow()
{
_DisplayRTB.Focus();
int scrollValue = _Panel.VerticalScroll.Value + (Top - (_Panel.Height / 2)); // calculate scroll center for the item
if(scrollValue > _Panel.VerticalScroll.Minimum && scrollValue <= _Panel.VerticalScroll.Maximum) // If it isn't within range
_Panel.VerticalScroll.Value = scrollValue; // Center the item
}
private void vlnCSLARTB_Paint(object sender, PaintEventArgs e)
{