loading of command bars has been moved to UWT
This commit is contained in:
parent
5358a28c7c
commit
86ea89730b
@ -95,40 +95,7 @@ namespace UniversalEditor.UserInterface
|
||||
*/
|
||||
return tab;
|
||||
}
|
||||
|
||||
private Toolbar LoadCommandBar(CommandBar cb)
|
||||
{
|
||||
Toolbar tb = new Toolbar();
|
||||
foreach (CommandItem ci in cb.Items)
|
||||
{
|
||||
if (ci is SeparatorCommandItem)
|
||||
{
|
||||
tb.Items.Add(new ToolbarItemSeparator());
|
||||
}
|
||||
else if (ci is CommandReferenceCommandItem)
|
||||
{
|
||||
CommandReferenceCommandItem crci = (ci as CommandReferenceCommandItem);
|
||||
Command cmd = Application.Commands[crci.CommandID];
|
||||
if (cmd == null) continue;
|
||||
|
||||
ToolbarItemButton tsb = new ToolbarItemButton(cmd.ID, (StockType)cmd.StockType);
|
||||
tsb.SetExtraData<CommandReferenceCommandItem>("crci", crci);
|
||||
tsb.Click += tsbCommand_Click;
|
||||
tsb.Title = cmd.Title;
|
||||
tb.Items.Add(tsb);
|
||||
}
|
||||
}
|
||||
return tb;
|
||||
}
|
||||
|
||||
private void tsbCommand_Click(object sender, EventArgs e)
|
||||
{
|
||||
ToolbarItemButton tsb = (sender as ToolbarItemButton);
|
||||
CommandReferenceCommandItem crci = tsb.GetExtraData<CommandReferenceCommandItem>("crci");
|
||||
Command cmd = Application.Commands[crci.CommandID];
|
||||
cmd.Execute();
|
||||
}
|
||||
|
||||
|
||||
protected override void OnLostFocus(EventArgs e)
|
||||
{
|
||||
base.OnLostFocus(e);
|
||||
@ -217,11 +184,6 @@ namespace UniversalEditor.UserInterface
|
||||
this.Ribbon.Tabs.Add (ribbonTabHome);
|
||||
}
|
||||
}
|
||||
if (this.CommandDisplayMode == CommandDisplayMode.CommandBar || this.CommandDisplayMode == CommandDisplayMode.Both) {
|
||||
foreach (CommandBar cb in Application.CommandBars) {
|
||||
this.Controls.Add (LoadCommandBar(cb));
|
||||
}
|
||||
}
|
||||
dckContainer = new DockingContainerControl();
|
||||
dckContainer.SelectionChanged += dckContainer_SelectionChanged;
|
||||
Controls.Add (dckContainer, new BoxLayout.Constraints(true, true, 0, BoxLayout.PackType.Start));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user