Object and Property name changes for consistency

This commit is contained in:
Rich
2008-03-27 19:39:10 +00:00
parent 7caa952bc3
commit c0511c990d
19 changed files with 2229 additions and 1407 deletions

View File

@@ -11,47 +11,47 @@ namespace Volian.Controls.Library
{
public partial class StepTabRibbon : UserControl
{
private StepItem _MyDisplayItem;
public StepItem MyDisplayItem
private StepItem _MyStepItem;
public StepItem MyStepItem
{
get { return _MyDisplayItem; }
get { return _MyStepItem; }
set
{
_MyDisplayItem = value;
_MyStepItem = value;
if (value != null)
{
_MyDisplayRTB = value.MyDisplayRTB;
_MyStepRTB = value.MyStepRTB;
}
}
}
private StepRTB _MyDisplayRTB;
public StepRTB MyDisplayRTB
private StepRTB _MyStepRTB;
public StepRTB MyStepRTB
{
get { return _MyDisplayRTB; }
get { return _MyStepRTB; }
set
{
_MyDisplayRTB = value;
_MyStepRTB = value;
if (value != null)
{
_ContextMenuBar.SetContextMenuEx(_MyDisplayRTB, btnCMRtfEdit);
_MyDisplayRTB.SelectionChanged += new EventHandler(MyDisplayRTB_SelectionChanged);
_MyDisplayRTB.Leave += new EventHandler(MyDisplayRTB_Leave);
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfEdit);
_MyStepRTB.SelectionChanged += new EventHandler(MyStepRTB_SelectionChanged);
_MyStepRTB.Leave += new EventHandler(MyStepRTB_Leave);
}
}
}
void MyDisplayRTB_Leave(object sender, EventArgs e)
void MyStepRTB_Leave(object sender, EventArgs e)
{
_MyDisplayRTB.SelectionChanged -= new EventHandler(MyDisplayRTB_SelectionChanged);
_MyDisplayRTB.Leave -= new EventHandler(MyDisplayRTB_Leave);
_MyStepRTB.SelectionChanged -= new EventHandler(MyStepRTB_SelectionChanged);
_MyStepRTB.Leave -= new EventHandler(MyStepRTB_Leave);
}
void MyDisplayRTB_SelectionChanged(object sender, EventArgs e)
void MyStepRTB_SelectionChanged(object sender, EventArgs e)
{
btnCMBold.Checked = btnBold.Checked = _MyDisplayRTB.SelectionFont.Bold;
btnCMItalics.Checked = btnItalics.Checked = _MyDisplayRTB.SelectionFont.Italic;
btnCMUnderline.Checked = btnUnderline.Checked = _MyDisplayRTB.SelectionFont.Underline;
btnCMSubscript.Checked = btnSubscript.Checked = RTBAPI.IsSubScript(_MyDisplayRTB);
btnCMSuperscript.Checked = btnSuperscript.Checked = RTBAPI.IsSuperScript(_MyDisplayRTB);
btnCMCut.Enabled = btnCMCopy.Enabled = btnCut.Enabled = btnCopy.Enabled = _MyDisplayRTB.SelectionLength > 0;
btnCMBold.Checked = btnBold.Checked = _MyStepRTB.SelectionFont.Bold;
btnCMItalics.Checked = btnItalics.Checked = _MyStepRTB.SelectionFont.Italic;
btnCMUnderline.Checked = btnUnderline.Checked = _MyStepRTB.SelectionFont.Underline;
btnCMSubscript.Checked = btnSubscript.Checked = RTBAPI.IsSubScript(_MyStepRTB);
btnCMSuperscript.Checked = btnSuperscript.Checked = RTBAPI.IsSuperScript(_MyStepRTB);
btnCMCut.Enabled = btnCMCopy.Enabled = btnCut.Enabled = btnCopy.Enabled = _MyStepRTB.SelectionLength > 0;
}
public StepTabRibbon()
{
@@ -85,73 +85,73 @@ namespace Volian.Controls.Library
private void btnSym_Click(object sender, EventArgs e)
{
DevComponents.DotNetBar.ButtonItem b = (DevComponents.DotNetBar.ButtonItem)sender;
_MyDisplayRTB.InsertSymbol((string)b.Tag);
_MyStepRTB.InsertSymbol((string)b.Tag);
}
private void btnPaste_Click(object sender, EventArgs e)
{
IDataObject myDO = Clipboard.GetDataObject();
if (myDO.GetDataPresent("Rich Text Format"))
_MyDisplayRTB.SelectedRtf = myDO.GetData("Rich Text Format").ToString();
_MyStepRTB.SelectedRtf = myDO.GetData("Rich Text Format").ToString();
else if (myDO.GetDataPresent("Text"))
_MyDisplayRTB.SelectedText = myDO.GetData("Text").ToString();
_MyStepRTB.SelectedText = myDO.GetData("Text").ToString();
}
private void btnCut_Click(object sender, EventArgs e)
{
Clipboard.Clear();
DataObject myDO = new DataObject("Rich Text Format", _MyDisplayRTB.SelectedRtf);
DataObject myDO = new DataObject("Rich Text Format", _MyStepRTB.SelectedRtf);
Clipboard.SetDataObject(myDO);
_MyDisplayRTB.SelectedText = "";
_MyStepRTB.SelectedText = "";
}
private void btnCopy_Click(object sender, EventArgs e)
{
Clipboard.Clear();
DataObject myDO = new DataObject("Rich Text Format", _MyDisplayRTB.SelectedRtf);
DataObject myDO = new DataObject("Rich Text Format", _MyStepRTB.SelectedRtf);
Clipboard.SetDataObject(myDO);
}
private void btnBold_Click(object sender, EventArgs e)
{
FontStyle fs = _MyDisplayRTB.SelectionFont.Style ^ FontStyle.Bold;
_MyDisplayRTB.SelectionFont = new Font(_MyDisplayRTB.SelectionFont, fs);
btnCMBold.Checked = btnBold.Checked = _MyDisplayRTB.SelectionFont.Bold;
FontStyle fs = _MyStepRTB.SelectionFont.Style ^ FontStyle.Bold;
_MyStepRTB.SelectionFont = new Font(_MyStepRTB.SelectionFont, fs);
btnCMBold.Checked = btnBold.Checked = _MyStepRTB.SelectionFont.Bold;
}
private void btnItalics_Click(object sender, EventArgs e)
{
FontStyle fs = _MyDisplayRTB.SelectionFont.Style ^ FontStyle.Italic;
_MyDisplayRTB.SelectionFont = new Font(_MyDisplayRTB.SelectionFont, fs);
btnCMItalics.Checked = btnItalics.Checked = _MyDisplayRTB.SelectionFont.Italic;
FontStyle fs = _MyStepRTB.SelectionFont.Style ^ FontStyle.Italic;
_MyStepRTB.SelectionFont = new Font(_MyStepRTB.SelectionFont, fs);
btnCMItalics.Checked = btnItalics.Checked = _MyStepRTB.SelectionFont.Italic;
}
private void btnUnderline_Click(object sender, EventArgs e)
{
FontStyle fs = _MyDisplayRTB.SelectionFont.Style ^ FontStyle.Underline;
_MyDisplayRTB.SelectionFont = new Font(_MyDisplayRTB.SelectionFont, fs);
btnCMUnderline.Checked = btnUnderline.Checked = _MyDisplayRTB.SelectionFont.Underline;
FontStyle fs = _MyStepRTB.SelectionFont.Style ^ FontStyle.Underline;
_MyStepRTB.SelectionFont = new Font(_MyStepRTB.SelectionFont, fs);
btnCMUnderline.Checked = btnUnderline.Checked = _MyStepRTB.SelectionFont.Underline;
}
private void btnSuperscript_Click(object sender, EventArgs e)
{
RTBAPI.ToggleSuperscript(!RTBAPI.IsSuperScript(_MyDisplayRTB), _MyDisplayRTB, _MyDisplayRTB.SelectionLength == 0 ? RTBAPI.RTBSelection.SCF_DEFAULT : RTBAPI.RTBSelection.SCF_SELECTION);
btnCMSuperscript.Checked = btnSuperscript.Checked = RTBAPI.IsSuperScript(_MyDisplayRTB);
RTBAPI.ToggleSuperscript(!RTBAPI.IsSuperScript(_MyStepRTB), _MyStepRTB, _MyStepRTB.SelectionLength == 0 ? RTBAPI.RTBSelection.SCF_DEFAULT : RTBAPI.RTBSelection.SCF_SELECTION);
btnCMSuperscript.Checked = btnSuperscript.Checked = RTBAPI.IsSuperScript(_MyStepRTB);
}
private void btnSubscript_Click(object sender, EventArgs e)
{
RTBAPI.ToggleSubscript(!RTBAPI.IsSubScript(_MyDisplayRTB), _MyDisplayRTB, _MyDisplayRTB.SelectionLength == 0 ? RTBAPI.RTBSelection.SCF_DEFAULT : RTBAPI.RTBSelection.SCF_SELECTION);
btnCMSubscript.Checked = btnSubscript.Checked = RTBAPI.IsSubScript(_MyDisplayRTB);
RTBAPI.ToggleSubscript(!RTBAPI.IsSubScript(_MyStepRTB), _MyStepRTB, _MyStepRTB.SelectionLength == 0 ? RTBAPI.RTBSelection.SCF_DEFAULT : RTBAPI.RTBSelection.SCF_SELECTION);
btnCMSubscript.Checked = btnSubscript.Checked = RTBAPI.IsSubScript(_MyStepRTB);
}
private void btnUppercase_Click(object sender, EventArgs e)
{
_MyDisplayRTB.SetSelectedCase('U');
_MyStepRTB.SetSelectedCase('U');
}
private void btnLowercase_Click(object sender, EventArgs e)
{
_MyDisplayRTB.SetSelectedCase('l');
_MyStepRTB.SetSelectedCase('l');
}
private void btnTitleCase_Click(object sender, EventArgs e)
{
_MyDisplayRTB.SetSelectedCase('T');
_MyStepRTB.SetSelectedCase('T');
}
//public event DisplayRTBLinkEvent LinkInsertTran;
//private void OnLinkInsertTran(object sender, LinkClickedEventArgs args)
@@ -164,12 +164,12 @@ namespace Volian.Controls.Library
// see if user is positioned 'on' a transition within the rtb, if so do a modify, otherwise,
// insert transition.
StepTabPanel tmp = Parent as StepTabPanel;
tmp.MyTabControl.OnLinkModifyTran(this, new DisplayLinkEventArgs(_MyDisplayItem, null));
tmp.MyDisplayTabControl.OnLinkModifyTran(this, new StepPanelLinkEventArgs(_MyStepItem, null));
}
private void btnInsHrdSpc_Click(object sender, EventArgs e)
{
_MyDisplayRTB.InsertSymbol(@"\u160?");
_MyStepRTB.InsertSymbol(@"\u160?");
}
private void btnInsRO_Click(object sender, EventArgs e)
@@ -177,17 +177,17 @@ namespace Volian.Controls.Library
// see if user is positioned 'on' an RO within the rtb, if so do a modify, otherwise,
// insert transition.
StepTabPanel tmp = Parent as StepTabPanel;
tmp.MyTabControl.OnLinkModifyRO(this, new DisplayLinkEventArgs(_MyDisplayItem, null));
tmp.MyDisplayTabControl.OnLinkModifyRO(this, new StepPanelLinkEventArgs(_MyStepItem, null));
}
private void btnRedo_Click(object sender, EventArgs e)
{
_MyDisplayRTB.Redo();
_MyStepRTB.Redo();
}
private void btnUndo_Click(object sender, EventArgs e)
{
_MyDisplayRTB.Undo();
_MyStepRTB.Undo();
}
}
}