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:
@@ -30,6 +30,7 @@ namespace Volian.Controls.Library
|
||||
get { return _TabItem; }
|
||||
set { _TabItem = value; }
|
||||
}
|
||||
//private frmPG _frm = null;
|
||||
public DSOTabPanel(DocumentInfo documentInfo, DisplayTabControl myTabControl)
|
||||
{
|
||||
_MyTabControl = myTabControl;
|
||||
@@ -37,6 +38,8 @@ namespace Volian.Controls.Library
|
||||
SetupDSOTabPanel();
|
||||
_MyDocument = documentInfo;
|
||||
SetupDSO();
|
||||
//_frm = new frmPG(_MyDSOFramer);
|
||||
//_frm.Show();
|
||||
}
|
||||
private void SetupDSOTabPanel()
|
||||
{
|
||||
@@ -98,15 +101,15 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
void DSOTabPanel_Enter(object sender, EventArgs e)
|
||||
{
|
||||
//try
|
||||
//{
|
||||
// _MyDSOFramer.EventsEnabled = true;
|
||||
// _MyDSOFramer.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoResetNow;
|
||||
//}
|
||||
//catch (Exception ex)
|
||||
//{
|
||||
// if (_MyLog.IsErrorEnabled) _MyLog.ErrorFormat("DSOTabPage_Enter", ex);
|
||||
//}
|
||||
try
|
||||
{
|
||||
_MyDSOFramer.EventsEnabled = true;
|
||||
_MyDSOFramer.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoResetNow;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.ErrorFormat("DSOTabPage_Enter", ex);
|
||||
}
|
||||
_MyTabControl.OnItemSelectedChanged(this, null);
|
||||
_MyDSOFramer.Focus();
|
||||
}
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -156,16 +156,28 @@ namespace Volian.Controls.Library
|
||||
ExpandAsNeeded(item);
|
||||
ItemLookup[id].ItemSelect();
|
||||
}
|
||||
private ItemInfo _LastItemSelected;
|
||||
internal ItemInfo LastItemSelected
|
||||
{
|
||||
get { return _LastItemSelected; }
|
||||
}
|
||||
internal ItemInfo _ItemSelected;
|
||||
public ItemInfo ItemSelected
|
||||
{
|
||||
get { return _ItemSelected; }
|
||||
set
|
||||
{
|
||||
_ItemSelected = value;
|
||||
if (value == null)
|
||||
{
|
||||
OnItemSelectedChanged(this, null);
|
||||
return;
|
||||
}
|
||||
_LastItemSelected = value;
|
||||
int id = value.ItemID;
|
||||
ExpandAsNeeded(value);
|
||||
_ItemSelected = value;
|
||||
ItemLookup[id].ItemSelect();
|
||||
OnItemSelectedChanged(this, new DisplayPanelEventArgs(ItemLookup[id], null));
|
||||
}
|
||||
}
|
||||
public DisplayItem DisplayItemSelected
|
||||
@@ -174,8 +186,8 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
public void ItemShow()
|
||||
{
|
||||
if (_ItemSelected != null)
|
||||
ItemLookup[_ItemSelected.ItemID].ItemShow();
|
||||
if (_LastItemSelected != null)
|
||||
ItemLookup[_LastItemSelected.ItemID].ItemShow();
|
||||
}
|
||||
private int _Scrolling = 0; // Volian Property Snippet
|
||||
public int Scrolling
|
||||
|
@@ -63,7 +63,8 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
void DisplayTabPanel_Enter(object sender, EventArgs e)
|
||||
{
|
||||
if (ItemSelected != null) _MyPanel.ItemShow();
|
||||
//if (ItemSelected != null)
|
||||
_MyPanel.ItemShow();
|
||||
}
|
||||
private void SetupDisplayPanel()
|
||||
{
|
||||
|
Reference in New Issue
Block a user