This commit is contained in:
2010-08-04 15:17:19 +00:00
parent 1d5a43627c
commit 935802a57a
13 changed files with 151 additions and 188 deletions

View File

@@ -90,9 +90,9 @@ namespace Volian.Controls.Library
public AnnotationDetails()
{
InitializeComponent();
#if(DEBUG)
//#if(DEBUG)
//Resize+=new EventHandler(AnnotationDetails_Resize); // Debug the resize event
#endif
//#endif
}
#endregion

View File

@@ -10,7 +10,7 @@ using VEPROMS.CSLA.Library;
using XYPlots;
using DevComponents.DotNetBar;
using System.Text.RegularExpressions;
using VG;
//using VG;
namespace Volian.Controls.Library
{

View File

@@ -863,10 +863,8 @@ namespace Volian.Controls.Library
private void btnSearch_Click(object sender, EventArgs e)
{
#if DEBUG
DateTime start = DateTime.Now;
#endif
Cursor savcursor = Cursor;
DateTime start = DateTime.Now;
Cursor savcursor = Cursor;
try
{
string[] strSearchText = null;
@@ -948,10 +946,9 @@ namespace Volian.Controls.Library
{
Cursor = savcursor;
}
#if DEBUG
MessageBox.Show(string.Format("{0} Milliseconds", TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalMilliseconds));
#endif
}
if (vlnStackTrace.DebugMode)
MessageBox.Show(string.Format("{0} Milliseconds", TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalMilliseconds));
}
private void cbxTextSearchText_Leave(object sender, EventArgs e)
{

View File

@@ -46,15 +46,9 @@ namespace Volian.Controls.Library
private Font _SectFont = new Font("Arial", 10, FontStyle.Bold);
private Font _StepFont = new Font("Arial", 10);
private Color _ActiveColor = Color.SkyBlue;
#if (DEBUG)
private Color _InactiveColor = Color.Linen;
private Color _TabColor = Color.Beige;
private Color _PanelColor = Color.LightGray;
#else
private Color _InactiveColor = Color.White;
private Color _TabColor = Color.White;
private Color _PanelColor = Color.White;
#endif
// Whether panel is in view or edit mode. Toggled from steprtb
// or set based on approval/multi-user (these two will be done
// later.
@@ -232,27 +226,34 @@ namespace Volian.Controls.Library
public StepPanel()
{
InitializeComponent();
SetupStepPanel();
}
private void SetupStepPanel()
{
this.BackColorChanged += new EventHandler(StepPanel_BackColorChanged);
#if(DEBUG)
this.Paint += new PaintEventHandler(StepPanel_Paint);
this.DoubleClick += new EventHandler(StepPanel_DoubleClick); // Toggles Vertical lines on and off
#else
this.BackColor = Color.White;
#endif
if (vlnStackTrace.DebugMode)
{
_InactiveColor = Color.Linen;
_TabColor = Color.Beige;
_PanelColor = Color.LightGray;
this.Paint += new PaintEventHandler(StepPanel_Paint);
this.DoubleClick += new EventHandler(StepPanel_DoubleClick); // Toggles Vertical lines on and off
}
else
{
_InactiveColor = Color.White;
_TabColor = Color.White;
_PanelColor = Color.White;
this.BackColor = Color.White;
}
this.AutoScroll = true;
}
public StepPanel(IContainer container)
{
container.Add(this);
InitializeComponent();
this.BackColorChanged += new EventHandler(StepPanel_BackColorChanged);
#if(DEBUG)
this.Paint += new PaintEventHandler(StepPanel_Paint); // Toggles Vertical lines on and off
this.DoubleClick += new EventHandler(StepPanel_DoubleClick);
#else
this.BackColor = Color.White;
#endif
this.AutoScroll = true;
SetupStepPanel();
}
void StepPanel_BackColorChanged(object sender, EventArgs e)
{

View File

@@ -203,28 +203,18 @@ namespace Volian.Controls.Library
// return;
//}
_origDisplayText = vlntxt;
#if(DEBUG)
// Use Times New Roman for Debugging
//Font = new Font("Times New Roman", 14, FontStyle.Regular);
//Font = _origDisplayText.TextFont.WindowsFont;
Font formatFont = _origDisplayText.TextFont.WindowsFont;
Font formatFont = _origDisplayText.TextFont.WindowsFont;
if (_MyItemInfo.IsTable || _MyItemInfo.IsFigure)
Font = formatFont;
else
Font = new Font(_MyFontFamily == null ? formatFont.FontFamily : _MyFontFamily, formatFont.Size, formatFont.Style);
//Font = new Font("Bookman Old Style", formatFont.Size, formatFont.Style);
#elif(RELEASE)
Font = _origDisplayText.TextFont.WindowsFont; // font defined in plant's format
#else //DEMO
// Comment this out for DEMO to customer
// UN-Comment this for testing
//Font = _origDisplayText.TextFont.WindowsFont; // font defined in plant's format
Font formatFont = _origDisplayText.TextFont.WindowsFont;
if (_MyItemInfo.IsTable || _MyItemInfo.IsFigure)
Font = formatFont;
else
Font = new Font("Bookman Old Style", formatFont.Size, formatFont.Style);
#endif
{
if (vlnStackTrace.DebugMode)
Font = new Font(_MyFontFamily == null ? formatFont.FontFamily : _MyFontFamily, formatFont.Size, formatFont.Style);
else
Font = new Font("Bookman Old Style", formatFont.Size, formatFont.Style);
// TODO: Release Mode
//Font = _origDisplayText.TextFont.WindowsFont; // font defined in plant's format
}
Text = ""; // Initialize text before add text
// IMPORTANT: SetLineSpacing must be set before Links, otherwise it
// was confusing the 'handle' of the rtf box.

View File

@@ -738,47 +738,47 @@ namespace Volian.Controls.Library
}
#endregion
#region RHM debug
#if DEBUG
// The following code generates an XML output for the selected item for print testing.
private void btnPageBreak_Click(object sender, EventArgs e)
{
// This is here temporarily to get a node and all of it's children for print testing.
OutputAllChildren(MyStepItem);
}
private void OutputAllChildren(StepItem myStepItem)
{
OutputAllChildren(myStepItem.MyBeforeStepItems);
OutputStepInfo(myStepItem);
OutputAllChildren(myStepItem.MyAfterStepItems);
OutputAllChildren(myStepItem.MyRNOStepItems);
}
private void OutputStepInfo(StepItem myStepItem)
{
Label lbl = myStepItem.MyLabel;
if (lbl.Text.Trim() != "")
Console.WriteLine("<text x='{0}In' y='{1}In' font-family='{2}' font-size='{3}Pt'>{4}</text>",
ToInches(myStepItem.Left + lbl.Left), ToInches(myStepItem.Top + lbl.Top),
lbl.Font.FontFamily.Name,lbl.Font.SizeInPoints,lbl.Text);
StepRTB rtb = myStepItem.MyStepRTB;
Console.WriteLine("<foreignObject x='{0}In' y='{1}In' width='{2}In' " +
"requiredExtensions='http://Volian.Com/EmbeddedRTF'>{3}</foreignObject>",
ToInches(myStepItem.Left + rtb.Left), ToInches(myStepItem.Top + rtb.Top), ToInches(rtb.Width), myStepItem.MyItemInfo.MyContent.Text);
// ToInches(myStepItem.Left + rtb.Left), ToInches(myStepItem.Top + rtb.Top), ToInches(rtb.Width), rtb.Rtf);
}
private float ToInches(int val)
{
return Convert.ToSingle(val)/96F;
}
//#if DEBUG
// // The following code generates an XML output for the selected item for print testing.
// private void btnPageBreak_Click(object sender, EventArgs e)
// {
// // This is here temporarily to get a node and all of it's children for print testing.
// OutputAllChildren(MyStepItem);
// }
// private void OutputAllChildren(StepItem myStepItem)
// {
// OutputAllChildren(myStepItem.MyBeforeStepItems);
// OutputStepInfo(myStepItem);
// OutputAllChildren(myStepItem.MyAfterStepItems);
// OutputAllChildren(myStepItem.MyRNOStepItems);
// }
// private void OutputStepInfo(StepItem myStepItem)
// {
// Label lbl = myStepItem.MyLabel;
// if (lbl.Text.Trim() != "")
// Console.WriteLine("<text x='{0}In' y='{1}In' font-family='{2}' font-size='{3}Pt'>{4}</text>",
// ToInches(myStepItem.Left + lbl.Left), ToInches(myStepItem.Top + lbl.Top),
// lbl.Font.FontFamily.Name,lbl.Font.SizeInPoints,lbl.Text);
// StepRTB rtb = myStepItem.MyStepRTB;
// Console.WriteLine("<foreignObject x='{0}In' y='{1}In' width='{2}In' " +
// "requiredExtensions='http://Volian.Com/EmbeddedRTF'>{3}</foreignObject>",
// ToInches(myStepItem.Left + rtb.Left), ToInches(myStepItem.Top + rtb.Top), ToInches(rtb.Width), myStepItem.MyItemInfo.MyContent.Text);
//// ToInches(myStepItem.Left + rtb.Left), ToInches(myStepItem.Top + rtb.Top), ToInches(rtb.Width), rtb.Rtf);
// }
// private float ToInches(int val)
// {
// return Convert.ToSingle(val)/96F;
// }
private void OutputAllChildren(List<StepItem> list)
{
if(list != null)
foreach (StepItem itm in list)
OutputAllChildren(itm);
}
// private void OutputAllChildren(List<StepItem> list)
// {
// if(list != null)
// foreach (StepItem itm in list)
// OutputAllChildren(itm);
// }
#endif
//#endif
private void btnToggleEditView_Click(object sender, EventArgs e)
{
MyStepRTB.ToggleEditView();

View File

@@ -190,6 +190,12 @@ namespace Volian.Controls.Library
}
#endif
}
private static bool _DebugMode = true;
public static bool DebugMode
{
get { return vlnStackTrace._DebugMode; }
set { vlnStackTrace._DebugMode = value; }
}
}
}