Updates to DropDownPanel, Baseline, & Controls

This commit is contained in:
2026-08-05 15:16:53 -04:00
parent 6f0fcdded2
commit 6d7d127b63
14 changed files with 356 additions and 453 deletions
@@ -13,7 +13,6 @@ namespace Volian.Controls.Library
public partial class frmImportWordContents : Form
{
LBApplicationClass _WordApp;
bool _initializing = false;
private StepRTB _MyStepRTB = null;
public StepRTB MyStepRTB
@@ -23,12 +22,10 @@ namespace Volian.Controls.Library
}
public frmImportWordContents()
{
_initializing = true;
InitializeComponent();
// C2019-021 Allow the Number field to be edited.
txbWordFile.Text = Properties.Settings.Default.ImportWordFilePath;
disableButtons();
_initializing = false;
// B2019-108 Enable/disable buttons
btnOpen.Enabled = File.Exists(txbWordFile.Text) && _WordApp == null;
}
@@ -44,14 +41,9 @@ namespace Volian.Controls.Library
btnInsertNext.Enabled = false;
btnReplaceNext.Enabled = false;
}
private void ofd_FileOk(object sender, CancelEventArgs e)
{
_initializing = true;
txbWordFile.Text = ofd.FileName;
_initializing = false;
}
private void ofd_FileOk(object sender, CancelEventArgs e) => txbWordFile.Text = ofd.FileName;
private void btnBrowse_Click(object sender, EventArgs e)
private void btnBrowse_Click(object sender, EventArgs e)
{
// if we have a word doc open, then close it and reset WordApp
if (_WordApp != null)
@@ -254,8 +246,8 @@ namespace Volian.Controls.Library
}
return retval.ToString();
}
catch (Exception ex)
{
catch (Exception)
{
return "12";
}
}
@@ -281,8 +273,7 @@ namespace Volian.Controls.Library
{
try
{
if (_WordApp != null)
_WordApp.Quit();
_WordApp?.Quit();
// B2019-108 Reset WordApp when closed.
_WordApp = null;
}
@@ -355,12 +346,11 @@ namespace Volian.Controls.Library
}
else
{
EditItem ei = MyStepRTB.Parent as EditItem;
if (ei != null)
{
ei.AddSiblingAfter();
}
}
if (MyStepRTB.Parent is EditItem ei)
{
ei.AddSiblingAfter();
}
}
}
}
@@ -380,10 +370,7 @@ namespace Volian.Controls.Library
ei = ei.MyParentEditItem;
else
ei = ei.MyPreviousEditItem;
if (ei != null)
{
ei.AddSiblingAfter();
}
ei?.AddSiblingAfter();
}
}
// C201-021 New Function Add a new High level step
@@ -402,10 +389,7 @@ namespace Volian.Controls.Library
ei = ei.MyParentEditItem;
else
ei = ei.MyPreviousEditItem;
if (ei != null)
{
ei.AddSiblingAfter();
}
ei?.AddSiblingAfter();
}
}
private EditItem GetEditItem(Control Ctrl)
@@ -556,7 +540,6 @@ namespace Volian.Controls.Library
return;
}
LoadTable2(xd.DocumentElement);
int type = 20008;
if(MyStepRTB.MyItemInfo.IsTable)
{
using( Item itm = MyStepRTB.MyItemInfo.Get())
@@ -573,7 +556,7 @@ namespace Volian.Controls.Library
{
EditItem ei = MyStepRTB.Parent as EditItem;
ei.AddChild(E_FromType.Table, 20008, TblFlexGrid);
if (ei != null) ei.SetAllTabs();
ei?.SetAllTabs();
}
}
@@ -624,7 +607,7 @@ namespace Volian.Controls.Library
int TableWidth = 0;
for (iC = 0; iC < tbl.Columns.Count; iC++)
{
TableWidth = TableWidth + Wcol[iC];
TableWidth += Wcol[iC];
}
tend = DateTime.Now; Console.WriteLine("{0} before Rollup columns", TimeSpan.FromTicks(tend.Ticks - tstart.Ticks).TotalMilliseconds); tstart = tend;
// roll up columns
@@ -649,7 +632,7 @@ namespace Volian.Controls.Library
Wcell[iR, i] = Wcell[iR, i - 1];
Wcell[iR, i - 1] = 0;
}
tmp = tmp - Wcol[iC + SpanC[iR, iC]];
tmp -= Wcol[iC + SpanC[iR, iC]];
SpanC[iR, iC]++;
}
iC = iC + SpanC[iR, iC] - 1;