public ErrorListPad() { instance = this; properties = PropertyService.NestedProperties("ErrorListPad"); TaskService.Cleared += TaskServiceCleared; TaskService.Added += TaskServiceAdded; TaskService.Removed += TaskServiceRemoved; TaskService.InUpdateChanged += delegate { if (!TaskService.InUpdate) InternalShowResults(); }; SD.BuildService.BuildFinished += ProjectServiceEndBuild; SD.ProjectService.SolutionOpened += OnSolutionOpen; SD.ProjectService.SolutionClosed += OnSolutionClosed; errors = new ObservableCollection<SDTask>(TaskService.Tasks.Where(t => t.TaskType != TaskType.Comment)); toolBar = ToolBarService.CreateToolBar(contentPanel, this, "/SharpDevelop/Pads/ErrorList/Toolbar"); contentPanel.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); contentPanel.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); contentPanel.Children.Add(toolBar); contentPanel.Children.Add(errorView); Grid.SetRow(errorView, 1); errorView.ItemsSource = errors; errorView.MouseDoubleClick += ErrorViewMouseDoubleClick; errorView.Style = (Style)new TaskViewResources()["TaskListView"]; errorView.ContextMenu = MenuService.CreateContextMenu(errorView, DefaultContextMenuAddInTreeEntry); errorView.CommandBindings.Add(new CommandBinding(ApplicationCommands.Copy, ExecuteCopy, CanExecuteCopy)); errorView.CommandBindings.Add(new CommandBinding(ApplicationCommands.SelectAll, ExecuteSelectAll, CanExecuteSelectAll)); InternalShowResults(); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.toolBar1 = ((System.Windows.Controls.ToolBar)(target)); return; case 2: this.grid1 = ((System.Windows.Controls.Grid)(target)); return; case 3: this.listBox1 = ((System.Windows.Controls.ListBox)(target)); #line 19 "..\..\MainWindow.xaml" this.listBox1.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.listBox1_SelectionChanged); #line default #line hidden return; case 4: this.gridSplitter1 = ((System.Windows.Controls.GridSplitter)(target)); return; case 5: this.richTextBox1 = ((System.Windows.Controls.RichTextBox)(target)); return; case 6: #line 23 "..\..\MainWindow.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; case 7: #line 25 "..\..\MainWindow.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_1); #line default #line hidden return; case 8: this.Slider1 = ((System.Windows.Controls.Slider)(target)); #line 26 "..\..\MainWindow.xaml" this.Slider1.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.Slider1_ValueChanged); #line default #line hidden return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.toolBar = ((System.Windows.Controls.ToolBar)(target)); return; case 2: this.Url = ((DevExpress.Xpf.Editors.TextEdit)(target)); return; case 3: this.toolBar1 = ((System.Windows.Controls.ToolBar)(target)); return; case 4: this.button = ((System.Windows.Controls.Button)(target)); #line 34 "..\..\MainWindow.xaml" this.button.Click += new System.Windows.RoutedEventHandler(this.button_Click); #line default #line hidden return; case 5: this.toolBar2 = ((System.Windows.Controls.ToolBar)(target)); return; case 6: this.button1 = ((System.Windows.Controls.Button)(target)); #line 45 "..\..\MainWindow.xaml" this.button1.Click += new System.Windows.RoutedEventHandler(this.button1_Click); #line default #line hidden return; case 7: this.toolBar3 = ((System.Windows.Controls.ToolBar)(target)); return; case 8: this.button2 = ((System.Windows.Controls.Button)(target)); #line 56 "..\..\MainWindow.xaml" this.button2.Click += new System.Windows.RoutedEventHandler(this.button2_Click); #line default #line hidden return; case 9: this.tabControl = ((System.Windows.Controls.TabControl)(target)); return; } this._contentLoaded = true; }
private void AddToolBar(IMenu toolbarModel) { var toolBar = new ToolBar(); toolBar.SetResourceReference(ToolBar.StyleProperty, Resources.ToolBarStyleKey); toolBar.DataContext = toolbarModel; m_toolBarTray.ToolBars.Add(toolBar); }
private void TryArrangeChildren(IList<Region> children) { if (children.Count > 0) { var toolBar = new ToolBar(); toolBarContainer.Content = toolBar; toolBarContainer.Visibility = Visibility.Visible; for (int i = 0, c = children.Count; i < c; i++) { var child = children[i]; var btn = new Button() { Content = child.ChildrenLabel }; btn.Click += (o, e) => { var control = child.ControlResult.Control; control.RemoveFromParent(); new Window() { WindowState = WindowState.Maximized, Content = control }.Show(); }; toolBar.Items.Add(btn); } } }
void AddFileToolBar(ToolBarTray tray, int band, int index) { ToolBar toolbar = new ToolBar(); toolbar.Band = band; toolbar.BandIndex = index; tray.ToolBars.Add(toolbar); RoutedUICommand[] comm = { ApplicationCommands.New, ApplicationCommands.Open, ApplicationCommands.Save }; string[] strImages = { "NewDocumentHS.png", "OpenHS.png", "SaveHS.png" }; for (int i = 0; i < 3; i++) { Button btn = new Button(); btn.Command = comm[i]; toolbar.Items.Add(btn); string fileName = Path.Combine(Directory.GetCurrentDirectory(), strImages[i]); Image img = new Image(); img.Source = new BitmapImage(new Uri(fileName)); img.Stretch = Stretch.None; btn.Content = img; ToolTip tip = new ToolTip(); tip.Content = comm[i].Text; btn.ToolTip = tip; } CommandBindings.Add(new CommandBinding(ApplicationCommands.New, OnNew)); CommandBindings.Add(new CommandBinding(ApplicationCommands.Open, OnOpen)); CommandBindings.Add(new CommandBinding(ApplicationCommands.Save, OnSave)); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.ButtonBar = ((System.Windows.Controls.ToolBar)(target)); return; case 2: this.NewWeapon = ((System.Windows.Controls.Button)(target)); return; case 3: this.NewItem = ((System.Windows.Controls.Button)(target)); return; case 4: this.PasteCode = ((System.Windows.Controls.Button)(target)); return; case 5: this.SelectedSlot = ((System.Windows.Controls.ContentControl)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.menu = ((System.Windows.Controls.Menu)(target)); return; case 2: this.toolBar = ((System.Windows.Controls.ToolBar)(target)); return; case 3: this.toolBar1 = ((System.Windows.Controls.ToolBar)(target)); return; case 4: this.button = ((System.Windows.Controls.Button)(target)); #line 41 "..\..\MainWindow.xaml" this.button.Click += new System.Windows.RoutedEventHandler(this.button_Click); #line default #line hidden return; case 5: this.textBox = ((System.Windows.Controls.TextBox)(target)); return; } this._contentLoaded = true; }
protected AbstractConsolePad() { this.panel = new Grid(); this.console = new ConsoleControl(); // creating the toolbar accesses the WordWrap property, so we must do this after creating the console this.toolbar = BuildToolBar(); this.toolbar.SetValue(DockPanel.DockProperty, Dock.Top); panel.Children.Add(toolbar); panel.Children.Add(console); panel.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); panel.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); Grid.SetRow(console, 1); this.history = new List<string>(); this.console.editor.TextArea.PreviewKeyDown += (sender, e) => { e.Handled = HandleInput(e.Key); }; this.console.editor.TextArea.TextEntered += AbstractConsolePadTextEntered; this.InitializeConsole(); }
public void AddSeparator(double width,ToolBar location) { Separator sp = new Separator(); sp.Width = width; BrushConverter bc = new BrushConverter(); sp.Background = (Brush)bc.ConvertFrom("Transparent"); location.Items.Add(sp); }
public static void RemoveToolBarOverflow(ToolBar toolBar) { FrameworkElement overflowGrid = toolBar.Template.FindName("OverflowGrid", toolBar) as FrameworkElement; if (overflowGrid != null) { overflowGrid.Visibility = Visibility.Collapsed; } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.spnlControls = ((System.Windows.Controls.WrapPanel)(target)); return; case 2: this.Save = ((System.Windows.Controls.Button)(target)); #line 18 "..\..\CollectionEditor.xaml" this.Save.Click += new System.Windows.RoutedEventHandler(this.Save_Click); #line default #line hidden return; case 3: this.Canel = ((System.Windows.Controls.Button)(target)); #line 19 "..\..\CollectionEditor.xaml" this.Canel.Click += new System.Windows.RoutedEventHandler(this.Canel_Click); #line default #line hidden return; case 4: this.lbxEnteties = ((System.Windows.Controls.ListBox)(target)); #line 20 "..\..\CollectionEditor.xaml" this.lbxEnteties.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.lbxEnteties_SelectionChanged); #line default #line hidden return; case 5: this.tbToolBar = ((System.Windows.Controls.ToolBar)(target)); return; case 6: this.MainMenu = ((System.Windows.Controls.Menu)(target)); #line 26 "..\..\CollectionEditor.xaml" this.MainMenu.AddHandler(System.Windows.Controls.MenuItem.ClickEvent, new System.Windows.RoutedEventHandler(this.Menu_Click)); #line default #line hidden return; case 7: this.mnuNewItem = ((System.Windows.Controls.MenuItem)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.MenuLabel = ((System.Windows.Controls.Label)(target)); return; case 2: this.SaveButton = ((System.Windows.Controls.Button)(target)); return; case 3: this.PrintButton = ((System.Windows.Controls.Button)(target)); return; case 4: this.CopyButton = ((System.Windows.Controls.Button)(target)); return; case 5: this.NextButton = ((System.Windows.Controls.Button)(target)); return; case 6: this.CancelButton = ((System.Windows.Controls.Button)(target)); return; case 7: this.MainTabControl = ((System.Windows.Controls.TabControl)(target)); return; case 8: this.PersonTabItem = ((System.Windows.Controls.TabItem)(target)); return; case 9: this.GeneralGroupBox = ((System.Windows.Controls.GroupBox)(target)); return; case 10: this.VehicleTabItem = ((System.Windows.Controls.TabItem)(target)); return; case 11: this.toolBar1 = ((System.Windows.Controls.ToolBar)(target)); return; case 12: this.richTextBox1 = ((System.Windows.Controls.RichTextBox)(target)); return; case 13: this.documentViewer1 = ((System.Windows.Controls.DocumentViewer)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.SettingsFlyout = ((MahApps.Metro.Controls.Flyout)(target)); return; case 2: this.enabledSwitch = ((MahApps.Metro.Controls.ToggleSwitch)(target)); #line 50 "..\..\MainWindow.xaml" this.enabledSwitch.IsCheckedChanged += new System.EventHandler(this.OnIsCheckedChanged); #line default #line hidden return; case 3: this.HardwareID = ((System.Windows.Controls.TextBox)(target)); return; case 4: this.ScripList = ((System.Windows.Controls.ListBox)(target)); #line 100 "..\..\MainWindow.xaml" this.ScripList.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.OnSelectionChanged); #line default #line hidden return; case 5: this.SearchBox = ((System.Windows.Controls.TextBox)(target)); return; case 6: this.ReflectTree = ((System.Windows.Controls.TreeView)(target)); return; case 7: this.MessageEditor = ((ICSharpCode.AvalonEdit.TextEditor)(target)); return; case 8: this.InfoEditor = ((ICSharpCode.AvalonEdit.TextEditor)(target)); return; case 9: this.ScripEditor = ((ICSharpCode.AvalonEdit.TextEditor)(target)); return; case 10: this.ToolBar1 = ((System.Windows.Controls.ToolBar)(target)); return; } this._contentLoaded = true; }
public static void ResizeToolbar(ToolBar toolStrip, FrameworkElement resizingItem) { var w = (from FrameworkElement t in toolStrip.Items where t != resizingItem select t.ActualWidth).Sum(); if (((toolStrip.ActualWidth - w) - 50) > 50) resizingItem.Width = (toolStrip.ActualWidth - w) - 50; else resizingItem.Width = 50; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.toolBar1 = ((System.Windows.Controls.ToolBar)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.MainWindow = ((EyeInTheSky.MainWindow)(target)); return; case 2: this.MenuStrip = ((System.Windows.Controls.Menu)(target)); return; case 3: this.MenuStrip_FileButton = ((System.Windows.Controls.MenuItem)(target)); #line 11 "..\..\..\View\MainWindow.xaml" this.MenuStrip_FileButton.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click); #line default #line hidden return; case 4: this.MenuStrip_DataBaseButton = ((System.Windows.Controls.MenuItem)(target)); #line 12 "..\..\..\View\MainWindow.xaml" this.MenuStrip_DataBaseButton.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click); #line default #line hidden return; case 5: this.MenuStrip_HelpButton = ((System.Windows.Controls.MenuItem)(target)); #line 13 "..\..\..\View\MainWindow.xaml" this.MenuStrip_HelpButton.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click); #line default #line hidden return; case 6: this.ToolBar = ((System.Windows.Controls.ToolBar)(target)); return; case 7: #line 16 "..\..\..\View\MainWindow.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; } this._contentLoaded = true; }
public CraftTheToolbar() { Title = "Craft the Toolbar"; RoutedUICommand[] comm = { ApplicationCommands.New, ApplicationCommands.Open, ApplicationCommands.Save, ApplicationCommands.Print, ApplicationCommands.Cut, ApplicationCommands.Copy, ApplicationCommands.Paste, ApplicationCommands.Delete }; string[] strImages = { "NewDocumentHS.png", "openHS.png", "saveHS.png", "PrintHS.png", "CutHS.png", "CopyHS.png", "PasteHS.png", "DeleteHS.png" }; // Create DockPanel as content of window. DockPanel dock = new DockPanel(); dock.LastChildFill = false; Content = dock; // Create Toolbar docked at top of window. ToolBar toolbar = new ToolBar(); dock.Children.Add(toolbar); DockPanel.SetDock(toolbar, Dock.Top); // Create the Toolbar buttons. for (int i = 0; i < 8; i++) { if (i == 4) toolbar.Items.Add(new Separator()); // Create the Button. Button btn = new Button(); btn.Command = comm[i]; toolbar.Items.Add(btn); // Create an Image as content of the Button. Image img = new Image(); img.Source = new BitmapImage( new Uri("pack://application:,,/Images/" + strImages[i])); img.Stretch = Stretch.None; btn.Content = img; // Create a ToolTip based on the UICommand text. ToolTip tip = new ToolTip(); tip.Content = comm[i].Text; btn.ToolTip = tip; // Add the UICommand to the window command bindings. CommandBindings.Add( new CommandBinding(comm[i], ToolBarButtonOnClick)); } }
//Add new tool to toolsbox public void AddTool(BaseUMLMode Mode, Uri icon1, Uri icon2, ToolBar location) { ToolButton UIButton = new Controls.ToolButton(Mode, icon1, icon2); UIButton.AddHandler(MouseLeftButtonDownEvent, new MouseButtonEventHandler(ToolsButton_MouseLeftButtonDown), true); UIButton.AddHandler(MouseEnterEvent, new MouseEventHandler(ToolsButton_MouseEnter), true); UIButton.AddHandler(MouseLeaveEvent, new MouseEventHandler(ToolsPanel_MouseEnter), true); location.Items.Add(UIButton); Buttons.Add(UIButton); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.ToolBar = ((System.Windows.Controls.ToolBar)(target)); return; case 2: #line 21 "..\..\..\View\Home.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.OpenAboutWindow); #line default #line hidden return; case 3: #line 23 "..\..\..\View\Home.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Exit); #line default #line hidden return; case 4: this.Clock = ((System.Windows.Controls.Label)(target)); return; case 5: this.todoist = ((System.Windows.Controls.Button)(target)); return; case 6: this.statistics = ((System.Windows.Controls.Button)(target)); return; case 7: this.photoview = ((System.Windows.Controls.Button)(target)); return; case 8: this.genpass = ((System.Windows.Controls.Button)(target)); return; case 9: this.manpass = ((System.Windows.Controls.Button)(target)); return; case 10: this.timer = ((System.Windows.Controls.Button)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.timeLine = ((ICSharpCode.Profiler.Controls.ExtendedTimeLineControl)(target)); #line 33 "..\..\..\..\Src\Views\ProfilerView.xaml" this.timeLine.RangeChanged += new System.EventHandler <ICSharpCode.Profiler.Controls.RangeEventArgs>(this.TimeLineRangeChanged); #line default #line hidden return; case 2: this.toolBar1 = ((System.Windows.Controls.ToolBar)(target)); return; case 3: this.mnuQueryHistory = ((System.Windows.Controls.MenuItem)(target)); return; case 4: this.mnuClearQueryHistory = ((System.Windows.Controls.MenuItem)(target)); #line 38 "..\..\..\..\Src\Views\ProfilerView.xaml" this.mnuClearQueryHistory.Click += new System.Windows.RoutedEventHandler(this.ClearQueryHistoryClick); #line default #line hidden return; case 5: this.tabView = ((System.Windows.Controls.TabControl)(target)); #line 43 "..\..\..\..\Src\Views\ProfilerView.xaml" this.tabView.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.TabViewSelectionChanged); #line default #line hidden return; case 6: this.treeView = ((ICSharpCode.Profiler.Controls.QueryView)(target)); return; case 7: this.top20View = ((ICSharpCode.Profiler.Controls.QueryView)(target)); return; case 8: this.dummyTab = ((System.Windows.Controls.TabItem)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.myMediaElement1 = ((System.Windows.Controls.MediaElement)(target)); #line 10 "..\..\MainWindow.xaml" this.myMediaElement1.MediaFailed += new System.EventHandler <System.Windows.ExceptionRoutedEventArgs>(this.myMediaElement1_MediaFailed); #line default #line hidden return; case 2: this.toolBar1 = ((System.Windows.Controls.ToolBar)(target)); return; case 3: #line 13 "..\..\MainWindow.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; case 4: #line 14 "..\..\MainWindow.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_1); #line default #line hidden return; case 5: #line 15 "..\..\MainWindow.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_2); #line default #line hidden return; case 6: #line 16 "..\..\MainWindow.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_3); #line default #line hidden return; } this._contentLoaded = true; }
/// <summary> /// Removes the toolbar overflow side button. /// <see cref="https://stackoverflow.com/a/1051264"/> /// </summary> private void Toolbar_Loaded(object sender, RoutedEventArgs e) { System.Windows.Controls.ToolBar toolBar = sender as System.Windows.Controls.ToolBar; var overflowGrid = toolBar.Template.FindName("OverflowGrid", toolBar) as FrameworkElement; if (overflowGrid != null) { overflowGrid.Visibility = Visibility.Collapsed; } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.myToolBar = ((System.Windows.Controls.ToolBar)(target)); return; } this._contentLoaded = true; }
private void ToolBar_Loaded(object sender, RoutedEventArgs e) { System.Windows.Controls.ToolBar templatedParent = sender as System.Windows.Controls.ToolBar; FrameworkElement element = templatedParent.Template.FindName("OverflowGrid", templatedParent) as FrameworkElement; if (element != null) { element.Visibility = Visibility.Collapsed; } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.MyTabControl = ((System.Windows.Controls.TabControl)(target)); return; case 2: this.InkToolBar = ((System.Windows.Controls.ToolBar)(target)); return; case 3: this.inkRadio = ((System.Windows.Controls.RadioButton)(target)); return; case 4: this.eraseRadio = ((System.Windows.Controls.RadioButton)(target)); return; case 5: this.selectRadio = ((System.Windows.Controls.RadioButton)(target)); return; case 6: this.comboColors = ((System.Windows.Controls.ComboBox)(target)); return; case 7: this.btnSave = ((System.Windows.Controls.Button)(target)); return; case 8: this.btnLoad = ((System.Windows.Controls.Button)(target)); return; case 9: this.btnClear = ((System.Windows.Controls.Button)(target)); return; case 10: this.MyInkCanvas = ((System.Windows.Controls.InkCanvas)(target)); return; case 11: this.mySB = ((System.Windows.Controls.Primitives.ScrollBar)(target)); return; case 12: this.labelSBThumb = ((System.Windows.Controls.Label)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.MyToolbar = ((System.Windows.Controls.ToolBar)(target)); return; case 2: #line 17 "..\..\MainWindow.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.CompressMpeg_Click); #line default #line hidden return; case 3: #line 18 "..\..\MainWindow.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.DecompressMpeg_Click); #line default #line hidden return; case 4: this.InfoText = ((System.Windows.Controls.TextBlock)(target)); return; case 5: #line 29 "..\..\MainWindow.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Prev_Click); #line default #line hidden return; case 6: this.image = ((System.Windows.Controls.Image)(target)); return; case 7: #line 31 "..\..\MainWindow.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Next_Click); #line default #line hidden return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.ContainerGrid = ((System.Windows.Controls.Grid)(target)); return; case 2: this.toolbarTray = ((System.Windows.Controls.ToolBarTray)(target)); return; case 3: this.toolBar = ((System.Windows.Controls.ToolBar)(target)); return; case 4: this.BtnAdd = ((System.Windows.Controls.Button)(target)); #line 24 "..\..\NSGridView.xaml" this.BtnAdd.Click += new System.Windows.RoutedEventHandler(this.BtnAdd_Click); #line default #line hidden return; case 5: this.BtnRemove = ((System.Windows.Controls.Button)(target)); #line 27 "..\..\NSGridView.xaml" this.BtnRemove.Click += new System.Windows.RoutedEventHandler(this.BtnRemove_Click); #line default #line hidden return; case 6: this.BtnRefresh = ((System.Windows.Controls.Button)(target)); #line 30 "..\..\NSGridView.xaml" this.BtnRefresh.Click += new System.Windows.RoutedEventHandler(this.BtnRefresh_Click); #line default #line hidden return; case 7: this.dgGrid = ((Telerik.Windows.Controls.RadGridView)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.toolBar = ((System.Windows.Controls.ToolBar)(target)); return; case 2: this.btnsave = ((System.Windows.Controls.Button)(target)); #line 24 "..\..\..\..\Management\Forms\IntackForm.xaml" this.btnsave.Click += new System.Windows.RoutedEventHandler(this.Button_Save); #line default #line hidden return; case 3: this.btnclear = ((System.Windows.Controls.Button)(target)); #line 31 "..\..\..\..\Management\Forms\IntackForm.xaml" this.btnclear.Click += new System.Windows.RoutedEventHandler(this.Button_Click_1); #line default #line hidden return; case 4: this.btnexit = ((System.Windows.Controls.Button)(target)); #line 38 "..\..\..\..\Management\Forms\IntackForm.xaml" this.btnexit.Click += new System.Windows.RoutedEventHandler(this.Button_Click_2); #line default #line hidden return; case 5: this.TxtName = ((System.Windows.Controls.TextBox)(target)); return; case 6: this.TxtDesc = ((System.Windows.Controls.TextBox)(target)); return; case 7: this.TxtID = ((System.Windows.Controls.TextBox)(target)); return; } this._contentLoaded = true; }
public static void ResizeToolbar(ToolBar toolStrip, FrameworkElement resizingItem) { var w = (from FrameworkElement t in toolStrip.Items where t != resizingItem select t.ActualWidth).Sum(); if (((toolStrip.ActualWidth - w) - 50) > 50) { resizingItem.Width = (toolStrip.ActualWidth - w) - 50; } else { resizingItem.Width = 50; } }
void AddEditToolBar(ToolBarTray tray, int band, int index) { // Create Toolbar. ToolBar toolbar = new ToolBar(); toolbar.Band = band; toolbar.BandIndex = index; tray.ToolBars.Add(toolbar); RoutedUICommand[] comm = { ApplicationCommands.Cut, ApplicationCommands.Copy, ApplicationCommands.Paste, ApplicationCommands.Delete, ApplicationCommands.Undo, ApplicationCommands.Redo }; string[] strImages = { "CutHS.png", "CopyHS.png", "PasteHS.png", "DeleteHS.png", "Edit_UndoHS.png", "Edit_RedoHS.png" }; for (int i = 0; i < 6; i++) { if (i == 4) toolbar.Items.Add(new Separator()); Button btn = new Button(); btn.Command = comm[i]; toolbar.Items.Add(btn); Image img = new Image(); img.Source = new BitmapImage( new Uri("pack://application:,,/Images/" + strImages[i])); img.Stretch = Stretch.None; btn.Content = img; ToolTip tip = new ToolTip(); tip.Content = comm[i].Text; btn.ToolTip = tip; } CommandBindings.Add(new CommandBinding(ApplicationCommands.Cut)); CommandBindings.Add(new CommandBinding(ApplicationCommands.Copy)); CommandBindings.Add(new CommandBinding(ApplicationCommands.Paste)); CommandBindings.Add(new CommandBinding( ApplicationCommands.Delete, OnDelete, CanDelete)); CommandBindings.Add(new CommandBinding(ApplicationCommands.Undo)); CommandBindings.Add(new CommandBinding(ApplicationCommands.Redo)); }
public MeetTheDockers() { Title = "Meet the Dockers"; DockPanel dock = new DockPanel(); Content = dock; // Create menu. Menu menu = new Menu(); MenuItem item = new MenuItem(); item.Header = "Menu"; menu.Items.Add(item); // Dock menu at top of panel. DockPanel.SetDock(menu, Dock.Top); dock.Children.Add(menu); // Create tool bar. ToolBar tool = new ToolBar(); tool.Header = "Toolbar"; // Dock tool bar at top of panel. DockPanel.SetDock(tool, Dock.Top); dock.Children.Add(tool); // Create status bar. StatusBar status = new StatusBar(); StatusBarItem statitem = new StatusBarItem(); statitem.Content = "Status"; status.Items.Add(statitem); // Dock status bar at bottom of panel. DockPanel.SetDock(status, Dock.Bottom); dock.Children.Add(status); // Create list box. ListBox lstbox = new ListBox(); lstbox.Items.Add("List Box Item"); // Dock list box at left of panel. DockPanel.SetDock(lstbox, Dock.Left); dock.Children.Add(lstbox); // Create text box. TextBox txtbox = new TextBox(); txtbox.AcceptsReturn = true; // Add text box to panel & give it input focus. dock.Children.Add(txtbox); txtbox.Focus(); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.ComponentLibraryRoot = ((System.Windows.Controls.Grid)(target)); return; case 4: this.IconsToolBar = ((System.Windows.Controls.ToolBar)(target)); return; case 5: #line 251 "..\..\..\Views\ComponentsLibraryWindow.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.OpenImportManager_Click); #line default #line hidden return; case 6: this.FilterBox = ((TraceLab.UI.WPF.Controls.SearchTextBox)(target)); return; case 7: this.FilterBinding = ((System.Windows.Data.Binding)(target)); return; case 8: this.PlaceHolderWidth = ((System.Windows.Controls.Grid)(target)); return; case 9: this.ComponentLibrary = ((TraceLab.UI.WPF.Controls.TreeListView)(target)); return; case 10: this.rescanCanvas = ((System.Windows.Controls.Grid)(target)); return; case 11: this.isRescanBinding = ((System.Windows.Data.Binding)(target)); return; case 12: this.rescanImage = ((System.Windows.Controls.Image)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.browserTabItem = ((System.Windows.Controls.TabItem)(target)); return; case 2: this.browserStackPanel = ((System.Windows.Controls.StackPanel)(target)); return; case 3: this.browserToolBar = ((System.Windows.Controls.ToolBar)(target)); return; case 4: this.backButton = ((System.Windows.Controls.Button)(target)); #line 14 "..\..\WebBrowser.xaml" this.backButton.Click += new System.Windows.RoutedEventHandler(this.BackButton_Click); #line default #line hidden return; case 5: this.forwardButton = ((System.Windows.Controls.Button)(target)); #line 15 "..\..\WebBrowser.xaml" this.forwardButton.Click += new System.Windows.RoutedEventHandler(this.ForwardButton_Click); #line default #line hidden return; case 6: this.searchTextBox = ((System.Windows.Controls.TextBox)(target)); return; case 7: this.searchButton = ((System.Windows.Controls.Button)(target)); return; case 8: this.webBrowser = ((System.Windows.Controls.WebBrowser)(target)); return; } this._contentLoaded = true; }
private void ToolBar_Loaded(object sender, RoutedEventArgs e) { System.Windows.Controls.ToolBar toolBar = sender as System.Windows.Controls.ToolBar; var overflowGrid = toolBar.Template.FindName("OverflowGrid", toolBar) as FrameworkElement; if (overflowGrid != null) { overflowGrid.Visibility = Visibility.Collapsed; } var mainPanelBorder = toolBar.Template.FindName("MainPanelBorder", toolBar) as FrameworkElement; { mainPanelBorder.Margin = new Thickness(0); } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.myWindow = ((Graph_Editor.PropertiesWindow.EdgeProperty)(target)); return; case 2: this.fullWindow = ((System.Windows.Controls.Grid)(target)); return; case 3: this.weightEdge = ((System.Windows.Controls.TextBox)(target)); #line 10 "..\..\..\PropertiesWindow\EdgeProperty.xaml" this.weightEdge.KeyDown += new System.Windows.Input.KeyEventHandler(this.weightEdge_KeyDown); #line default #line hidden return; case 4: this.labeWeight = ((System.Windows.Controls.Label)(target)); return; case 5: this.colorBar = ((System.Windows.Controls.ToolBar)(target)); return; case 6: this.labelColor = ((System.Windows.Controls.Label)(target)); return; case 7: this.buttonClose = ((System.Windows.Controls.Button)(target)); #line 14 "..\..\..\PropertiesWindow\EdgeProperty.xaml" this.buttonClose.Click += new System.Windows.RoutedEventHandler(this.buttonClose_Click); #line default #line hidden return; case 8: this.logo = ((System.Windows.Controls.Image)(target)); return; } this._contentLoaded = true; }
public CraftTheToolbar() { Title = "Craft the Toolbar"; RoutedUICommand[] comm = { ApplicationCommands.New, ApplicationCommands.Open, ApplicationCommands.Save, ApplicationCommands.Print, ApplicationCommands.Cut, ApplicationCommands.Copy, ApplicationCommands.Paste, ApplicationCommands.Delete }; string[] strImages = { "NewDocumentHS.png", "OpenHS.png", "SaveHS.png", "PrintHS.png", "CutHS.png", "CopyHS.png", "PasteHS.png", "DeleteHS.png" }; DockPanel dock = new DockPanel(); dock.LastChildFill = false; Content = dock; ToolBar toolbar = new ToolBar(); dock.Children.Add(toolbar); DockPanel.SetDock(toolbar, Dock.Top); for (int i = 0; i < 8; i++) { if (i == 4) toolbar.Items.Add(new Separator()); Button btn = new Button(); btn.Command = comm[i]; toolbar.Items.Add(btn); Image img = new Image(); string fileName = Path.Combine(Directory.GetCurrentDirectory(), strImages[i]); img.Source = new BitmapImage(new Uri(fileName)); img.Stretch = Stretch.None; btn.Content = img; ToolTip tip = new ToolTip(); tip.Content = comm[i].Text; btn.ToolTip = tip; CommandBindings.Add(new CommandBinding(comm[i], ToolBarButtonOnClick)); } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.TBdelegateList = ((System.Windows.Controls.ToolBar)(target)); return; case 2: this.listOfRepresentative = ((System.Windows.Controls.DataGrid)(target)); return; } this._contentLoaded = true; }
void AddParaToolBar(ToolBarTray tray, int band, int index) { ToolBar toolbar = new ToolBar(); toolbar.Band = band; toolbar.BandIndex = index; tray.ToolBars.Add(toolbar); toolbar.Items.Add(btnAlignment[0] = CreateButton(TextAlignment.Left, "Align Left", 0, 4)); toolbar.Items.Add(btnAlignment[1] = CreateButton(TextAlignment.Center, "Center", 2, 2)); toolbar.Items.Add(btnAlignment[2] = CreateButton(TextAlignment.Right, "Align Right", 4, 0)); toolbar.Items.Add(btnAlignment[3] = CreateButton(TextAlignment.Justify, "Justify", 0, 0)); txtbox.SelectionChanged += TextBoxOnSelectionChanged2; }
/// <summary> /// Creates the UI. Returns the root. /// </summary> private Grid InitView() { Grid grid; Controls.Add(new ElementHost { Dock = DockStyle.Fill, Child = grid = new Grid() }); KeyboardNavigation.SetDirectionalNavigation(grid, KeyboardNavigationMode.None); grid.AddRowChild("Auto", new TextBlock(new Run(Stringtable.ChangesAfterRestart)) { Margin = new Thickness(5), HorizontalAlignment = HorizontalAlignment.Center }); // TODO: show only if there are changes // TODO(H): icons on the toolbar ToolBar toolbar; grid.AddRowChild("Auto", new ToolBarTray { ToolBars = { (toolbar = new ToolBar()) } }); KeyboardNavigation.SetTabNavigation(toolbar, KeyboardNavigationMode.Continue); KeyboardNavigation.SetTabIndex(toolbar, 10); toolbar.Items.Add(new Button { Content = new StackPanel { Orientation = Orientation.Horizontal, Children = { new Image { Width = 16, Height = 16, Source = Utils.LoadResourceImage("Icons/DownloadMorePlugins.png") }, new TextBlock{ VerticalAlignment = VerticalAlignment.Center }.Append(Stringtable.DownloadCommandText) } }, ToolTip = Stringtable.DownloadCommandTooltip, Command = CommandDownloadMorePlugins }); toolbar.Items.Add(new Button { Content = new StackPanel { Orientation = Orientation.Horizontal, Children = { new Image { Width = 16, Height = 16, Source = Utils.LoadResourceImage("Icons/RefreshPlugins.png") }, new TextBlock{ VerticalAlignment = VerticalAlignment.Center }.Append(Stringtable.RefreshCommandText) } }, ToolTip = Stringtable.RefreshCommandTooltip, Command = CommandRefresh }); toolbar.Items.Add(new Separator()); toolbar.Items.Add(new Button { Content = Stringtable.AboutPluginsCommandText, ToolTip = Stringtable.AboutPluginsCommandTooltip, Command = CommandAboutOmeaPlugins }); grid.AddRowChild("*", InitView_PluginsList()); return(grid); }
/// <summary> /// Default cto /// </summary> protected DebuggerPad() { // UI this.panel = new DockPanel(); this.toolbar = BuildToolBar(); if (this.toolbar != null) { this.toolbar.SetValue(DockPanel.DockProperty, Dock.Top); this.panel.Children.Add(toolbar); } InitializeComponents(); AttachToDebugger(); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.DesktopPanel = ((System.Windows.Controls.DockPanel)(target)); return; case 2: this.GridPanel = ((System.Windows.Controls.Grid)(target)); return; case 3: this.SettingBar = ((System.Windows.Controls.ToolBar)(target)); return; case 4: this.AddButton = ((System.Windows.Controls.Button)(target)); return; case 5: this.AccountName = ((System.Windows.Controls.Label)(target)); return; case 6: this.SettingButtonSecond = ((System.Windows.Controls.MenuItem)(target)); return; case 7: this.ExitButton = ((System.Windows.Controls.MenuItem)(target)); return; case 8: this.RemoveAccountButton = ((System.Windows.Controls.MenuItem)(target)); return; case 9: this.LeftButton = ((System.Windows.Controls.Button)(target)); return; case 10: this.RightButton = ((System.Windows.Controls.Button)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.RowBox0 = ((System.Windows.Controls.ToolBar)(target)); return; case 2: this.RowBox1 = ((System.Windows.Controls.ToolBar)(target)); return; case 3: this.RowBox2 = ((System.Windows.Controls.ToolBar)(target)); return; case 4: this.RowBox3 = ((System.Windows.Controls.ToolBar)(target)); return; case 5: this.RowBox4 = ((System.Windows.Controls.ToolBar)(target)); return; case 6: this.RowBox5 = ((System.Windows.Controls.ToolBar)(target)); return; case 7: this.RowBox6 = ((System.Windows.Controls.ToolBar)(target)); return; case 8: this.RowBox7 = ((System.Windows.Controls.ToolBar)(target)); return; case 9: this.InfoBox = ((System.Windows.Controls.Label)(target)); return; case 10: this.ToolControlBox = ((System.Windows.Controls.Canvas)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.CosmosAssemblyUserControl = ((Cosmos.VS.Windows.AssemblyUC)(target)); return; case 2: this.toolBar1 = ((System.Windows.Controls.ToolBar)(target)); return; case 3: this.butnFilter = ((System.Windows.Controls.Primitives.ToggleButton)(target)); return; case 4: this.butnCopy = ((System.Windows.Controls.Button)(target)); return; case 5: this.butnStepMode = ((System.Windows.Controls.Button)(target)); return; case 6: this.butnStepInto = ((System.Windows.Controls.Button)(target)); return; case 7: this.butnStepOver = ((System.Windows.Controls.Button)(target)); return; case 8: this.ASMScrollViewer = ((System.Windows.Controls.ScrollViewer)(target)); return; case 9: this.tblkSource = ((System.Windows.Controls.TextBlock)(target)); return; case 10: this.mitmCopy = ((System.Windows.Controls.MenuItem)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.tbpToolBar = ((System.Windows.Controls.Primitives.ToolBarPanel)(target)); return; case 2: this.tbToolBar = ((System.Windows.Controls.ToolBar)(target)); return; case 3: this.btnAdd = ((System.Windows.Controls.Button)(target)); return; case 4: this.btnCopy = ((System.Windows.Controls.Button)(target)); return; case 5: this.btnModify = ((System.Windows.Controls.Button)(target)); return; case 6: this.btnSave = ((System.Windows.Controls.Button)(target)); return; case 7: this.btnDelete = ((System.Windows.Controls.Button)(target)); return; case 8: this.btnCancel = ((System.Windows.Controls.Button)(target)); return; case 9: this.btnAuditing = ((System.Windows.Controls.Button)(target)); return; case 10: this.btnUnaudited = ((System.Windows.Controls.Button)(target)); return; } this._contentLoaded = true; }
protected void CreateMenuEndItem(PluginMenuItemPart firstPart, ToolBar theMenuItem, Image theImageList) { if (firstPart.TextStyle.ButtonType == null) { theMenuItem.Header = firstPart.TextStyle.Text; theMenuItem.ToolTip = firstPart.TextStyle.ToolTipText; if (firstPart.TextStyle.Image != null) { try { string image = firstPart.TextStyle.Image; LoadImage(theImageList, image); //theMenuItem.ImageKey = image; } catch { } } } else { theMenuItem = ReflectUtils.CreateInstance(firstPart.TextStyle.ButtonType) as ToolBar; theMenuItem.Header = firstPart.TextStyle.Text; theMenuItem.ToolTip = firstPart.TextStyle.ToolTipText; if (firstPart.TextStyle.Image != null) { try { string image = firstPart.TextStyle.Image; LoadImage(theImageList, image); //theMenuItem.ImageKey = image; } catch { } } if (firstPart.TextStyle.Tag != null) { try { //theMenuItem.Alignment = (ToolStripItemAlignment)(Enum.Parse( // typeof(ToolStripItemAlignment), firstPart.TextStyle.Tag.Split(',')[0], true // )); } catch { } } } }
void AddFileToolBar(ToolBarTray tray, int band, int index) { // Create the ToolBar. ToolBar toolbar = new ToolBar(); toolbar.Band = band; toolbar.BandIndex = index; tray.ToolBars.Add(toolbar); RoutedUICommand[] comm = { ApplicationCommands.New, ApplicationCommands.Open, ApplicationCommands.Save }; string[] strImages = { "NewDocumentHS.png", "openHS.png", "saveHS.png" }; // Create buttons for the ToolBar. for (int i = 0; i < 3; i++) { Button btn = new Button(); btn.Command = comm[i]; toolbar.Items.Add(btn); Image img = new Image(); img.Source = new BitmapImage( new Uri("pack://application:,,/Images/" + strImages[i])); img.Stretch = Stretch.None; btn.Content = img; ToolTip tip = new ToolTip(); tip.Content = comm[i].Text; btn.ToolTip = tip; } // Add the command bindings. CommandBindings.Add( new CommandBinding(ApplicationCommands.New, OnNew)); CommandBindings.Add( new CommandBinding(ApplicationCommands.Open, OnOpen)); CommandBindings.Add( new CommandBinding(ApplicationCommands.Save, OnSave)); }
public UnitTestsPad(ITestService testService) { this.testService = testService; panel = new DockPanel(); treeView = new TestTreeView(); // treeView must be created first because it's used by CreateToolBar toolBar = CreateToolBar("/SharpDevelop/Pads/UnitTestsPad/Toolbar"); panel.Children.Add(toolBar); DockPanel.SetDock(toolBar, Dock.Top); panel.Children.Add(treeView); treeView.ContextMenu = CreateContextMenu("/SharpDevelop/Pads/UnitTestsPad/ContextMenu"); testService.OpenSolutionChanged += testService_OpenSolutionChanged; testService_OpenSolutionChanged(null, null); }
public SearchResultsPad() { if (instance != null) throw new InvalidOperationException("Cannot create multiple instances"); instance = this; toolBar = new ToolBar(); ToolBarTray.SetIsLocked(toolBar, true); defaultToolbarItems = ToolBarService.CreateToolBarItems(dockPanel, this, "/SharpDevelop/Pads/SearchResultPad/Toolbar"); foreach (object toolBarItem in defaultToolbarItems) { toolBar.Items.Add(toolBarItem); } DockPanel.SetDock(toolBar, Dock.Top); contentPlaceholder = new ContentPresenter(); dockPanel = new DockPanel { Children = { toolBar, contentPlaceholder } }; }
public void Remove_ShouldRemoveToolBarFromToolBarTray() { var toolBar1 = new WPF.ToolBar(); var toolBar2 = new WPF.ToolBar(); _toolBarTray.ToolBars.Add(toolBar1); Assert.IsTrue(_toolBarTray.ToolBars.Contains(toolBar1)); Assert.IsFalse(_toolBarTray.ToolBars.Contains(toolBar2)); _toolBarTrayUIAdapter.Remove(toolBar2); Assert.IsTrue(_toolBarTray.ToolBars.Contains(toolBar1)); Assert.IsFalse(_toolBarTray.ToolBars.Contains(toolBar2)); _toolBarTrayUIAdapter.Remove(toolBar1); Assert.IsFalse(_toolBarTray.ToolBars.Contains(toolBar1)); Assert.IsFalse(_toolBarTray.ToolBars.Contains(toolBar2)); }
public MoveTheToolbar() { Title = "Move the Toolbar"; // Create DockPanel as content of window. DockPanel dock = new DockPanel(); Content = dock; // Create ToolBarTray at top and left of window. ToolBarTray trayTop = new ToolBarTray(); dock.Children.Add(trayTop); DockPanel.SetDock(trayTop, Dock.Top); ToolBarTray trayLeft = new ToolBarTray(); trayLeft.Orientation = Orientation.Vertical; dock.Children.Add(trayLeft); DockPanel.SetDock(trayLeft, Dock.Left); // Create TextBox to fill rest of client area. TextBox txtbox = new TextBox(); dock.Children.Add(txtbox); // Create six Toolbars... for (int i = 0; i < 6; i++) { ToolBar toolbar = new ToolBar(); toolbar.Header = "Toolbar " + (i + 1); if (i < 3) trayTop.ToolBars.Add(toolbar); else trayLeft.ToolBars.Add(toolbar); // ... with six buttons each. for (int j = 0; j < 6; j++) { Button btn = new Button(); btn.FontSize = 16; btn.Content = (char)('A' + j); toolbar.Items.Add(btn); } } }
public MeetTheDockers() { Title = "Meet the Dockers"; DockPanel dock = new DockPanel(); Content = dock; Menu menu = new Menu(); MenuItem item = new MenuItem(); item.Header = "Menu"; menu.Items.Add(item); DockPanel.SetDock(menu, Dock.Top); dock.Children.Add(menu); ToolBar tool = new ToolBar(); tool.Header = "Toolbar"; DockPanel.SetDock(tool, Dock.Top); dock.Children.Add(tool); StatusBar status = new StatusBar(); StatusBarItem statitem = new StatusBarItem(); statitem.Content = "Status"; status.Items.Add(statitem); DockPanel.SetDock(status, Dock.Bottom); dock.Children.Add(status); ListBox lstbox = new ListBox(); lstbox.Items.Add("List Box Item"); DockPanel.SetDock(lstbox, Dock.Left); dock.Children.Add(lstbox); TextBox txtbox = new TextBox(); txtbox.AcceptsReturn = true; dock.Children.Add(txtbox); txtbox.Focus(); }
public DebuggerPad() { // UI this.panel = new DockPanel(); this.toolbar = BuildToolBar(); if (this.toolbar != null) { this.toolbar.SetValue(DockPanel.DockProperty, Dock.Top); this.panel.Children.Add(toolbar); } // logic debugger = (WindowsDebugger)DebuggerService.CurrentDebugger; InitializeComponents(); debugger.ProcessSelected += delegate(object sender, ProcessEventArgs e) { SelectProcess(e.Process); }; SelectProcess(debugger.DebuggedProcess); }
public SearchResultsPad() { if (instance != null) throw new InvalidOperationException("Cannot create multiple instances"); instance = this; toolBar = new ToolBar(); ToolBarTray.SetIsLocked(toolBar, true); defaultToolbarItems = ToolBarService.CreateToolBarItems(contentPanel, this, "/SharpDevelop/Pads/SearchResultPad/Toolbar"); foreach (object toolBarItem in defaultToolbarItems) { toolBar.Items.Add(toolBarItem); } contentPlaceholder = new ContentPresenter(); contentPanel = new Grid { Children = { toolBar, contentPlaceholder } }; contentPanel.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); contentPanel.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); Grid.SetRow(contentPlaceholder, 1); }
protected AbstractConsolePad() { this.panel = new DockPanel(); this.console = new ConsoleControl(); // creating the toolbar accesses the WordWrap property, so we must do this after creating the console this.toolbar = BuildToolBar(); this.toolbar.SetValue(DockPanel.DockProperty, Dock.Top); this.panel.Children.Add(toolbar); this.panel.Children.Add(console); this.history = new List<string>(); this.console.editor.TextArea.PreviewKeyDown += (sender, e) => { e.Handled = HandleInput(e.Key); }; this.console.editor.TextArea.TextEntered += new TextCompositionEventHandler(AbstractConsolePadTextEntered); this.InitializeConsole(); }
public WorkBenchView([Import(CompositionPoints.Workbench.ViewModel)] Workbench vm) { InitializeComponent(); DataContext = vm; // ToolBarTray.ToolBars isn't a dependency property, so we // have to add the Tool Bars manually foreach (IToolBar toolBarViewModel in vm.ToolBars) { ToolBar toolBar = new ToolBar(); toolBar.DataContext = toolBarViewModel; // Bind the Header Property Binding headerBinding = new Binding("Header"); toolBar.SetBinding(ToolBar.HeaderProperty, headerBinding); // Bind the Items Property Binding itemsBinding = new Binding("Items"); toolBar.SetBinding(ToolBar.ItemsSourceProperty, itemsBinding); // Bind the Visible Property Binding visibleBinding = new Binding("Visible"); visibleBinding.Converter = new BooleanToVisibilityConverter(); toolBar.SetBinding(ToolBar.VisibilityProperty, visibleBinding); // Bind the ToolTip Property Binding toolTipBinding = new Binding("ToolTip"); toolBar.SetBinding(ToolBar.ToolTipProperty, toolTipBinding); tbtToolBar.ToolBars.Add(toolBar); } // hook up the event handlers so the viewmodel knows when we're closing this.Closing += vm.OnClosing; this.Closed += vm.OnClosed; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.picturePickerToolbar = ((System.Windows.Controls.ToolBar)(target)); return; case 2: this.btnPreviousPage = ((System.Windows.Controls.Button)(target)); #line 8 "..\..\MainWindow.xaml" this.btnPreviousPage.Click += new System.Windows.RoutedEventHandler(this.btnPreviousPage_Click); #line default #line hidden return; case 3: this.btnNextImage = ((System.Windows.Controls.Button)(target)); #line 10 "..\..\MainWindow.xaml" this.btnNextImage.Click += new System.Windows.RoutedEventHandler(this.btnNextImage_Click); #line default #line hidden return; case 4: this.imageHolder = ((System.Windows.Controls.Image)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.mainToolBar = ((System.Windows.Controls.ToolBar)(target)); return; case 2: this.Start = ((System.Windows.Controls.Button)(target)); return; case 3: this.Stop = ((System.Windows.Controls.Button)(target)); return; case 4: this.AddToQueue = ((System.Windows.Controls.Button)(target)); return; case 5: this.ShowQueue = ((System.Windows.Controls.Button)(target)); return; case 6: this.Preview = ((System.Windows.Controls.Button)(target)); return; case 7: this.ActivityWindow = ((System.Windows.Controls.Button)(target)); return; case 8: this.Titles = ((System.Windows.Controls.ComboBox)(target)); return; case 9: this.Angles = ((System.Windows.Controls.ComboBox)(target)); return; case 10: this.PointToPointMode = ((System.Windows.Controls.ComboBox)(target)); return; case 11: this.StartPoint = ((System.Windows.Controls.ComboBox)(target)); return; case 12: this.EndPoint = ((System.Windows.Controls.ComboBox)(target)); return; case 13: this.Destination = ((System.Windows.Controls.TextBox)(target)); return; case 14: this.DestinationBrowser = ((System.Windows.Controls.Button)(target)); return; case 15: this.Container = ((System.Windows.Controls.ComboBox)(target)); return; case 16: this.LargeFileMp4 = ((System.Windows.Controls.CheckBox)(target)); return; case 17: this.WebOptimized = ((System.Windows.Controls.CheckBox)(target)); return; case 18: this.iPod5G = ((System.Windows.Controls.CheckBox)(target)); return; case 19: this.tabControl = ((System.Windows.Controls.TabControl)(target)); return; case 20: this.pictureTab = ((System.Windows.Controls.TabItem)(target)); return; case 21: this.PictureSettingsViewModel = ((System.Windows.Controls.ContentControl)(target)); return; case 22: this.filtersTab = ((System.Windows.Controls.TabItem)(target)); return; case 23: this.FiltersViewModel = ((System.Windows.Controls.ContentControl)(target)); return; case 24: this.videoTab = ((System.Windows.Controls.TabItem)(target)); return; case 25: this.VideoViewModel = ((System.Windows.Controls.ContentControl)(target)); return; case 26: this.audioTab = ((System.Windows.Controls.TabItem)(target)); return; case 27: this.AudioViewModel = ((System.Windows.Controls.ContentControl)(target)); return; case 28: this.subtitlesTab = ((System.Windows.Controls.TabItem)(target)); return; case 29: this.SubtitleViewModel = ((System.Windows.Controls.ContentControl)(target)); return; case 30: this.chaptersTab = ((System.Windows.Controls.TabItem)(target)); return; case 31: this.ChaptersViewModel = ((System.Windows.Controls.ContentControl)(target)); return; case 32: this.advancedTab = ((System.Windows.Controls.TabItem)(target)); return; case 33: this.AdvancedViewModel = ((System.Windows.Controls.ContentControl)(target)); return; case 34: #line 218 "..\..\..\..\Views\MainView.xaml" ((System.Windows.Controls.TreeView)(target)).SelectedItemChanged += new System.Windows.RoutedPropertyChangedEventHandler<object>(this.TreeView_SelectedItemChanged); #line default #line hidden return; case 35: this.presetsToolBar = ((System.Windows.Controls.ToolBar)(target)); return; } this._contentLoaded = true; }
private void DisplayCommands() { myDockPanel.LastChildFill = true; string currentDir = String.Copy(Environment.CurrentDirectory); // Define the child content myTextBlock1 BorderMenu.Height = 25; BorderMenu.Background = Brushes.SkyBlue; BorderMenu.BorderThickness = new Thickness(1); DockPanel.SetDock(BorderMenu, Dock.Top); // Add barcode tray menu items ToolBarTray tbtToolBarTray = new ToolBarTray(); ToolBar tbToolBar = new ToolBar(); // Add task buttons Button btnPrintCommandList = new Button() { Content = "列印", Background = Brushes.White, Name = "btnPrint" }; btnPrintCommandList.Click += btnPrintCommandList_Click; tbToolBar.Items.Add(btnPrintCommandList); DockPanel.SetDock(tbtToolBarTray, Dock.Left); tbToolBar.Background = Brushes.Orange; tbtToolBarTray.ToolBars.Add(tbToolBar); BorderMenu.Child = tbtToolBarTray; // Loading Barcode Image (image/textblock --> stackpanel --> border ===> DockPanel ===> Window) // create image element //////////////////////////////////////////// Image iPrint1 = new Image(); iPrint1.Width = 180; BitmapImage biPrint1 = new BitmapImage(); biPrint1.BeginInit(); //biPrint1.UriSource = new Uri(@"c:\Sigknow0001.jpg", UriKind.RelativeOrAbsolute); biPrint1.UriSource = new Uri(currentDir + "\\Sigknow0001.jpg", UriKind.RelativeOrAbsolute); biPrint1.DecodePixelWidth = 400; biPrint1.DecodePixelHeight = 100; //iPrint1.Height = 100; biPrint1.EndInit(); iPrint1.Source = biPrint1; TextBlock tb1 = new TextBlock(); tb1.Text = "建立關係 (Associate)"; tb1.HorizontalAlignment = System.Windows.HorizontalAlignment.Center; StackPanel sp1 = new StackPanel(); sp1.Children.Add(iPrint1); sp1.Children.Add(tb1); sp1.Orientation = System.Windows.Controls.Orientation.Vertical; Border bContent1 = new Border(); bContent1.Height = 99; bContent1.Background = Brushes.White; bContent1.BorderThickness = new Thickness(1); DockPanel.SetDock(bContent1, Dock.Top); bContent1.Child = sp1; //////////////////////////////////////////// Image iPrint2 = new Image(); iPrint2.Width = 180; BitmapImage biPrint2 = new BitmapImage(); biPrint2.BeginInit(); biPrint2.UriSource = new Uri(currentDir + "\\Sigknow0002.jpg", UriKind.RelativeOrAbsolute); biPrint2.DecodePixelWidth = 400; biPrint2.DecodePixelHeight = 100; biPrint2.EndInit(); iPrint2.Source = biPrint2; TextBlock tb2 = new TextBlock(); tb2.Text = "解除關係 (Disassociate)"; tb2.HorizontalAlignment = System.Windows.HorizontalAlignment.Center; StackPanel sp2 = new StackPanel(); sp2.Children.Add(iPrint2); sp2.Children.Add(tb2); sp2.Orientation = System.Windows.Controls.Orientation.Vertical; Border bContent2 = new Border(); bContent2.Height = 99; bContent2.Background = Brushes.White; bContent2.BorderThickness = new Thickness(1); DockPanel.SetDock(bContent2, Dock.Top); bContent2.Child = sp2; //////////////////////////////////////////// Image iPrint3 = new Image(); iPrint3.Width = 180; BitmapImage biPrint3 = new BitmapImage(); biPrint3.BeginInit(); biPrint3.UriSource = new Uri(currentDir + "\\Sigknow0003.jpg", UriKind.RelativeOrAbsolute); biPrint3.DecodePixelWidth = 400; biPrint3.DecodePixelHeight = 100; biPrint3.EndInit(); iPrint3.Source = biPrint3; TextBlock tb3 = new TextBlock(); tb3.Text = "查詢關係 (Query)"; tb3.HorizontalAlignment = System.Windows.HorizontalAlignment.Center; StackPanel sp3 = new StackPanel(); sp3.Children.Add(iPrint3); sp3.Children.Add(tb3); sp3.Orientation = System.Windows.Controls.Orientation.Vertical; Border bContent3 = new Border(); bContent3.Height = 99; bContent3.Background = Brushes.White; bContent3.BorderThickness = new Thickness(1); DockPanel.SetDock(bContent3, Dock.Top); bContent3.Child = sp3; //////////////////////////////////////////// Image iPrint4 = new Image(); iPrint4.Width = 180; BitmapImage biPrint4 = new BitmapImage(); biPrint4.BeginInit(); biPrint4.UriSource = new Uri(currentDir + "\\Sigknow0004.jpg", UriKind.RelativeOrAbsolute); biPrint4.DecodePixelWidth = 400; biPrint4.DecodePixelHeight = 100; biPrint4.EndInit(); iPrint4.Source = biPrint4; TextBlock tb4 = new TextBlock(); tb4.Text = "清除 (Reset)"; tb4.HorizontalAlignment = System.Windows.HorizontalAlignment.Center; StackPanel sp4 = new StackPanel(); sp4.Children.Add(iPrint4); sp4.Children.Add(tb4); sp4.Orientation = System.Windows.Controls.Orientation.Vertical; Border bContent4 = new Border(); bContent4.Height = 99; bContent4.Background = Brushes.White; bContent4.BorderThickness = new Thickness(1); DockPanel.SetDock(bContent4, Dock.Top); bContent4.Child = sp4; //////////////////////////////////////////// Image iPrint5 = new Image(); iPrint5.Width = 180; BitmapImage biPrint5 = new BitmapImage(); biPrint5.BeginInit(); biPrint5.UriSource = new Uri(currentDir + "\\Sigknow0005.jpg", UriKind.RelativeOrAbsolute); biPrint5.DecodePixelWidth = 400; biPrint5.DecodePixelHeight = 100; biPrint5.EndInit(); iPrint5.Source = biPrint5; TextBlock tb5 = new TextBlock(); tb5.Text = " OK "; tb5.HorizontalAlignment = System.Windows.HorizontalAlignment.Center; StackPanel sp5 = new StackPanel(); sp5.Children.Add(iPrint5); sp5.Children.Add(tb5); sp5.Orientation = System.Windows.Controls.Orientation.Vertical; Border bContent5 = new Border(); bContent5.Height = 99; bContent5.Background = Brushes.White; bContent5.BorderThickness = new Thickness(1); DockPanel.SetDock(bContent5, Dock.Top); bContent5.Child = sp5; //////////////////////////////////////////// Image iPrint6 = new Image(); iPrint6.Width = 180; BitmapImage biPrint6 = new BitmapImage(); biPrint6.BeginInit(); biPrint6.UriSource = new Uri(currentDir + "\\Sigknow0006.jpg", UriKind.RelativeOrAbsolute); biPrint6.DecodePixelWidth = 400; biPrint6.DecodePixelHeight = 100; biPrint6.EndInit(); iPrint6.Source = biPrint6; TextBlock tb6 = new TextBlock(); tb6.Text = " NG "; tb6.HorizontalAlignment = System.Windows.HorizontalAlignment.Center; StackPanel sp6 = new StackPanel(); sp6.Children.Add(iPrint6); sp6.Children.Add(tb6); sp6.Orientation = System.Windows.Controls.Orientation.Vertical; Border bContent6 = new Border(); bContent6.Height = 99; bContent6.Background = Brushes.White; bContent6.BorderThickness = new Thickness(1); DockPanel.SetDock(bContent6, Dock.Top); bContent6.Child = sp6; // put all barcode images into a StackPanel StackPanel spCommands = new StackPanel(); BorderMainBody.Background = Brushes.White; BorderMainBody.BorderBrush = Brushes.Black; BorderMainBody.BorderThickness = new Thickness(2); //BorderMainBody.CornerRadius = new CornerRadius(45); BorderMainBody.Padding = new Thickness(1); //BorderMainBody.Child = spCommands; // load all barcode images to a canvas double maxX = bContent1.Width; double maxY = bContent1.Height; Canvas.SetTop(bContent1, maxY * 0 + 15); Canvas.SetTop(bContent2, maxY * 1 + 15); Canvas.SetTop(bContent5, maxY * 2 + 15); Canvas.SetTop(bContent6, maxY * 3 + 15); //Canvas.SetTop(bContent3, maxY * 4 + 15); //Canvas.SetTop(bContent4, maxY * 5 + 15); canvasCommands.Children.Add(bContent1); canvasCommands.Children.Add(bContent2); canvasCommands.Children.Add(bContent5); canvasCommands.Children.Add(bContent6); //canvasCommands.Children.Add(bContent3); //canvasCommands.Children.Add(bContent4); BorderMainBody.Child = canvasCommands; // Add child elements to the DockPanel Children collection myDockPanel.Children.Add(BorderMenu); myDockPanel.Children.Add(BorderMainBody); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.baseContainer = ((System.Windows.Controls.Grid)(target)); return; case 2: this.mainMenu = ((System.Windows.Controls.Menu)(target)); return; case 3: this.mainToolbar = ((System.Windows.Controls.ToolBar)(target)); return; case 4: this.mainGrid = ((System.Windows.Controls.Grid)(target)); return; case 5: this.mainStatusBar = ((System.Windows.Controls.Primitives.StatusBar)(target)); return; } this._contentLoaded = true; }