This commit is contained in:
2011-04-06 14:24:49 +00:00
parent 0637a08e83
commit 6e353f6781
3 changed files with 20 additions and 6 deletions

View File

@@ -632,8 +632,9 @@ namespace Volian.Controls.Library
{
_MouseDown = true;
//Console.WriteLine("vvvvvvvvvv StepRTB Mouse Down id= {0}",MyItemInfo.ItemID);
bool inPsi = this.Parent.FindForm().Name.Contains("frmPSI");
if (!_ContextMenuStripChanged)
OnSetMenu(this, new StepRTBMenuEventArgs("OpenContextMenu"));
OnSetMenu(this, new StepRTBMenuEventArgs(inPsi?"PSI":"OpenContextMenu"));
_ContextMenuStripChanged = false;
CorrectSelectionAtEndOfLine();
}
@@ -945,7 +946,7 @@ namespace Volian.Controls.Library
else
AddLink20(linkUrl, linkValue);
}
private string FontTable
public string FontTable
{
get
{

View File

@@ -96,6 +96,10 @@ namespace Volian.Controls.Library
//Console.WriteLine(string.Format("StepTabRibbon: In set of MyStepRTB, Selected Text = {0}", MyStepRTB.SelectedText));
switch (_MyStepRTB.FieldToEdit)
{
case E_FieldToEdit.PSI:
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMPSI);
_DefaultContextMenu = btnCMPSI;
break;
case E_FieldToEdit.StepText:
if (MyFlexGrid != null)
{
@@ -147,7 +151,7 @@ namespace Volian.Controls.Library
MessageBox.Show("No symbols are available, check with administrator");
return;
}
BuildSymbolGallery(sl, galleryContainerSymbolsCM, galleryContainerSymbolsCM3, galleryContainerSymbolsGrid);
BuildSymbolGallery(sl, galleryContainerSymbolsCM, galleryContainerSymbolsCM3, galleryContainerSymbolsGrid, galleryContainerSymbolsCM4);
//BuildSymbolGallery(sl, galleryContainerSymbolsCM);
//BuildSymbolGallery(sl, galleryContainerSymbolsCM3);
//BuildSymbolGallery(sl, galleryContainerSymbolsGrid);
@@ -247,7 +251,7 @@ namespace Volian.Controls.Library
// //SetButtonAndMenuEnabling(false);
//}
private void BuildSymbolGallery(SymbolList sl, DevComponents.DotNetBar.GalleryContainer gc1, DevComponents.DotNetBar.GalleryContainer gc2, DevComponents.DotNetBar.GalleryContainer gc3)
private void BuildSymbolGallery(SymbolList sl, DevComponents.DotNetBar.GalleryContainer gc1, DevComponents.DotNetBar.GalleryContainer gc2, DevComponents.DotNetBar.GalleryContainer gc3, DevComponents.DotNetBar.GalleryContainer gc4)
{
foreach (Symbol sym in sl)
{
@@ -269,6 +273,9 @@ namespace Volian.Controls.Library
DevComponents.DotNetBar.ButtonItem btnCM3 = GetCMButton(sym);
btnCM3.Click += new System.EventHandler(btnSym_Click);
gc3.SubItems.Add(btnCM3);
DevComponents.DotNetBar.ButtonItem btnCM4 = GetCMButton(sym);
btnCM4.Click += new System.EventHandler(btnSym_Click);
gc4.SubItems.Add(btnCM4);
}
}
@@ -1302,7 +1309,9 @@ namespace Volian.Controls.Library
{
bool displayMenu = false;
E_AccStep? actable = 0;
StepData sd = MyItemInfo.FormatStepData;
if (menuName.Contains("PSI")) Console.WriteLine("menu = {0}", menuName);
StepData sd = MyItemInfo==null?null:MyItemInfo.FormatStepData;
if (sd != null) // will be null if section
{
actable = sd.StepEditData.AcTable;
@@ -1311,6 +1320,10 @@ namespace Volian.Controls.Library
//btnInsCaut.Enabled = (actable & E_AccStep.AddingCaution) > 0;
switch (menuName)
{
case "PSI":
displayMenu = true;
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMPSI);
break;
case "InsHLS":
displayMenu = true;
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMInsHLS);
@@ -1980,7 +1993,7 @@ namespace Volian.Controls.Library
//_RibbonControl.Height = rbnBorderlistBox.Height + _RibbonControl.Height - _RibbonControl.ClientSize.Height;
}
}
public enum E_FieldToEdit { StepText, Text, Number };
public enum E_FieldToEdit { StepText, Text, Number, PSI };
public class StepTabRibbonEventArgs : EventArgs
{
public StepTabRibbonEventArgs() { ; }