private static void MakeDialogItem(TabControl tabbie, ref bool firstFocus, LexReadDialog dialog, string header) { TabItem item = null; item = new TabItem() { Header = header + " Context" }; tabbie.Items.Add(item); var scroller = new ScrollerPanel(); item.Content = scroller; var cursor = new CursorPanel(); scroller.Content = cursor; cursor.Content = dialog; if (firstFocus) { cursor.Focus(); } firstFocus = false; item.MouseLeftButtonUp += (sender, e) => cursor.Focus(); }
public void Show() { var win = new StickyWindow((r) => Persist.Put <PersistRect>("LexError", r), () => Persist.Get <PersistRect>("LexError", new PersistRect(100, 100, 500, 300))) { Title = "Compiler Error", }; var dock = new DockPanel(); win.Content = dock; TabControl tabbie = new TabControl() { TabStripPlacement = Dock.Bottom }; Label Lab; dock.Children.Add(Lab = new Label() { Content = Message }); DockPanel.SetDock(Lab, Dock.Top); dock.Children.Add(tabbie); bool firstFocus = true; if (CompilerList != null) { var dialog = new LexReadDialog(CompilerList, new FontFamily("Lucida Console"), 10); MakeDialogItem(tabbie, ref firstFocus, dialog, "Compiler"); } if (Source != null) { var dialog = new LexReadDialog(Source, Index, new FontFamily("Lucida Console"), 10); MakeDialogItem(tabbie, ref firstFocus, dialog, "Source"); } win.ShowDialog(); }